paper-with-me

홈 › Papers

Fourier Circuits in Neural Networks and Transformers: A Case Study of Modular Arithmetic with Multiple Inputs

2024-02-12 · Chenyang Li, YIngyu Liang, Zhenmei Shi, Zhao Song, Tianyi Zhou

In the evolving landscape of machine learning, a pivotal challenge lies in deciphering the internal representations harnessed by neural networks and Transformers. Building on recent progress toward comprehending how networks execute distinct target functions, our study embarks on an exploration of the underlying reasons behind networks adopting specific computational strategies. We direct our focus to the complex algebraic learning task of modular addition involving $k$ inputs. Our research presents a thorough analytical characterization of the features learned by stylized one-hidden layer neural networks and one-layer Transformers in addressing this task. A cornerstone of our theoretical framework is the elucidation of how the principle of margin maximization shapes the features adopted by one-hidden layer neural networks. Let $p$ denote the modulus, $D_p$ denote the dataset of modular arithmetic with $k$ inputs and $m$ denote the network width. We demonstrate that a neuron count of $ m \geq 2^{2k-2} \cdot (p-1) $, these networks attain a maximum $ L_{2,k+1} $-margin on the dataset $ D_p $. Furthermore, we establish that each hidden-layer neuron aligns with a specific Fourier spectrum, integral to solving modular addition problems. By correlating our findings with the empirical observations of similar studies, we contribute to a deeper comprehension of the intrinsic computational mechanisms of neural networks. Furthermore, we observe similar computational mechanisms in attention matrices of one-layer Transformers. Our work stands as a significant stride in unraveling their operation complexities, particularly in the realm of complex algebraic tasks.

📄 PDF Abstract BibTeX arXiv:2402.09469

Code (0)

등록된 구현이 없습니다.

Tasks

2kMathematical Reasoning

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Position-Wise Feed-Forward Layer 설명 없음
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Focus 설명 없음
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…

Similar Papers 제목 키워드 기반

Towards Empirical Interpretation of Internal Circuits and Properties in Grokked Transformers on Modular Polynomials

2024-02-26 · Hiroki Furuta, Gouki Minegishi, Yusuke Iwasawa, Yutaka Matsuo

Grokking has been actively explored to reveal the mystery of delayed generalization and identifying interpretable representations and algorithms inside the grokked models is a suggestive hint to understanding its mechani…

Multiplication Beyond Groups: Stratified Fourier Mechanisms in Transformer Circuits

2026-07-08 · Zitong Andrew Chen, Junaid Hasan, Akhil Srinivasan, Hemkesh Bandi 외 arxiv

Transformers have demonstrated a remarkable ability to learn algorithmic reasoning, yet mechanistic analyses have mostly focused on globally invertible operations such as cyclic addition and group composition. In this wo…

Clustering Head: A Visual Case Study of the Training Dynamics in Transformers

2024-10-31 · Ambroise Odonnat, Wassim Bouaziz, Vivien Cabannes

This paper introduces the sparse modular addition task and examines how transformers learn it. We focus on transformers with embeddings in $\R^2$ and introduce a visual sandbox that provides comprehensive visualizations …

Clustering

Low Rank and Sparse Fourier Structure in Recurrent Networks Trained on Modular Addition

2025-03-28 · Akshay Rangamani

Modular addition tasks serve as a useful test bed for observing empirical phenomena in deep learning, including the phenomenon of \emph{grokking}. Prior work has shown that one-layer transformer architectures learn Fouri…

Attribute

On the geometry and topology of representations: the manifolds of modular addition

2025-12-31 · Gabriela Moisescu-Pareja, Gavin McCracken, Harley Wiltzer, Vincent Létourneau 외 arxiv

The Clock and Pizza interpretations, associated with architectures differing in either uniform or learnable attention, were introduced to argue that different architectural designs can yield distinct circuits for modular…