arXiv:2506.21551cs.LG2025-06中稿 · ICLR被引 11

首次揭示大模型预训练中记忆到泛化的突变现象,无需测试即可监控泛化能力。

Grokking in LLM Pretraining? Monitor Memorization-to-Generalization without Test

  • 通过分析专家路径演化,发现模型从随机记忆转向结构化泛化。
  • 提出两个新指标,零成本追踪下游任务泛化效果。
  • 适用于大规模混合专家模型,对实际训练有指导意义。

本文首次研究了大模型预训练中的突现现象(grokking)。在单轮次、跨领域大规模语料的下一个词预测任务中,我们考察了模型何时记忆数据、何时下游任务泛化开始提升,以及两者是否存在时滞。不同于以往在小模型和算法数据上数千轮训练的研究,本工作聚焦于真实场景:使用混合专家(MoE)架构的大模型进行一阶段预训练,并评估其在数学推理、常识问答、代码生成和领域检索等多样任务上的泛化表现。研究首次验证了突现现象仍存在于预训练过程中,且不同数据子集因分布差异可能异步进入突现阶段。通过分析训练数据路径(即MoE中各层的专家选择),发现即使预训练损失已收敛,路径仍从随机、非平滑、实例特异演变为更结构化、可迁移。为此提出两个新度量:样本间路径相似性与层间专家聚合一致性,仅基于训练数据即可无成本地准确跟踪泛化进展,替代传统昂贵的指令微调与基准评估。

原文摘要 · Abstract (English)

This paper presents the first study of grokking in practical LLM pretraining. Specifically, we investigate when an LLM memorizes the training data, when its generalization on downstream tasks starts to improve, and what happens if there is a lag between the two. Unlike existing works studying when a small model generalizes to limited and specified tasks during thousands epochs' training on algorithmic data, we focus on a practical setting for LLMs, i.e., one-epoch pretraining of next-token prediction on a cross-domain, large-scale corpus, and generalization on diverse benchmark tasks covering math/commonsense reasoning, code generation, and domain-specific retrieval. Our study, for the first time, verifies that grokking still emerges in pretraining mixture-of-experts (MoE) LLMs, though different local data groups may enter their grokking stages asynchronously due to the heterogeneity of their distributions and attributions to others. To find a mechanistic interpretation of this local grokking, we investigate the dynamics of training data's pathways (i.e., expert choices across layers in MoE). Our primary discovery is that the pathways evolve from random, non-smooth across layers, instance-specific to more structured and transferable across samples, despite the converged pretraining loss. This depicts a transition from memorization to generalization. Two novel metrics are developed to quantify these patterns: one computes the pathway similarity between samples, while the other measures the consistency of aggregated experts between subsequent layers for each sample. These training data based metrics induce zero cost but can faithfully track and monitor the generalization of LLMs on downstream tasks, which, in conventional settings, requires costly instruction tuning and benchmark evaluation.

大模型突现现象泛化监控MoE

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。