Shrinking Small Language Models: Can Freezing the Embedding Table Solve the Bloated Vocabulary Problem?

    In small language models, the embedding matrix often accounts for more than half of all parameters, dwarfing the Transformer layers that do the actual reasoning. This article explains why vocabulary tables balloon in size, why on-device deployment exposes the imbalance, and how techniques such as freezing embeddings, weight tying, vocabulary pruning, low-rank factorization, and quantization can dramatically shrink model size without sacrificing language capability.

    Shrinking Small Language Models: Can Freezing the Embedding Table Solve the Bloated Vocabulary Problem?

    An Overlooked Structural Imbalance

    When we talk about “small models,” the intuitive understanding is: fewer parameters, lighter computation, easy to run. But if you dissect a typical edge-side language model with 200 to 300 million parameters and examine the parameter distribution closely, you’ll find a rather ironic fact — the Transformer backbone that actually performs computation and inference (attention layers and feed-forward networks) often accounts for only half or even less of the total parameters, while the remaining bulk is eaten up by a “vocabulary table.”

    This table is technically known as the embedding matrix. It maps the discrete token IDs output by the tokenizer into dense vectors, serving as the model’s first entry point for understanding language. The parameter count of an embedding matrix is straightforward:

    1. Embedding parameters = vocabulary size V × hidden dimension d

    Take a small model with a 260,000-word vocabulary and a hidden dimension of 640 as an example: the input embedding alone accounts for roughly 166 million parameters. If the output layer (LM Head) does not share weights with the input embedding, another parameter block of the same size must be added. By comparison, the model’s Transformer layers may have only tens of millions of parameters. This leads to a strange phenomenon: a model that claims to be “small and lean” carries over 60% of its “body weight” in static lookup parameters rather than in dynamic computation that actually does the thinking.

    Why Vocabularies Grow So Large

    A large vocabulary is not a design mistake — it is the result of multiple practical factors compounding.

    1. The Rigid Demand for Multilingual Coverage

    Modern small models generally target global users and need to cover dozens of languages — Chinese, English, Japanese, Korean, Arabic, and more — while also handling code, mathematical symbols, and emoji. Each language added with high-quality support requires significant vocabulary expansion. Chinese characters alone number in the tens of thousands; relying solely on byte fallback can serve as a backstop, but it substantially increases sequence length and slows inference.

    2. The Trade-off Between Tokenization Granularity and Training Efficiency

    A larger vocabulary means shorter token sequences. The same sentence might be split into 10 tokens with a large vocabulary versus 20 with a small one. Shorter sequences directly reduce attention computation overhead (whose complexity grows with the square of sequence length) and speed up training convergence. Therefore, when training resources are abundant, vendors tend to choose larger vocabularies — but this choice becomes a heavy burden at deployment time.

    3. The Illusion That Embedding Parameters Are “Free”

    The embedding matrix is a lookup operation, not a matrix multiplication, so its cost is nearly zero in FLOPs-based compute statistics. This makes it easy for designers to overlook its real cost: storage footprint and memory bandwidth consumption. On server GPUs this is not a problem, but on phones and laptops, every megabyte of model size and every memory read directly affects load time, power consumption, and heat generation.

    On-Device Deployment Exposes the Contradiction

    Three key trends in the small model space in recent years have pushed the vocabulary problem to the forefront.

    First, extreme low-bit quantization has matured. The industry has demonstrated that neural network weights can be compressed to just three discrete values — -1, 0, and +1 (the ternary approach) — and with custom operators, model size and computation can be dramatically reduced with acceptable quality loss. If the backbone network can be compressed down to the 1-bit level while the embedding layer still “sits” at FP16 or even FP32, its share of the total size naturally becomes glaring.

    Second, sub-billion-parameter models have proven practical. Small models released by multiple vendors and open-source ecosystems have proven adequate for everyday tasks such as summarization, rewriting, classification, and lightweight conversation, moving on-device intelligence from concept to reality.

    Third, real on-device deployment has become the main battleground. Once models are actually packed into phones and laptops, storage space, peak memory usage, and first-load latency all become quantifiable costs. Only then do people realize: compressing the backbone yields diminishing returns, while the vocabulary table has never been seriously touched.

    Freezing the Vocabulary: The Idea and Its Rationale

    The core proposition of “freezing the embedding table” is: after pretraining is complete, the embedding vectors are already stable semantic representations, so they no longer need to be updated during subsequent fine-tuning or incremental training — and at deployment time they can even be treated as read-only constants and subjected to aggressive compression.

    The rationale rests on several observations:

    • Embeddings converge early. Empirical research shows that token vector representations form stable semantic structures early in training (similar words cluster together, analogy relationships hold), and the updates in later training are minimal.
    • Embeddings tolerate perturbation well. Unlike attention weights, which interact layer by layer, embeddings are independent lookup tables and are insensitive to the small shifts caused by quantization and pruning.
    • Freezing brings engineering benefits. Once frozen, the embedding layer no longer needs to store gradients and optimizer states (for Adam, this saves two memory blocks equal in size to the parameters), significantly reducing fine-tuning costs. At deployment, techniques like asymmetric quantization and offline pre-compression can be used without worrying about training consistency.

    Combining Techniques for Maximum Reduction

    Freezing is just the first step. To truly turn the vocabulary from “fat” into “muscle,” the following techniques are typically combined:

    1. Input-Output Weight Tying

    Having the output projection layer directly reuse the transpose of the input embedding matrix instantly eliminates an entire vocabulary-sized parameter block. This is the most mature practice in the industry, and it is nearly lossless for small models.

    2. Vocabulary Pruning and Tokenizer Retraining

    For specific scenarios (such as a Chinese-only customer service model), tokens for unused languages can be removed, shrinking the vocabulary from hundreds of thousands to tens of thousands, with parameters decreasing linearly in proportion. The cost is the loss of cross-lingual capability, so boundaries must be clearly defined on the requirements side.

    3. Low-Rank Factorization

    Approximate the embedding matrix E ∈ R^{V×d} as the product of two smaller matrices:

    1. E ≈ A · B, where A ∈ R^{V×r}, B ∈ R^{r×d}, r << d

    Parameters drop from V×d to r×(V+d). With rank r set to 1/8 of the original dimension, compression of nearly 87% is achievable, usually requiring a small amount of recovery fine-tuning to compensate for precision loss.

    4. Embedding Layer Quantization

    Applying INT8 or even INT4 quantization to frozen embeddings reduces size by another 2 to 4 times. Since embedding vector distributions are relatively smooth, quantization error has limited downstream impact, and per-row scaling factors work even better.

    5. Hash-Based and Compositional Embeddings

    Using hash functions to map rare tokens to a shared, smaller vector pool, or representing tokens through “sub-vector concatenation,” can push the storage overhead of rare words down to extremely low levels — well suited to extremely long-tail vocabularies.

    Trade-offs and Practical Recommendations

    Technique Compression Quality Risk Implementation Cost
    Weight tying ~50% (embedding portion) Very low Very low
    Vocabulary pruning Linear with pruning ratio Medium (scenario-dependent) Medium (requires tokenizer retraining)
    Low-rank factorization 60%–90% Medium Medium (requires recovery fine-tuning)
    Quantization 50%–75% Low Low
    Hash embeddings 90%+ High High

    The practical recommendation is to proceed in stages: start with weight tying and freezing to capture half the gains at zero risk; then add quantization to shrink embedding size to a quarter of the original; finally, evaluate whether to prune the vocabulary based on your business’s language coverage. Throughout the process, establish a fixed evaluation set (perplexity, downstream task accuracy, on-device load time, and peak memory) as a regression baseline, and roll back any compression step that degrades metrics beyond a threshold.

    Conclusion

    Competition among small models is shifting from “how many parameters” to “where the parameters are spent.” When the backbone network has already been squeezed to the limit by quantization, that vocabulary table carrying 60% of the body weight is the next tough nut to crack. Freezing the embedding table is not a silver bullet, but it opens the right line of thinking: treat embeddings as stable, aggressively compressible static assets rather than untouchable relics. Whoever can slim down the vocabulary while preserving language capability will win a valuable size and speed advantage in the race for on-device intelligence.