The Hidden Weight Burden in Small Models: Reducing Embedding Table Size

    Small models with fewer than a billion parameters are now "good enough" for everyday question answering, summarization, and intent recognition—and increasingly they run directly on phones and laptops instead of round-tripping to the cloud. Once a model moves to the edge, the rules change: parameters are no longer just an academic number but a real determinant of install size, memory footprint, and load latency. In a world where you budget every byte, the most overlooked yet most bloated component is the vocabulary—more precisely, the embedding table. This article walks through why embedding tables dominate small-model size, why they've long been left untouched, and a set of composable techniques (weight tying, parameter freezing, vocabulary pruning, embedding quantization, and low-rank factorization) that developers can stack to shrink this hidden burden with almost no loss in quality.

    Introduction: Small models are hot, but size has become a hard barrier

    Over the past two years, sub-billion-parameter models have kept improving and are now “good enough” for everyday question answering, text summarization, and intent recognition. At the same time, the industry increasingly favors running these models directly on edge devices like phones and laptops, rather than depending on a round-trip to the cloud for every request.

    Once a model lands on the edge, the evaluation criteria change fundamentally: parameter count is no longer just an academic figure but a real determinant of install size, memory usage, and load latency. Every additional megabyte of weights consumes precious flash storage, and every weight read slows down time-to-first-token. In this “account by the byte” world, any part of the model that can be slimmed down deserves a second look.

    And among those parts, the one most easily overlooked yet most “bloated” is the vocabulary—more precisely, the embedding table.

    1. How heavy is the vocabulary? Let’s do the parameter math

    To understand why the vocabulary is so heavy, you first need to see how its parameter count comes about. Before entering the Transformer backbone, a mainstream language model needs an embedding layer to map discrete tokens into dense vectors. This embedding table is essentially a large two-dimensional matrix:

    1. Embedding table parameters = vocabulary size × hidden dimension

    Take a representative configuration as an example:

    • Vocabulary size V ≈ 32,000
    • Hidden dimension d ≈ 512

    Then the input embedding table alone has 32000 × 512 ≈ 16.4 million parameters.

    The problem is that many models don’t have just one such table. To improve output quality, the input embedding table and the output projection matrix (which maps hidden vectors back to vocabulary probabilities) are often kept independent rather than shared—what’s called “untied weights.” When that happens, the embedding-related parameter count doubles, reaching about 32.8 million.

    Now compare that with the size of the backbone. Suppose the model has 6 Transformer layers, each consisting roughly of self-attention (about 4 × d² ≈ 1.05 million) and a feed-forward network (with d_ff = 2048, about 2 × d × d_ff ≈ 2.1 million), for about 3.15 million per layer and roughly 18.9 million across 6 layers.

    Add the three parts together: embeddings 32.8 million + backbone 18.9 million ≈ 51.7 million. Of that, the vocabulary-related portion alone accounts for about 63%.

    This is how “the vocabulary eats up most of a small model’s weight” comes about. It isn’t a coincidence of some particular implementation but a mathematically inevitable result: the smaller a model’s hidden dimension and the shallower its layers, the “slimmer” the backbone, and the more prominent that nearly fixed embedding chunk becomes. The lighter you make a model, the higher the relative share of the vocabulary actually gets.

    2. Why the vocabulary has long been “untouchable”

    If the vocabulary is so heavy, why has optimization work long concentrated on attention mechanisms, quantization, and distillation, with few daring to touch the vocabulary?

    The root cause is that the vocabulary is the foundation of everything—change one thing and the whole model shifts:

    • High compatibility cost: The vocabulary defines the mapping between tokens and integer IDs. Once you add or remove entries or adjust IDs, all the trained weights and all downstream fine-tuning results may need to be realigned, at enormous cost.
    • Tight coupling with the tokenizer: The vocabulary is usually produced by a tokenizer. Once tokenization rules and merge strategies change, the input and output formats change with them, and the comparability of existing corpora and evaluation benchmarks is broken.
    • Hard-to-quantify benefits: By comparison, techniques like quantization and pruning have mature evaluation pipelines, whereas changing the vocabulary touches the entire chain of data, training, and evaluation—it’s “dirty, heavy work.”

    So “don’t touch the vocabulary” has long been a default, safe choice. But when edge deployment pushes size and memory to their limits, this skipped-over heavyweight has instead become the most worthwhile low-hanging target to attack.

    3. What does “freezing the vocabulary” actually freeze?

    In a technical context, “freezing” usually refers to parameter freezing—marking a subset of parameters as no longer updated (no gradient backpropagation, weights held constant) during training or fine-tuning.

    Applying the freezing idea to the embedding table, the core insight is this: for a small model whose capabilities are already good enough, the semantic mapping carried by the vocabulary is often already stable enough, and repeatedly fine-tuning it yields limited gains while costing memory and compute. Freezing it amounts to acknowledging that “this foundation doesn’t need to be tamped down repeatedly,” freeing up precious training resources to concentrate on the parts that genuinely need adjusting.

    Illustrative code (framework-agnostic):

    1. # Freeze the embedding table and output projection; train only the backbone
    2. for name, param in model.named_parameters():
    3. if "embedding" in name or "lm_head" in name:
    4. param.requires_grad = False

    It’s worth stressing, though, that parameter freezing mainly addresses memory and compute overhead during training; it does not directly shrink the final model’s size. To truly “slim down” for the edge, you still need the more direct “tools” below.

    4. The tools for slimming down the vocabulary

    1. Tie input and output weights (weight tying)

    If the input embedding table and the output projection could share the same weights (weight tying) but are stored independently, that’s the most regrettable waste. Binding the two halves the embedding-related parameters outright. This is mathematically equivalent, loses almost no quality, and offers the best return on effort—the single highest-value step.

    1. # Output projection reuses the input embedding weights
    2. model.output_projection.weight = model.embedding.weight

    2. Freeze embedding parameters during training

    As covered in the previous section, freezing the vocabulary during fine-tuning saves the overhead of updating and storing gradients for this part, making training more memory-efficient and faster to converge. It doesn’t change the size, but it can significantly lower iteration cost.

    3. Vocabulary pruning: cut the tokens you don’t use

    For small models aimed at a specific domain or language, a general large vocabulary often contains many low-frequency tokens that almost never appear (rare characters, unrelated languages, uncommon symbols). By analyzing the real corpus, removing these tokens that will almost never be activated, and cleaning up the corresponding embedding rows, you can noticeably shrink the vocabulary while preserving quality. The cost is that you need to realign the mapping once, so be sure to run thorough before-and-after consistency checks.

    4. Embedding quantization: store the same words in fewer bits

    An embedding table is essentially a floating-point matrix and is well suited to quantization. Compressing each weight from 32-bit or 16-bit floating point into an 8-bit—or even 4-bit—integer representation can cut the size by roughly multiples. With suitable quantization error calibration, the accuracy loss can usually be kept within an acceptable range, making it a classic edge-deployment technique.

    5. Low-rank factorization: split one big matrix into two small ones

    If both the vocabulary and the hidden dimension are large, the embedding matrix V × d may contain a lot of redundancy. You can use a low-rank approximation to factor it into two smaller matrices, V × r and r × d (r ≪ d), trading slightly more computation for smaller storage. Whether it pays off depends on whether the target hardware is more storage-constrained or more compute-constrained.

    5. Putting it into practice: a composable slimming checklist

    These techniques are not mutually exclusive and can typically be stacked to form a clear optimization path:

    1. Tie weights first: Confirm whether the input and output weights are already tied. This step is zero-risk with immediate payoff.
    2. Then prune: Based on the target scenario’s corpus, prune the vocabulary—cut low-frequency dead tokens and clean up the corresponding embedding rows.
    3. Then quantize: Apply low-bit quantization to the retained embedding matrix to compress the size further.
    4. Factorize if needed: If it still doesn’t meet the target, evaluate whether low-rank factorization suits the current hardware.

    In practice, model weights produced by this kind of offline training are usually managed centrally through object storage, while inference services can be distributed uniformly and scaled elastically through a container platform, with logging services and monitoring/alerting tracking key edge metrics like load time and memory usage. This forms a closed loop of “train—distribute—observe,” giving every slimming step a solid, traceable basis.

    One caveat to keep in mind: any slimming must be judged by evaluation. It’s recommended to fix a set of benchmarks covering core tasks and, after each optimization step, run a quality comparison alongside size and latency measurements—ensuring that “what comes off is redundancy, and what stays is capability.”

    Conclusion

    Competition among small models is shifting from “are the parameters big enough” to “is the size small enough and is it fast enough.” And the long-overlooked vocabulary is precisely the most worthwhile target to dig into. Through this combination of weight sharing, parameter freezing, vocabulary pruning, embedding quantization, and low-rank factorization, developers can bring down this model’s “hidden weight” with almost no sacrifice in quality. When every megabyte and every read is taken seriously, small models can truly run lighter, faster, and more stably on phones and laptops.