Abstract
TWIG represents neural network weights as shared discrete decision paths, unifying compression methods and enabling efficient fixed-weight circuits with optimized discrete choices.
We introduce TWIG (Tree-structured Weights with Inherited Gates), a representation in which every weight of a neural network is the end of a path of small discrete decisions: a sign, a shift by a power of two, a zero gate, an index into a shared table. Weights that belong together share the upper part of their paths, and each decision is inherited by every weight below it, so it is stored once and applied once. This simple change has three consequences. Any trained network can be written as a TWIG, and when the decisions are powers of two its weight layers become circuits made almost entirely of wires and adders, suited to chips whose weights are fixed at fabrication. Pruning, quantization, low-rank factorization, codebooks and weight sharing become edits of one object, so a single optimizer can choose among all of them for a whole network. And choosing the decisions is the ground-state problem of a higher-order Boltzmann machine whose interactions follow the paths of the tree, the problem class that annealers and quantum optimizers are built to solve. Today these questions are handled apart: each compression method brings its own format and solver, a circuit with fixed weights needs a dedicated constant multiplier for every weight, and discrete solvers reach only narrow subproblems such as rounding. Weight formats have long been moving toward shared decisions, through group scales, shared exponents, microexponents and sparse weights; TWIG takes this trend to its end, and every common format is a shallow TWIG at no extra cost. On five weight matrices of a large language model, a flat tree whose signed power-of-two terms are chosen per weight for circuit cost, with no group scales, needs 9--15\% fewer additions than GPTQ at equal layer error at 3- and 4-bit accuracy on typical matrices, and 20--55\% fewer on matrices with strong outliers.
Community
We introduce state trees, a new representation in which every weight is a path of discrete decisions, and decisions can be shared across weights. Quantization, pruning, low-rank factorization and weight sharing all become edits on a tree, and applying the weights reduces to shifts and additions. We hope it opens new directions in compression, efficient kernels and hardware.
As a first, deliberately simple application, we build a state tree on the original weights, one node per 64 values. Every weight and every KV-cache value still decodes to its exact BF16 bits directly on the tensorcores , with no calibration and no accuracy trade-off. On Qwen3-8B (A100, vLLM):
- 24% fewer bits for the weights (12.1 instead of 16) and 22% for the KV cache
- up to 1.28× faster generation, end to end
- 1.49× more tokens in the KV cache at the same memory budget
- decode attention 1.2–2.5× faster than FlashAttention-2 on the same values
Get this paper in your agent:
hf papers read 2610.31931 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper