atlas

Research map / Large language models / Language, safety and interpretability

Position: Do pretrained Transformers Learn In-Context by Gradient Descent?

ICML 2024 · Large language models › Language, safety and interpretability · approach: In-context learning analysis · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Position paper arguing that the ICL≈GD equivalence claims do not hold for real pretrained LLMs, using order-sensitivity analysis and an empirical comparison of ICL vs fine-tuned GD on LLaMA-7B.

Problem

Whether in-context learning in pretrained transformers is algorithmically equivalent to gradient descent, given that prior theoretical and empirical support relies on ICL-objective training, hand-constructed weights, and assumptions that differ from real LLMs.

Approach

Critiques the assumptions of prior ICL≈GD work (ICL-objective training, hand-constructed sparse weights, single-parameter-set analysis), proves that algorithmic equivalence implies matching order sensitivity, and tests this on natural pretrained LLMs with distributional metrics (top-K token overlap, OCS, accuracy) comparing ICL against GD and sub-model GD.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Increase GD demonstrations from 8 to 512GD on LLaMa-7B · AGNewsaccuracy: 0.42 -> 0.69Helped
Increase GD demonstrations from 8 to 512GD on LLaMa-7B · CBaccuracy: 0.39 -> 0.72Helped
Increase GD demonstrations from 8 to 512GD on LLaMa-7B · SST-2accuracy: 0.49 -> 0.75Helped
Increase GD demonstrations from 8 to 512GD on LLaMa-7B · RTEaccuracy: 0.36 -> 0.65Helped
Use ICL instead of GDLLaMa-7B · AGNews, CB, SST-2, and RTEaccuracyHelped
Increase ICL demonstrationsLLaMa-7B · AGNews, CB, SST-2, and RTEaccuracyHelped
Compare ICL with GD or an implicit-submodel GD variantLLaMa-7B · Evaluated datasets and demonstration settingstoken overlapHurt
Compare ICL with GD or an implicit-submodel GD variantLLaMa-7B · Evaluated datasets and demonstration settingsOCSHurt
Present demonstrations in different ordersICL versus GD-based algorithms · AGNewsorder sensitivityMixed
Continue pretraining across checkpointsGPT-J · AGNews, SST-2, CB, and RTEICL capacityNo clear effect
Fine-tune W_V in a single deep layer rather than the full model (ablation)Implicit-submodel GD on LLaMa-7B · ICL versus implicit-submodel GDoutput-distribution alignmentHurt
Fine-tune W_V in a single middle layer rather than the full model (ablation)Implicit-submodel GD on LLaMa-7B · ICL versus implicit-submodel GDoutput-distribution alignmentHurt

Surprising findings

Limitations

Experimental setup

Datasets: AGNews CB SST-2 RTE

Benchmarks: AGNews CB SST-2 RTE

Metrics: accuracy over full vocabulary token overlap (top-10) overlap cosine similarity (OCS) order sensitivity (std of output probabilities)

Baselines: Fine-tuning with GD SGD Adam GD sub-model (W_V of a middle or deep layer)

Builds on: Akyürek et al. ICL as gradient descent von Oswald et al. transformers learn in-context by gradient descent Dai et al. GPT as meta-optimizers Garg et al. what can transformers learn in-context

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy