Pith. sign in

REVIEW 16 cited by

Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizers

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2212.10559 v3 pith:XJS4KDVO submitted 2022-12-20 cs.CL

classification cs.CL
keywords in-contextattentiondescentgradientlearningfinetuninglanguagemodels
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Large pretrained language models have shown surprising in-context learning (ICL) ability. With a few demonstration input-label pairs, they can predict the label for an unseen input without parameter updates. Despite the great success in performance, its working mechanism still remains an open question. In this paper, we explain language models as meta-optimizers and understand in-context learning as implicit finetuning. Theoretically, we figure out that Transformer attention has a dual form of gradient descent. On top of it, we understand ICL as follows: GPT first produces meta-gradients according to the demonstration examples, and then these meta-gradients are applied to the original GPT to build an ICL model. We comprehensively compare the behaviors of in-context learning and explicit finetuning on real tasks to provide empirical evidence that supports our understanding. Experimental results show that in-context learning behaves similarly to explicit finetuning from multiple perspectives. Inspired by the dual form between Transformer attention and gradient descent, we design a momentum-based attention by analogy with gradient descent with momentum. The improved performance over vanilla attention further supports our understanding from another perspective, and more importantly, shows the potential to utilize our understanding for future model design. The code is available at \url{https://aka.ms/icl}.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 16 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. OpenAlex reports about 25 citations worldwide. Full citation record

  1. Provable Low-Frequency Bias of In-Context Learning of Representations

    cs.LG 2025-07 conditional novelty 7.0 of 10

    In-context learning biases hidden representations toward low-frequency eigenvectors of a reweighted graph Laplacian, a phenomenon the authors prove and test.

  2. Can Gradient Descent Simulate Prompting?

    cs.CL 2025-06 conditional novelty 7.0 of 10

    A MAML-style meta-training objective makes a single gradient step on new text recover part of the performance that prompting achieves, on reversal-curse and passage-QA tasks.

  3. Test-Time Scaling via Error Localization

    cs.LG 2026-07 conditional novelty 6.0 of 10

    TTEL uses feedback-induced token probability drops to localize the first error in a failed reasoning trace and branch a new generation from that prefix, improving pass@k per token on coding and math benchmarks.

  4. Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attention

    cs.CL 2025-09 conditional novelty 6.0 of 10

    ICR extracts shared attention directions from in-context learning and routes them at inference time, enabling zero-shot reuse across tasks.

  5. FedChip: Federated LLM for Artificial Intelligence Accelerator Chip Design

    cs.AR 2025-07 conditional novelty 6.0 of 10

    FedChip applies federated fine-tuning to LLM-based AI accelerator design, adding a 30k-sample dataset and a Chip@k metric, with a reported 77% quality improvement over high-end LLMs.

  6. Transformers Meet In-Context Learning: A Universal Approximation Theory

    cs.LG 2025-06 accept novelty 6.0 of 10

    A constructive theorem shows that transformers can perform in-context learning for any Barron-type function class by combining universal features with an emulated Lasso solver.

  7. ConText: Driving In-context Learning for Text Removal and Segmentation

    cs.CV 2025-06 conditional novelty 6.0 of 10

    ConText is the first visual in-context learning model for text removal and segmentation, chaining the two tasks and using self-prompting to reach new state-of-the-art scores.

  8. Adaptive Task Vectors for Large Language Models

    cs.LG 2025-06 conditional novelty 6.0 of 10

    Adaptive Task Vectors use a small model to generate query-specific steering vectors for frozen LLMs, reporting strong accuracy and generalization, though the theoretical equivalences to LoRA and Prefix-Tuning are not ...

  9. Transformers as Multi-task Learners: Decoupling Features in Hidden Markov Models

    cs.LG 2025-06 conditional novelty 6.0 of 10

    A hand-constructed O(ln L + T)-layer Transformer is shown to approximate low-rank hidden Markov models in-context, with lower layers extracting local history features and upper layers performing regression-based decoding.

  10. Optimization-Inspired Few-Shot Adaptation for Large Language Models

    cs.LG 2025-05 conditional novelty 6.0 of 10

    OFA tunes LayerNorm parameters as optimization preconditioners and adds step-ratio and sharpness penalties, reporting consistent few-shot accuracy gains over baselines on Llama and GPT-2 models.

  11. Solving Empirical Bayes via Transformers

    cs.LG 2025-02 conditional novelty 6.0 of 10

    A transformer pre-trained on synthetic Poisson data can beat the classical NPMLE estimator on several empirical Bayes tasks and run about 100x faster.

  12. Enhancing Chain-of-Thought Reasoning with Critical Representation Fine-tuning

    cs.CL 2025-07 conditional novelty 5.0 of 10

    CRFT selects critical internal representations via attention and saliency scores and fine-tunes only them, improving GSM8K accuracy over ReFT from 29.0% to 32.8% on LLaMA-2-7B.

  13. Prompting Wireless Networks: Reinforced In-Context Learning for Power Control

    eess.SP 2025-06 conditional novelty 5.0 of 10

    Prompting LLMs with a few reward-ranked state-action examples controls base station power at a level comparable to a trained DQN on a small simulated problem.

  14. The Prompt is Mightier than the Example

    cs.LG 2025-05 conditional novelty 5.0 of 10

    Injecting domain knowledge into prompts can substitute for many in-context examples in LLM-based synthetic tabular data generation, cutting required example counts by 40-90%.

  15. In-context learning of closed form solution to simple linear regression task using transformer with linear self-attention

    cs.LG 2026-07 conditional novelty 4.0 of 10

    A two-layer linear-attention transformer can approximate the closed-form least-squares solution by using layer normalization for division, and one l1-regularized training run mostly reproduces this construction.

  16. Thinking About Thinking: SAGE-nano's Inverse Reasoning for Self-Aware Language Models

    cs.AI 2025-06 reject novelty 3.0 of 10

    A 4B-parameter model is claimed to explain its own reasoning through inverse attention analysis, but the paper offers no consistent evidence or artifacts.

Pith tools