Table of Contents
Fetching ...

History Rhymes: Macro-Contextual Retrieval for Robust Financial Forecasting

Sarthak Khanna, Armin Berger, Muskaan Chopra, David Berghaus, Rafet Sifa

TL;DR

The paper tackles non-stationarity in financial markets by introducing macro-contextual retrieval, which grounds each daily forecast in historically analogous macro regimes. It jointly embeds macro indicators and financial sentiment into a shared space and uses causal FAISS-based retrieval to condition predictions on retrieved precedents, without retraining. Empirical results show that macro-conditioned retrieval improves robustness under distribution shift, achieving profitable and risk-adjusted performance in OOD tests on AAPL 2024 and cross-asset transfer to XOM 2024, while providing interpretable evidence chains that map to recognizable macro episodes. The approach offers a principled, explainable path to robust daily forecasting in finance, with publicly available data, models, and code.

Abstract

Financial markets are inherently non-stationary: structural breaks and macroeconomic regime shifts often cause forecasting models to fail when deployed out of distribution (OOD). Conventional multimodal approaches that simply fuse numerical indicators and textual sentiment rarely adapt to such shifts. We introduce macro-contextual retrieval, a retrieval-augmented forecasting framework that grounds each prediction in historically analogous macroeconomic regimes. The method jointly embeds macro indicators (e.g., CPI, unemployment, yield spread, GDP growth) and financial news sentiment in a shared similarity space, enabling causal retrieval of precedent periods during inference without retraining. Trained on seventeen years of S&P 500 data (2007-2023) and evaluated OOD on AAPL (2024) and XOM (2024), the framework consistently narrows the CV to OOD performance gap. Macro-conditioned retrieval achieves the only positive out-of-sample trading outcomes (AAPL: PF=1.18, Sharpe=0.95; XOM: PF=1.16, Sharpe=0.61), while static numeric, text-only, and naive multimodal baselines collapse under regime shifts. Beyond metric gains, retrieved neighbors form interpretable evidence chains that correspond to recognizable macro contexts, such as inflationary or yield-curve inversion phases, supporting causal interpretability and transparency. By operationalizing the principle that "financial history may not repeat, but it often rhymes," this work demonstrates that macro-aware retrieval yields robust, explainable forecasts under distributional change. All datasets, models, and source code are publicly available.

History Rhymes: Macro-Contextual Retrieval for Robust Financial Forecasting

TL;DR

The paper tackles non-stationarity in financial markets by introducing macro-contextual retrieval, which grounds each daily forecast in historically analogous macro regimes. It jointly embeds macro indicators and financial sentiment into a shared space and uses causal FAISS-based retrieval to condition predictions on retrieved precedents, without retraining. Empirical results show that macro-conditioned retrieval improves robustness under distribution shift, achieving profitable and risk-adjusted performance in OOD tests on AAPL 2024 and cross-asset transfer to XOM 2024, while providing interpretable evidence chains that map to recognizable macro episodes. The approach offers a principled, explainable path to robust daily forecasting in finance, with publicly available data, models, and code.

Abstract

Financial markets are inherently non-stationary: structural breaks and macroeconomic regime shifts often cause forecasting models to fail when deployed out of distribution (OOD). Conventional multimodal approaches that simply fuse numerical indicators and textual sentiment rarely adapt to such shifts. We introduce macro-contextual retrieval, a retrieval-augmented forecasting framework that grounds each prediction in historically analogous macroeconomic regimes. The method jointly embeds macro indicators (e.g., CPI, unemployment, yield spread, GDP growth) and financial news sentiment in a shared similarity space, enabling causal retrieval of precedent periods during inference without retraining. Trained on seventeen years of S&P 500 data (2007-2023) and evaluated OOD on AAPL (2024) and XOM (2024), the framework consistently narrows the CV to OOD performance gap. Macro-conditioned retrieval achieves the only positive out-of-sample trading outcomes (AAPL: PF=1.18, Sharpe=0.95; XOM: PF=1.16, Sharpe=0.61), while static numeric, text-only, and naive multimodal baselines collapse under regime shifts. Beyond metric gains, retrieved neighbors form interpretable evidence chains that correspond to recognizable macro contexts, such as inflationary or yield-curve inversion phases, supporting causal interpretability and transparency. By operationalizing the principle that "financial history may not repeat, but it often rhymes," this work demonstrates that macro-aware retrieval yields robust, explainable forecasts under distributional change. All datasets, models, and source code are publicly available.

Paper Structure

This paper contains 21 sections, 3 equations, 3 figures, 9 tables.

Figures (3)

  • Figure 2: AAPL representation diagnostics and retrieval results.
  • Figure 3: Robustness degradation across CV and OOD. Macro-Retrieval exhibits the smallest performance drop.
  • Figure 4: XOM representation diagnostics and retrieval results.