Explorerโ€บData Scienceโ€บMachine Learning
Research PaperResearchia:202609.28064

Weight Pair Encoding: Inducing a Smaller Grammar in Neural Network Weights

Irene Tallini

Abstract

We show that neural network weights can be explicilty 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 L2 budget. The network computes with the rewritten weights and trains through them with a straight-through estimator. Unlike a flat codebook of fixed-size en...

Submitted: September 28, 2026Subjects: Machine Learning; Data Science

Description / Details

We show that neural network weights can be explicilty 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 L2 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 0.43x and 0.38x 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.


Source: arXiv:2609.31564v1 - http://arxiv.org/abs/2609.31564v1 PDF: https://arxiv.org/pdf/2609.31564v1 Original Link: http://arxiv.org/abs/2609.31564v1

Please sign in to join the discussion.

No comments yet. Be the first to share your thoughts!

Access Paper
View Source PDF
Submission Info
Date:
Sep 28, 2026
Topic:
Data Science
Area:
Machine Learning
Comments:
0
Bookmark
Weight Pair Encoding: Inducing a Smaller Grammar in Neural Network Weights | Researchia