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

LLM-Generated Counterfactual Stress Scenarios for Portfolio Risk Simulation via Hybrid Prompt-RAG Pipeline

Author

Listed:
  • Masoud Soleimani

Abstract

We develop a transparent and fully auditable LLM-based pipeline for macro-financial stress testing, combining structured prompting with optional retrieval of country fundamentals and news. The system generates machine-readable macroeconomic scenarios for the G7, which cover GDP growth, inflation, and policy rates, and are translated into portfolio losses through a factor-based mapping that enables Value-at-Risk and Expected Shortfall assessment relative to classical econometric baselines. Across models, countries, and retrieval settings, the LLMs produce coherent and country-specific stress narratives, yielding stable tail-risk amplification with limited sensitivity to retrieval choices. Comprehensive plausibility checks, scenario diagnostics, and ANOVA-based variance decomposition show that risk variation is driven primarily by portfolio composition and prompt design rather than by the retrieval mechanism. The pipeline incorporates snapshotting, deterministic modes, and hash-verified artifacts to ensure reproducibility and auditability. Overall, the results demonstrate that LLM-generated macro scenarios, when paired with transparent structure and rigorous validation, can provide a scalable and interpretable complement to traditional stress-testing frameworks.

Suggested Citation

  • Masoud Soleimani, 2025. "LLM-Generated Counterfactual Stress Scenarios for Portfolio Risk Simulation via Hybrid Prompt-RAG Pipeline," Papers 2512.07867, arXiv.org.
  • Handle: RePEc:arx:papers:2512.07867
    as

    Download full text from publisher

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

    References listed on IDEAS

    as
    1. Aikman, David & Angotti, Romain & Budnik, Katarzyna, 2024. "Stress testing with multiple scenarios: a tale on tails and reverse stress scenarios," Working Paper Series 2941, European Central Bank.
    2. Kutateladze, Varlam, 2022. "The kernel trick for nonlinear factor modeling," International Journal of Forecasting, Elsevier, vol. 38(1), pages 165-177.
    3. Paolo Guarda & Abdelaziz Rouabah & John Theal, 2011. "An MVAR Framework to Capture Extreme Events in Macroprudential Stress Tests," BCL working papers 63, Central Bank of Luxembourg.
    4. Xiao-Yang Liu & Guoxuan Wang & Hongyang Yang & Daochen Zha, 2023. "FinGPT: Democratizing Internet-scale Data for Financial Large Language Models," Papers 2307.10485, arXiv.org, revised Nov 2023.
    5. Rodrigo Alfaro & Mathias Drehmann, 2009. "Macro stress tests and crises: what can we learn?," BIS Quarterly Review, Bank for International Settlements, December.
    6. Borio, Claudio & Drehmann, Mathias & Tsatsaronis, Kostas, 2014. "Stress-testing macro stress testing: Does it live up to expectations?," Journal of Financial Stability, Elsevier, vol. 12(C), pages 3-15.
    7. Fama, Eugene F. & French, Kenneth R., 1993. "Common risk factors in the returns on stocks and bonds," Journal of Financial Economics, Elsevier, vol. 33(1), pages 3-56, February.
    8. Bollerslev, Tim, 1986. "Generalized autoregressive conditional heteroskedasticity," Journal of Econometrics, Elsevier, vol. 31(3), pages 307-327, April.
    9. Moffo, Ahmadou Mustapha Fonton, 2024. "A machine learning approach in stress testing US bank holding companies," International Review of Financial Analysis, Elsevier, vol. 95(PC).
    10. Anastasios Petropoulos & Vassilis Siakoulis & Konstantinos P. Panousis & Loukas Papadoulas & Sotirios Chatzis, 2020. "A Deep Learning Approach for Dynamic Balance Sheet Stress Testing," Papers 2009.11075, arXiv.org, revised Sep 2022.
    11. Pesaran, Hashem & Timmermann, Allan, 2005. "Real-Time Econometrics," Econometric Theory, Cambridge University Press, vol. 21(1), pages 212-231, February.
    12. Natalie Packham, 2024. "Risk factor aggregation and stress testing," Quantitative Finance, Taylor & Francis Journals, vol. 24(9), pages 1327-1340, September.
    13. Solveig Flaig & Gero Junike, 2022. "Scenario Generation for Market Risk Models Using Generative Neural Networks," Risks, MDPI, vol. 10(11), pages 1-28, October.
    14. Matthias Thiemann & Carolina Raquel Melches & Edin Ibrocevic, 2021. "Measuring and mitigating systemic risks: how the forging of new alliances between central bank and academic economists legitimize the transnational macroprudential agenda," Review of International Political Economy, Taylor & Francis Journals, vol. 28(6), pages 1433-1458, October.
    15. Paul C. Tetlock, 2007. "Giving Content to Investor Sentiment: The Role of Media in the Stock Market," Journal of Finance, American Finance Association, vol. 62(3), pages 1139-1168, June.
    16. M. K. Nallakaruppan & Himakshi Chaturvedi & Veena Grover & Balamurugan Balusamy & Praveen Jaraut & Jitendra Bahadur & V. P. Meena & Ibrahim A. Hameed, 2024. "Credit Risk Assessment and Financial Decision Support Using Explainable Artificial Intelligence," Risks, MDPI, vol. 12(10), pages 1-18, October.
    17. Connor, Gregory & Korajczyk, Robert A., 1986. "Performance measurement with the arbitrage pricing theory : A new framework for analysis," Journal of Financial Economics, Elsevier, vol. 15(3), pages 373-394, March.
    18. Shijie Wu & Ozan Irsoy & Steven Lu & Vadim Dabravolski & Mark Dredze & Sebastian Gehrmann & Prabhanjan Kambadur & David Rosenberg & Gideon Mann, 2023. "BloombergGPT: A Large Language Model for Finance," Papers 2303.17564, arXiv.org, revised Dec 2023.
    19. Hamilton, James D & Gang, Lin, 1996. "Stock Market Volatility and the Business Cycle," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 11(5), pages 573-593, Sept.-Oct.
    20. Engle, Robert F, 1982. "Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation," Econometrica, Econometric Society, vol. 50(4), pages 987-1007, July.
    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. Keunbae Ahn, 2021. "Predictable Fluctuations in the Cross-Section and Time-Series of Asset Prices," PhD Thesis, Finance Discipline Group, UTS Business School, University of Technology, Sydney, number 1-2021, January-A.
    2. Wisniewski, Tomasz Piotr & Yekini, Liafisu Sina, 2014. "Predicting Stock Market Returns Based on the Content of Annual Report Narrative: A New Anomaly," MPRA Paper 58107, University Library of Munich, Germany.
    3. Jin Guo, 2015. "Causal relationship between stock returns and real economic growth in the pre- and post-crisis period: evidence from China," Applied Economics, Taylor & Francis Journals, vol. 47(1), pages 12-31, January.
    4. Seyoung Park & Eun Ryung Lee & Sungchul Lee & Geonwoo Kim, 2019. "Dantzig Type Optimization Method with Applications to Portfolio Selection," Sustainability, MDPI, vol. 11(11), pages 1-32, June.
    5. Andrea Bucci, 2020. "Realized Volatility Forecasting with Neural Networks," Journal of Financial Econometrics, Oxford University Press, vol. 18(3), pages 502-531.
    6. Kei Nakagawa & Yusuke Uchiyama, 2020. "GO-GJRSK Model with Application to Higher Order Risk-Based Portfolio," Mathematics, MDPI, vol. 8(11), pages 1-12, November.
    7. Konstantinos Drakos, 2009. "Cross-Country Stock Market Reactions to Major Terror Events: The Role of Risk Perception," Economics of Security Working Paper Series 16, DIW Berlin, German Institute for Economic Research.
    8. Campbell, John Y. & Giglio, Stefano & Polk, Christopher & Turley, Robert, 2018. "An intertemporal CAPM with stochastic volatility," Journal of Financial Economics, Elsevier, vol. 128(2), pages 207-233.
    9. Kuang‐Liang Chang & Chi‐Wei He, 2010. "Does The Magnitude Of The Effect Of Inflation Uncertainty On Output Growth Depend On The Level Of Inflation?," Manchester School, University of Manchester, vol. 78(2), pages 126-148, March.
    10. Ding, Yi & Engle, Robert & Li, Yingying & Zheng, Xinghua, 2025. "Multiplicative factor model for volatility," Journal of Econometrics, Elsevier, vol. 249(PB).
    11. Ioannis D Vrontos & Loukia Meligkotsidou & Spyridon D Vrontos, 2011. "Performance evaluation of mutual fund investments: The impact of non-normality and time-varying volatility," Journal of Asset Management, Palgrave Macmillan, vol. 12(4), pages 292-307, September.
    12. Zhao, Zifeng & Zhang, Zhengjun & Chen, Rong, 2018. "Modeling maxima with autoregressive conditional Fréchet model," Journal of Econometrics, Elsevier, vol. 207(2), pages 325-351.
    13. Zhu (Drew) Zhang & Jie Yuan & Amulya Gupta, 2024. "Let the Laser Beam Connect the Dots: Forecasting and Narrating Stock Market Volatility," INFORMS Journal on Computing, INFORMS, vol. 36(6), pages 1400-1416, December.
    14. David Daewhan Cho, 2004. "Uncertainty in Second Moments: Implications for Portfolio Allocation," Econometric Society 2004 Far Eastern Meetings 433, Econometric Society.
    15. Abdulrahman Alswaidan & Jeffrey D. Varner, 2026. "Hybrid Hidden Markov Model for Modeling Equity Excess Growth Rate Dynamics: A Discrete-State Approach with Jump-Diffusion," Papers 2603.10202, arXiv.org, revised Apr 2026.
    16. Choi, Jaewon & Richardson, Matthew, 2016. "The volatility of a firm's assets and the leverage effect," Journal of Financial Economics, Elsevier, vol. 121(2), pages 254-277.
    17. Shogbuyi, Abiodun & Steeley, James M., 2017. "The effect of quantitative easing on the variance and covariance of the UK and US equity markets," International Review of Financial Analysis, Elsevier, vol. 52(C), pages 281-291.
    18. Daniel Huerta & Peter V. Egly & Diego Escobari, 2016. "The Liquidity Crisis, Investor Sentiment, and REIT Returns and Volatility," Journal of Real Estate Portfolio Management, Taylor & Francis Journals, vol. 22(1), pages 47-62, January.
    19. Junyu Chen & Tom Boot & Lingwei Kong & Weining Wang, 2026. "Transformer-based CoVaR: Systemic Risk in Textual Information," Papers 2602.12490, arXiv.org.
    20. Black, Angela J. & McMillan, David G., 2006. "Asymmetric risk premium in value and growth stocks," International Review of Financial Analysis, Elsevier, vol. 15(3), pages 237-246.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    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:2512.07867. 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.