JoFormer用路径化位置建模提升Transformer性能,实测更优。
JoFormer (Journey-based Transformer): Theory and Empirical Analysis on the Tiny Shakespeare Dataset
- 以可学习的方向变换序列表示相对位置,构建路径式位置编码
- 在Tiny Shakespeare上实现更低困惑度与更快收敛速度
- 为位置信息建模提供理论清晰的新范式,适合研究者参考
Transformer在序列建模中表现卓越,但有效融入位置信息仍是活跃的研究挑战。本文提出基于新近提出的非交换代数的旅程式Transformer(JoFormer),通过沿输入序列依次组合可学习的方向变换来表示相对位置,扩展并泛化了现有相对位置表示方法。我们从基本原理推导出JoFormer注意力机制,证明其包含旋转编码等标准方法作为特例。在Tiny Shakespeare字符级语言建模任务上,将JoFormer与RoFormer基线对比,结果表明其始终具备更低困惑度和更快收敛速度,凸显其更具表达力的路径化位置处理优势。值得注意的是,当前每标记的JoFormer仍为原始概念变体,层间角度独立,却已展现强劲性能,充分验证其作为更表达性架构的可行性。最后讨论了JoFormer为整合位置结构到Transformer中提供的原则性方法。代码见https://github.com/mahesh-godavarti/joformer。
原文摘要 · Abstract (English)
Transformers have demonstrated remarkable success in sequence modeling, yet effectively incorporating positional information remains a challenging and active area of research. In this paper, we introduce JoFormer, a journey-based Transformer architecture grounded in a recently proposed non-commutative algebra for composing transformations across positions. JoFormer represents relative positions through learnable directional transforms that are sequentially composed along the input, thereby extending and generalizing existing approaches based on relative position representations. We derive the JoFormer attention mechanism from first principles and show that it subsumes standard methods such as rotary transformations as special cases. To evaluate its effectiveness, we compare JoFormer to the RoFormer baseline on the Tiny Shakespeare character-level language modeling task. Our results demonstrate that JoFormer consistently achieves lower perplexity and faster convergence, highlighting the advantages of its more expressive, journey-based treatment of position. Notably, the per-token JoFormer is still a primitive, conceptual variant with layer-independent angles, yet it already demonstrates strong performance-underscoring its promise as a proof of concept for more expressive architectures. We conclude by discussing how JoFormer offers a principled approach to integrating positional structure into Transformer architectures. The code used in this work is available at https://github.com/mahesh-godavarti/joformer.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。