Language models (LMs), like other neural networks, often favor shortcut heuristics based on surface-level patterns. Although LMs behave like n-gram models early in training, they must eventually learn hierarchical syntactic representations to correctly apply grammatical rules out-of-distribution (OOD). In this work, we use case studies of English grammar to explore how complex, diverse training data drives models to generalize OOD. We construct a framework that unifies our understanding of random variation with training dynamics, rule selection with memorization, and data diversity with complexity. We show that these factors are nuanced, and that intermediate levels of diversity and complexity lead to inconsistent behavior across random seeds and to unstable training dynamics. Our findings emphasize the critical role of training data in shaping generalization patterns and illuminate how competing model strategies lead to inconsistent generalization outcomes across random seeds. Code is available at https://github.com/sunnytqin/concept_comp.git.
翻译:与其他神经网络类似,语言模型(LMs)通常倾向于基于表层模式的捷径启发式方法。尽管语言模型在训练早期表现得像 n-gram 模型,但它们最终必须学习层级句法表征,以便在分布外(OOD)情况下正确应用语法规则。在本工作中,我们利用英语语法的案例研究,探讨了复杂多样的训练数据如何驱动模型实现 OOD 泛化。我们构建了一个框架,将我们对随机变异与训练动态、规则选择与记忆、数据多样性与复杂性的理解统一起来。我们表明,这些因素具有细微差别,中等水平的多样性和复杂性会导致不同随机种子之间的行为不一致以及训练动态的不稳定。我们的研究结果强调了训练数据在塑造泛化模式中的关键作用,并阐明了相互竞争的模型策略如何导致不同随机种子之间不一致的泛化结果。代码可在 https://github.com/sunnytqin/concept_comp.git 获取。