Knot Quivers as an Exact Testbed for Where Transformer Activation Outliers Come From

When a large language model is compressed to 4-bit numbers, a handful of hidden values that are hundreds or thousands of times larger than the rest ("activation outliers") stretch the quantization grid until ordinary values round to zero. The field has fixes that work, but it disagrees about where these outliers come from. One camp says they are a side effect of normalization placement. Another says they are a forced response to the causal attention mask. The field also judges fixes almost entirely by language-modeling perplexity, a measure that averages over everything and has no ground truth for whether a given internal computation survived.

We propose to settle both issues on a task family borrowed from mathematical physics: computing the integer invariants of symmetric quivers. A quiver here is a small directed graph, written as a symmetric integer matrix. Through the knot–quiver correspondence it encodes knot invariants, and its outputs, called Donaldson–Thomas (DT) invariants, are guaranteed to be integers. The task has three properties that language modeling lacks. Every answer can be checked exactly. The inputs have no natural first token, so mask direction becomes a clean experimental variable. And the theory supplies exact symmetries: relabeling nodes, or applying "unlinking" rewrites that change the graph but provably not its answer. A quantized model can therefore be tested on whether it stays consistent across inputs that must give identical outputs. We use this testbed to run controlled training ablations that separate the two causal stories, and to measure a quantization failure mode that perplexity cannot see.

Core Claim

Our claim is that small transformers trained to map a symmetric quiver to its DT invariants will reproduce the outlier phenomena seen in language models, including massive activations, attention sinks and low-bit collapse. They will do so under conditions we can switch on and off independently. Specifically, the input can be fed causally in a random node order or bidirectionally. Normalization can be RMSNorm or DynamicTanh. Attention can be softmax or gated. The training data is exact, so we can also define a symmetry-consistency score: the rate at which a quantized model gives identical integer outputs on permuted or unlinked versions of the same quiver. We expect this score to separate quantization methods that look nearly tied on perplexity.

What Each Direction Contributes

The topological direction supplies the data and the symmetries, not a new quantizer. Knots-quivers correspondence shows that the generating series of colored knot polynomials equals the generating series of a symmetric quiver with integer matrix $C$ of size $m$. This series is

$$P_C(x,q)=\sum_{d\in\mathbb{N}^m}\frac{(-q^{1/2})^{\,d^\top C d}\,x_1^{d_1}\cdots x_m^{d_m}}{(q;q)_{d_1}\cdots(q;q)_{d_m}},$$

where $d$ is a vector of nonnegative integers and $(q;q)_k=\prod_{i=1}^k(1-q^i)$. The DT invariants are the integers obtained by factoring this series into elementary pieces. Because they are integers, the paper can prove integrality of the knot invariants called LMOV numbers. Knot-quiver correspondence: a brief review and Quiver Diagonalization and Open BPS States supply two further tools. The first is the unlinking operations, which remove an arrow by adding a node while preserving the series. The second is a diagonalization procedure that gives an exact order-by-order route to the invariants. Together they give us a generator of unlimited training pairs and of equivalence classes with known identical answers. The anchor knots in those papers give real-world test points with published quivers: the trefoil, figure-eight, torus knots and twist knots.

The outlier direction supplies the phenomena and the competing hypotheses. Anatomy of Massive Activations and Attention Sinks argues that massive activations come from the Pre-Norm layout and SwiGLU, and are separable from attention sinks. Swapping RMSNorm for DynamicTanh cut spikes from 3,818 to 153 while the sink ratio rose. Attention Sinks Induce Gradient Sinks argues instead that the causal mask funnels gradient onto the first token, and that massive activations are the model's defense against it. Quantizable Transformers attributes outliers to softmax's inability to output zero. Its gated attention brought OPT-1.3B's INT8 perplexity from 989.6 to 29.95. These papers motivate the work and supply interventions we reuse. Neither of the first two ties its explanation to post-training quantization damage, and both required pre-training at scale (Sun et al. used a 100B-token budget). We test the same hypotheses at a scale where a full factorial grid is affordable.

The closest structural work is Quiver neural networks. It treats a network's architecture as a quiver representation and compresses losslessly using rotation symmetry, but only for norm-dependent activations; softmax and RMSNorm are excluded. We do the opposite: the quiver is the data, and the network is an ordinary transformer with exactly the components that paper excludes. We considered porting its symmetry argument to quantization grids. We dropped this because rotation-based quantizers already search that symmetry group, and a reframing would add little.

Research Program

We first build a data generator. It draws random symmetric integer matrices with $m\le 6$ nodes and bounded entries, and computes DT invariants exactly up to a fixed total degree. For each quiver it emits a node permutation and a short chain of unlinking rewrites, all with provably equal answers. Training sequences encode the matrix entries as tokens and the target integers in signed base-10 digits. Held-out splits include larger $m$, higher degree, and the published knot quivers.

