Manuscript Offprint
arXiv:2609.31564Weight Pair Encoding: Inducing a Smaller Grammar in Neural Network Weights
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Irene Tallini*
Area Science Park
Trieste, Italy
irene.tallini@areasciencepark.it
Alberto Cazzaniga†
Université Côte d'Azur, Inria, LJAD
Maasai Project Team, Nice, France
Area Science Park, Trieste, Italy
Daniele Solombrino*
Sapienza University of Rome
Rome, Italy
Emanuele Rodola†
Sapienza University of Rome and Paradigma
Rome, Italy
Abstract
We show that neural network weights can be explicitly fintuned to admit a smaller grammar. Weight Pair Encoding (WeightPE) does so by placing a lossy Re-Pair compressor inside a straight-through estimator. The int8 weights of the network are flattened into one string, and near-matching Re-Pair patterns are made exactly equal within a global budget. The network computes with the rewritten weights and trains through them with a straight-through estimator. Unlike a flat codebook of fixed-size entries, a grammar offers variable-length patterns and reuses them hierarchically inside larger ones. On the MLP weights of ViT-B/16 and ViT-L/16 finetuned on CIFAR-10, WeightPE produces a Re-Pair grammar and the size of the one produced by an equivalent int8 QAT run, at a cost of 1.9 and 1.1 accuracy points. The trend extends to different grammar compressors (LZ78, SEQUITUR), over which the networks has not be finetuned against. To our knowledge, this is the first time grammar size has been used as an explicit training objective for network weights.
1 Introduction and Related Works
Identifying and imposing structure in the weights of a network has repeatedly proved valuable: weight repetition [Nowlan and Hinton, 1992, Ullrich et al., 2017], low-rank structure [Aghajanyan et al., 2021, Hu et al., 2022], permutation symmetry [Entezari et al., 2022, Ainsworth et al., 2023].
Grammar structure is another rich candidate: it compresses a string exposing its repetitions hierarchically, it supports random access in space proportional to the compressed size [Bille et al., 2015] and direct computation over the compressed representation [Ferragina et al., 2022]. The size of the smallest grammar generating a string is an expressive yet computable approximation of Kolmogorov complexity: finding it is NP-hard, but it admits heuristics with worst-case guarantees [Charikar et al., 2005].
In principle, any scheme that reduces the symbol alphabet shrinks the grammar: quantization, by leaving fewer distinct symbols, leaves fewer distinct substrings, and the grammar shrinks as a side effect. Existing compact representations of weights work this way and are flat: codebooks and clustering [Han et al., 2016, Cho et al., 2022], or size placed directly in the objective through entropy
Equal contribution.
Equal senior contribution.
Preprint.

Figure 1: Top: Finetuning pipeline of WeightPE. Bottom left: High-level steps of one lossy Re-Pair iteration. Bottom right: Cluster leaders emerging in one step of WeightPE.
penalties, learned bit-widths, and reusable motifs [Oktay et al., 2020, Cséfalvay and Imber, 2023, Bakhtiarifard et al., 2026]. The atom is always one weight or a fixed-size block, so variable-length substrings that recur, and recur inside one another, cannot be named. To our knowledge, grammar size has never been an explicit training objective for network weights.
We therefore introduce WeightPE, which pushes the weights at training time to admit a small grammar. WeightPE flattens the int8-quantized weights into a single string and compresses it with a lossy variant of Re-Pair: recurring patterns are first rewritten onto shared cluster leaders under a global L2 distortion budget and standard Re-Pair merges then build the grammar, similarly to a lossy tokenization of the flattened, concatenated weight matrix. The gradient is computed through STE. On ViT-B/16 and ViT-L/16 finetuned on CIFAR-10, the MLP weights WeightPE produces a Re-Pair grammar and the size of the one an equivalent int8 QAT run, at a cost of 1.9 and 1.1 accuracy points.
Straight-through estimation Quantization-aware training [Jacob et al., 2018] computes the forward pass on quantized weights, avoiding the non-differentiability issues by treating the displacement the map introduces as a constant rather than as a function of the weights [Bengio et al., 2013]. For a map P applied to a weight matrix W, let , held fixed with respect to W; the network then computes with
while the gradient reaches W unchanged, as if P were the identity.
3 Method
Nothing in (1) requires P to be a quantizer: it can be any operator which does not irreparaibly degrade the loss. We build a P that also makes the grammar of the weights small. It quantizes, serializes the whole network into one string, and compresses that string with a lossy Re-Pair that may merge patterns close in distance (Figure 1) .
We note the problem can be formulated as a rate–distortion problem.

