LGFeb 11, 2025

Attention Learning is Needed to Efficiently Learn Parity Function

arXiv:2502.07553v12 citationsh-index: 13
Originality Highly original
AI Analysis

This work establishes transformers as theoretically superior to feed-forward neural networks for learning low-sensitivity functions like parity, addressing a gap in generalization ability for sequential modeling.

The paper tackles the problem of learning the k-parity function, showing that transformers require only O(k) parameters, while feed-forward neural networks need at least Ω(n) parameters, with n typically much larger than k.

Transformers, with their attention mechanisms, have emerged as the state-of-the-art architectures of sequential modeling and empirically outperform feed-forward neural networks (FFNNs) across many fields, such as natural language processing and computer vision. However, their generalization ability, particularly for low-sensitivity functions, remains less studied. We bridge this gap by analyzing transformers on the $k$-parity problem. Daniely and Malach (NeurIPS 2020) show that FFNNs with one hidden layer and $O(nk^7 \log k)$ parameters can learn $k$-parity, where the input length $n$ is typically much larger than $k$. In this paper, we prove that FFNNs require at least $Ω(n)$ parameters to learn $k$-parity, while transformers require only $O(k)$ parameters, surpassing the theoretical lower bound needed by FFNNs. We further prove that this parameter efficiency cannot be achieved with fixed attention heads. Our work establishes transformers as theoretically superior to FFNNs in learning parity function, showing how their attention mechanisms enable parameter-efficient generalization in functions with low sensitivity.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes