arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.12224cs.CL
收藏

无位置编码的因果Transformer的长度泛化

Length Generalization of Causal Transformers without Position Encoding

School of Computer Science, East China Normal University(华东师范大学计算机科学学院);School of Computer Science, Fudan University(复旦大学计算机科学学院);International Human Phenome Institutes, Shanghai(国际人类表型组研究院(上海));Shanghai AI Lab(上海人工智能实验室);Institute of Modern Languages and Linguistics, Fudan University(复旦大学现代语言与语言学研究所)

Jie Wang, Tao Ji, Yuanbin Wu, Hang Yan, Tao Gui, Qi Zhang, Xuanjing Huang, Xiaoling Wang

AI总结:

本文研究无位置编码(NoPE)的因果Transformer的长度泛化问题,发现其失败与注意力分散有关,并提出参数高效的温度超参数调优方法,显著扩展上下文长度,在长序列任务上取得与最先进算法竞争的性能。

摘要:

对于基于Transformer的最新语言模型而言,泛化到更长的句子具有重要意义。除了操作显式位置特征的算法之外,无位置编码(NoPE)的Transformer的成功为克服这一挑战提供了新的途径。在本文中,我们研究了NoPE的长度泛化性质。我们发现,尽管NoPE能够扩展到比常用的显式位置编码更长的序列,但其上下文长度仍然有限。我们确定了NoPE泛化失败与注意力分布分散之间的联系。我们提出了一种参数高效的调优方法,用于搜索注意力头的最佳温度超参数,这显著扩大了NoPE的上下文大小。在长序列语言建模、合成密码检索任务和真实世界长上下文任务上的实验表明,NoPE能够与最先进的长度泛化算法取得竞争性的性能。源代码可公开获取。

英文摘要:

Generalizing to longer sentences is important for recent Transformer-based language models. Besides algorithms manipulating explicit position features, the success of Transformers without position encodings (NoPE) provides a new way to overcome the challenge. In this paper, we study the length generalization property of NoPE. We find that although NoPE can extend to longer sequences than the commonly used explicit position encodings, it still has a limited context length. We identify a connection between the failure of NoPE's generalization and the distraction of attention distributions. We propose a parameter-efficient tuning for searching attention heads' best temperature hyper-parameters, which substantially expands NoPE's context size. Experiments on long sequence language modeling, the synthetic passkey retrieval task and real-world long context tasks show that NoPE can achieve competitive performances with state-of-the-art length generalization algorithms. The source code is publicly accessible

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

↑