Lune

ICLR2024Top-tier venue

Transformers can optimally learn regression mixture models

Reese Pathak, Rajat Sen, Weihao Kong, Abhimanyu Das

Abstract

Mixture models arise in many regression problems, but most methods have seen limited adoption partly due to these algorithms' highly-tailored and model-specific nature. On the other hand, transformers are flexible, neural sequence models that present the intriguing possibility of providing general-purpose prediction methods, even in this mixture setting. In this work, we investigate the hypothesis that transformers can learn an optimal predictor for mixtures of regressions. We construct a generative process for a mixture of linear regressions for which the decision-theoretic optimal procedure is given by data-driven exponential weights on a finite set of parameters. We observe that transformers achieve low meansquared error on data generated via this process. By probing the transformer's output at inference time, we also show that transformers typically make predictions that are close to the optimal predictor. Our experiments also demonstrate that transformers can learn mixtures of regressions in a sample-efficient fashion and are somewhat robust to distribution shifts. We complement our experimental observations by proving constructively that the decision-theoretic optimal procedure is indeed implementable by a transformer.

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.

9 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

  • Transformers as Algorithms: Generalization and Stability in In-context Learning cites Language Models are Few-Shot Learners
  • Transformers as Algorithms: Generalization and Stability in In-context Learning cites Transformers Learn In-Context by Gradient Descent
  • Transformers as Algorithms: Generalization and Stability in In-context Learning cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • A Theoretical Understanding of Self-Correction through In-context Alignment cites Transformers as Algorithms: Generalization and Stability in In-context Learning
  • A Theoretical Understanding of Self-Correction through In-context Alignment cites Transformers Learn In-Context by Gradient Descent
  • A Theoretical Understanding of Self-Correction through In-context Alignment cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Transformers Can Do Bayesian Inference cites Language Models are Few-Shot Learners
  • Linear Transformers are Versatile In-Context Learners cites Transformers as Algorithms: Generalization and Stability in In-context Learning
  • Linear Transformers are Versatile In-Context Learners cites Language Models are Few-Shot Learners
  • Linear Transformers are Versatile In-Context Learners cites Transformers Learn In-Context by Gradient Descent
  • Linear Transformers are Versatile In-Context Learners cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • On the Robustness of Transformers against Context Hijacking for Linear Classification cites Transformers as Algorithms: Generalization and Stability in In-context Learning
  • On the Robustness of Transformers against Context Hijacking for Linear Classification cites Language Models are Few-Shot Learners
  • On the Robustness of Transformers against Context Hijacking for Linear Classification cites In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization
  • On the Robustness of Transformers against Context Hijacking for Linear Classification cites Transformers Learn In-Context by Gradient Descent
  • On the Robustness of Transformers against Context Hijacking for Linear Classification cites What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization cites Transformers as Algorithms: Generalization and Stability in In-context Learning
  • In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization cites Language Models are Few-Shot Learners
  • In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization cites Transformers Learn In-Context by Gradient Descent
  • In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initialization 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 Transformers as Algorithms: Generalization and Stability in In-context Learning
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time cites Linear Transformers are Versatile In-Context Learners
  • 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 Transformers Learn In-Context by Gradient Descent
  • 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
  • Transformers Learn In-Context by Gradient Descent cites Language Models are Few-Shot Learners
  • Transformers Learn In-Context by Gradient Descent 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 Transformers Can Do Bayesian Inference
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers9

  1. A Theoretical Understanding of Self-Correction through In-context AlignmentYifei Wang, Yuyang Wu, Zeming Wei, Stefanie Jegelka et al.NeurIPS 2024 · 69 citations
  2. Linear Transformers are Versatile In-Context LearnersMax Vladymyrov, Johannes von Oswald, Mark Sandler, Rong GeNeurIPS 2024 · 37 citations
  3. In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD InitializationRuiqi Zhang, Jingfeng Wu, Peter L. BartlettNeurIPS 2024 · 37 citations
  4. Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and TimeBlake Bordelon, Mary I. Letey, Cengiz PehlevanICLR 2026 · 14 citations
  5. On the Robustness of Transformers against Context Hijacking for Linear ClassificationTianle Li, Chenyang Zhang, Xingwu Chen, Yuan Cao et al.NeurIPS 2025 · 7 citations

Builds on10

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations
  3. Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento et al.ICML 2023 · 729 citations
  4. Transformers Can Do Bayesian InferenceSamuel Müller, Noah Hollmann, Sebastian Pineda-Arango, Josif Grabocka et al.ICLR 2022 · 287 citations
  5. Transformers as Algorithms: Generalization and Stability in In-context LearningYingcong Li, Muhammed Emrullah Ildiz, Dimitris Papailiopoulos, Samet OymakICML 2023 · 242 citations

Related papers

  1. Distribution Transformers: Fast Approximate Bayesian Inference With On-The-Fly Prior AdaptationGeorge Whittle, Juliusz Ziomek, Jacob Rawling, Michael A OsborneICML 2026 · 13 citations
  2. Decision Transformer: Reinforcement Learning via Sequence ModelingLili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee et al.NeurIPS 2021 · 2,557 citations
  3. Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm SelectionYu Bai, Fan Chen, Huan Wang, Caiming Xiong et al.NeurIPS 2023 · 356 citations
  4. Supervised Pretraining Can Learn In-Context Reinforcement LearningJonathan Lee, Annie Xie, Aldo Pacchiano, Yash Chandak et al.NeurIPS 2023 · 170 citations
  5. What learning algorithm is in-context learning? Investigations with linear modelsEkin Akyürek, Dale Schuurmans, Jacob Andreas, Tengyu Ma et al.ICLR 2023 · 85 citations
Dusk over the sea between two cliffs drawn in fine vertical lines