LLM-Generated Counterfactual Stress Scenarios for Portfolio Risk Simulation via Hybrid Prompt-RAG Pipeline
LLM-Generated Counterfactual Stress Scenarios for Portfolio Risk Simulation via Hybrid Prompt-RAG Pipeline
This paper presents a transparent and 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 G7 countries, covering GDP growth, inflation, and policy rates, which are translated into portfolio losses through a factor-based mapping enabling 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.
Highlights
- 1Develops a fully auditable Prompt-RAG pipeline for generating structured macroeconomic stress scenarios using LLMs.
- 2Combines IMF fundamentals with optional news retrieval to produce country-specific shocks for G7 economies.
- 3Translates LLM-generated macro shocks into portfolio VaR/CVaR multiples via a three-channel factor model.
- 4Provides extensive diagnostics including plausibility checks, dispersion analysis, and ANOVA variance decomposition.
- 5Demonstrates that portfolio composition and prompt design dominate risk variation, with retrieval having marginal effects.
Methods
- MHybrid Prompt-RAG pipeline with structured JSON output, optional news retrieval, and MiniLM-FAISS indexing.
- MTwo-layer plausibility filtering (hard and soft gates) and NLI-based regime tagging for scenario quality control.
- MThree-channel factor model (pure volatility, linear PCA, nonlinear polynomial) for mapping macro shocks to portfolio losses.
- MANOVA-based variance decomposition to quantify contributions of model, retrieval, news, and prompt design to tail-risk outcomes.
Results
- RLLMs produce coherent, country-specific stress narratives with stable tail-risk amplification across G7 economies.
- RRisk variation is driven primarily by portfolio composition and prompt design, not by retrieval mechanism.
- RGPT-5-mini yields 627 accepted scenarios after plausibility filtering; Llama-3.1-8B-Instruct yields 307.
- RVaR/CVaR multiples from LLM scenarios exceed historical bootstrap baselines, with nonlinear channel showing highest amplification.
- RCross-run stability and fairness diagnostics confirm consistent performance across countries and configurations.
Analyze Paper
Generate insights from "LLM-Generated Counterfactual Stress Scenarios for Portfolio ...".