Source-linked AI summary

Retrieval-augmented generation vs. deterministic tax computation in multi-agent financial advisory: A 2x2 factorial experiment

Aryan Brar, Justin Du, Avery Lor, Kylie Seto, Eric Taylor

arXiv:2608.23908v1cs.AI

TL;DR

The paper addresses whether tax computation and retrieved knowledge improve multi-agent tax-loss-harvesting recommendations. It evaluates these components in a 2×2 repeated-measures experiment and finds that the tax engine reduced savings, while RAG had no significant main or interaction effect. Overall, the results caution that domain-specific tooling may conflict with language-model reasoning rather than reliably improving performance.

  • Problem

    Existing research has rarely empirically compared learned policies, tax reasoning, and retrieval-augmented knowledge within a unified portfolio-management system.

  • Method

    A 2×2 repeated-measures experiment toggled a tax optimization engine and vectorized knowledge retrieval across four conditions in a multi-agent trade recommendation system.

  • Results

    Enabling the tax engine reduced mean tax savings by approximately 55 percentage points, while RAG had no significant main effect or interaction with the engine.

  • Takeaways & Limitations

    Domain-specific tooling does not guarantee better recommendations and may degrade performance when rule-based calculations conflict with broader agent reasoning.

  • Takeaways & Limitations

    The study used synthetic scenarios under a single market regime and did not verify wash-sale compliance or qualitative recommendation soundness.

Abstract

from arXiv · show

Tax-loss harvesting demonstrates consistent benefits to long-term portfolio growth; yet implementing it efficiently often involves complex considerations that are specific to the holdings within that portfolio and the individual who owns it. We introduce a custom capital gains calculation engine and a RAG-retrieved vector store of market advisory reports to provide context for a multi-agent trade recommendation system. We investigate the effects of each context provider on the quality of recommendations, measured by relative capital gains incurred during portfolio liquidation. A 2x2 repeated-measures ANOVA revealed a significant main effect of the tax optimization engine ($F(1,29) = 9.17$, $p = .005$, $η^2_p = .240$): enabling the engine reduced tax savings by approximately 55 percentage points relative to the no-engine conditions. The RAG main effect was not significant ($p = .841$), nor was the interaction ($p = .553$). The RAG-only condition achieved the highest descriptive mean tax savings (47.7%), and the baseline condition performed second-best (30.6%), suggesting that the pre-trained language model's internalized financial knowledge may be sufficient for competent tax-loss harvesting recommendations without explicit tooling. These results indicate that augmenting LLM agents with domain-specific computation engines does not guarantee improved performance and may introduce conflicting optimization signals.

1 Introduction

The introduction frames AI-driven wealth management as an expanding field and identifies a gap in integrating tax reasoning, multi-agent systems, and retrieval-augmented knowledge for portfolio decisions.

  • AI and deep learning have expanded portfolio optimization, risk assessment, and investment decision-making across institutional and retail settings.Robo-advisors and AI-driven platforms have broadened access to quantitative investment strategies.
  • Tax-loss harvesting improves after-tax returns by selling shares below cost to generate credits that offset or defer capital gains.The paper describes tax alpha as the tax consequences of active management.
  • Mixture-of-Experts and multi-agent architectures divide heterogeneous, multi-objective problems among specialized agents selected by a learned router.
  • RAG augments language models with retrieved external knowledge to condition decisions, support factuality, enable updates without retraining, and provide verifiable justification.
  • Prior work has largely studied AI portfolio management, tax-loss harvesting, and multi-agent architectures separately, leaving their unified integration and empirical comparison insufficiently examined.The identified gap includes testing whether external knowledge improves portfolio-management decisions.

2 Related Works

Related work covers tax-loss-harvesting performance, tax-aware optimization, deep learning portfolio systems, and fintech-enabled personalization, establishing technical and financial foundations for the present study.

  • 1.08% annualized alpha before transaction costs and 0.82% under wash-sale constraints were reported for tax-loss harvesting using historical US equity data.
  • Tax-loss-harvesting alpha varies across market regimes, reaching 2.13% annually during the Great Depression and 0.51% during 1949–1972.
  • A -10% monthly or -15% daily harvesting threshold was identified as a reasonable balance between harvesting yield and active risk.
  • Tax-aware long-short strategies primarily generate net capital losses through gain deferral rather than increased loss realization.
  • Pishehvar introduced a three-phase personalized, tax-aware deep reinforcement learning system addressing ticker lock-in, multiple objectives, and behavioral personalization.
  • Bachhav et al. reported 39.8% lower simulated rebalancing tax liability and 8.2%–16.1% annualized returns across risk profiles in a personalized allocation engine.
  • The literature emphasizes regulatory constraints such as wash-sale rules and tax-aware methods operating through gain deferral.
  • Deep learning and reinforcement learning support dynamic optimization balancing alpha generation, tax efficiency, and behavioral alignment at scale and low cost.

3 Hypotheses

