arXiv:2501.02393cs.LGcond-mat.mes-hall2025-01被引 10

将图神经网络思想融入注意力机制,让Transformer更灵活地捕捉复杂依赖关系。

Graph-Aware Isomorphic Attention for Adaptive Dynamics in Transformers

  • 用图同构网络和邻域聚合重构注意力,增强关系建模能力
  • 在多个任务上减少泛化差距,提升学习性能
  • 适合需要动态适应复杂结构的模型优化场景

我们提出一种改进Transformer架构的方法,将图感知的关系推理融入注意力机制,结合图神经网络与语言建模的思想。基于注意力与图论的内在联系,将Transformer注意力机制重新表述为图操作,提出图感知同构注意力(Graph-Aware Isomorphic Attention)。该方法采用图同构网络(GIN)和主邻域聚合(PNA)等先进图建模策略,丰富关系结构表示,有效捕捉复杂依赖并实现跨任务泛化,表现为泛化差距减小与学习性能提升。此外,我们将图感知注意力扩展为稀疏GIN-注意力(Sparse GIN-Attention),一种微调方法,通过将注意力矩阵视为稀疏邻接图,以极低计算开销增强预训练模型的图感知能力。相比低秩适配(LoRA)等方法,该技术实现更优的训练动态与泛化效果。我们还揭示了传统注意力中隐含的图状结构,提出将Transformer演化为层次化GIN模型用于关系推理的新视角,对基础模型发展具有深远意义,适用于生物信息学、材料科学及语言建模等领域,推动可解释且通用的建模策略发展。

原文摘要 · Abstract (English)

We present an approach to modifying Transformer architectures by integrating graph-aware relational reasoning into the attention mechanism, merging concepts from graph neural networks and language modeling. Building on the inherent connection between attention and graph theory, we reformulate the Transformer's attention mechanism as a graph operation and propose Graph-Aware Isomorphic Attention. This method leverages advanced graph modeling strategies, including Graph Isomorphism Networks (GIN) and Principal Neighborhood Aggregation (PNA), to enrich the representation of relational structures. Our approach captures complex dependencies and generalizes across tasks, as evidenced by a reduced generalization gap and improved learning performance. Additionally, we expand the concept of graph-aware attention to introduce Sparse GIN-Attention, a fine-tuning approach that employs sparse GINs. By interpreting attention matrices as sparse adjacency graphs, this technique enhances the adaptability of pre-trained foundational models with minimal computational overhead, endowing them with graph-aware capabilities. Sparse GIN-Attention fine-tuning achieves improved training dynamics and better generalization compared to alternative methods like low-rank adaption (LoRA). We discuss latent graph-like structures within traditional attention mechanisms, offering a new lens through which Transformers can be understood. By evolving Transformers as hierarchical GIN models for relational reasoning. This perspective suggests profound implications for foundational model development, enabling the design of architectures that dynamically adapt to both local and global dependencies. Applications in bioinformatics, materials science, language modeling, and beyond could benefit from this synthesis of relational and sequential data modeling, setting the stage for interpretable and generalizable modeling strategies.

注意力机制图神经网络Transformer关系建模

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