通过分段序列训练扩展语言模型的输入上下文
Extending Input Contexts of Language Models through Training on Segmented Sequences
AI总结:
该研究针对语言模型长输入训练的成本与适配难题,提出分段序列训练结合插值扩展位置嵌入的方法,无需改架构和额外内存即可将上下文扩展4倍并优化困惑度,适配多种位置嵌入方式。
摘要:
在长输入上有效训练语言模型面临诸多技术挑战。出于成本考量,语言模型先在固定序列长度上进行预训练,再适配更长的序列。我们探索了多种通过分段序列训练让模型适配长输入的方法,以及一种基于插值的绝对位置嵌入扩展方法。我们提出了一种训练流程,可在不改变模型架构、且不会产生比在原始输入长度上训练更高内存成本的前提下,扩展预训练模型的输入上下文大小。通过从长输入中对子分段进行采样、同时保留其原始位置,模型能够学习新的位置交互关系。我们的方法既适用于采用绝对位置嵌入的模型(可扩展其输入上下文),也对主流的相对位置嵌入方法有效,能在长度超过训练时的序列上降低困惑度。实验证明,我们的方法可将输入上下文扩展4倍,同时还能提升困惑度表现。
英文摘要:
Effectively training language models on long inputs poses many technical challenges. As a cost consideration, languages models are pretrained on a fixed sequence length before being adapted to longer sequences. We explore various methods for adapting models to longer inputs by training on segmented sequences and an interpolation-based method for extending absolute positional embeddings. We develop a training procedure to extend the input context size of pretrained models with no architectural changes and no additional memory costs than training on the original input lengths. By sub-sampling segments from long inputs while maintaining their original position the model is able to learn new positional interactions. Our method benefits both models trained with absolute positional embeddings, by extending their input contexts, as well as popular relative positional embedding methods showing a reduced perplexity on sequences longer than they were trained on. We demonstrate our method can extend input contexts by a factor of 4x while improving perplexity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。