{"paper":{"title":"What learning algorithm is in-context learning? Investigations with linear models","license":"http://arxiv.org/licenses/nonexclusive-distrib/1.0/","headline":"Transformers implement gradient descent and ridge regression implicitly when doing in-context learning on linear tasks.","cross_cats":["cs.CL"],"primary_cat":"cs.LG","authors_text":"Dale Schuurmans, Denny Zhou, Ekin Aky\\\"urek, Jacob Andreas, Tengyu Ma","submitted_at":"2022-11-28T18:59:51Z","abstract_excerpt":"Neural sequence models, especially transformers, exhibit a remarkable capacity for in-context learning. They can construct new predictors from sequences of labeled examples $(x, f(x))$ presented in the input without further parameter updates. We investigate the hypothesis that transformer-based in-context learners implement standard learning algorithms implicitly, by encoding smaller models in their activations, and updating these implicit models as new examples appear in the context. Using linear regression as a prototypical problem, we offer three sources of evidence for this hypothesis. Fir"},"claims":{"count":4,"items":[{"kind":"strongest_claim","text":"Trained in-context learners closely match the predictors computed by gradient descent, ridge regression, and exact least-squares regression, transitioning between different predictors as transformer depth and dataset noise vary, and converging to Bayesian estimators for large widths and depths.","source":"verdict.strongest_claim","status":"machine_extracted","claim_id":"C1","attestation":"unclaimed"},{"kind":"weakest_assumption","text":"That results on linear regression as a prototypical problem will extend to the more complex, non-linear tasks typical of real in-context learning in language models.","source":"verdict.weakest_assumption","status":"machine_extracted","claim_id":"C2","attestation":"unclaimed"},{"kind":"one_line_summary","text":"Transformers performing in-context learning implicitly implement gradient descent, ridge regression, and least-squares predictors for linear models, with behavior shifting based on model depth, width, and data noise.","source":"verdict.one_line_summary","status":"machine_extracted","claim_id":"C3","attestation":"unclaimed"},{"kind":"headline","text":"Transformers implement gradient descent and ridge regression implicitly when doing in-context learning on linear tasks.","source":"verdict.pith_extraction.headline","status":"machine_extracted","claim_id":"C4","attestation":"unclaimed"}],"snapshot_sha256":"ec988c53f7351edc99d0a73d498306e283a9c543a189fdf77b8434b3bdc8d8e9"},"source":{"id":"2211.15661","kind":"arxiv","version":3},"verdict":{"id":"49e18b99-281f-43c3-890a-82ea371269f5","model_set":{"reader":"grok-4.3"},"created_at":"2026-05-17T13:34:58.805779Z","strongest_claim":"Trained in-context learners closely match the predictors computed by gradient descent, ridge regression, and exact least-squares regression, transitioning between different predictors as transformer depth and dataset noise vary, and converging to Bayesian estimators for large widths and depths.","one_line_summary":"Transformers performing in-context learning implicitly implement gradient descent, ridge regression, and least-squares predictors for linear models, with behavior shifting based on model depth, width, and data noise.","pipeline_version":"pith-pipeline@v0.9.0","weakest_assumption":"That results on linear regression as a prototypical problem will extend to the more complex, non-linear tasks typical of real in-context learning in language models.","pith_extraction_headline":"Transformers implement gradient descent and ridge regression implicitly when doing in-context learning on linear tasks."},"references":{"count":31,"sample":[{"doi":"","year":2016,"title":"Understanding intermediate layers using linear classifier probes","work_id":"bdc944db-4be2-44f7-950b-eaef12fab00e","ref_index":1,"cited_arxiv_id":"1610.01644","is_internal_anchor":true},{"doi":"","year":2016,"title":"Hoffman, David Pfau, Tom Schaul, and Nando de Freitas","work_id":"82defb4b-6d1f-4494-9004-339e87d67d22","ref_index":2,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":2016,"title":"Layer Normalization","work_id":"20a2d720-0046-4c7c-bcd6-327ec8143f69","ref_index":3,"cited_arxiv_id":"1607.06450","is_internal_anchor":true},{"doi":"","year":2020,"title":"Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert - Voss, Gretc","work_id":"9f711468-19ce-4b64-a999-bb8e3e934e66","ref_index":4,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":2020,"title":"Thread: circuits","work_id":"d9cad1f6-2e0a-4543-b594-9bf6a98592a4","ref_index":5,"cited_arxiv_id":"","is_internal_anchor":false}],"resolved_work":31,"snapshot_sha256":"95c00cd09b87214b570278c5b5195ba3abf0a61b2cc2cc5439201f91320208a0","internal_anchors":6},"formal_canon":{"evidence_count":1,"snapshot_sha256":"6f2385ee3ca73ec023a6e04cdedc30a4c5b02f3ae2b55e4abffc5fe10fa38c47"},"author_claims":{"count":0,"strong_count":0,"snapshot_sha256":"258153158e38e3291e3d48162225fcdb2d5a3ed65a07baac614ab91432fd4f57"},"builder_version":"pith-number-builder-2026-05-17-v1"}