通过上下文化等变位置编码重新思考语言模型中的寻址机制
Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encoding
AI总结:
本文提出上下文化等变位置编码框架 TAPE,通过动态上下文感知的位置编码提升 Transformer 的寻址能力、长程依赖建模与推理性能,并在多项任务中验证其优越性。
摘要:
Transformer 依赖基于内容和基于位置的寻址机制来进行预测,但现有的位置编码技术常常削弱基于位置寻址的有效性。当前许多方法在注意力图中强制执行刚性模式,限制了建模长程依赖和适应多样化任务的能力。此外,大多数位置编码被学习为通用偏置,缺乏数据集中不同实例所需的专门化。为了解决这一问题,我们提出 conTextualized equivariant Position Encoding(TAPE),这是一个新颖的框架,通过跨层融入序列内容来增强位置嵌入。TAPE 引入动态的、上下文感知的位置编码,克服了传统固定模式的约束。我们证明 TAPE 可以通过模拟更广泛的算法类别来可证明地促进 LLM 的推理能力。通过强制置换和正交等变性,TAPE 确保位置编码在更新过程中的稳定性,从而提升长上下文能力。我们的方法可以轻松集成到预训练的 Transformer 中,以最小的开销实现参数高效微调。大量实验表明,与现有的位置嵌入技术相比,TAPE 在语言建模、算术推理和长上下文检索任务中取得了优越的性能。代码可在 https://github.com/VITA-Group/TAPE 获取。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。