Why Embedding Vocabulary Tables Eat 60% of Small Model Parameters, and How to Cut Them Down for On-Device Deployment

    When models are compressed below one billion parameters, the embedding vocabulary stops being a rounding error and becomes the largest single component of the file — often 60% or more of all parameters. This article explains why quantization and ternarization techniques routinely leave the vocabulary table untouched, why that table resists compression, and which proven techniques (vocabulary pruning, embedding quantization, low-rank factorization, hashing and clustering, embedding freezing) can be applied to bring it under control. It also covers the reporting conventions that hide this cost and the practical trade-offs to check before shipping a compact model to phones, laptops, or edge boxes.

    1. Introduction: The Models Shrank, the Problem Didn’t

    Over the past two years, sub-billion-parameter models have quietly become “good enough.” On phones, laptops, and edge boxes — devices where compute and memory are both constrained — a well-designed small model can already handle everyday tasks like classification, extraction, rewriting, and simple question answering. To fit them onto these devices, engineers reach for the usual compression toolkit: low-bit quantization, structured sparsity, ternarization (weights restricted to just -1, 0, and +1), and so on. The goal is always the same: smaller files, faster loads, lower inference power draw.

    But there’s a structural fact that has been overlooked for a long time. Once total parameter count drops into the hundreds of millions, the component responsible for “remembering vocabulary” — the embedding table — stops being a minor line item and becomes the dominant one. Compression squeezes the main body of the model thinner and thinner, while the vocabulary table sits there like stubborn body fat, quietly accounting for most of the file size. This article asks whether that table is really worth what it costs, and what can be done about it.

    2. Breaking Down a Small Model: Where Do the Parameters Go?

    Consider a small model designed for on-device use with a total of roughly 268 million parameters. If you break down its internals, you see a distribution that runs counter to intuition:

    • The feed-forward/attention part that actually does the computation and inference accounts for only about 71 million parameters.
    • The embedding table that maps each discrete token to a vector consumes about 168 million parameters.
    • The vocabulary table’s share is roughly 63% — more than six-tenths of all parameters.

    Why is this ratio unremarkable in large models but glaring in small ones? Because the distribution of parameters shifts with model scale:

    • In a model with tens of billions of parameters, the embedding table typically accounts for only a low single-digit percentage — a negligible rounding error.
    • In a model of a few hundred million parameters, every layer of the main body has been thinned out, while the vocabulary table’s size is determined by “vocabulary size × hidden dimension” and barely shrinks with model depth. It ends up being the model.

    One more detail is worth adding. In most language models, the embedding table doesn’t exist independently — it’s used as a lookup on the input side, and on the output side the classification/projection layer typically reuses the transpose of the same matrix (weight tying). This means a single table serves both roles: reading tokens in and projecting logits out. Any change to it has to account for both ends.

    3. Why Quantization Skipped the Embedding Table

    Quantization is the mainstream approach to slimming a model, so why didn’t it incidentally compress the vocabulary table? The answer lies in how each class of technique handles things:

    1. Ternarization: compresses only the main body. Ternarized networks restrict weights to {-1, 0, +1}, bringing the main body close to 1-bit storage density. But they typically leave the embedding table untouched.
    2. Mainstream weight quantization methods: most bypass the embedding and output layers entirely, applying low-bit quantization only to the intermediate linear layers.
    3. Common on-device inference engines: support for the output/embedding side is conservative, often capping compression at 6–8 bits — far less aggressive than what the main body achieves.

    The result is what you might call an inverted file structure. Taking that same small model as a rough example: if ternarization leaves the main body at around 20 MB while the embedding table is still stored at 16 bits, the vocabulary table can reach roughly 335 MB. Add the two together and the table becomes the largest single block in the file.

    There’s also a reporting convention problem worth flagging. When some vendors publish results for compression techniques, the memory-usage figures are often labeled “excluding the embedding layer” — quoting a number like 0.4 GB while leaving the vocabulary table out of the count. Accepting that framing by default sidesteps a question that deserves scrutiny: if the vocabulary table accounts for sixty percent of the file, is it worth that price?

    4. Why the Embedding Table Is So Hard to Compress

    The vocabulary table has become a dead zone for compression for a few unavoidable technical reasons:

    • Every row carries independent semantics. Each vector in the table represents the meaning of one token. There is little structural redundancy between them — unlike convolutional weights, which have predictable local correlation — so simple sparsity patterns don’t help much.
    • Table size is set by the task and the language, not by model depth. A model can be made deeper or thinner, but the vocabulary table’s size is fixed by tokenizer token count × hidden dimension. Compressing the main body doesn’t shrink it automatically.
    • The distribution is highly skewed (long-tailed). In real corpora, a small number of high-frequency tokens account for the overwhelming majority of occurrences, while vast numbers of low-frequency and rare tokens are almost never activated — yet each one still occupies a full vector. This creates an opportunity for pruning and a trap at the same time: crudely cutting low-frequency tokens can damage handling of rare entities and domain-specific terminology.
    • It serves both input and output. Because of weight tying, the table has to do lookups and projection, so any compression must keep both “reading in correctly” and “projecting out correctly” intact. There’s less room for error.

    5. General Approaches to Lightening the Vocabulary Table

    Once you understand the causes, the fixes follow directly. These are the approaches commonly used in practice — each can be applied on its own, and they can be stacked.

    1. Vocabulary Pruning

    Use token frequency statistics to cut low-frequency tokens, keep only the high-frequency portion, and map everything removed to <unk>. This gives the most direct payoff.

    1. # Prune the vocabulary by token frequency: keep high-frequency tokens,
    2. # map low-frequency ones to <unk>
    3. freq = count_tokens(corpus)
    4. keep = freq >= THRESHOLD # set the retention threshold
    5. new_vocab = build_vocab(keep) # rebuild the id mapping
    6. remap = {old_id: new_id for old_id, new_id in new_vocab.items()}
    7. remap[OOV_ID] = UNK_ID # all pruned low-frequency tokens point to <unk>

    The key trade-off is the threshold: the more aggressively you prune, the more the size drops, but the larger the recall loss for rare words and proper nouns. Evaluate several thresholds on a validation set before committing.

    2. Embedding Quantization and Low-Bit Storage

    The embedding table isn’t more precious than the main body — it can be quantized to low bit widths too. A common approach is to compute a scaling factor per row (per word vector), quantize, and dequantize at inference time.

    1. # Per-row symmetric quantization of each word vector to reduce storage bits
    2. W = embedding.weight # shape [vocab_size, dim]
    3. qmax = 2 ** (bits - 1) - 1 # bits can be 4 / 8
    4. scale = W.abs().amax(dim=1, keepdim=True).clamp_min(1e-6) / qmax
    5. W_q = (W / scale).round().clamp(-qmax, qmax).to(torch.int8)
    6. # Dequantize on demand at inference: W_hat = W_q.to(float) * scale

    The finer the quantization granularity (per row, or grouped), the smaller the accuracy loss. Rare tokens are more sensitive to error, so a mixed strategy that keeps them at a higher bit width is worth considering.

    3. Low-Rank Factorization

    Approximate the large [vocab_size, dim] matrix as the product of two skinny matrices, [vocab_size, r] × [r, dim] with r ≪ dim, trading low-rank structure for a smaller footprint. It works especially well on large vocabulary tables where rows are semantically similar and structurally regular. The cost is a bit of extra matrix multiplication.

    4. Hashing and Cluster-Based Sharing

    Have multiple tokens share the same pool of “codebook vectors”: cluster or hash-bucket the word vectors, then store only the codebook plus a bucket index per token. Low-frequency words naturally land in a small number of codebooks, so the more redundancy, the better the compression.

    5. Freezing the Embedding Layer

    The idea behind the title — “freeze the vocabulary table” — refers to a pragmatic approach: while fine-tuning or quantizing the main body, keep the embedding table relatively fixed, stop training or substantially altering it, and treat it as a stable, independently compressible module. The benefits:

    • The main body can be compressed aggressively without being constrained by joint optimization with the table.
    • The table can independently adopt a combination of pruning and low-bit quantization.
    • It avoids the chain of compromises where you sacrifice main-body compression ratio just to accommodate embedding accuracy.

    Freezing doesn’t mean nothing moves ever. It means decoupling the training strategy from the storage strategy: freeze during training to reduce coupling and memory overhead, then apply dedicated compression to this stable table at deployment time.

    6. Trade-offs and Practical Recommendations

    No single approach solves everything. Keep these principles in mind when putting any of it into production:

    • Measure before optimizing. Before touching anything, calculate the embedding table’s actual share in your target model. If it’s small, don’t bother. If it’s large — as in small models — deal with the table first.
    • Layer the techniques. The usual starting point is the trio of weight tying + vocabulary pruning + embedding quantization: the gains stack and the implementation cost stays manageable.
    • Back it with task metrics. Run every compression scheme through your business validation set, paying particular attention to degradation in long-tail content: rare words, proper nouns, code symbols.
    • Keep quantization reports transparent. When assessing on-device footprint, always count the embedding layer in. Avoid “excluding the embedding layer” framing that obscures real usage.
    • Implement on general-purpose toolchains. Pruning, quantization, and factorization are all standard operations you can build with general deep learning frameworks and on-device inference engines — no vendor-specific API required.

    7. Conclusion

    Competition among small models is shifting from “who has more parameters” to “who is smarter per unit of volume.” Once the main body has been compressed down to around 1 bit, the embedding table becomes the most expensive component in terms of memory and load time. It is no longer a harmless rounding error but a genuine cost center that on-device deployment has to confront head-on. Pulling the table out for separate scrutiny — prune what should be pruned, quantize what should be quantized, and freeze it for dedicated treatment when necessary — is the key step toward getting hundred-million-parameter models to actually run on phones and laptops.