Lune

ICLR2025Top-tier venue

MLPs Learn In-Context on Regression and Classification Tasks

William Lingxiao Tong, Cengiz Pehlevan

Abstract

In-context learning (ICL), the remarkable ability to solve a task from only input exemplars, is often assumed to be a unique hallmark of Transformer models. By examining commonly employed synthetic ICL tasks, we demonstrate that multi-layer perceptrons (MLPs) can also learn in-context. Moreover, MLPs, and the closely related MLP-Mixer models, learn in-context comparably with Transformers under the same compute budget in this setting. We further show that MLPs outperform Transformers on a series of classical tasks from psychology designed to test relational reasoning, which are closely related to in-context classification. These results underscore a need for studying in-context learning beyond attention-based architectures, while also challenging prior arguments against MLPs' ability to solve relational tasks. Altogether, our results highlight the unexpected competence of MLPs in a synthetic setting, and support the growing interest in all-MLP alternatives to Transformer architectures. It remains unclear how MLPs perform against Transformers at scale on real-world tasks, and where a performance gap may originate. We encourage further exploration of these architectures in more complex settings to better understand the potential comparative advantage of attention-based schemes.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Pretrain–Test Task Alignment Governs Generalization in In-Context Learning cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • An Explanation of In-context Learning as Implicit Bayesian Inference cites Language Models are Few-Shot Learners
  • Competition Dynamics Shape Algorithmic Phases of In-Context Learning cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Competition Dynamics Shape Algorithmic Phases of In-Context Learning cites Language Models are Few-Shot Learners
  • Competition Dynamics Shape Algorithmic Phases of In-Context Learning cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Linear Transformers Implicitly Discover Unified Numerical Algorithms cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Linear Transformers Implicitly Discover Unified Numerical Algorithms cites Language Models are Few-Shot Learners
  • Linear Transformers Implicitly Discover Unified Numerical Algorithms cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Training Dynamics of In-Context Learning in Linear Attention cites Language Models are Few-Shot Learners
  • Training Dynamics of In-Context Learning in Linear Attention cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time cites Pretrain–Test Task Alignment Governs Generalization in In-Context Learning
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time cites Training Dynamics of In-Context Learning in Linear Attention
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time cites Language Models are Few-Shot Learners
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites Language Models are Few-Shot Learners
  • Pay Attention to MLPs cites MLP-Mixer: An all-MLP Architecture for Vision
  • Pay Attention to MLPs cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and TimeBlake Bordelon, Mary I. Letey, Cengiz PehlevanICLR 2026 · 14 citations
  2. Pretrain–Test Task Alignment Governs Generalization in In-Context LearningMary Letey, Jacob A Zavatone-Veth, Yue M. Lu, Cengiz PehlevanICLR 2026 · 6 citations
  3. Linear Transformers Implicitly Discover Unified Numerical AlgorithmsPatrick Lutz, Aditya Gangrade, Hadi Daneshmand, Venkatesh SaligramaNeurIPS 2025 · 3 citations
  4. Competition Dynamics Shape Algorithmic Phases of In-Context LearningCore Francisco Park, Ekdeep Singh Lubana, Hidenori TanakaICLR 2025
  5. Training Dynamics of In-Context Learning in Linear AttentionYedi Zhang, Aaditya K. Singh, Peter E. Latham, Andrew M. SaxeICML 2025

Builds on19

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. MLP-Mixer: An all-MLP Architecture for VisionIlya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer et al.NeurIPS 2021 · 3,862 citations
  3. An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 citations
  4. Pay Attention to MLPsHanxiao Liu, Zihang Dai, David R. So, Quoc V. LeNeurIPS 2021 · 912 citations
  5. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations

Related papers

  1. Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning AbilityIvan Lee, Nan Jiang, Taylor Berg-KirkpatrickICLR 2024 · 16 citations
  2. Scaling MLPs: A Tale of Inductive BiasGregor Bachmann, Sotiris Anagnostidis, Thomas HofmannNeurIPS 2023 · 71 citations
  3. How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with RepresentationsTianyu Guo, Wei Hu, Song Mei, Huan Wang et al.ICLR 2024 · 80 citations
  4. On the generalization capacity of neural networks during generic multimodal reasoningTakuya Ito, Soham Dan, Mattia Rigotti, James R. Kozloski et al.ICLR 2024 · 4 citations
  5. Differential learning kinetics govern the transition from memorization to generalization during in-context learningAlex Nguyen, Gautam ReddyICLR 2025
Dusk over the sea between two cliffs drawn in fine vertical lines