用球面能量最小化原理重设计Transformer,让模型更可解释且高效。
Hyper-SET: Designing Transformers via Hyperspherical Energy Minimization
- 基于球面能量函数,从顶层出发构建注意力与前馈模块。
- 模型在图像分类、数独求解等任务上表现媲美甚至超越传统Transformer。
- 适合关注模型可解释性与参数效率的研究者或工程师。
基于Transformer的模型取得了显著成功,但其核心组件——Transformer层——主要依赖启发式设计,自下而上构建,缺乏理论指导。为此,本文提出一种基于能量的自顶向下建模思路,将令牌动态形式化为高维空间中的语义对齐与低维空间中的分布均匀性联合最大似然估计。通过扩展的霍普菲尔德能量函数量化这两项特性,构建约束能量最小化问题,实现了对称注意力与前馈模块的设计,结合RMS归一化。进一步提出超球面能量变换器(Hyper-SET),一种递归深度结构,由球面上迭代能量优化自然生成。该模型通过层间共享参数实现任意深度扩展,参数量更少。理论坚实且结构紧凑,在图像分类、掩码图像建模和数独求解等任务中表现竞争力甚至更优。还基于该通用原则设计了线性注意力与门控前馈层,并展示其深度方向的LoRA可扩展性。结果表明,Hyper-SET是迈向可解释且原理化的Transformer设计的重要一步。
原文摘要 · Abstract (English)
Transformer-based models have achieved remarkable success, but their core components, Transformer layers, are largely heuristics-driven and engineered from the bottom up, calling for a prototypical model with high interpretability and practical competence. To this end, we conceptualize a principled, top-down approach grounded in energy-based interpretation. Specifically, we formalize token dynamics as a joint maximum likelihood estimation on the hypersphere, featuring two properties: semantic alignment in the high-dimensional space and distributional uniformity in the low-dimensional space. By quantifying them with extended Hopfield energy functions, we instantiate this idea as a constrained energy minimization problem, which enables designs of symmetric attention and feedforward modules with RMS normalization. We further present \textit{Hyper-Spherical Energy Transformer} (Hyper-SET), a recurrent-depth alternative to vanilla Transformers naturally emerging from iterative energy optimization on the hypersphere. With shared parameters across layers, Hyper-SET can scale to arbitrary depth with fewer parameters. Theoretically grounded and compact, it achieves competitive or superior performance across diverse tasks, including Sudoku solving, image classification, and masked image modeling. We also design novel variations under the proposed general principle, such as linear attention and gated feedforward layer. Moreover, we showcase its scalability with depth-wise LoRA. Our results highlight Hyper-SET as a step toward interpretable and principled Transformer design.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。