提出稀疏上下文二元组模型,提升线性Transformer的训练效率与迁移能力。
Learning and Transferring Sparse Contextual Bigrams with Linear Transformers
- 设计稀疏上下文二元组,让生成依赖于由前一词决定的少数历史位置。
- 证明预训练可跳过初始耗样本阶段,实现更高效的微调。
- 算法比SGD更优,适用于需快速迁移的语言建模任务。
Transformers在自然语言建模中表现卓越,其成功原因之一在于能够结合上下文信息与全局知识,但理论基础尚不清晰。本文首先引入稀疏上下文二元组(SCB),作为经典二元组模型的自然扩展:下一个词的生成依赖于由最后一个词决定的稀疏早期位置集合。接着分析了一层线性Transformer在梯度算法下学习SCB的训练动态与样本复杂度。结果表明,从零开始训练时,过程可分为两个阶段:初始阶段样本密集,相关性从零提升至非平凡值;随后进入更高效的优化阶段。此外,我们证明:若下游任务与预训练任务间存在非平凡相关性,通过预训练模型微调可直接跳过初始耗样本阶段。实验还表明,该算法在本设置中优于SGD,并讨论了其与传统softmax Transformer的关系。
原文摘要 · Abstract (English)
Transformers have excelled in natural language modeling and one reason behind this success is their exceptional ability to combine contextual informal and global knowledge. However, the theoretical basis remains unclear. In this paper, first we introduce the Sparse Contextual Bigram (SCB), a natural extension of the classical bigram model, where the next token's generation depends on a sparse set of earlier positions determined by the last token. We then analyze the training dynamics and sample complexity of learning SCB using a one-layer linear transformer with a gradient-based algorithm. We show that when trained from scratch, the training process can be split into an initial sample-intensive stage where the correlation is boosted from zero to a nontrivial value, followed by a more sample-efficient stage of further improvement. Additionally, we prove that, provided a nontrivial correlation between the downstream and pretraining tasks, finetuning from a pretrained model allows us to bypass the initial sample-intensive stage. We also empirically demonstrate that our algorithm can outperform SGD in this setting and discuss its relationship with the usual softmax-based transformers.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。