The study hypothesized that increasingly sophisticated combinations of tax reasoning and retrieved knowledge would improve after-tax portfolio performance in a four-condition factorial experiment.

  • The experiment compares a no-augmentation baseline, a capital-gains engine, a RAG vector store, and both components together.The primary outcome is percentage reduction in projected capital-gains tax liability relative to a no-trade baseline.
  • The baseline policy was hypothesized to deliver the poorest after-tax performance because it used pre-tax returns without explicit tax reasoning or external knowledge.
  • The tax-aware agent was hypothesized to outperform baseline through explicit loss-harvesting objectives, tax-lot tracking, and wash-sale constraints.
  • The RAG policy was hypothesized to outperform baseline by using market, earnings, volatility, tax, and regulatory context, with smaller gains than the tax agent alone.
  • The combined system was hypothesized to outperform either single augmentation through complementary structural tax reasoning and adaptive contextual knowledge.

4 Methods

The methods used a 2×2 within-subjects design in which the same multi-agent architecture evaluated 30 synthetic taxable portfolios with tax-engine and retrieval components toggled independently.

  • The 2×2 design crossed tax-engine presence with knowledge-retrieval presence, producing both-active, tax-only, retrieval-only, and baseline conditions.All conditions used the same multi-agent architecture and each portfolio experienced every condition.
  • 30 simulated client portfolio scenarios were evaluated, each containing 5 to 20 positions and at least one unrealized capital loss.Portfolio values ranged from $25,000 to $500,000.
  • Each portfolio was processed through all four conditions by a LangChain-based multi-agent orchestration system with an orchestrator and specialized sub-agents.
  • The tax-engine condition controlled agents’ access to tax-related system-prompt sections, while the tax-guidance condition controlled access to RAG tooling.
  • The primary dependent variable was percentage tax savings, defined as the proportional reduction in projected federal capital-gains tax liability relative to a no-trade baseline.

5 Results

The tax optimization engine significantly reduced tax savings, while RAG had no significant main effect and did not interact with the engine. These findings remained consistent across sensitivity, dollar-value, and non-parametric analyses.

  • 5.1 Descriptive Statistics: −11.03% and −21.02% mean tax savings occurred when the tax engine was enabled, indicating increased tax liability on average.With the engine disabled, mean tax savings were positive at 30.55% and 47.73%, regardless of RAG status.
  • 5.2 Omnibus 2 × 2 Repeated-Measures ANOVA: F(1, 29) = 9.17, p = .005, η2_p = .240: the tax engine significantly reduced tax savings from M = 39.14% to M = −16.03%.The effect size was described as large.
  • 5.2 Omnibus 2 × 2 Repeated-Measures ANOVA: F(1, 29) = 0.04, p = .841: RAG had no significant main effect on tax savings.The Tax Tools × RAG interaction was also non-significant, F(1, 29) = 0.36, p = .553, indicating that the engine effect did not depend on RAG status.
  • 5.3 Post-Hoc Pairwise Comparisons: 55 percentage points more tax savings were obtained when the tax optimization engine was disabled than when it was enabled.The pairwise comparison found a medium-to-large effect, t(29) = 3.03, pbonf = .005, g = 0.67.
  • 5.4 Sensitivity Analysis: p = .048 after outlier exclusion: the engine effect remained significant, while RAG and the interaction remained non-significant.The sensitivity analysis excluded seven portfolios, leaving 23 portfolios and 92 observations; the effect size decreased from η2_p = .240 to η2_p = .166.
  • 5.5 Supplementary Analysis: Tax Savings Amount: p = .026 in the dollar-value analysis: the tax engine significantly reduced absolute tax savings, while RAG and the interaction were not significant.A Friedman test also found significant differences among conditions, χ2(3) = 10.47, p = .015, W = 0.116.

6 Conclusion

The tax optimization engine significantly worsened tax savings, while RAG had no significant main effect or interaction with the engine. These findings contradicted the initial hypotheses and highlight limitations in the synthetic, single-regime evaluation.

  • F(1, 29) = 9.17, p = .005, η2_p = .240: enabling the tax engine significantly reduced tax savings with a large effect.Mean tax savings were -16.0% with the engine enabled versus +39.1% when disabled.
  • Approximately 55 percentage points separated engine-enabled and engine-disabled mean tax savings.The detrimental engine effect did not depend on whether RAG was also enabled.
  • The RAG main effect was not significant, and the Tax Tools × RAG interaction was not significant.The pattern was also confirmed by a Friedman test and remained under outlier-exclusion sensitivity analysis.
  • RAG Only achieved 47.7% mean tax savings, while Baseline achieved 30.5%, and both engine-enabled conditions produced negative mean savings.The Baseline result suggests internalized financial knowledge may support competent recommendations without explicit tooling.
  • The study used synthetic scenarios under a single market regime and did not verify wash-sale compliance or qualitative recommendation soundness.High within-condition variability, with SDs from 46% to 162%, also indicates heterogeneous handling across portfolio configurations.
  • The findings suggest domain-specific tooling can degrade agent performance when integration creates friction or conflicting optimization signals.Future work should test broader portfolios, real client data, multiple regimes, improved integration, and recommendation quality beyond tax savings.
Loading 2608.23908v1…