Re-Pair grammar size, normalized by the int8 QAT baseline
(L2 distortion budget)

top row: (L2 distortion budget)
bottom row: total grammar size per weight

Re-Pair grammar size, normalized by the int8 QAT baseline
(L2 distortion budget)

top row: (L2 distortion budget)
bottom row: total grammar size per weight
Figure 2: WeightPE test accuracy and grammar size for ViT-B/16 (top) and ViT-L/16 (bottom) on CIFAR-10. Left: the effect of grammar size, normalized by the baseline grammar size, on test accuracy, for various numbers of cluster leaders T and budget errors . Center: the effect of on grammar size under different compressors. Right: the effect of on absolute grammar size.
Serialization Each weight matrix is quantized to int8 row-wise [Krishnamoorthi, 2018], flattened row-major, and concatenated into a single string. One grammar therefore covers the whole network, and a pattern found in one block is reusable in another. We also impose that no rule can cross a row.
Lossy Re-Pair Re-Pair shares a rule between two substrings only when they are exactly equal, whereas a quantized weight matrix is full of patterns that are almost equal. Our operator therefore alternates two rounds. REWRITE, the only lossy step, buckets adjacent-pair occurrences by the length of the code string they expand to; within a bucket the T most frequent distinct pairs become cluster leaders, and each occurrence is rewritten onto its nearest leader, cheapest first according to distance over a non-overlapping set, until the distortion budget is spent. MERGE is a lossless Re-Pair round on the rewritten sequence, so the near-duplicates that REWRITE has just made exactly equal collapse into one shared rule. Unlike standard Re-Pair it merges every repeated pair rather than only the most frequent, for computational efficiency. Once the spent distortion reaches the budget, REWRITE switches off and the remaining rounds are plain Re-Pair. Please refer to Appendix A for further details about the algorithm.
Training The perturbed string is expanded back to weights and trained through (1). For computational efficiency, the perturbation operator is applied every ten optimization steps.
4 Experiments
We finetune ViT-B/16 and ViT-L/16 on CIFAR-10 (Appendix B). The operator applies to any weight matrix, but we restrict the string to the two MLP projections of every block, which carry about two thirds of the parameters. The attention block passes through a softmax over its own activations, so a perturbation of its weights propagates less predictably. The attention projections are quantized to int8 through the same estimator but never perturbed, while patch embedding, normalization, and classification layers are left in full precision [Or et al., 2025]. We sweep the distortion budget and the number of cluster leaders T.
Metrics We use top-1 accuracy on the CIFAR-10 test set as downstream task evaluation metric. The smallest grammar of the deployed weights cannot be computed: each compressor only gives an upper bound on it. Thus we report three grammar compressors: Re-Pair, which the operator is built against; SEQUITUR [Nevill-Manning and Witten, 1997] and LZ78 [Ziv and Lempel, 1978], which it is not. All grammar sizes are normalized by the corresponding grammar size of the int8 QAT baseline, trained under identical settings. Both quantities consider only the layers used in the string (MLP weights), as reported in 4.
5 Results
On ViT-B/16 the Re-Pair grammar of the deployed weights reaches the size of the QAT grammar for 1.9 accuracy points; on ViT-L/16, for 1.1.
Accuracy vs. grammar size tradeoff The left column of Figure 2 plots accuracy against grammar size, showing one curve for each cluster count T, at various values. On ViT-B/16 the grammar size falls down to when compared to the baseline int8 QAT run, losing just 0.7 points of downstream test accuracy. Further grammar size reductions down to reach 97.3% test accuracy. The number of leaders matters only where the budget is large enough not to be spent all on the short sequences. At the four curves sit on top of one another, while at they separate cleanly. The right column gives an indication about absolute sizes involved in the ratios and shows that much of the compression comes from a length reduction of the top-level string. Wall execution time, reported in Figure 3, grows with both WeightPE hyperparameters.
Generalization across compressors The central column shows the grammar size obtained when using three compressors on the same weights. Each grammar size is normalized by the grammar size of the baseline int8 QAT run. SEQUITUR matches Re-Pair rates almost perfectly, while LZ78 moves the least. Notably, both of these compressors have never been used in the WeightPE perturbation applied during finetuning.
Scaling model size ViT-L/16 exhibits a more favorable accuracy–grammar-size trade-off than ViT-B/16. At a comparable grammar size of approximately the int8 QAT baseline, ViT-L/16 incurs only a 0.3-percentage-point drop in test accuracy, compared with a 1.9-point drop for ViT-B/16. Moreover, ViT-L/16 remains robust as the distortion budget is increased further: at the largest tested , the accuracy degradation is only 1.1 percentage points, compared with approximately 1.9 points for ViT-B/16 at its strongest compression setting. These results suggest that increasing model scale substantially improves robustness to grammar compression, enabling more aggressive compression at a given downstream accuracy loss.
6 Conclusion
We introduced Weight Pair Encoding, which makes the grammar size of a network’s weights an explicit training objective by placing a lossy Re-Pair perturbation, bounded by a global budget, inside a straight-through estimator. On two ViT backbones finetuned on CIFAR-10 the deployed weights admit a grammar roughly smaller than the one a parallel int8 QAT at a small cost in accuracy, and the reduction is visible to compressors the objective was not built from.
Limitations Behavior for more model families, datasets and quantization levels still has to be tested. We swept only row-major flattening, although the serialization axis is a free choice of the method and a different one exposes a different set of patterns. Finally, the operator has not yet been optimized for computatioonal efficiency: its cost is negligible for some parameters and around 5x in others.
Future work The perturbation is built on Re-Pair, but the same idea can be in principle applied to any compressor with an explicit notion of a repeated pattern. It would be interesting to optimize for good permutation first, like Ainsworth et al. [2023], and then apply WeightPE. Since robustness to quantization has been shown to be a transferable direction in weight space [Solombrino et al., 2026], it is natural to ask whether the small-grammar structure induced by WeightPE is one too, so that a model could be patched toward a smaller grammar without finetuning. It is also open whether a shared rule corresponds to an interpretable computation, whether a grammar over weights helps the models that consume weights as data, and how the scheme compares to standard compressors once size is counted in bits rather than in symbols.
Acknowledgments
The authors acknowledge the Area Science Park supercomputing platform ORFEO made available for conducting the research reported in this paper, and the technical support of the Laboratory of Data Engineering staff. IT and AC were supported by the projects “Supporto alla diagnosi di malattie rare tramite l’intelligenza artificiale”, CUP: F53C22001770002, and “Valutazione automatica delle immagini diagnostiche tramite l’intelligenza artificiale”, CUP: F53C22001780002. AC was supported by the European Union – NextGenerationEU within the project PNRR “PRP@CERIC” IR0000028 – Mission 4 Component 2 Investment 3.1 Action 3.1.1. This work has been carried out while DS was enrolled in the Italian National Doctorate on Artificial Intelligence run by Sapienza University of Rome.
References
Armen Aghajanyan, Sonal Gupta, and Luke Zettlemoyer. Intrinsic dimensionality explains the effectiveness of language model fine-tuning. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics (ACL), 2021. URL https://arxiv.org/abs/2012.13255. arXiv:2012.13255.
Samuel K. Ainsworth, Jonathan Hayase, and Siddhartha Srinivasa. Git re-basin: Merging models modulo permutation symmetries. In International Conference on Learning Representations (ICLR), 2023. URL https://arxiv.org/abs/2209.04836. arXiv:2209.04836.
Pedram Bakhtiarifard, Zheng Chen, Tobias Wenshøj, Hans Christian Dam, and Raghavendra Selvan. Algorithmic simplification of neural networks with mosaic-of-motifs. arXiv preprint arXiv:2602.14896, 2026. URL https://arxiv.org/abs/2602.14896.
Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013. URL https://arxiv.org/abs/1308.3432.
Philip Bille, Gad M. Landau, Rajeev Raman, Kunihiko Sadakane, Srinivasa Rao Satti, and Oren Weimann. Random access to grammar-compressed strings and trees. SIAM Journal on Computing, 44(3):513–539, 2015. URL https://arxiv.org/abs/1001.1565. arXiv:1001.1565.
Moses Charikar, Eric Lehman, Ding Liu, Rina Panigrahy, Manoj Prabhakaran, Amit Sahai, and Abhi Shelat. The smallest grammar problem. IEEE Transactions on Information Theory, 51(7):2554–2576, 2005.
Minsik Cho, Keivan Alizadeh Vahid, Saurabh Adya, and Mohammad Rastegari. DKM: Differentiable k-means clustering layer for neural network compression. In International Conference on Learning Representations (ICLR), 2022. URL https://arxiv.org/abs/2108.12659. arXiv:2108.12659.
Szabolcs Cséfalvay and James Imber. Self-compressing neural networks. arXiv preprint arXiv:2301.13142, 2023. URL https://arxiv.org/abs/2301.13142.
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR), 2021. URL https://arxiv.org/abs/2010.11929. arXiv:2010.11929.
Rahim Entezari, Hanie Sedghi, Olga Saukh, and Behnam Neyshabur. The role of permutation invariance in linear mode connectivity of neural networks. In International Conference on Learning Representations (ICLR), 2022. URL https://arxiv.org/abs/2110.06296. arXiv:2110.06296.
Paolo Ferragina, Travis Gagie, Dominik Köppl, Giovanni Manzini, Gonzalo Navarro, Manuel Striani, and Francesco Tosoni. Improving matrix-vector multiplication via lossless grammar-compressed matrices. Proceedings of the VLDB Endowment, 15(10):2175–2187, 2022. URL https://arxiv.org/abs/2203.14540. arXiv:2203.14540.
Philip Gage. A new algorithm for data compression. The C Users Journal, 12(2):23–38, 1994.
Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In International Conference on Learning Representations (ICLR), 2016. URL https://arxiv.org/abs/1510.00149. arXiv:1510.00149.
Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations (ICLR), 2022. URL https://arxiv.org/abs/2106.09685. arXiv:2106.09685.
Gabriel Ilharco, Marco Tulio Ribeiro, Mitchell Wortsman, Suchin Gururangan, Ludwig Schmidt, Hannaneh Hajishirzi, and Ali Farhadi. Editing models with task arithmetic. arXiv preprint arXiv:2212.04089, 2022.
Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. URL https://arxiv.org/abs/1712.05877. arXiv:1712.05877.
Raghuraman Krishnamoorthi. Quantizing deep convolutional networks for efficient inference: A whitepaper. arXiv preprint arXiv:1806.08342, 2018. URL https://arxiv.org/abs/1806.08342.
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
N. Jesper Larsson and Alistair Moffat. Off-line dictionary-based compression. Proceedings of the IEEE, 88(11):1722–1732, 2000.
Craig G. Nevill-Manning and Ian H. Witten. Identifying hierarchical structure in sequences: A linear-time algorithm. Journal of Artificial Intelligence Research, 7:67–82, 1997.
Steven J. Nowlan and Geoffrey E. Hinton. Simplifying neural networks by soft weight-sharing. Neural Computation, 4(4):473–493, 1992.
Deniz Oktay, Johannes Ballé, Saurabh Singh, and Abhinav Shrivastava. Scalable model compression by entropy penalized reparameterization. In International Conference on Learning Representations (ICLR), 2020. URL https://arxiv.org/abs/1906.06624. arXiv:1906.06624.
Andrew Or, Apurva Jain, Daniel Vega-Myhre, Jesse Cai, Charles David Hernandez, Zhenrui Zheng, Driss Guessous, Vasiliy Kuznetsov, Christian Puhrsch, Mark Saroufim, et al. Torchao: Pytorch-native training-to-serving model optimization. arXiv preprint arXiv:2507.16099, 2025.
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL), 2016. URL https://arxiv.org/abs/1508.07909. arXiv:1508.07909.
Daniele Solombrino, Antonio Andrea Gargiulo, Adrian Robert Minut, Luca Zhou, Alessandro Zirilli, and Emanuele Rodolà. Zero-shot quantization via weight-space arithmetic. In Advances in Neural Information Processing Systems (NeurIPS), 2026. URL https://arxiv.org/abs/2604.03420. arXiv:2604.03420.
Andreas Steiner, Alexander Kolesnikov, Xiaohua Zhai, Ross Wightman, Jakob Uszkoreit, and Lucas Beyer. How to train your ViT? data, augmentation, and regularization in vision transformers. Transactions on Machine Learning Research (TMLR), 2022. URL https://arxiv.org/abs/2106.10270. arXiv:2106.10270.
Karen Ullrich, Edward Meeds, and Max Welling. Soft weight-sharing for neural network compression. In International Conference on Learning Representations (ICLR), 2017. URL https://arxiv.org/abs/1702.04008. arXiv:1702.04008.
Ross Wightman. PyTorch image models. https://github.com/huggingface/pytorch-image-models, 2019.
Jacob Ziv and Abraham Lempel. Compression of individual sequences via variable-rate coding. IEEE Transactions on Information Theory, 24(5):530–536, 1978.
Algorithm 1 The perturbation operator: REWRITE, then merge, once per round.
1: function PERTURB(x, τ, n_max) 2: s ← x; G ← 0; pos_i ← i; r ← x; D ← 0; stall ← 0 3: loop 4: b ← |s| + 2|G| 5: if b ≤ n_max or |s| < 2 then break 6: end if 7: n_REWRITE ← 0; δ ← 0 8: if D < τ² then 9: (s, pos, r, n_REWRITE, δ) ← REWRITEROUND(s, pos, r, x, τ² - D); D ← D + δ 10: end if 11: (s, pos, G, n_new) ← MERGEROUND(s, pos, G) 12: if n_REWRITE = 0 and n_new = 0 then break merged 13: end if 14: if |s| + 2|G| ≥ b then 15: stall ← stall + 1; if stall = 2 then break 16: else 17: stall ← 0 18: end if 19: end loop 20: return s, G, D 21: end function
A The operator in detail
All merges together to decrease runtime. Standard Re-Pair performs one merge (the single globally most frequent pair) per step, which is unfeasible at the scales of our experiments. Our operator instead collapses a whole independent set of non-overlapping occurrences per round, all in GPU, so the number of sequential rounds is rather than and the weight string never leaves the GPU. The grammar this produces is therefore not the one sequential greedy Re-Pair would produce: the sequential implementation is only used for evaluation. Algorithms 1–3 give the whole procedure. x is the sentence of int8 codes, s the current symbol sequence, G the rule set, the offset at which symbol expands in x, and r the running exact reconstruction of x under the current grammar.
A worked example The following is one round of PERTURB on a twelve-code sentence, run through the implementation. The budget is and the bucket gets leaders. Every symbol is still a single code, so occurrence covers positions and , the reconstruction equals the original, and each cost is simply the squared distance from the chosen leader.
| position | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| x | = 5 | 3 | 5 | 5 | 3 | 5 | 8 | 2 | 5 | 3 | 4 | 6 |
| occurrence j | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
| pair | (5,3) | (3,5) | (5,5) | (5,3) | (3,5) | (5,8) | (8,2) | (2,5) | (5,3) | (3,4) | (4,6) | |
| cost | 8 | 8 | 4 | 8 | 8 | 13 | 10 | 1 | 8 | 1 | 2 |
leaders (the two most frequent pairs of the bucket): (5,3) x3, (3,5) x2 independent set (strict local minima of the cost): j2, j7, j9 sorted by cost: 1, 1, 4 cumulative: 1, 2, 6 B = 5 => commit j7 and j9
after REWRITE = 5 3 5 5 3 5 8 [3 5] [3 5] 6 D = 2
does not fit in the budget and stays a candidate for the next round. The two committed REWRITEs cost one each: and . Their point is what happens next: the pair now occurs four times instead of two, at and , which are pairwise non-adjacent, so the MERGEROUND that follows creates a single rule covering all four. The round returns with one rule, a grammar of 10 symbols against the 12 it started from.
Algorithm 2 The lossy step. is the distortion still affordable, the leader de-duplication radius per element, the number of clusters.
1: function REWRITERROUND(, , , , ) 2: round-start snapshot: REWRITEs do not see each other's REWRITEs 3: for every occurrence , i.e. every pair lying inside one row 4: for all length buckets holding occurrences do 5: 6: for all occurrences of the bucket do 7: the immutable original codes of this span 8: what the span already costs 9: , over the leaders whose pair differs from 's 10: ; leader 11: end for 12: end for 13: 14: sort by increasing cost, keep the longest prefix whose cumulative cost is the budget, enforced a priori 15: for all do 16: overwrite , with the two symbols of leader 17: the leader's split need not match 's own 18: 19: end for 20: return , , , , 21: end function
22: function LEADERS(, , , ) : the bucket's distinct pairs, with counts 23: 24: for all in decreasing frequency, at most candidates do 25: if or then 26: append to ; if then break 27: end if 28: end for 29: return the expansions of , read from 30: end function
B Experimental setup
Models and data We finetune timm [Wightman, 2019] ViT-B/16 and ViT-L/1 checkpoints [Dosovitskiy et al., 2021] pretrained on ImageNet-21k with the AugReg recipe [Steiner et al., 2022] on CIFAR-10 [Krizhevsky, 2009], with a freshly initialized 10-way head; input transforms are taken from each checkpoint's own pretraining configuration, and the validation split is drawn with a dedicated seed independent of the run seed.
Following Ilharco et al. [2022], we finetune for six epochs, with an effective batch of 128 reached by gradient accumulation, AdamW at learning rate with weight decay 0.1, a cosine schedule with 500 warm-up steps, gradient clipping at 1.0, and no label smoothing. Every run in each sweep share these hyperparameters, so runs differ only in and in the cluster count .
WeightPE We Apply WeightPE to the two MLP projections of every transformer block, corresponding to almost two thirds of the total number of trainable parameters. The query, key, and value projections are quantized, but never perturbed. Patch embedding, normalization, and classification layers are kept in full precision, following [Or et al., 2025] We use row-wise, symmetric, int8 weights-only quantization. Accordingly, we adopt row-major serialization and we confine rules to a row, while maintaining a single grammar shared across all perturbed MLP weights in the network. We set the minimum expansion length for REWRITE to and require at least occurrences in a length bucket before processing it. The perturbation is run with target grammar size . For leader construction, we use a de-duplication radius of , where N is the
Algorithm 3 The lossless step, and the selection rule both steps share.
1: function MERGEROUND(s, pos, G) 2: 3: the jitter only makes the order strict 4: add one fresh rule to G per distinct pair occurring in S 5: replace every by its rule symbol and delete the consumed right symbol ( is inherited) 6: return s, pos, G, the number of new rules 7: end function
8: function SELECTINDEPENDENT( , C) 9: return at the ends, the missing neighbour counts as beaten 10: end function


Figure 3: Observed end-to-end training-time overhead across WeightPE sweep grid for ViT-B/16 (left) and ViT-L/16 (right), relative to an int8 QAT baseline.
number of quantized codes in the serialized weight string, and consider at most 8T frequent candidate pairs when selecting the T leaders. We impose no additional frequency threshold on the lossless MERGE step. Distortion is measured in quantized-code space relative to the original int8 weights, so the global budget is in the notation of Algorithm 2. We refresh the WeightPE perturbation periodically rather than at every optimization step, using one refresh every ten training updates. We sweep for ViT-B/16 and additionally include 0.35 for ViT-L/16, with .
C Run environment
ViT-B/16 experiments are run on an NVIDIA A100-40GB and ViT-L/16 experiments on an NVIDIA H100-80GB GPU.
D Run timings
Figure 3 reports the observed wall-clock time of every run in Figures 2, expressed relative to the corresponding int8 QAT baseline.
These measurements were collected during normal operation of a shared Slurm-managed cluster. They therefore include uncontrolled system-level variation, such as CPU, I/O, and node contention from co-located jobs, and should not be interpreted as controlled microbenchmarks of the WeightPE operator itself. We report them to provide an indication of the end-to-end training overhead observed in our experimental setting.