mlsanityData to 7 Oct 2026

Language Models "Grok" to Copy

arXiv 2409.09281 ↗First posted 14 Sep 2024cs.CL cs.AI cs.LGcited by 5

On the map: Retrieval-augmented generation → Generation and context integration

Abstract (arXiv)

We examine the pre-training dynamics of language models, focusing on their ability to copy text from preceding context--a fundamental skill for various LLM applications, including in-context learning (ICL) and retrieval-augmented generation (RAG). We propose a novel perspective that Transformer-based language models develop copying abilities similarly to grokking, which refers to sudden generalization on test set long after the model fit to the training set. Our experiments yield three arguments: (1) The pre-training loss decreases rapidly, while the context copying ability of models initially lags and then abruptly saturates. (2) The speed of developing copying ability is independent of the number of tokens trained, similarly to how grokking speed is unaffected by dataset size as long as the data distribution is preserved. (3) Induction heads, the attention heads responsible for copying, form from shallow to deep layers during training, mirroring the development of circuits in deeper layers during grokking. We contend that the connection between grokking and context copying can provide valuable insights for more effective language model training, ultimately improving in-context performance. For example, we demonstrated that techniques that enhance grokking, such as regularization, either accelerate or enhance the development of context copying.

Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Placed in Generation and context integration, one of 15 directions in Retrieval-augmented generation. Builds on 17 of its 24 references that are in the map. First posted on arXiv 14 Sep 2024.

Builds on

17 of 24 references.

Closest ancestors · 1

Same direction, newest first

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks22 May

Other references · 16

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  4. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
  5. 2022In-context Learning and Induction Headscited by 930
  6. 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
  7. 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 599
  8. 2022Towards Understanding Grokking: An Effective Theory of Representation Learningcited by 229
  9. 2024How Do Large Language Models Acquire Factual Knowledge During Pretraining?cited by 86
  10. 2024Grokked Transformers are Implicit Reasoners: A Mechanistic Journey to the Edge of Generalizationcited by 78
  11. 2024Grokfast: Accelerated Grokking by Amplifying Slow Gradientscited by 38
  12. 2023Fortify the Shortest Stave in Attention: Enhancing Context Awareness of Large Language Models for Effective Tool Usecited by 27
4 more
  1. 2024Batch-ICL: Effective, Efficient, and Order-Agnostic In-Context Learningcited by 20
  2. 2024Mixture of In-Context Experts Enhance LLMs' Long Context Awarenesscited by 17
  3. 2023Grokking Beyond Neural Networks: An Empirical Exploration with Model Complexitycited by 13
  4. 2024Deep Grokking: Would Deep Neural Networks Generalize Better?cited by 13

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 1; 2025: 3; 2026: 1.

5 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Grokking in LLM Pretraining? Monitor Memorization-to-Generalization without Test
  2. 2024Mitigating Copy Bias in In-Context Learning through Neuron Pruning
  3. 2026What do Language Models Learn and When? The Implicit Curriculum Hypothesis
  4. 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scale
  5. 2025Too Big to Think: Capacity, Memorization, and Generalization in Pre-Trained Transformers
  6. 2026Is Grokking Worthwhile? Functional Analysis and Transferability of Generalization Circuits in Transformers
  7. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
  8. 2024Repeat After Me: Transformers are Better than State Space Models at Copying