arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.05807cs.LGcs.CL
收藏

融合至关重要:Transformer中位置编码融合的长度感知分析

Fusion Matters: Length-Aware Analysis of Positional-Encoding Fusion in Transformers

School of Computer Science and Technology(计算机科学与技术学院);Harbin Institute of Technology(哈尔滨工业大学)

Mohamed Amine Hallam, Kuo-Kun Tseng

AI总结:

本文研究了Transformer中位置编码融合机制对长序列性能的影响,发现融合策略的选择对长文档有显著提升,且提出了轻量级卷积门控机制以增强模型效果。

摘要:

Transformer需要位置编码来表示序列顺序,但大多数先前工作集中在设计新的位置编码而非研究如何将位置信息与标记嵌入融合。在本文中,我们研究融合机制本身是否影响性能,尤其是在长序列设置中。我们进行了一项受控的实证研究,比较了三种经典的融合策略——逐元素相加、连接与投影、以及标量门控融合——在相同的Transformer架构、数据划分和随机种子下。在三个涵盖短(AG新闻)、中等(IMDB)和长(ArXiv)序列的文本分类数据集上的实验表明,融合选择对短文本影响 negligible,但在长文档上产生一致的收益。为了验证这些收益是结构性而非随机性,我们进行了配对种子分析和跨数据集比较,覆盖不同序列长度范围。此外,在ArXiv数据集上的额外实验表明,可学习融合的益处可以跨多种位置编码家族泛化。最后,我们探索了一种轻量级的卷积门控机制,在融合层面引入局部归纳偏置,仅在长文档上评估。我们的结果表明,位置编码融合是长序列Transformer中的非平凡设计选择,应被视为显式建模决策而非固定默认。

英文摘要:

Transformers require positional encodings to represent sequence order, yet most prior work focuses on designing new positional encodings rather than examining how positional information is fused with token embeddings. In this paper, we study whether the fusion mechanism itself affects performance, particularly in long-sequence settings. We conduct a controlled empirical study comparing three canonical fusion strategies--element-wise addition, concatenation with projection, and scalar gated fusion--under identical Transformer architectures, data splits, and random seeds. Experiments on three text classification datasets spanning short (AG News), medium (IMDB), and long (ArXiv) sequences show that fusion choice has negligible impact on short texts but produces consistent gains on long documents. To verify that these gains are structural rather than stochastic, we perform paired-seed analysis and cross-dataset comparison across sequence-length regimes. Additional experiments on the ArXiv dataset indicate that the benefit of learnable fusion generalizes across multiple positional encoding families. Finally, we explore a lightweight convolutional gating mechanism that introduces local inductive bias at the fusion level, evaluated on long documents only. Our results indicate that positional-encoding fusion is a non-trivial design choice for long-sequence Transformers and should be treated as an explicit modeling decision rather than a fixed default.

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

↑