arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.03989cs.LGcs.AIcs.NAmath.NA
收藏

Transformer的数学解释

A Mathematical Explanation of Transformers

NORCE Norwegian Research Centre(挪威研究中心);Department of Mathematics, Hong Kong Baptist University(香港浸会大学数学系);School of Data Science and Department of Operations and Risk Management, Lingnan University(岭南大学数据科学学院与运营及风险管理系)

Xue-Cheng Tai, Hao Liu, Lingfeng Li, Raymond H. Chan

AI总结:

本文提出一种连续框架,将Transformer架构解释为结构积分微分方程的离散化,揭示自注意力机制和归一化操作的数学本质,为理解Transformer的核心组件提供了统一的理论基础。

摘要:

Transformer架构已革新序列建模领域,并成为大语言模型(LLMs)近期突破的基础。然而,仍缺乏全面的数学理论解释其结构和操作。本文提出一种新的连续框架,严格地将Transformer解释为结构积分微分方程的离散化。在此框架中,自注意力机制自然地表现为非局部积分算子,归一化操作被表征为对时间依赖约束的投影。这种算子理论和变分视角为理解架构核心组件(包括注意力、前馈层和归一化)提供了统一且可解释的基础。本文方法超越了以往的理论分析,通过将整个Transformer操作嵌入连续域(包括令牌索引和特征维度)进行扩展,导致一个原理性强且灵活的框架,不仅加深了理论洞察,还为架构设计、分析和基于控制的解释提供了新方向。这种新解释为弥合深度学习架构与连续数学建模之间的差距提供了步骤,并为可解释和理论基础的神经网络模型发展贡献了基础视角。

英文摘要:

The Transformer architecture has revolutionized the field of sequence modeling and underpins the recent breakthroughs in large language models (LLMs). However, a comprehensive mathematical theory that explains its structure and operations remains elusive. In this work, we propose a novel continuous framework that rigorously interprets the Transformer as a discretization of a structured integro-differential equation. Within this formulation, the self-attention mechanism emerges naturally as a non-local integral operator, and layer normalization is characterized as a projection to a time-dependent constraint. This operator-theoretic and variational perspective offers a unified and interpretable foundation for understanding the architecture's core components, including attention, feedforward layers, and normalization. Our approach extends beyond previous theoretical analyses by embedding the entire Transformer operation in continuous domains for both token indices and feature dimensions. This leads to a principled and flexible framework that not only deepens on theoretical insight but also offers new directions for architecture design, analysis, and control-based interpretations. This new interpretation provides a step toward bridging the gap between deep learning architectures and continuous mathematical modeling, and contributes a foundational perspective to the ongoing development of interpretable and theoretically grounded neural network models.

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

↑