Parallel Structures in Pre-training Data Yield In-Context Learning

Yanda Chen, Chen Zhao, Zhou Yu, Kathleen McKeown, He He
2/19/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: yandachen/ParallelStructuresICL (5 stars, last commit 2024-06-29).

Abstract

Pre-trained language models (LMs) are capable of in-context learning (ICL): they can adapt to a task with only a few examples given in the prompt without any parameter update. However, it is unclear where this capability comes from as there is a stark distribution shift between pre-training text and ICL prompts. In this work, we study what patterns of the pre-training data contribute to ICL. We find that LMs' ICL ability depends on $\textit{parallel structures}$ in the pre-training data -- pairs of phrases following similar templates in the same context window. Specifically, we detect parallel structures by checking whether training on one phrase improves prediction of the other, and conduct ablation experiments to study their effect on ICL. We show that removing parallel structures in the pre-training data reduces LMs' ICL accuracy by 51% (vs 2% from random ablation). This drop persists even when excluding common patterns such as n-gram repetitions and long-range dependency, showing the diversity and generality of parallel structures. A closer look at the detected parallel structures indicates that they cover diverse linguistic tasks and span long distances in the data.

View on arXivView PDF

Code Implementations(1)

Implementation code for the paper "Parallel Structures in Pre-training Data Yield In-Context Learning"

52PythonMar 4, 20242 years ago

Similar Papers

Cite this paper

@article{chen2024parallel,
  title  = {Parallel Structures in Pre-training Data Yield In-Context Learning},
  author = {Yanda Chen and Chen Zhao and Zhou Yu and Kathleen McKeown and He He},
  year   = {2024},
  eprint = {2402.12530},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.12530v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.12530.svg)](https://codeofpaper.com/paper/2402.12530)

Discussion