mlsanityData to 7 Oct 2026

Universal In-Context Approximation By Prompting Fully Recurrent Models

arXiv 2406.01424 ↗First posted 3 Jun 2024cs.LG cs.AI cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

Zero-shot and in-context learning enable solving tasks without model fine-tuning, making them essential for developing generative model solutions. Therefore, it is crucial to understand whether a pretrained model can be prompted to approximate any function, i.e., whether it is a universal in-context approximator. While it was recently shown that transformer models do possess this property, these results rely on their attention mechanism. Hence, these findings do not apply to fully recurrent architectures like RNNs, LSTMs, and the increasingly popular SSMs. We demonstrate that RNNs, LSTMs, GRUs, Linear RNNs, and linear gated architectures such as Mamba and Hawk/Griffin can also serve as universal in-context approximators. To streamline our argument, we introduce a programming language called LSRL that compiles to these fully recurrent architectures. LSRL may be of independent interest for further studies of fully recurrent models, such as constructing interpretability benchmarks. We also study the role of multiplicative gating and observe that architectures incorporating such gating (e.g., LSTMs, GRUs, Hawk/Griffin) can implement certain operations more stably, making them more viable candidates for practical in-context universal approximation.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 40 of its 70 references that are in the map. First posted on arXiv 3 Jun 2024.

Builds on

40 of 70 references.

References · 40

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2016Layer Normalizationcited by 5,579
  5. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  7. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  8. 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
  9. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  10. 2020Longformer: The Long-Document Transformercited by 3,362
  11. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
  12. 2019Root Mean Square Layer Normalizationcited by 1,425
28 more
  1. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  2. 2022Transformers learn in-context by gradient descentcited by 714
  3. 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
  4. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  5. 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 700
  6. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  7. 2020HiPPO: Recurrent Memory with Optimal Polynomial Projectionscited by 600
  8. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
  9. 2023Resurrecting Recurrent Neural Networks for Long Sequencescited by 397
  10. 2022Diagonal State Spaces are as Effective as Structured State Spacescited by 350
  11. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  12. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  13. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  14. 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 232
  15. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
  16. 2021Design Guidelines for Prompt Engineering Text-to-Image Generative Modelscited by 216
  17. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
  18. 2023Finding Alignments Between Interpretable Causal Variables and Distributed Neural Representationscited by 197
  19. 2021Thinking Like Transformerscited by 182
  20. 2023Tracr: Compiled Transformers as a Laboratory for Interpretabilitycited by 99
  21. 2020Neural Networks Fail to Learn Periodic Functions and How to Fix Itcited by 97
  22. 2023Uncovering mesa-optimization algorithms in Transformerscited by 94
  23. 2015Representation Benefits of Deep Feedforward Networkscited by 84
  24. 2024Transformers, parallel computation, and logarithmic depthcited by 75
  25. 2024RecurrentGemma: Moving Past Transformers for Efficient Open Language Modelscited by 61
  26. 2023State-space Models with Layer-wise Nonlinearity are Universal Approximators with Exponential Decaying Memorycited by 38
  27. 2023Universality and Limitations of Prompt Tuningcited by 30
  28. 2024Prompting a Pretrained Transformer Can Be a Universal Approximatorcited by 25

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2023Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning Ability
  2. 2024Linearizing Large Language Models
  3. 2026On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models
  4. 2025Probing In-Context Learning: Impact of Task Complexity and Model Architecture on Generalization and Efficiency
  5. 2026The Context-Ready Transformer
  6. 2024Linear Transformers with Learnable Kernel Functions are Better In-Context Models
  7. 2025How Transformers Learn In-Context Recall Tasks? Optimality, Training Dynamics and Generalization
  8. 2024State Soup: In-Context Skill Learning, Retrieval and Mixing