paper-with-me

Papers

Exact Sequence Classification with Hardmax Transformers

2025-02-04 · Albert Alcalde, Giovanni Fantuzzi, Enrique Zuazua

We prove that hardmax attention transformers perfectly classify datasets of $N$ labeled sequences in $\mathbb{R}^d$, $d\geq 2$. Specifically, given $N$ sequences with an arbitrary but finite length in $\mathbb{R}^d$, we construct a transformer with $\mathcal{O}(N)$ blocks and $\mathcal{O}(Nd)$ parameters perfectly classifying this dataset. Our construction achieves the best complexity estimate to date, independent of the length of the sequences, by innovatively alternating feed-forward and self-attention layers and by capitalizing on the clustering effect inherent to the latter. Our novel constructive method also uses low-rank parameter matrices within the attention mechanism, a common practice in real-life transformer implementations. Consequently, our analysis holds twofold significance: it substantially advances the mathematical theory of transformers and it rigorously justifies their exceptional real-world performance in sequence classification tasks.

📄 PDF Abstract BibTeX arXiv:2502.02270

Code (0)

등록된 구현이 없습니다.

Tasks

Classification

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음

Similar Papers 제목 키워드 기반

Optimal Memorization Capacity of Transformers

2024-09-26 · Tokio Kajitsuka, Issei Sato

Recent research in the field of machine learning has increasingly focused on the memorization capacity of Transformers, but how efficient they are is not yet well understood. We demonstrate that Transformers can memorize…

Memorization

Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?

2023-07-26 · Tokio Kajitsuka, Issei Sato

Existing analyses of the expressive capacity of Transformer models have required excessively deep layers for data memorization, leading to a discrepancy with the Transformers actually used in practice. This is primarily …

Memorization

Clustering in pure-attention hardmax transformers and its role in sentiment analysis

2024-06-26 · Albert Alcalde, Giovanni Fantuzzi, Enrique Zuazua

Transformers are extremely successful machine learning models whose mathematical properties remain poorly understood. Here, we rigorously characterize the behavior of transformers with hardmax self-attention and normaliz…

Sentiment Analysis

Localmax dynamics for attention in transformers and its asymptotic behavior

2025-09-19 · Henri Cimetière, Maria Teresa Chiri, Bahman Gharesifard arxiv

We introduce a new discrete-time attention model, termed the localmax dynamics, which interpolates between the classic softmax dynamics and the hardmax dynamics, where only the tokens that maximize the influence toward a…

The Expressive Power of Low Precision Softmax Transformers with (Summarized) Chain-of-Thought

2026-05-18 · Moritz Brösamle, Stephan Eckstein arxiv

Existing expressivity results for transformers typically rely on hardmax attention, high precision, and other architectural modifications that disconnect them from the models used in practice. We bridge this gap by analy…