Small Model Embedding Vocabularies Eat 60% of Parameters: How to Freeze and Slim Them Down

    Small language models often allocate most of their parameters to the embedding vocabulary rather than the computational backbone. This article explains why vocabularies dominate parameter counts in small models, why conventional quantization tends to skip embedding layers, and how freezing the embedding table enables more aggressive offline compression. It covers vocabulary quantization, codebook and product quantization, hashing, low-rank factorization, input-output decoupling, rare-token compression, and the practical trade-offs involved.

    A counterintuitive fact: the vocabulary is the real weight of a small model

    If you open a small-parameter model designed for phones and laptops—typically around 270 million parameters—you may see a surprising parameter distribution. The layers that do the main work for attention and feed-forward inference often contain only about 70 to 80 million parameters. Meanwhile, the embedding table that maps discrete tokens to dense vectors can exceed 160 million parameters, taking more than 60% of the total model size.

    This ratio is the opposite of what most people expect from large models. In models with tens or hundreds of billions of parameters, the embedding table is a small fraction of the whole and can be ignored. But when the parameter scale drops to a few hundred million, the embedding table can become almost as large as the model itself. In other words, small models are not simply “small and complete.” They are often “big vocabulary, small body”: the part that does the thinking and computation is slim, while the lookup dictionary occupies most of the weight.

    Why small models get burdened by vocabularies

    To understand this issue, start with the arithmetic. The size of an embedding table is roughly:

    vocabulary size × embedding dimension

    Suppose the vocabulary contains 30,000 common tokens, including subword tokens, and each token is represented by a 512-dimensional vector. The table alone is about 30,000 × 512 ≈ 15 million parameters. If the dimension is raised to 768 or higher, or if the vocabulary is expanded to over 100,000 tokens to cover multiple languages or domains, the parameter count can quickly grow to hundreds of millions.

    There is another important detail: many models use an input-output sharing design. The final output layer—the language model head—reuses the transpose of the embedding matrix. This further increases the burden on the vocabulary. The same table is responsible for both reading tokens into the model and producing outputs, making it a heavily used, high-pressure component.

    As a result, the main network can often be compressed through various techniques, but the vocabulary remains a large piece of “excess weight” that is difficult to remove. For extremely lightweight on-device models, this factor often determines how small the final model file can realistically become.

    Three forces in the on-device small-model era, yet the vocabulary is still untouched

    Several important developments in recent years have pushed the vocabulary issue into the spotlight.

    First, extreme quantization has matured. Techniques known as ternary networks or ternary quantization can compress neural-network weights from floating point to only three values—-1, 0, and +1—carrying about 1.58 bits of information. With minimal quality loss, these methods can significantly reduce model size and computation. They make it possible to push the main backbone close to 1 bit.

    Second, sub-billion-parameter models are now genuinely useful. Mainstream small models can reliably handle everyday tasks such as text generation, classification, extraction, and simple reasoning. They no longer always require calling a large model.

    Third, on-device deployment has become a real cost constraint. Once a model is placed on a phone, laptop, or embedded device, every megabyte of model size, every memory read, and every milliwatt of power consumption translates directly into user experience and battery life. At that point, “how heavy is the model” is no longer a theoretical metric. It affects whether the model can run smoothly and whether it can work offline.

    The contradiction is clear: the main backbone is being squeezed smaller and smaller, while the vocabulary stays almost unchanged. The industry has invested heavily in ternarizing the backbone and optimizing computation graphs, but for a long time it has simply accepted the idea that “the vocabulary should be this large.”

    Why quantization has largely bypassed embedding layers

    A common question is: if quantization exists, why not quantize the vocabulary too? There are several reasons.

    First, structural differences. Backbone weights are used in large-scale matrix multiplication, so quantization errors can be averaged out across many computations. An embedding table is essentially a lookup structure. Each token vector is stored independently, and quantization errors do not benefit from the same smoothing mechanism. This can directly affect semantic representation.

    Second, engineering conventions. Mainstream quantization methods—whether based on reconstruction error or activation awareness—usually assume that embedding layers and output layers either do not participate in quantization or participate only to a limited extent. This helps avoid quality regressions and keeps the workflow simpler. In many local inference engines, the output layer is quantized to only 6 to 8 bits, far from the near-1-bit compression achieved by the backbone.

    Third, reporting conventions can hide the problem. Some technical reports, when listing memory usage, explicitly state that the embedding layer is excluded. This removes the largest part of the model from the statistics. Over time, the industry has grown used to this default acceptance. Few people ask a basic question: is the vocabulary worth the cost of the space it occupies?

    A rough estimate makes the problem clear. Suppose a 270-million-parameter small model has a backbone that takes about 20 MB after ternary quantization. If the vocabulary is still stored as 16-bit floating point, it could expand to more than 300 MB. In that case, the vocabulary becomes the largest part of the file, directly conflicting with the goal of extremely lightweight on-device deployment.

    The core idea of freezing the vocabulary

    “Freezing the vocabulary” is essentially a shift in perspective. Instead of treating the embedding table as an ordinary weight that must remain high precision and participate in training, treat it as a read-only lookup table that can be processed independently, turned into a static artifact, and compressed aggressively.

    This idea has several supporting points.

    • A vocabulary is a lookup, not a computation. During forward inference, the embedding layer only retrieves a row by index. It does not involve the matrix multiplications used by the main backbone. Its storage format can therefore be fully decoupled from the backbone and compressed in a way suited to lookup tables.
    • A frozen embedding table can be preprocessed offline. If embedding vectors are no longer updated after training, they can be treated as constants. This allows aggressive offline compression, clustering, and reordering without worrying about dynamic changes during training.
    • The backbone and vocabulary should be compressed separately. Since they have different roles, they should not follow the same compression standard. The backbone can pursue extreme quantization close to 1 bit, while the vocabulary can use compression methods designed for large lookup tables.

    In short: demote the vocabulary from a “training object” to a “resource file,” and give it a separate slimming strategy.

    Practical methods for shrinking the vocabulary

    Once the vocabulary is frozen, how can it be compressed? Several common and mature directions can be used individually or in combination.

    1. Quantizing the vocabulary itself

    The most direct approach is to reduce embedding vectors from 16-bit to 8-bit, 4-bit, or even lower. Quantizing embeddings alone can introduce errors, but if combined with techniques such as vector reordering and intelligent initialization of cluster centers, quality loss can often be kept within an acceptable range. The key point is that quantizing an embedding table requires a different strategy from quantizing the main backbone. A single one-size-fits-all approach is not enough.

    2. Codebook quantization and product quantization

    Instead of storing a separate vector for every token, introduce a smaller codebook. Each token stores only a few indices pointing to entries in the codebook. Product quantization goes further by splitting high-dimensional vectors into multiple sub-spaces, each with its own small codebook. This changes storage cost from “vocabulary size × dimension” to “vocabulary size × index length,” offering substantial compression.

    3. Hashing embeddings

    A hash function can map tokens directly to a fixed number of buckets. Multiple tokens may share the same bucket vector. This decouples the number of trainable parameters from the vocabulary size and can significantly reduce storage. The tradeoff is that hash collisions may occur, so additional calibration or compensation mechanisms may be needed.

    4. Low-rank factorization

    A large embedding matrix can be approximated as the product of two smaller matrices, A × B, using a lower rank r. When the embedding matrix has strong low-rank structure, this method can reconstruct a vector table close to the original with fewer parameters.

    5. Decoupling input and output

    If a model uses input-output sharing, it may be worth evaluating whether to split it. Give the output head a smaller low-rank approximation or an independent codebook, so that one large table does not have to serve both ends. Whether this is worthwhile depends on the model’s tolerance for quality loss.

    6. Slimming rare tokens

    In real text, a large number of tokens appear very rarely. High-frequency tokens can keep more precise representations, while long-tail tokens can use more aggressive quantization or larger shared codebooks. This creates a non-uniform compression scheme: fine-grained for hot tokens, simpler for cold ones.

    The following pseudocode illustrates the basic flow of “freeze first, then codebook-based storage.” It is only intended to show the idea and does not represent any specific framework or interface:

    1. # Illustrative: freeze the embedding table after training and compress it offline into a codebook-based format
    2. embedding_table = model.embedding.weight.detach() # Freeze; do not update
    3. # 1) Use product quantization to compress the large [V, D] table into several sub-space codebooks
    4. codes, codebooks = product_quantize(embedding_table, n_subspaces=8, k_bits=8)
    5. # 2) During inference, retrieve codes by token ID and approximate the vector using the codebooks
    6. def lookup_vector(token_id):
    7. sub_ids = split(codes[token_id], n_subspaces=8)
    8. vec = concat([codebooks[i][sub_ids[i]] for i in range(8)])
    9. return vec
    10. # On the storage side, only codes and codebooks are saved, which is much smaller than the original table

    Trade-offs and boundaries of freezing the vocabulary

    Freezing the vocabulary is not free. Its costs and limits should be evaluated carefully.

    • Quality loss must be measured. The embedding table carries a large amount of semantics. Aggressive compression may cause regressions in downstream tasks, so evaluation must be done on the target tasks rather than only looking at compression ratio.
    • Multilingual and domain expansion are more sensitive. The larger and broader the vocabulary, the harder it is to preserve accuracy for rare tokens. Loss in long-tail semantics needs careful validation.
    • Engineering complexity increases. Codebooks, hashing, and low-rank methods introduce additional decoding overhead and inference logic. The one-time cost of offline preprocessing must be weighed against the long-term benefits of deployment.
    • Freezing requires that the current vocabulary is “good enough.” If the business needs continuous incremental learning of new words or new domains, full freezing may not be suitable. In that case, a balance must be found between frozen compression and updateability.

    Conclusion

    The slimming of small models has long been dominated by one main line: extreme quantization of the backbone. Meanwhile, the vocabulary—which can account for about 60% of the parameters—has been quietly accepted as an unavoidable cost. Reassessing the role of the embedding table and repositioning it from a high-precision training weight to a read-only lookup table that can be compressed offline is a key step in truly reducing model size for on-device deployment. By applying vocabulary quantization, codebook or product quantization, hashing embeddings, low-rank factorization, input-output decoupling, and other targeted methods, developers can separately slim down the vocabulary. Whoever takes the cost of the vocabulary seriously first will have a better chance of making “good-enough small models” even smaller, faster, and cheaper in the competition for efficient on-device AI.