paper-with-me

홈 › Papers

Counting in Small Transformers: The Delicate Interplay between Attention and Feed-Forward Layers

2024-07-16 · Freya Behrens, Luca Biggio, Lenka Zdeborová

Next to scaling considerations, architectural design choices profoundly shape the solution space of transformers. In this work, we analyze the solutions simple transformer blocks implement when tackling the histogram task: counting items in sequences. Despite its simplicity, this task reveals a complex interplay between predictive performance, vocabulary and embedding sizes, token-mixing mechanisms, and feed-forward layer capacity. We identify two theoretical counting strategies transformers adopt, relation-based and inventory-based counting, each defining distinct learning regimes for the task. These strategies dictate how functionality is distributed between attention and feed-forward layers. We further show that adding softmax and beginning-of-sequence tokens allow for more robustness when embedding dimensions are comparatively small. Empirical introspection of trained models closely confirms both the learning regimes of the various architectures and the formation of these strategies during training. We demonstrate how a basic task that requires only aggregation and selection is significantly impacted by minor design changes.

📄 PDF Abstract BibTeX arXiv:2407.11542

Code (1)

SPOC-group/counting-attention 공식 구현 pytorch

Tasks

Memorization

Methods 이 논문이 사용한 방법론

Attention 설명 없음
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$…

Similar Papers 제목 키워드 기반

The interplay between language similarity and script on a novel multi-layer Algerian dialect corpus

2021-05-16 · Findings (ACL) 2021 8 · Samia Touileb, Jeremy Barnes

Recent years have seen a rise in interest for cross-lingual transfer between languages with similar typology, and between languages of various scripts. However, the interplay between language similarity and difference in…

Cross-Lingual TransferPart-Of-Speech TaggingSentiment Analysis

Kernel Two-Sample Tests in High Dimension: Interplay Between Moment Discrepancy and Dimension-and-Sample Orders

2021-12-31 · Jian Yan, Xianyang Zhang

Motivated by the increasing use of kernel-based metrics for high-dimensional and large-scale data, we study the asymptotic behavior of kernel two-sample tests when the dimension and sample sizes both diverge to infinity.…

Effects of Parameter Norm Growth During Transformer Training: Inductive Bias from Gradient Descent

2020-10-19 · EMNLP 2021 11 · William Merrill, Vivek Ramanujan, Yoav Goldberg, Roy Schwartz 외

The capacity of neural networks like the widely adopted transformer is known to be very high. Evidence is emerging that they learn successfully due to inductive bias in the training routine, typically a variant of gradie…

Inductive Bias

Counting Like Transformers: Compiling Temporal Counting Logic Into Softmax Transformers

2024-04-05 · Andy Yang, David Chiang

Deriving formal bounds on the expressivity of transformers, as well as studying transformers that are constructed to implement known algorithms, are both effective methods for better understanding the computational power…

Emergent properties with repeated examples

2024-10-09 · François Charton, Julia Kempe

We study the performance of transformers as a function of the number of repetitions of training examples with algorithmically generated datasets. On three problems of mathematics: the greatest common divisor, modular mul…

DiversityMemorization