Brewing Knowledge in Context: Distillation Perspectives on In-Context Learning

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Li, Chengye, Liu, Haiyun, Li, Yuanxi
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866918057756065792
author Li, Chengye
Liu, Haiyun
Li, Yuanxi
author_facet Li, Chengye
Liu, Haiyun
Li, Yuanxi
contents In-context learning (ICL) allows large language models (LLMs) to solve novel tasks without weight updates. Despite its empirical success, the mechanism behind ICL remains poorly understood, limiting our ability to interpret, improve, and reliably apply it. In this paper, we propose a new theoretical perspective that interprets ICL as an implicit form of knowledge distillation (KD), where prompt demonstrations guide the model to form a task-specific reference model during inference. Under this view, we derive a Rademacher complexity-based generalization bound and prove that the bias of the distilled weights grows linearly with the Maximum Mean Discrepancy (MMD) between the prompt and target distributions. This theoretical framework explains several empirical phenomena and unifies prior gradient-based and distributional analyses. To the best of our knowledge, this is the first to formalize inference-time attention as a distillation process, which provides theoretical insights for future prompt engineering and automated demonstration selection.
format Preprint
id arxiv_https___arxiv_org_abs_2506_11516
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Brewing Knowledge in Context: Distillation Perspectives on In-Context Learning
Li, Chengye
Liu, Haiyun
Li, Yuanxi
Machine Learning
Computation and Language
In-context learning (ICL) allows large language models (LLMs) to solve novel tasks without weight updates. Despite its empirical success, the mechanism behind ICL remains poorly understood, limiting our ability to interpret, improve, and reliably apply it. In this paper, we propose a new theoretical perspective that interprets ICL as an implicit form of knowledge distillation (KD), where prompt demonstrations guide the model to form a task-specific reference model during inference. Under this view, we derive a Rademacher complexity-based generalization bound and prove that the bias of the distilled weights grows linearly with the Maximum Mean Discrepancy (MMD) between the prompt and target distributions. This theoretical framework explains several empirical phenomena and unifies prior gradient-based and distributional analyses. To the best of our knowledge, this is the first to formalize inference-time attention as a distillation process, which provides theoretical insights for future prompt engineering and automated demonstration selection.
title Brewing Knowledge in Context: Distillation Perspectives on In-Context Learning
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2506.11516