Functional Equivalence in Attention: A Comprehensive Study with Applications to Linear Mode Connectivity

Viet-Hoang Tran, Vinh Khanh Bui, Van-Hoan Trinh, Tan Lai Ngoc, Tan M. Nguyen
6/16/2026
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

Neural network parameter spaces are inherently non-injective, as distinct parameter configurations can realize identical functions through functional equivalence. While this symmetry is well understood in classical fully connected and convolutional models, it becomes substantially more intricate in modern attention-based architectures. Existing analyses of multihead attention have largely focused on the vanilla formulation, overlooking positional encodings that fundamentally reshape architectural symmetries. In this work, we provide a formal study of functional equivalence in Transformers with positional encodings. Focusing on the two most widely used variants--sinusoidal and rotary positional encodings (RoPE)--we show that sinusoidal encodings preserve the equivalence structure of vanilla attention, whereas rotary encodings significantly reduce the symmetry group, thereby enhancing expressivity. This offers a principled explanation for the growing prominence of RoPE in practice. We further examine how positional encodings affect linear mode connectivity, and through an alignment algorithm, empirically demonstrate that the presence and variability of connectivity across Transformer settings crucially depend on the positional encoding.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{tran2026functional,
  title  = {Functional Equivalence in Attention: A Comprehensive Study with Applications to Linear Mode Connectivity},
  author = {Viet-Hoang Tran and Vinh Khanh Bui and Van-Hoan Trinh and Tan Lai Ngoc and Tan M. Nguyen},
  year   = {2026},
  eprint = {2606.17830},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.17830v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.17830.svg)](https://codeofpaper.com/paper/2606.17830)

Discussion