IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2509.22088.html

Factor-Based Conditional Diffusion Model for Contextual Portfolio Optimization

Author

Listed:
  • Xuefeng Gao
  • Mengying He
  • Xuedong He

Abstract

We propose a novel conditional diffusion model for contextual portfolio optimization that learns the cross-sectional distribution of next-day stock returns conditioned on high-dimensional asset-specific factors. Our model leverages a Diffusion Transformer architecture with token-wise conditioning, which enables linking each asset's return to its own factor vector while capturing complex cross-asset dependencies. By drawing generative samples from the learned conditional return distribution, we perform daily mean-variance and mean-CVaR optimization, incorporating transaction costs and realistic constraints. Using data from the Chinese A-share market, we demonstrate that our approach consistently outperforms various standard benchmarks across multiple risk-adjusted performance metrics. Furthermore, we provide a theoretical error analysis that quantifies the propagation of distributional approximation errors from the conditional diffusion model to the downstream portfolio optimization task. Our results demonstrate the potential of generative diffusion models in high-dimensional data-driven contextual stochastic optimization and financial decision making.

Suggested Citation

  • Xuefeng Gao & Mengying He & Xuedong He, 2025. "Factor-Based Conditional Diffusion Model for Contextual Portfolio Optimization," Papers 2509.22088, arXiv.org, revised Apr 2026.
  • Handle: RePEc:arx:papers:2509.22088
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2509.22088
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Jingwen Jiang & Bryan Kelly & Dacheng Xiu, 2023. "(Re‐)Imag(in)ing Price Trends," Journal of Finance, American Finance Association, vol. 78(6), pages 3193-3249, December.
    2. Victor DeMiguel & Lorenzo Garlappi & Francisco J. Nogales & Raman Uppal, 2009. "A Generalized Approach to Portfolio Optimization: Improving Performance by Constraining Portfolio Norms," Management Science, INFORMS, vol. 55(5), pages 798-812, May.
    3. Shihao Gu & Bryan Kelly & Dacheng Xiu, 2020. "Empirical Asset Pricing via Machine Learning," Review of Finance, European Finance Association, vol. 33(5), pages 2223-2273.
    4. Minshuo Chen & Renyuan Xu & Yumin Xu & Ruixun Zhang, 2025. "Diffusion Factor Models: Generating High-Dimensional Returns with Factor Structure," Papers 2504.06566, arXiv.org, revised Jan 2026.
    5. Shihao Gu & Bryan Kelly & Dacheng Xiu, 2020. "Empirical Asset Pricing via Machine Learning," The Review of Financial Studies, Society for Financial Studies, vol. 33(5), pages 2223-2273.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Yilie Huang & Yanwei Jia & Xun Yu Zhou, 2024. "Mean--Variance Portfolio Selection by Continuous-Time Reinforcement Learning: Algorithms, Regret Analysis, and Empirical Study," Papers 2412.16175, arXiv.org, revised Mar 2026.
    2. Lioui, Abraham & Tarelli, Andrea, 2022. "Chasing the ESG factor," Journal of Banking & Finance, Elsevier, vol. 139(C).
    3. Rubesam, Alexandre, 2022. "Machine learning portfolios with equal risk contributions: Evidence from the Brazilian market," Emerging Markets Review, Elsevier, vol. 51(PB).
    4. Tu, Xueyong & Li, Bin, 2024. "Robust portfolio selection with smart return prediction," Economic Modelling, Elsevier, vol. 135(C).
    5. Maung, Kenwin & Swanson, Norman R., 2025. "A survey of models and methods used for forecasting when investing in financial markets," International Journal of Forecasting, Elsevier, vol. 41(4), pages 1355-1382.
    6. Constantinos Kardaras & Hyeng Keun Koo & Johannes Ruf, 2022. "Estimation of growth in fund models," Papers 2208.02573, arXiv.org.
    7. De Nard, Gianluca & Zhao, Zhao, 2022. "A large-dimensional test for cross-sectional anomalies:Efficient sorting revisited," International Review of Economics & Finance, Elsevier, vol. 80(C), pages 654-676.
    8. Andrea Rigamonti, 2024. "Can machine learning make technical analysis work?," Financial Markets and Portfolio Management, Springer;Swiss Society for Financial Market Research, vol. 38(3), pages 399-412, September.
    9. Roccazzella, Francesco & Gambetti, Paolo & Vrins, Frédéric, 2022. "Correction to: Optimal and robust combination of forecasts via constrained optimization and shrinkage," International Journal of Forecasting, Elsevier, vol. 38(3), pages 1050-1050.
    10. Wu, Ruike & Yang, Yanrong & Shang, Han Lin & Zhu, Huanjun, 2025. "Making distributionally robust portfolios feasible in high dimension," Journal of Econometrics, Elsevier, vol. 252(PA).
    11. Yuan, Ying & Qu, Yong & Wang, Tianyang, 2025. "Predicting risk premiums: A constraint-based model," Journal of Empirical Finance, Elsevier, vol. 83(C).
    12. De Nard, Gianluca & Zhao, Zhao, 2023. "Using, taming or avoiding the factor zoo? A double-shrinkage estimator for covariance matrices," Journal of Empirical Finance, Elsevier, vol. 72(C), pages 23-35.
    13. Yonghe Lu & Yanrong Yang & Terry Zhang, 2024. "Double Descent in Portfolio Optimization: Dance between Theoretical Sharpe Ratio and Estimation Accuracy," Papers 2411.18830, arXiv.org.
    14. Dylan Herman & Cody Googin & Xiaoyuan Liu & Alexey Galda & Ilya Safro & Yue Sun & Marco Pistoia & Yuri Alexeev, 2022. "A Survey of Quantum Computing for Finance," Papers 2201.02773, arXiv.org, revised Jun 2022.
    15. Conlon, Thomas & Cotter, John & Kynigakis, Iason, 2025. "Asset allocation with factor-based covariance matrices," European Journal of Operational Research, Elsevier, vol. 325(1), pages 189-203.
    16. Breitung, Christian, 2023. "Automated stock picking using random forests," Journal of Empirical Finance, Elsevier, vol. 72(C), pages 532-556.
    17. Nechvátalová, Lenka, 2025. "Autoencoder asset pricing models and economic restrictions — international evidence," International Review of Financial Analysis, Elsevier, vol. 107(C).
    18. Beckmeyer, Heiner & Wiedemann, Timo, 2025. "All Days Are Not Created Equal: Understanding Momentum by Learning to Weight Past Returns," Journal of Banking & Finance, Elsevier, vol. 181(C).
    19. Minshuo Chen & Renyuan Xu & Yumin Xu & Ruixun Zhang, 2025. "Diffusion Factor Models: Generating High-Dimensional Returns with Factor Structure," Papers 2504.06566, arXiv.org, revised Jan 2026.
    20. Cirulli, Antonello & Walker, Patrick S., 2025. "Outperforming equal weighting," Economics Letters, Elsevier, vol. 255(C).

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2509.22088. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.