Minimal is rare: does gradient descent find the provably minimal number of attention heads?
Recent work determined exactly how many attention heads a one-layer, attention-only softmax transformer needs to compute a symmetric Boolean function: the head complexity H*(f) equals the number of times f changes value between consecutive Hamming weights. These results describe what the architecture can represent, not what training finds. We use them as ground truth and ask how often full-batch Adam, trained on the complete truth table, reaches an exact solution with a given head budget H. Over all symmetric functions on n = 4, 5, 6 bits (and the H* ∈ {2, 3} functions on n = 7), with 32 seeds per setting, the exact-fit rate at H = H* falls from 33% (n = 4) to 7% (n = 7), and stays below 80% even at H = 3H*. Learning rate, longer training, float64 and a wider model do not close the gap. Greedy head pruning from 3H* heads reaches H* no more often than training at H* from scratch. The proved minimum is also a poor predictor of which functions are hard. A simple statistic, the net offset of the transition points from n/2, predicts difficulty much better; we found it on n = 6 and then confirmed four pre-registered predictions on fresh data (n = 5 and n = 7), e.g. Spearman ρ = −0.86 and −0.88 among the H* = 2 functions. Two further pre-registered tests reject a simple explanation: capping the attention logits makes almost every function trainable, but only because it enlarges the model class; a cap released during training leaves the success rate of the original model unchanged at H = H* (13.8% vs. 13.3%). Code, per-seed results and the pre-registration file: https://github.com/leduyphuc1702/minimal-heads-trainability (also attached). AI tools were used for implementation, experiments, drafting and literature search. Not yet peer-reviewed.
Authors
- Duy Phuc Le
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-27
- DOI
- https://doi.org/10.5281/zenodo.24574802
- Primary Topic
- Neural Networks and Applications
- Type
- preprint