提出动态位置编码TAPE,让大模型更精准理解文本顺序。
Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encoding
- 根据上下文动态生成位置编码,取代固定模式。
- 在长文本推理和数学计算任务中显著提升性能。
- 无需大量参数,可无缝接入现有大模型使用。
Transformer依赖内容与位置双重机制进行预测,但现有位置编码常削弱位置感知能力。许多方法强制注意力图遵循固定模式,限制长距离依赖建模与任务适应性。同时,多数位置编码作为通用偏置学习,缺乏对数据集内不同实例的专门化表达。为此,本文提出上下文感知等变位置编码(TAPE),通过跨层融合序列内容增强位置嵌入。TAPE引入动态、上下文敏感的位置编码,突破传统固定模式限制。我们证明其可形式化促进大模型推理能力,模拟更广算法类。通过强制置换与正交等变性,确保更新过程中的编码稳定性,提升长上下文处理能力。该方法可轻松集成至预训练Transformer,实现低开销参数高效微调。大量实验表明,TAPE在语言建模、算术推理与长文本检索任务中均优于现有位置编码技术。代码已公开于https://github.com/VITA-Group/TAPE。
原文摘要 · Abstract (English)
Transformers rely on both content-based and position-based addressing mechanisms to make predictions, but existing positional encoding techniques often diminish the effectiveness of position-based addressing. Many current methods enforce rigid patterns in attention maps, limiting the ability to model long-range dependencies and adapt to diverse tasks. Additionally, most positional encodings are learned as general biases, lacking the specialization required for different instances within a dataset. To address this, we propose con\textbf{T}extualized equivari\textbf{A}nt \textbf{P}osition \textbf{E}ncoding (\textbf{TAPE}), a novel framework that enhances positional embeddings by incorporating sequence content across layers. TAPE introduces dynamic, context-aware positional encodings, overcoming the constraints of traditional fixed patterns. We show that TAPE can provably facilitate LLM reasoning ability by emulating a broader class of algorithms. By enforcing permutation and orthogonal equivariance, TAPE ensures the stability of positional encodings during updates, improving long-context ability. Our method can be easily integrated into pre-trained transformers, offering parameter-efficient fine-tuning with minimal overhead. Extensive experiments show that TAPE achieves superior performance in language modeling, arithmetic reasoning, and long-context retrieval tasks compared to existing positional embedding techniques. Code is available at https://github.com/VITA-Group/TAPE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。