arXiv:2504.12459cs.CLcs.AI2025-04ICLR被引 26

语言模型中线性表示的强弱与训练数据频率直接相关,可用来推断训练数据特征。

On Linear Representations and Pretraining Data Frequency in Language Models

  • 通过分析事实三元组共现频率,发现线性表示由训练数据频次驱动
  • 在OLMo-7B和GPT-J中,主体与客体分别至少出现1000次和2000次时形成线性表示
  • 提出可跨模型预测训练频次的回归模型,适用于封闭数据模型分析

预训练数据直接影响语言模型的行为与质量,但其作用机制仍不清晰。本文关注预训练数据频率与模型线性表示之间的关系。研究发现,主题-关系-客体事实三元组的共现频率及上下文学习准确率均与线性表示强度高度相关,且这一现象贯穿预训练全过程。在OLMo-7B和GPT-J模型中,当主体和客体分别至少共现1000次和2000次时,线性表示会稳定形成,无论发生于预训练哪个阶段。进一步构建回归模型,基于完全训练后模型的线性表示质量,可准确预测词项在预训练中的出现频次,且在不同模型、不同数据集上表现良好,为推断封闭模型训练数据提供了新方法。结论表明,线性表示强度蕴含模型训练语料信息,可用于调控与优化模型行为,如通过控制训练数据达到特定频次阈值。

原文摘要 · Abstract (English)

Pretraining data has a direct impact on the behaviors and quality of language models (LMs), but we only understand the most basic principles of this relationship. While most work focuses on pretraining data's effect on downstream task behavior, we investigate its relationship to LM representations. Previous work has discovered that, in language models, some concepts are encoded `linearly' in the representations, but what factors cause these representations to form? We study the connection between pretraining data frequency and models' linear representations of factual relations. We find evidence that the formation of linear representations is strongly connected to pretraining term frequencies; specifically for subject-relation-object fact triplets, both subject-object co-occurrence frequency and in-context learning accuracy for the relation are highly correlated with linear representations. This is the case across all phases of pretraining. In OLMo-7B and GPT-J, we discover that a linear representation consistently (but not exclusively) forms when the subjects and objects within a relation co-occur at least 1k and 2k times, respectively, regardless of when these occurrences happen during pretraining. Finally, we train a regression model on measurements of linear representation quality in fully-trained LMs that can predict how often a term was seen in pretraining. Our model achieves low error even on inputs from a different model with a different pretraining dataset, providing a new method for estimating properties of the otherwise-unknown training data of closed-data models. We conclude that the strength of linear representations in LMs contains signal about the models' pretraining corpora that may provide new avenues for controlling and improving model behavior: particularly, manipulating the models' training data to meet specific frequency thresholds.

语言模型线性表示预训练数据频次分析

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