arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2209.15189cs.CLcs.AI
收藏

通过提取上下文进行学习

Learning by Distilling Context

University of California, Berkeley(加州大学伯克利分校)

Charlie Snell, Dan Klein, Ruiqi Zhong

摘要:

语言模型从上下文标记(如提示或便笺)中获益匪浅。当被提示信息时,他们的表现会更好,他们通过在预测最终答案之前生成一个便笺簿来获得新的推理能力。但是,它们不会带来\textit{internalize}这些性能增益,这些性能增益在上下文令牌消失时消失。我们的工作建议应用上下文蒸馏,使语言模型可以通过内化这些增益来改进自身。具体地说,给定目标任务的合成未标记输入,我们以``[instructions] + [task-input ''为条件来预测``[scratch-pad] + [final answer '';然后我们微调相同的模型,以``[task-input ''为条件来预测它自己的``[final answer '',而不需要看到``[instructions ''或使用``[scratch-pad ''。本文证明了上下文蒸馏是一种通用的训练语言模型的方法,它可以有效地内化3种类型的训练信号。首先,它可以内化抽象任务指令和解释,因此我们可以用新指令迭代更新模型参数并覆盖旧指令。第二,它可以为复杂的任务(例如,8-数字加法),并且这种新获得的能力证明对于其它下游任务是有用的。最后,它可以内在化具体的训练样本,并且在SPIDER Text-to-SQL数据集上比直接梯度下降学习的性能高9\%;此外,结合上下文蒸馏操作可以内在化比上下文窗口大小允许的更多的训练样本。

英文摘要:

Language models significantly benefit from context tokens, such as prompts or scratchpads. They perform better when prompted with informative instructions, and they acquire new reasoning capabilities by generating a scratch-pad before predicting the final answers. However, they do not \textit{internalize} these performance gains, which disappear when the context tokens are gone. Our work proposes to apply context distillation so that a language model can improve itself by internalizing these gains. Concretely, given a synthetic unlabeled input for the target task, we condition the model on ``[instructions] + [task-input]'' to predict ``[scratch-pad] + [final answer]''; then we fine-tune the same model to predict its own ``[final answer]'' conditioned on the ``[task-input]'', without seeing the ``[instructions]'' or using the ``[scratch-pad]''. We show that context distillation is a general method to train language models, and it can effectively internalize 3 types of training signals. First, it can internalize abstract task instructions and explanations, so we can iteratively update the model parameters with new instructions and overwrite old ones. Second, it can internalize step-by-step reasoning for complex tasks (e.g., 8-digit addition), and such a newly acquired capability proves to be useful for other downstream tasks. Finally, it can internalize concrete training examples, and it outperforms directly learning with gradient descent by 9\% on the SPIDER Text-to-SQL dataset; furthermore, combining context distillation operations can internalize more training examples than the context window size allows.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