We then train transformers of 10M–100M parameters over a factorial grid with four axes. The mask is either causal over a randomly ordered node list or bidirectional over the input. Normalization is Pre-Norm RMSNorm or DynamicTanh. Attention is softmax, gated attention, or softmax with the V-scale valve from Chen and Yao. The feed-forward block is SwiGLU or GELU. Each cell is trained to a matched exact-match accuracy at full precision. We log peak activation magnitude per layer, attention sink ratio, and first-token gradient norm during training.

Each trained model is then quantized at W8A8, W4A4 and W4A4KV4 with the same suite of post-training methods. We report three metrics. Exact-match accuracy is the share of fully correct invariant lists. The pre-rounding integrality gap is the distance of the decoded digit distribution from a single integer. Symmetry consistency is the agreement across a quiver's equivalence class.

Finally, we check transfer. We train the same architecture grid at matched size on a C4 subset, and test whether each cell's outlier statistics and quantization ranking agree with the quiver-task results. We also fine-tune a released 7B-scale model on the quiver task and quantize it. This tells us whether symmetry consistency ranks methods differently from WikiText-2 perplexity on a model whose outliers formed during real pre-training.

Baselines

The naive reference is round-to-nearest uniform quantization with min/max calibration, paired with the full-precision model as the upper bound. Quantizable Transformers reports this baseline collapsing BERT from 4.49 to 1294 perplexity at INT8. It shows whether a given architecture cell produces outliers at all.

The strongest existing post-training method is DFRot (DFRot). It refines the randomized Hadamard rotation of QuaRot specifically to handle token-specific massive activations, which is the exact phenomenon at issue here. Reported numbers from the file are as follows. DFRot improves LLaMA3-70B perplexity by 0.98 at W4A4KV4 and raises LLaMA3-8B zero-shot accuracy by 1.56% over QuaRot. QuaRot itself loses 0.47 WikiText-2 perplexity on Llama-2-70B at 4 bits. No reported result was found on Lacuna for any quantization method on knot or quiver tasks. We run QuaRot and DFRot alongside the channel shift-and-scale method of Outlier Suppression+. All three get the same calibration set, the same calibration budget (DFRot's single-GPU tuning time sets the cap), and identical evaluation splits.

Our proposal is a measurement and a causal study, not a quantizer, so "beating" a baseline means something specific. The study succeeds if symmetry consistency reorders methods that perplexity-style exact match ranks as tied within noise. It also succeeds if one architecture axis predicts low-bit collapse across all quantizers.

Two ablations isolate our ingredients. The first keeps the first token and detected sink tokens in FP16 and quantizes everything else with round-to-nearest. This is the cheap fix a practitioner would try first. The second trains the full grid on a generic symmetric-set task of matched difficulty and output range: sorting multisets and reporting integer statistics. This shows whether anything specific to quivers matters.

Why not just…?

Why not just keep measuring perplexity and zero-shot accuracy? Those benchmarks have no ground-truth internal computation and no exact symmetries, so they cannot tell a quantized model that is slightly blurrier from one that has started giving inconsistent answers to equivalent inputs. Our fine-tuned 7B experiment directly tests whether symmetry consistency adds information. If its method ranking matches the WikiText-2 ranking, we will report that the new metric is redundant.

Why not just use a generic synthetic task like sorting or arithmetic? This is a real threat. The set-task control is in the grid precisely to measure it. Quivers add two things such tasks lack. The first is non-trivial equivalences that change the input's size and structure, not just its order; unlinking adds a node. The second is integer targets that grow quickly with degree, which stresses the output range. If the set task reproduces every finding, the paper's conclusion becomes that a cheap synthetic testbed suffices, and we will say so.

Why not just resolve the Sun et al. versus Chen and Yao disagreement at language-model scale? Doing so requires repeated 100B-token runs per ablation cell, which is why each paper varied only a few factors. Small models on a clean task allow the full interaction grid. The risk is that small-scale outliers form differently. The matched C4 runs are the check: we only claim a causal result if both datasets show it.

Why not just keep the sink tokens in high precision? For outliers tied to the first token this may be nearly sufficient. If so, it would be a useful negative result for the case that rotation refinement is needed. The ablation measures it directly. Bidirectional cells with no first-token semantics show whether outliers move to other tokens or channels, where a token-based exemption fails.

Decisive Checks

Three outcomes would be decisive. First, in bidirectional cells with RMSNorm, massive activations either appear or they do not. If they appear, normalization placement is sufficient and Sun et al.'s account is supported. If they vanish while causal cells keep them, Chen and Yao's mask-driven account is supported. Second, at W4A4, the DFRot-versus-QuaRot gap in symmetry consistency should be large where the gap in exact match is small; otherwise the new metric earns nothing. Third, the quiver-grid ranking of architectures by low-bit damage should match the C4-grid ranking. If it does not, the testbed is a curiosity rather than a probe of how real models break, and we would report that.