IDEAS home Printed from https://ideas.repec.org/p/fip/fedhwp/104142.html

Neural Attention in Heterogeneous-Agent Economies

Author

Abstract

Transformers, the core architecture behind modern large language models, combine flexible nonlinear approximation with attention, a mechanism that learns how information is aggregated across inputs. Can attention reveal which parts of an agent distribution matter for aggregate dynamics? I represent cross-sectional distributions as economic tokens and embed a transformer in a recursive Krusell–Smith-style solution method. The transformer forecasts the continuation distribution entering individual Bellman equations. I establish an analytical link between transformer attention and the sensitivity of aggregate policy functions to distributional components, with attention recovering their normalized marginal sensitivities under a restricted representation. In Krusell–Smith benchmarks, the transformer rediscovers approximate aggregation and assigns nearly uniform attention when aggregate capital is nearly sufficient. In a heterogeneous-firm economy with endogenous default, attention concentrates near the firm default margin and becomes state dependent: during downturns attention shifts toward financially fragile firms, whose balance sheets become more consequential for leverage and aggregate dynamics.

Suggested Citation

  • Alessandro Villa, 2026. "Neural Attention in Heterogeneous-Agent Economies," Working Paper Series WP 2026-14, Federal Reserve Bank of Chicago.
  • Handle: RePEc:fip:fedhwp:104142
    DOI: 10.21033/wp-2026-14
    as

    Download full text from publisher

    File URL: https://doi.org/10.21033/wp-2026-14
    File Function: Persistent link
    Download Restriction: no

    File URL: https://www.chicagofed.org/-/media/publications/working-papers/2026/wp2026-14.pdf
    File Function: Full text
    Download Restriction: no

    File URL: https://libkey.io/10.21033/wp-2026-14?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    JEL classification:

    • C45 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Neural Networks and Related Topics
    • C63 - Mathematical and Quantitative Methods - - Mathematical Methods; Programming Models; Mathematical and Simulation Modeling - - - Computational Techniques
    • C68 - Mathematical and Quantitative Methods - - Mathematical Methods; Programming Models; Mathematical and Simulation Modeling - - - Computable General Equilibrium Models
    • D22 - Microeconomics - - Production and Organizations - - - Firm Behavior: Empirical Analysis
    • E21 - Macroeconomics and Monetary Economics - - Consumption, Saving, Production, Employment, and Investment - - - Consumption; Saving; Wealth
    • E32 - Macroeconomics and Monetary Economics - - Prices, Business Fluctuations, and Cycles - - - Business Fluctuations; Cycles
    • E44 - Macroeconomics and Monetary Economics - - Money and Interest Rates - - - Financial Markets and the Macroeconomy
    • G33 - Financial Economics - - Corporate Finance and Governance - - - Bankruptcy; Liquidation

    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:fip:fedhwp:104142. 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.

    We have no bibliographic references for this item. You can help adding them by using 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: Lauren Wiese (email available below). General contact details of provider: https://edirc.repec.org/data/frbchus.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.