用元数据预训练语言模型,能提升长上下文任务表现
When Does Metadata Conditioning (NOT) Work for Language Model Pre-Training? A Study with Context-Free Grammars
- 用生成式语法构造人工数据,测试元数据对模型的影响
- 元数据在上下文足够长时提升性能,否则反而降低效果
- 适合长上下文推理任务,不适用于信息不足的场景
语言模型获取潜在语义的能力是决定其性能的关键。一种便捷方法是在预训练数据的文本前添加元数据(如网址、域名、风格),使模型在看到完整文本前就能访问潜在语义。以往研究发现该方法在某些下游任务中提升了模型表现,但未在平均下一个词预测损失上表现出一致改进。为理解这一现象,我们通过人工数据深入考察了预训练中添加元数据对模型性能的影响。结果发现,该方法对下游任务既有正面也有负面作用。研究表明,其有效性取决于下游任务提示能否支持从上下文中推断出潜在语义。具体而言,使用概率上下文无关语法生成的数据表明:当上下文足够长以推断潜在语义时,加入元数据可提升模型表现;反之,若上下文信息不足以进行准确后验推断,则该技术会损害性能。
原文摘要 · Abstract (English)
The ability to acquire latent semantics is one of the key properties that determines the performance of language models. One convenient approach to invoke this ability is to prepend metadata (e.g. URLs, domains, and styles) at the beginning of texts in the pre-training data, making it easier for the model to access latent semantics before observing the entire text. Previous studies have reported that this technique actually improves the performance of trained models in downstream tasks; however, this improvement has been observed only in specific downstream tasks, without consistent enhancement in average next-token prediction loss. To understand this phenomenon, we closely investigate how prepending metadata during pre-training affects model performance by examining its behavior using artificial data. Interestingly, we found that this approach produces both positive and negative effects on the downstream tasks. We demonstrate that the effectiveness of the approach depends on whether latent semantics can be inferred from the downstream task's prompt. Specifically, through investigations using data generated by probabilistic context-free grammars, we show that training with metadata helps improve model's performance when the given context is long enough to infer the latent semantics. In contrast, the technique negatively impacts performance when the context lacks the necessary information to make an accurate posterior inference.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。