The Vocabulary Eats 60% of a Small Model's Parameters: Is Freezing It Viable?
In small on-device language models, the embedding table can account for the majority of parameters, yet most compression techniques leave it untouched. This article breaks down why the vocabulary is so hard to compress, introduces the idea of "freezing" the embedding table through techniques such as extreme low-bit quantization, factorization, and hashing, and explains the engineering tradeoffs to weigh when deciding whether to freeze the vocabulary on edge devices.
1. An Overlooked Fact: Most of a Small Model’s “Weight” Isn’t in Its “Brain”
When you load a few-hundred-megabyte language model on a phone, you tend to assume its size is spent mostly on “computation”—the layers that handle understanding and reasoning. But if you break the parameters apart, the result is often surprising.
Take a 268-million-parameter small model built for phones and laptops. The backbone that actually runs the forward pass—the attention and feed-forward blocks—is only around 70 million parameters. A single embedding table, by contrast, accounts for roughly 168 million parameters, or more than 60% of the total. In other words, the part that “actually thinks” is less than 40%, while the part that “remembers words” is the real bulk.
For a large model, this ratio is harmless—one extra table among hundreds of billions of parameters barely shows up. But for a small model in the hundreds-of-millions range, the vocabulary is almost the model itself. The following snippet gives a sense of its weight:
# Embedding table size estimate (values are illustrative, to show the order of magnitude)vocab_size = 262144 # vocabulary size: number of tokens (~260k)hidden_dim = 640 # vector dimension per tokenbytes_param = 2 # 16-bit float = 2 bytesembedding_params = vocab_size * hidden_dim # ≈ 168Membedding_mb = embedding_params * bytes_param / 1e6print(f"Embedding params: {embedding_params/1e6:.1f}M")print(f"Embedding memory: {embedding_mb:.1f} MB")
As the vocabulary grows, this table’s linear growth eats directly into the most precious memory budget on the device.
2. Why the Vocabulary Has Become “Fat You Can’t Shed”
Over the past three years, the small-model ecosystem has gone through three major shifts—yet their combined effect has actually made the vocabulary problem worse:
- Extreme quantization slimmed down the “body.” Approaches like ternarization can represent weights with just three values (-1, 0, +1) with almost no quality loss, sharply cutting the size and compute of the backbone.
- Sub-billion-parameter models became genuinely usable. Lightweight models from several teams perform well enough on everyday tasks, turning “running a model locally” from a demo into a real need.
- On-device deployment turns every byte into real cost. Once a model runs on a phone or laptop, read speed and memory footprint directly shape the experience.
The problem: almost every mainstream compression method works “around” the vocabulary.
Ternarization only touches the backbone layers, leaving the embedding table at 16-bit. Common post-training quantization (PTQ) methods leave the embedding layer alone by default. Many widely used local inference engines compress the output layer to at most 6–8 bits. The result: once the “body” is squeezed down to near 1 bit, that 16-bit vocabulary becomes the largest and least compressible part of the file.
A typical estimate: keep a 16-bit vocabulary on a ternarized small model, and the file might be about 20 MB of backbone plus roughly 335 MB of vocabulary. You spend all that effort slimming down, and the fat stays exactly where it was. Some technical reports even note memory usage as “excluding the embedding layer”—effectively dropping the biggest chunk out of the accounting. That “accept it as-is” attitude is itself worth questioning: does the vocabulary really have to stay unchanged?
3. Root Cause: Why the Vocabulary Is So Hard to Compress
To understand the value of “freezing,” you first need to see why the vocabulary resists compression, for three reasons.
The semantic distribution is extremely long-tailed. In natural language, a handful of high-frequency words account for the vast majority of occurrences, while a huge mass of low-frequency words, rare subwords, and multilingual characters are almost never activated yet still occupy complete vector rows. They contribute little to inference quality but make up most of the size.
Weight sharing creates coupling. The embedding table usually shares parameters with the output projection layer (weight tying): one side “looks up” the input vectors, the other “computes” the output distribution. Any change has to account for both the input-side representation and the quality of the output logits, so you can’t simply chop it up or quantize it crudely.
Vector rows are relatively independent. Each row corresponds to a token, with no strong structural constraints between rows—unlike the reusable channel redundancy found in backbone layers. As a result, per-element quantization yields limited gains and tends to amplify errors on low-frequency rows.
4. The Core Idea: Freeze the Vocabulary
“Freezing the vocabulary” is essentially a change of attitude toward this table: instead of treating it as ordinary parameters that need high precision and remain trainable, you treat it as an independent component that can be fixed and compressed to the extreme. It isn’t a single technique but an umbrella term for a set of ideas:
- Extreme low-bit quantization: Apply a bit width far lower than the backbone (e.g., 2–4 bits) to the embedding table alone, and dequantize via a lookup table at inference time. Because embedding lookups involve almost no multiply-add, quantization has little impact on compute; the main gains are in memory and bandwidth.
- Factorization: Break the large “vocabulary × dimension” matrix into “vocabulary × small dimension” times “small dimension × dimension,” trading a low-rank approximation for fewer parameters while keeping some expressive power.
- Hashing and clustering sharing: Let multiple low-frequency tokens reuse the same or similar vectors (via hashing or clustering), compressing “one row per token” into “a few representative rows” and directly cutting the row count.
- Fixed sharing: Once the embedding is well trained, fix it in place at a set precision and form, so only the backbone trains—avoiding the vocabulary being repeatedly read, written, and updated during fine-tuning.
The key precondition for freezing is that the vocabulary must either be sufficiently trained already, or absorb compression error upfront through quantization-aware training. Otherwise, freezing it directly will noticeably hurt output quality.
5. Engineering Tradeoffs: When Freezing Is Worth It
Freezing isn’t a cure-all; you have to weigh the tradeoffs in practice:
- The quality–size balance point: High-frequency word representations must keep their precision; compression should focus on the low-frequency long tail. Blanket extreme quantization across the whole table is often a net loss.
- Matching the inference workload: For memory-constrained, lookup-heavy edge scenarios, freezing the vocabulary pays off most directly; for compute-bound training scenarios, the gains are limited.
- Consistent quantization alignment: Make sure the backbone and the vocabulary use consistent quantization schemes and dequantization paths within the same inference stack, so you don’t end up “compressing the table but the engine not recognizing it.”
A pragmatic rule of thumb: when your target model is under a billion parameters and the vocabulary accounts for more than half, evaluate freezing the vocabulary first—it usually delivers bigger size savings than continuing to squeeze the backbone.
6. Conclusion
Small models moving onto devices is an “every byte counts” engineering effort. Ternarization, factorization, and low-bit quantization have already pushed the backbone to its limits. The remaining hardest bone—the embedding vocabulary—is exactly what determines the final experience. Freeing the vocabulary from the outdated notion that it must stay high-precision and trainable, and re-examining it through freezing and extreme compression, is an underrated yet rewarding breakthrough in edge-model slimming today.
If you’re optimizing around mainstream model-compression and edge-inference toolchains—whether ternarization, post-training quantization, or common local inference frameworks—it’s worth pulling the vocabulary out and benchmarking it separately. General-purpose model-compression and edge-deployment capabilities, such as those offered by Baidu AI Cloud, can also be used to validate quality–size curves across different compression strategies and find the best tradeoff on real devices. What you save in the end is often the most valuable part of that 60%.
