Vocabulary Tables Consume 60% of Small Model Size: Is Freezing Them the Breakthrough?
This article examines why the vocabulary (embedding) table can account for roughly 63% of a small on-device language model's parameters, why standard quantization methods tend to leave it untouched, and how treating it as a frozen, read-only, statically compressible resource can meaningfully shrink deployment size. It covers the core rationale behind "freezing" the vocabulary and walks through practical techniques — weight tying, low-bit quantization, vocabulary trimming, low-rank factorization, compositional/hashed embeddings, and subword sharing — along with the trade-offs in accuracy, coverage, and cold-start time.
1. A Counterintuitive Fact: A Small Model’s Weight Hides in “Table Lookups”
When people talk about parameter counts, the instinct is “more layers and more width means heavier,” so compression naturally targets the attention and feed-forward layers. But take apart an on-device model of roughly 270 million parameters built for phones and laptops, and the conclusion flips that intuition:
- The feed-forward layers, which actually do the compute and reasoning, hold only about 71 million parameters;
- The “vocabulary” table that maps each token to a vector (the embedding table) alone accounts for about 168 million parameters;
- Together, the vocabulary makes up 63% of the entire model.
For large models with tens or hundreds of billions of parameters, this table is a rounding error; for a small model with a few hundred million parameters, it is nearly the whole model. The reason is that the embedding table’s size is set directly by two quantities:
# Embedding table size estimatevocab_size = 256000 # vocabulary size (number of tokens)d_model = 640 # hidden dimensionbytes_per_param = 2 # fp16, 2 bytes per parameterembed_params = vocab_size * d_model # ≈ 164Membed_bytes = embed_params * bytes_per_paramprint(f"Embedding params: {embed_params/1e6:.1f}M")print(f"fp16 size: {embed_bytes/1e6:.0f} MB") # ≈ 328 MB
The key point: the vocabulary size “balloons” almost independently of the hidden dimension, while small models shrink d_model to save compute. A smaller denominator and an unchanged numerator naturally inflate the vocabulary’s share. This explains an awkward situation — the slimmer the model’s “body,” the more the vocabulary looks like stubborn flab it can’t shed.
2. Why the Vocabulary Is Hard to Compress
To understand why everyone “accepts by default” this large chunk, first look at what the embedding table really is.
The embedding table is a lookup resource, not a compute graph. During the forward pass, you simply fetch the row of vectors corresponding to the input token’s id; this step involves almost no multiply-accumulate operations. The real compute cost happens in the attention and feed-forward layers that follow. This has two consequences:
- Limited quantization gains. The value of low-bit quantization lies mainly in reducing the data movement for multiply-accumulate operations. For a lookup, the fetched vector row follows the same compute path whether stored as 8-bit or 16-bit, so quantization saves storage more than compute.
- Greater sensitivity to precision. Embedding vectors often share parameters with the output layer (weight tying); they determine both the “input representation” and the “output scoring.” Aggressively compressing a table that affects both input and output tends to directly hurt quality, so quantization teams naturally prefer to skip it.
So we see the pattern: ternary schemes (weights restricted to -1, 0, +1) push the body down to nearly 1.58 bits but leave the embedding table at 16 bits; mainstream quantization methods like GPTQ and AWQ skip the embedding layer entirely; and common local inference engines quantize the output layer to at most 6–8 bits.
The result is ironic: once the body is compressed to the extreme, the vocabulary becomes the largest single block in the file. By industry estimates, if the small model above gets a ternary body but keeps a 16-bit vocabulary, the whole file roughly looks like “about 20 MB of body + about 335 MB of vocabulary” — the vocabulary dominates. More notably, some vendors, when publishing technical reports on similar schemes, list memory usage as “excluding the embedding layer,” which effectively drops this big chunk from the accounting altogether.
This “accept by default” attitude is exactly what deserves questioning: is this vocabulary really worth the space it takes up?
3. The Core Idea of “Freezing the Vocabulary”
“Freezing” is essentially looking at the embedding table from a different angle: no longer treating it as active weights that must participate in computation at high precision, but as a read-only lookup resource that can be statically compressed. Once you accept this framing, a whole set of slimming techniques follows a single, coherent logic.
1. Low-bit storage, lookups unchanged
The embedding table stores “symbols,” not intermediate activations that participate in heavy multiply-accumulate work. So it can be written to disk in a low-bit format far below the norm, then decoded row by row at load time. This is the same compression philosophy as a ternary body — it’s just that no one had been willing to touch the vocabulary before. Once frozen, the vocabulary can enjoy the same size benefits of low-bit storage.
2. Freezing means read-only, decoupling training from storage
Freezing the embedding layer during fine-tuning both prevents small datasets from “drifting” the pretrained semantic representations and keeps the vocabulary consistent and reusable in downstream steps. Once storage and computation are decoupled, the vocabulary can be compressed and cached on its own, without having to accommodate the gradient needs of training.
4. Practical Slimming Techniques
Around the goal of “making the vocabulary lighter,” the industry already has several general, mature directions that can be used alone or in combination:
- Weight sharing (tying input embeddings to the output layer): let input lookups and output scoring reuse the same table, directly saving one copy of parameters — the most basic and common approach.
- Low-bit quantization of the embedding table: apply 8-bit or even lower storage to the vocabulary alone, balancing size and quality.
- Vocabulary trimming: count high-frequency tokens in the actual corpus, cut rarely occurring long-tail entries, and shrink
vocab_size. The benefit is especially clear for domain-specific or single-language on-device scenarios. - Low-rank factorization: approximate the original embedding matrix with the product of two slim matrices, expressing roughly the same representational power with fewer parameters.
- Compositional / hashed embeddings: rebuild a large vocabulary from a smaller “codebook” plus composition rules to push the storage floor even lower.
- Subword-level sharing: use finer subword segmentation so that the same morpheme reuses a vector across different words, naturally reducing redundancy.
What these techniques have in common is turning the vocabulary from “one big table that must be shipped as-is” into “a resource that can be structurally compressed,” which fits the “freezing” framing exactly.
5. Trade-offs and Practical Recommendations
Freezing and compressing the vocabulary isn’t free; putting it into practice requires balancing three dimensions:
- Accuracy loss: the vocabulary affects both input representation and output scoring, so overly aggressive compression (especially trimming long-tail words plus extremely low bits stacked together) may hurt handling of rare words and proper nouns. It’s advisable to first quantify each technique’s impact in isolation, then stack them.
- Coverage: after trimming the vocabulary, inputs beyond it get split into finer subwords or even fall to unknown symbols, so coverage should be validated on real corpus in the target scenario.
- Loading and cold start: low-bit storage needs decoding at load time, which slightly increases startup overhead; if instant on-device launch is the goal, weigh decoding cost against memory bandwidth.
A pragmatic rollout order: first do weight sharing (zero cost), then low-bit quantization of the embedding table (low risk, high reward), and finally vocabulary trimming and more aggressive factorization for the specific scenario. At each step, regress against real task metrics and put “size saved” and “accuracy lost” in the same table for comparison, rather than blindly believing “smaller is better.”
One-sentence summary: the slimming bottleneck for small models is often not compute but that long-ignored vocabulary table. Treating the vocabulary as a freezable, compressible static resource to be governed is the key step that actually saves money in on-device deployment.
