IDEAS home Printed from https://ideas.repec.org/p/ces/ceswps/_12454.html

Using Transformers and Reinforcement Learning as Narrative Filters in Macroeconomics

Author

Listed:
  • Vegard H. Larsen
  • Leif Anders Thorsrud

Abstract

Building on recent advances in Natural Language Processing and modeling of sequences, we study how a multimodal Transformer-based deep learning architecture can be used for measurement and structural narrative attribution in macroeconomics. The framework we propose combines (news) text and (macroeconomic) time series information using cross-attention mechanisms, easily incorporates differences in data frequencies and reporting delays, and can be used together with Reinforcement Learning to produce structurally coherent summaries of high-frequency news flows. Applied and tested on both simulated and real-world data out-of-sample, the results we obtain are encouraging.

Suggested Citation

  • Vegard H. Larsen & Leif Anders Thorsrud, 2026. "Using Transformers and Reinforcement Learning as Narrative Filters in Macroeconomics," CESifo Working Paper Series 12454, CESifo.
  • Handle: RePEc:ces:ceswps:_12454
    as

    Download full text from publisher

    File URL: https://www.ifo.de/DocDL/cesifo1_wp12454.pdf
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Roberto S. Mariano & Yasutomo Murasawa, 2003. "A new coincident index of business cycles based on monthly and quarterly series," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 18(4), pages 427-443.
    2. Bai, Jushan & Wang, Peng, 2014. "Identification theory for high dimensional static and dynamic factor models," Journal of Econometrics, Elsevier, vol. 178(2), pages 794-804.
    3. Giannone, Domenico & Reichlin, Lucrezia & Small, David, 2008. "Nowcasting: The real-time informational content of macroeconomic data," Journal of Monetary Economics, Elsevier, vol. 55(4), pages 665-676, May.
    4. Marianne Baxter & Robert G. King, 1999. "Measuring Business Cycles: Approximate Band-Pass Filters For Economic Time Series," The Review of Economics and Statistics, MIT Press, vol. 81(4), pages 575-593, November.
    5. Valerie A. Ramey, 2011. "Identifying Government Spending Shocks: It's all in the Timing," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 126(1), pages 1-50.
    6. Frank Smets & Rafael Wouters, 2007. "Shocks and Frictions in US Business Cycles: A Bayesian DSGE Approach," American Economic Review, American Economic Association, vol. 97(3), pages 586-606, June.
    7. Melissa Dell, 2025. "Deep Learning for Economists," Journal of Economic Literature, American Economic Association, vol. 63(1), pages 5-58, March.
    8. Nimark, Kristoffer P. & Pitschner, Stefan, 2019. "News media and delegated information choice," Journal of Economic Theory, Elsevier, vol. 181(C), pages 160-196.
    9. Stephen Hansen & Michael McMahon & Andrea Prat, 2018. "Transparency and Deliberation Within the FOMC: A Computational Linguistics Approach," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 133(2), pages 801-870.
    10. James D. Hamilton, 2018. "Why You Should Never Use the Hodrick-Prescott Filter," The Review of Economics and Statistics, MIT Press, vol. 100(5), pages 831-843, December.
    11. Caldeira, João F. & Moura, Guilherme V. & Santos, André A.P., 2016. "Bond portfolio optimization using dynamic factor models," Journal of Empirical Finance, Elsevier, vol. 37(C), pages 128-158.
    12. Marta Banbura & Domenico Giannone & Lucrezia Reichlin, 2010. "Large Bayesian vector auto regressions," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 25(1), pages 71-92.
    13. Scott R. Baker & Nicholas Bloom & Steven J. Davis, 2016. "Measuring Economic Policy Uncertainty," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 131(4), pages 1593-1636.
    14. Hansen, Stephen & McMahon, Michael, 2016. "Shocking language: Understanding the macroeconomic effects of central bank communication," Journal of International Economics, Elsevier, vol. 99(S1), pages 114-133.
    15. George-Marios Angeletos & Fabrice Collard & Harris Dellas, 2020. "Business-Cycle Anatomy," American Economic Review, American Economic Association, vol. 110(10), pages 3030-3070, October.
    16. Hodrick, Robert J & Prescott, Edward C, 1997. "Postwar U.S. Business Cycles: An Empirical Investigation," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 29(1), pages 1-16, February.
    17. Larsen, Vegard H. & Thorsrud, Leif Anders & Zhulanova, Julia, 2021. "News-driven inflation expectations and information rigidities," Journal of Monetary Economics, Elsevier, vol. 117(C), pages 507-520.
    18. Mario Forni & Marc Hallin & Marco Lippi & Lucrezia Reichlin, 2000. "The Generalized Dynamic-Factor Model: Identification And Estimation," The Review of Economics and Statistics, MIT Press, vol. 82(4), pages 540-554, November.
    19. Stock, James H & Watson, Mark W, 2002. "Macroeconomic Forecasting Using Diffusion Indexes," Journal of Business & Economic Statistics, American Statistical Association, vol. 20(2), pages 147-162, April.
    20. Sims, Christopher A, 1980. "Macroeconomics and Reality," Econometrica, Econometric Society, vol. 48(1), pages 1-48, January.
    21. Ryan Chahrour & Kristoffer Nimark & Stefan Pitschner, 2021. "Sectoral Media Focus and Aggregate Fluctuations," American Economic Review, American Economic Association, vol. 111(12), pages 3872-3922, December.
    22. Estrella, Arturo & Hardouvelis, Gikas A, 1991. "The Term Structure as a Predictor of Real Economic Activity," Journal of Finance, American Finance Association, vol. 46(2), pages 555-576, June.
    23. Massimiliano Marcellino & Mario Porqueddu & Fabrizio Venditti, 2016. "Short-Term GDP Forecasting With a Mixed-Frequency Dynamic Factor Model With Stochastic Volatility," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 34(1), pages 118-127, January.
    24. Yuriy Gorodnichenko & Tho Pham & Oleksandr Talavera, 2023. "The Voice of Monetary Policy," American Economic Review, American Economic Association, vol. 113(2), pages 548-584, February.
    25. Marc Burri & Daniel Kaufmann, 2020. "A daily fever curve for the Swiss economy," Swiss Journal of Economics and Statistics, Springer;Swiss Society of Economics and Statistics, vol. 156(1), pages 1-11, December.
    26. Aruoba, S. BoraÄŸan & Diebold, Francis X. & Scotti, Chiara, 2009. "Real-Time Measurement of Business Conditions," Journal of Business & Economic Statistics, American Statistical Association, vol. 27(4), pages 417-427.
    27. Laura L. Veldkamp, 2011. "Information Choice in Macroeconomics and Finance," Economics Books, Princeton University Press, edition 1, number 9621, December.
    28. Shapiro, Adam Hale & Sudhof, Moritz & Wilson, Daniel J., 2022. "Measuring news sentiment," Journal of Econometrics, Elsevier, vol. 228(2), pages 221-243.
    29. Elliott Ash & Stephen Hansen & Yabra Muvdi & Claudia Marangon, 2026. "Large Language Models in Economics," Springer Books, in: Shlomo Weber & Victor Ginsburgh (ed.), The Palgrave Handbook of Economics and Language, edition 0, chapter 0, pages 191-210, Springer.
    30. James H. Stock & Mark W. Watson, 1989. "New Indexes of Coincident and Leading Economic Indicators," NBER Chapters, in: NBER Macroeconomics Annual 1989, Volume 4, pages 351-409, National Bureau of Economic Research, Inc.
    31. Diebold, Francis X & Mariano, Roberto S, 2002. "Comparing Predictive Accuracy," Journal of Business & Economic Statistics, American Statistical Association, vol. 20(1), pages 134-144, January.
    32. Leonardo Gambacorta & Byeungchun Kwon & Taejin Park & Pietro Patelli & Sonya Zhu, 2024. "CB-LMs: language models for central banking," BIS Working Papers 1215, Bank for International Settlements.
    33. Jonas E. Arias & Juan F. Rubio‐Ramírez & Daniel F. Waggoner, 2018. "Inference Based on Structural Vector Autoregressions Identified With Sign and Zero Restrictions: Theory and Applications," Econometrica, Econometric Society, vol. 86(2), pages 685-720, March.
    34. Lim, Bryan & Arık, Sercan Ö. & Loeff, Nicolas & Pfister, Tomas, 2021. "Temporal Fusion Transformers for interpretable multi-horizon time series forecasting," International Journal of Forecasting, Elsevier, vol. 37(4), pages 1748-1764.
    35. Ben S. Bernanke & Jean Boivin & Piotr Eliasz, 2005. "Measuring the Effects of Monetary Policy: A Factor-Augmented Vector Autoregressive (FAVAR) Approach," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 120(1), pages 387-422.
    36. repec:ulb:ulbeco:2013/13388 is not listed on IDEAS
    37. Larsen, Vegard H. & Thorsrud, Leif A., 2019. "The value of news for economic developments," Journal of Econometrics, Elsevier, vol. 210(1), pages 203-218.
    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. Stock, J.H. & Watson, M.W., 2016. "Dynamic Factor Models, Factor-Augmented Vector Autoregressions, and Structural Vector Autoregressions in Macroeconomics," Handbook of Macroeconomics, in: J. B. Taylor & Harald Uhlig (ed.), Handbook of Macroeconomics, edition 1, volume 2, chapter 0, pages 415-525, Elsevier.
    2. Jon Ellingsen & Vegard H. Larsen & Leif Anders Thorsrud, 2020. "News media vs. FRED-MD for macroeconomic forecasting," Working Paper 2020/14, Norges Bank.
    3. Jon Ellingsen & Vegard H. Larsen & Leif Anders Thorsrud, 2022. "News media versus FRED‐MD for macroeconomic forecasting," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 37(1), pages 63-81, January.
    4. Chauvet, Marcelle & Potter, Simon, 2013. "Forecasting Output," Handbook of Economic Forecasting, in: G. Elliott & C. Granger & A. Timmermann (ed.), Handbook of Economic Forecasting, edition 1, volume 2, chapter 0, pages 141-194, Elsevier.
    5. Cimadomo, Jacopo & Giannone, Domenico & Lenza, Michele & Monti, Francesca & Sokol, Andrej, 2022. "Nowcasting with large Bayesian vector autoregressions," Journal of Econometrics, Elsevier, vol. 231(2), pages 500-519.
    6. Vegard H ghaug Larsen & Leif Anders Thorsrud, 2018. "Business cycle narratives," Working Papers No 6/2018, Centre for Applied Macro- and Petroleum economics (CAMP), BI Norwegian Business School.
    7. Antolín-Díaz, Juan & Drechsel, Thomas & Petrella, Ivan, 2024. "Advances in nowcasting economic activity: The role of heterogeneous dynamics and fat tails," Journal of Econometrics, Elsevier, vol. 238(2).
    8. Raul Ibarra & Luis M. Gomez-Zamudio, 2017. "Are Daily Financial Data Useful for Forecasting GDP? Evidence from Mexico," Economía Journal, The Latin American and Caribbean Economic Association - LACEA, vol. 0(Spring 20), pages 173-203.
    9. Aastveit, Knut Are & Trovik, Tørres, 2014. "Estimating the output gap in real time: A factor model approach," The Quarterly Review of Economics and Finance, Elsevier, vol. 54(2), pages 180-193.
    10. Jianhao Lin & Jiacheng Fan & Yifan Zhang & Liangyuan Chen, 2023. "Real‐time macroeconomic projection using narrative central bank communication," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 38(2), pages 202-221, March.
    11. Nadav Ben Zeev, 2019. "Is There A Single Shock That Drives The Majority Of Business Cycle Fluctuations?," Working Papers 1906, Ben-Gurion University of the Negev, Department of Economics.
    12. Bekiros, Stelios D. & Paccagnini, Alessia, 2014. "Bayesian forecasting with small and medium scale factor-augmented vector autoregressive DSGE models," Computational Statistics & Data Analysis, Elsevier, vol. 71(C), pages 298-323.
    13. Gonzalo Echavarría M. & Wildo González P, 2011. "Un Modelo de Factores Dinámicos de Pequeña Escala para el Imacec," Notas de Investigación Journal Economía Chilena (The Chilean Economy), Central Bank of Chile, vol. 14(2), pages 109-118, August.
    14. Kaustubh, Kaustubh & Ranjan, Abhishek, 2025. "A multi-factor GDP nowcast model for India," Economic Modelling, Elsevier, vol. 147(C).
    15. Brandyn Bok & Daniele Caratelli & Domenico Giannone & Argia M. Sbordone & Andrea Tambalotti, 2018. "Macroeconomic Nowcasting and Forecasting with Big Data," Annual Review of Economics, Annual Reviews, vol. 10(1), pages 615-643, August.
    16. Elena Andreou & Eric Ghysels & Andros Kourtellos, 2013. "Should Macroeconomic Forecasters Use Daily Financial Data and How?," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 31(2), pages 240-251, April.
    17. Petropoulos, Fotios & Apiletti, Daniele & Assimakopoulos, Vassilios & Babai, Mohamed Zied & Barrow, Devon K. & Ben Taieb, Souhaib & Bergmeir, Christoph & Bessa, Ricardo J. & Bijak, Jakub & Boylan, Joh, 2022. "Forecasting: theory and practice," International Journal of Forecasting, Elsevier, vol. 38(3), pages 705-871.
      • Fotios Petropoulos & Daniele Apiletti & Vassilios Assimakopoulos & Mohamed Zied Babai & Devon K. Barrow & Souhaib Ben Taieb & Christoph Bergmeir & Ricardo J. Bessa & Jakub Bijak & John E. Boylan & Jet, 2020. "Forecasting: theory and practice," Papers 2012.03854, arXiv.org, revised Jan 2022.
    18. Bekiros Stelios & Paccagnini Alessia, 2015. "Estimating point and density forecasts for the US economy with a factor-augmented vector autoregressive DSGE model," Studies in Nonlinear Dynamics & Econometrics, De Gruyter, vol. 19(2), pages 107-136, April.
    19. Ángel Cuevas & Enrique Quilis, 2012. "A factor analysis for the Spanish economy," SERIEs: Journal of the Spanish Economic Association, Springer;Spanish Economic Association, vol. 3(3), pages 311-338, September.
    20. Karim Barhoumi & Olivier Darné & Laurent Ferrara, 2014. "Dynamic factor models: A review of the literature," OECD Journal: Journal of Business Cycle Measurement and Analysis, OECD Publishing, Centre for International Research on Economic Tendency Surveys, vol. 2013(2), pages 73-107.

    More about this item

    Keywords

    ;
    ;
    ;
    ;

    JEL classification:

    • C45 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Neural Networks and Related Topics
    • C55 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Large Data Sets: Modeling and Analysis
    • E32 - Macroeconomics and Monetary Economics - - Prices, Business Fluctuations, and Cycles - - - Business Fluctuations; Cycles
    • E37 - Macroeconomics and Monetary Economics - - Prices, Business Fluctuations, and Cycles - - - Forecasting and Simulation: Models and Applications

    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:ces:ceswps:_12454. 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: Klaus Wohlrabe (email available below). General contact details of provider: https://edirc.repec.org/data/cesifde.html .

    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.