arXiv:2410.14655cs.LG2024-10被引 9

让大模型在训练时用自己生成的文本,减少推理时的偏差。

Bridging the Training-Inference Gap in LLMs by Leveraging Self-Generated Tokens

  • 训练时交替使用真实词和模型自动生成的词作为输入。
  • 在摘要、问答和数学题任务中性能全面优于基线方法。
  • 无需外部模型即可自我修正,适合提升推理一致性。

语言模型通常在训练中以最大化给定历史词的下一个词概率为目标。然而推理时,模型会逐词自回归生成,并将前序生成结果作为输入预测后续词。每步微小预测差异在后续步骤中累积,导致生成分布偏离训练分布,可能引发不可预测行为。本文提出两种基于模型自生成文本的方法来缓解训练与推理之间的差异。第一种是批量调度采样(Batch-Scheduled Sampling),在训练中随机选择真实词或模型生成词作为输入,以交错方式修改上下文窗口。第二种是参考答案校正(Reference-Answer-based Correction),在训练中显式引入模型自我纠错能力,使其无需依赖外部模型即可修正生成序列与真实数据间的差距。通过在摘要、通用问答和数学问答任务上的广泛实验,验证了所提策略能显著提升模型整体表现。

原文摘要 · Abstract (English)

Language models are often trained to maximize the likelihood of the next token given past tokens in the training dataset. However, during inference time, they are utilized differently, generating text sequentially and auto-regressively by using previously generated tokens as input to predict the next one. Marginal differences in predictions at each step can cascade over successive steps, resulting in different distributions from what the models were trained for and potentially leading to unpredictable behavior. This paper proposes two simple approaches based on model own generation to address this discrepancy between the training and inference time. Our first approach is Batch-Scheduled Sampling, where, during training, we stochastically choose between the ground-truth token from the dataset and the model's own generated token as input to predict the next token. This is done in an offline manner, modifying the context window by interleaving ground-truth tokens with those generated by the model. Our second approach is Reference-Answer-based Correction, where we explicitly incorporate a self-correction capability into the model during training. This enables the model to effectively self-correct the gaps between the generated sequences and the ground truth data without relying on an external oracle model. By incorporating our proposed strategies during training, we have observed an overall improvement in performance compared to baseline methods, as demonstrated by our extensive experiments using summarization, general question-answering, and math question-answering tasks.

大模型训练自回归生成推理优化

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