arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.04130cs.LGcs.AI
收藏

位置嵌入在长度泛化中的局限性与能力

On the Limitations and Capabilities of Position Embeddings for Length Generalization

State Key Laboratory of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University(人工智能通用基础理论国家重点实验室,智能科学与技术学院,北京大学);Institute for Artificial Intelligence, Peking University(人工智能研究院,北京大学);Beijing Institute for General Artificial Intelligence(北京人工智能研究院);Pazhou Laboratory (Huangpu)(琶洲实验室(黄埔))

Yang Chen, Yitao Liang, Zhouchen Lin

AI总结:

本文通过理论分析位置嵌入在长度泛化中的作用,提出复杂度度量并引入尺度提示和学习式位置嵌入,以提升Transformer的长度泛化能力。

摘要:

在Transformer中,位置嵌入(PEs)显著影响长度泛化(LG)性能,但其根本作用仍不明确。本研究探讨了PEs在实现LG中的局限性与能力。我们在仅位置线性注意力(POLAs)中对PEs进行理论分析,引入线性表示复杂度(LRC)来刻画PEs何时能实现LG。分析表明,PEs并不扩展计算能力,而是结构化跨位置的学习计算。扩展到实际Transformer,我们提出序列表示复杂度(SRC),并推测LG可能实现当且仅当SRC在不同尺度下保持不变。我们通过多种推理任务的实证证据支持这一假设。为增强LG,我们引入尺度提示(Scale Hint),允许灵活的实例缩放,以及一种基于学习的位置嵌入框架,自动学习位置关系。我们的工作为改进Transformer中的LG提供了理论见解和实用策略。

英文摘要:

In Transformers, Position Embeddings (PEs) significantly influence Length Generalization (LG) performance, yet their fundamental role remains unclear. In this work, we investigate the limitations and capabilities of PEs in achieving LG. We theoretically analyze PEs in Position-Only Linear Attentions (POLAs), introducing Linear Representation Complexity (LRC) to characterize when PEs enable LG. Our analysis shows that PEs do not expand computational capabilities but structure learned computations across positions. Extending to practical Transformers, we propose Sequential Representation Complexity (SRC) and conjecture that LG is possible if and only if SRC remains invariant across scales. We support this hypothesis with empirical evidence in various reasoning tasks. To enhance LG, we introduce Scale Hint, allowing flexible instance scaling, and a Learning-Based Position Embedding framework that automatically learns positional relations. Our work provides theoretical insights and practical strategies for improving LG in Transformers.

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

↑