✗ Mechanism failed 2026

Channel-aware attention-head pruning

Implementation & benchmark of arXiv:2608.14712 — Which Question Is Your Attention Metric Answering? Attention Rows as Compositional Data

Usefulness7/10
Difficulty4/10
Novelty7/10

Source paper: Which Question Is Your Attention Metric Answering? Attention Rows as Compositional Data arXiv:2608.14712 ⓘ · analyzed Sep 1, 2026

AI-generated research hypothesis, automatically tested. Not peer-reviewed.

Idea description

Prune redundant attention heads using separate similarity scores for sink behavior and content routing. Two heads are considered safely redundant only when their normalized content compositions are close in Aitchison distance and their sink-mass trajectories are also close, avoiding pruning decisions dominated by a shared sink token.

Formulas

$$z(c)_j=\log c_j-\frac{1}{m}\sum_{k=1}^{m}\log c_k,\qquad d_{content}^2(c_a,c_b)=\frac{1}{m}\sum_{j=1}^{m}\bigl(z(c_a)_j-z(c_b)_j\bigr)^2.$$
$$u(s)=\log\frac{s}{1-s},\qquad d_{sink}^2(s_a,s_b)=\frac12\bigl(u(s_a)-u(s_b)\bigr)^2.$$
$$d_A^2(r_a,r_b)=\frac{m}{D}\left[d_{sink}^2(s_a,s_b)+d_{content}^2(c_a,c_b)\right].$$

Mathematical statement

For every attention row r of head h, write r=(s_h,(1-s_h)c_h), where s_h is the probability at the sink key and c_h is the normalized distribution over the remaining m keys. For two heads a and b, define z(c)_j=log(c_j)-(1/m) sum_k log(c_k), and define the content distance d_content^2(c_a,c_b)=(1/m) times the squared Euclidean distance between z(c_a) and z(c_b). Define the binary sink coordinate u(s)=log(s/(1-s)) and sink distance d_sink^2(s_a,s_b)=(u(s_a)-u(s_b))^2/2. The full Aitchison distance decomposes as d_A^2(r_a,r_b)=(m/D)[d_sink^2+d_content^2]. The pruning score should therefore retain heads whose content distance is large even when raw attention rows appear similar because both heads put most probability on the sink.

Implementation notes

(1) Integration point: use this as an offline head-selection algorithm before fine-tuning a Transformer, then physically remove the selected Q, K, V, and output-projection slices for those heads. Collect attention probabilities from 1,000 to 10,000 calibration sequences before pruning, using all query positions with at least two valid keys. (2) Pseudocode: initialize pairwise accumulators A_content and A_sink. For each batch, layer, head, and valid query row, extract s=attention[...,0], compute c=attention[...,1:]/(1-s), clamp c to eps and renormalize, compute z(c)=log(c)-mean(log(c)), and compute u(s)=logit(clamp(s,eps,1-eps)). For every head pair, accumulate squared z differences divided by m and squared u differences divided by 2. Form score_ab=alpha A_content[a,b]+(1-alpha) A_sink[a,b], but allow a merge only if both A_content[a,b] is below tau_content and A_sink[a,b] is below tau_sink. If a pair is admissible, retain the head with lower measured ablation importance, where importance is the validation-loss increase or output perturbation caused by zeroing that head. (3) The channel decomposition and distance formulas come from the paper; alpha, thresholds, epsilon, and the calibration distribution are estimated empirically. (4) First experiment: prune 25%, 50%, and 75% of heads in BERT-base or a 6-layer decoder on WikiText-2. Compare random pruning, raw-row cosine pruning, Jensen-Shannon pruning, and the two-channel method, followed by identical short recovery fine-tuning. Measure retained parameters, attention FLOPs, latency, and perplexity. Success is lower perplexity at the same retained head count and a larger gap over raw-row metrics when sink mass is high. Also verify that selected redundant pairs have low content distance rather than merely similar sink probabilities.

Verification

Mechanism failed

Stage 1 · Toy mechanism gate: Failed ✗

Stage 2 · Mechanism transferred to benchmark: Not tested

Stage 2 · Practical benchmark result: Not run

Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works

Stage 1 — Mechanism check agent confidence 9/10

Built a runnable channel-aware attention similarity MVP with Aitchison content/sink diagnostics and a toy pruning-selection test. The mechanism manifested: content distance was invariant to sink mass, equal-content full-distance scaling matched 2m/(m+1) to numerical precision, and channel thresholds rejected a raw-cosine false redundancy while accepting the true duplicate. However, the authoritative full-distance decomposition in the idea is mathematically incorrect as written: its median relative error was 0.59–0.96, whereas the corrected decomposition including the content geometric-mean term had less than 3e-15 error, so worked=false under the required math criterion.

Agent confidence
9/10
Baseline
Raw cosine selected the intended duplicate first but also ranked a same-sink/different-content pair next (cosine distance 0.000877; content distance 5.2082).
Idea
Channel-aware thresholds accepted only the true duplicate pair [0,3] (content distance 0.00004, sink distance 0), rejecting the false same-sink pair; content sink-invariance error was <=1.8e-15 and corrected decomposition error was <=2.5e-15.

Limitations: Only a synthetic attention-row experiment was tested; no Transformer surgery, ablation importance estimation, recovery fine-tuning, perplexity, latency, FLOP, or memory measurements were run. The stated formula should be corrected before applying this method to real head pruning.

How to run: python3 experiment.py

Verdict computed by deterministic test code from paired-seed statistics — not by the language model.

Artifacts

Implementation overview ⬇ Download all as ZIP 3 files · code, reports and structured results