arXiv:2409.12175cs.LGcs.AI2024-09被引 2

用双曲几何提升注意力,让模型更懂词语间复杂关系

Expanding Expressivity in Transformer Models with MöbiusAttention

  • 在注意力机制中引入莫比乌斯变换,实现复数空间的非线性映射
  • 在GLUE基准上表现优于基线模型,参数更少却更高效
  • 适合想提升模型表达能力的研究者,尤其关注几何结构的场景

注意力机制和Transformer架构通过捕捉长程依赖和复杂语言模式,彻底改变了自然语言处理。然而,其依赖矩阵乘法的线性操作限制了对词元间关系的充分建模。本文提出MöbiusAttention,将莫比乌斯变换融入基于Transformer的模型注意力机制中。莫比乌斯变换是复数空间中的非线性运算,具备在不同几何空间间映射的能力。通过引入该特性,MöbiusAttention使模型能学习更复杂的词元间几何关系,并利用复值权重向量捕获更广泛的信息。我们构建并预训练了带有MöbiusAttention的BERT与RoFormer版本,在GLUE基准上进行微调。实验表明,该方法在多种下游任务中优于基线BERT与RoFormer,即使参数量更少,也展现出更强的表达能力。本研究为探索复射影空间中莫比乌斯变换在基础模型中的潜力开辟了新路径。

原文摘要 · Abstract (English)

Attention mechanisms and Transformer architectures have revolutionized Natural Language Processing (NLP) by enabling exceptional modeling of long-range dependencies and capturing intricate linguistic patterns. However, their inherent reliance on linear operations in the form of matrix multiplications limits their ability to fully capture inter-token relationships on their own. We propose MöbiusAttention, a novel approach that integrates Möbius transformations within the attention mechanism of Transformer-based models. Möbius transformations are non-linear operations in spaces over complex numbers with the ability to map between various geometries. By incorporating these properties, MöbiusAttention empowers models to learn more intricate geometric relationships between tokens and capture a wider range of information through complex-valued weight vectors. We build and pre-train a BERT and a RoFormer version enhanced with MöbiusAttention, which we then finetune on the GLUE benchmark. We evaluate empirically our approach against the baseline BERT and RoFormer models on a range of downstream tasks. Our approach compares favorably against the baseline models, even with smaller number of parameters suggesting the enhanced expressivity of MöbiusAttention. This research paves the way for exploring the potential of Möbius transformations in the complex projective space to enhance the expressivity and performance of foundation models.

Transformer注意力机制复数表示几何建模

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。