{"paper":{"title":"An Explanation of In-context Learning as Implicit Bayesian Inference","license":"http://arxiv.org/licenses/nonexclusive-distrib/1.0/","headline":"Large language models perform in-context learning by implicitly inferring latent concepts that explain coherence in both pretraining data and prompt examples.","cross_cats":["cs.LG"],"primary_cat":"cs.CL","authors_text":"Aditi Raghunathan, Percy Liang, Sang Michael Xie, Tengyu Ma","submitted_at":"2021-11-03T09:12:33Z","abstract_excerpt":"Large language models (LMs) such as GPT-3 have the surprising ability to do in-context learning, where the model learns to do a downstream task simply by conditioning on a prompt consisting of input-output examples. The LM learns from these examples without being explicitly pretrained to learn. Thus, it is unclear what enables in-context learning. In this paper, we study how in-context learning can emerge when pretraining documents have long-range coherence. Here, the LM must infer a latent document-level concept to generate coherent next tokens during pretraining. At test time, in-context lea"},"claims":{"count":4,"items":[{"kind":"strongest_claim","text":"We prove when this occurs despite a distribution mismatch between prompts and pretraining data in a setting where the pretraining distribution is a mixture of HMMs.","source":"verdict.strongest_claim","status":"machine_extracted","claim_id":"C1","attestation":"unclaimed"},{"kind":"weakest_assumption","text":"That real-world pretraining corpora exhibit long-range coherence driven by latent document-level concepts that can be adequately captured by a mixture-of-HMMs generative process, and that this mechanism dominates the in-context behavior of large-scale models trained on messy web data.","source":"verdict.weakest_assumption","status":"machine_extracted","claim_id":"C2","attestation":"unclaimed"},{"kind":"one_line_summary","text":"In-context learning emerges as implicit Bayesian inference of latent concepts when pretraining data has long-range coherence, proven for mixture-of-HMM distributions and replicated on the synthetic GINC dataset.","source":"verdict.one_line_summary","status":"machine_extracted","claim_id":"C3","attestation":"unclaimed"},{"kind":"headline","text":"Large language models perform in-context learning by implicitly inferring latent concepts that explain coherence in both pretraining data and prompt examples.","source":"verdict.pith_extraction.headline","status":"machine_extracted","claim_id":"C4","attestation":"unclaimed"}],"snapshot_sha256":"ad87445a340020ea25925565e642fc90cd2d7a1b8a3a0a4ad17fe215d665560a"},"source":{"id":"2111.02080","kind":"arxiv","version":6},"verdict":{"id":"4e9aa3e5-95e6-49a4-a39f-c3eda946d3df","model_set":{"reader":"grok-4.3"},"created_at":"2026-05-16T22:18:23.706449Z","strongest_claim":"We prove when this occurs despite a distribution mismatch between prompts and pretraining data in a setting where the pretraining distribution is a mixture of HMMs.","one_line_summary":"In-context learning emerges as implicit Bayesian inference of latent concepts when pretraining data has long-range coherence, proven for mixture-of-HMM distributions and replicated on the synthetic GINC dataset.","pipeline_version":"pith-pipeline@v0.9.0","weakest_assumption":"That real-world pretraining corpora exhibit long-range coherence driven by latent document-level concepts that can be adequately captured by a mixture-of-HMMs generative process, and that this mechanism dominates the in-context behavior of large-scale models trained on messy web data.","pith_extraction_headline":"Large language models perform in-context learning by implicitly inferring latent concepts that explain coherence in both pretraining data and prompt examples."},"references":{"count":300,"sample":[{"doi":"","year":1966,"title":"Statistical inference for probabilistic functions of finite state markov chains","work_id":"7224cac5-ed47-4032-b64c-473b3a111b50","ref_index":1,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":2003,"title":"Blei, Andrew Ng, and M","work_id":"9626107e-2b80-43c8-a7fa-a52236887ed4","ref_index":2,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":2005,"title":"Language Models are Few-Shot Learners","work_id":"214732c0-2edd-44a0-af9e-28184a2b8279","ref_index":3,"cited_arxiv_id":"2005.14165","is_internal_anchor":true},{"doi":"","year":2020,"title":"Le, and Christopher D","work_id":"eeae921c-36f3-45b9-82ec-48c0ad725757","ref_index":4,"cited_arxiv_id":"","is_internal_anchor":false},{"doi":"","year":1977,"title":"A. P. Dempster, Laird N. M., and Rubin D. B. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society: Series B, 39 0 (1): 0 1--38, 1977","work_id":"cd7ad5ee-3f69-45e9-a1c4-9f5fdf6f5d9d","ref_index":5,"cited_arxiv_id":"","is_internal_anchor":false}],"resolved_work":300,"snapshot_sha256":"7bb962617aeb35410bc72bce51a63365d8ead76373f80f95fa125fcc4c237a12","internal_anchors":7},"formal_canon":{"evidence_count":2,"snapshot_sha256":"40ce0e32a6fa138e01c6a9a65554250320e68e88450f32a46c2f3a4be0865985"},"author_claims":{"count":0,"strong_count":0,"snapshot_sha256":"258153158e38e3291e3d48162225fcdb2d5a3ed65a07baac614ab91432fd4f57"},"builder_version":"pith-number-builder-2026-05-17-v1"}