Vocabulary Parameters in Small Language Models: Freezing Embeddings and Compression Trade-offs

    Small language models can devote a large share of their parameters to vocabulary-related input embeddings and output projections. This article explains why those matrices grow with vocabulary size, why they cannot simply be deleted, and how freezing, weight sharing, quantization, low-rank factorization, vocabulary pruning, and adapter-style training differ. It also outlines evaluation metrics and an engineering workflow for balancing model size, memory, latency, quality, and domain adaptation.

    When model parameter counts are at the billion scale or below, deployment cost is no longer determined only by Transformer layers and hidden dimensions. One easily overlooked fact is that vocabulary-related parameters can account for a large proportion of total model parameters. For small models aimed at everyday question answering, text classification, information extraction, and lightweight coding assistance, the main network may already be compact, but the input embedding layer and output layer can act like a fixed ballast that continuously consumes storage and GPU memory.

    1. Why the Vocabulary Accounts for So Many Parameters in Small Models

    A language model usually needs to convert discrete token IDs into continuous vectors. Let the vocabulary size be (V) and the hidden dimension be (d). The input embedding matrix typically has the shape:

    [
    E \in \mathbb{R}^{V \times d}
    ]

    Its parameter count is approximately:

    [
    V \times d
    ]

    In generation tasks, the model also needs to map hidden states back into vocabulary space to obtain prediction scores for each token. If the output layer uses a separate matrix, it needs a projection layer with a shape of approximately (d \times V), which also has about (V \times d) parameters.

    This means that the input embedding and output projection alone can produce approximately (2Vd) parameters.

    For example, assume the vocabulary contains 100,000 tokens and the hidden dimension is 2,000. A single embedding matrix then has about 200 million parameters. If input and output weights are not shared, the related parameter count increases further. For a small model with only a few hundred million total parameters, the vocabulary module will naturally account for a very high proportion.

    The situation is more complex in multilingual scenarios, which usually need to cover different writing systems, symbols, digit combinations, and special markers. To reduce unknown characters, the vocabulary continues to expand. As vocabulary size grows, the parameter counts of the embedding layer and output layer grow linearly. The number of layers in the main network does not change, but the vocabulary may become the main source of model size growth.

    2. Why Vocabulary Parameters Cannot Simply Be Deleted

    Although vocabulary parameters take up space, they are not irrelevant redundancy.

    First, input embeddings determine how the model understands tokens. The positions of different tokens in vector space affect how the model models word meaning, syntax, domain terminology, and contextual relationships. If a large number of embedding entries are deleted directly, the model may fail to recognize the corresponding text.

    Second, the output projection determines what the model can generate. Even if the main network already has strong contextual reasoning ability, the model cannot directly generate relevant characters or word pieces if certain tokens are missing from the output side.

    Third, the vocabulary is tied to the tokenization strategy. Changing the vocabulary usually means changing the text segmentation method. Once the input distribution changes, the model’s internal attention patterns and positional relationships are also affected. Therefore, vocabulary compression cannot focus only on parameter count. It must also evaluate token length, long-text efficiency, and generation quality.

    Finally, low-frequency tokens are not necessarily useless tokens. Professional terminology, code symbols, special formats, and minority-language text may appear infrequently, but they can be very important in specific tasks. Simply deleting vocabulary entries by frequency can easily degrade domain capabilities.

    3. What Is the Core Idea Behind Freezing the Vocabulary?

    Freezing the vocabulary usually does not mean removing it from the model. Instead, it means fixing the input embeddings, output projection, or part of those parameters during training or fine-tuning, so that new tasks no longer repeatedly update these large matrices.

    In traditional fine-tuning, gradients backpropagate through the complete model. For models with large vocabularies, the embedding layer and output layer consume large amounts of optimizer state, gradient cache, and GPU memory. After freezing, the training process mainly updates the main network, normalization layers, task heads, or a small number of adapter parameters, thereby reducing training cost.

    Three concepts need to be distinguished:

    1. Frozen parameters: Parameters still participate in forward computation but are not updated during training.
    2. Compressed parameters: Quantization, low-rank decomposition, or sparsification reduces actual storage.
    3. Pruned parameters: Unneeded tokens or matrix rows and columns are deleted, directly reducing structural scale.

    Freezing mainly addresses training stability and optimizer overhead. It cannot by itself eliminate the vocabulary footprint in the model file. If the goal is to reduce deployment storage and GPU memory, quantization, weight sharing, or structural compression must also be considered.

    4. Several Options Worth Prioritizing

    4.1 Input-Output Weight Sharing

    Many language models can let the input embedding matrix and output projection share the same set of parameters. In this way, two sets of (V \times d) parameters can be reduced to one, which in theory directly cuts vocabulary-related parameters.

    The advantages of weight sharing are its simple structure and mature implementation, and it often helps keep input representations and output representations consistent. The disadvantage is that the input side and output side do not perform exactly the same function. Some tasks may require more expressive freedom, so quality changes need to be evaluated on a validation set.

    4.2 Low-Bit Quantization of the Embedding Matrix

    If embedding parameters are stored at lower precision, model size drops significantly. It is important to note that the embedding layer is not necessarily suitable for exactly the same quantization strategy as the main network. High-frequency tokens, special symbols, and output-distribution-sensitive areas may be more sensitive to precision.

    A safer approach is stratified evaluation:

    • First use more aggressive compression for low-frequency tokens;
    • Retain higher precision for high-frequency tokens;
    • Handle special tokens and control symbols separately;
    • Compare perplexity, generation accuracy, and format-following ability.

    For quantized models, also check whether the inference framework supports the corresponding data layout. Otherwise, the theoretical compression ratio may not translate into actual GPU memory savings.

    4.3 Low-Rank Factorization

    The embedding matrix can be approximately decomposed into two smaller matrices:

    [
    E \approx AB
    ]

    where (A) has shape (V \times r), (B) has shape (r \times d), and (r) is smaller than (d). The parameter count then changes from (Vd) to:

    [
    Vr + rd
    ]

    When the rank (r) is small enough, parameter scale can be significantly reduced.

    Low-rank factorization is suitable for vocabularies with obvious redundancy, but it is not a lossless transformation. A rank that is too low may weaken the representation of rare words, domain terms, and multilingual characters. In practice, different token types should be evaluated through stratified sampling rather than relying only on aggregate average metrics.

    4.4 Vocabulary Pruning and Layered Vocabularies

    Token frequency statistics can be built from actual business corpora, and the vocabulary can be divided into a core vocabulary, an extended vocabulary, and a fallback character set.

    The core vocabulary covers high-frequency words, common symbols, and major business terms. The extended vocabulary handles specific domains. The fallback mechanism ensures that unknown text can still be split into finer-grained character or byte units.

    This design can reduce the parameter count in default deployment, but it leads to longer token sequences. As sequences become longer, attention computation, KV cache, and end-to-end latency may increase. Therefore, vocabulary pruning cannot be judged only by file size. It should also measure:

    • Average token count;
    • Long-text processing speed;
    • Sequence length during generation;
    • Business term coverage;
    • Fallback ratio for unknown text.

    4.5 Training Only Small-Scale Adapter Parameters

    During domain adaptation, the vocabulary and most main parameters can be frozen, and only a small number of additional modules are trained. The value of this approach is not only lower GPU memory usage. It also helps prevent small business datasets from damaging general language knowledge.

    Adapter parameters can be placed near attention modules, feed-forward modules, or task output layers. Because the number of new parameters is small, different business scenarios can save separate adapter modules while sharing the same base model. At deployment, the corresponding module is loaded by task, reducing multi-model maintenance cost.

    5. Does Freezing Affect Learning in New Domains?

    The key depends on where the new-domain changes occur.

    If a new task only requires the model to learn new decision rules, output formats, or business processes, freezing the vocabulary is usually not a major problem, because these capabilities depend more on the main network and task layer.

    If the new domain contains many new terms, new characters, or special encodings, simply freezing the vocabulary may run into difficulties. The model can still represent new words by combining multiple base tokens, but sequences become longer and the semantic composition is not necessarily ideal.

    Therefore, engineering teams can use a partial unfreezing strategy:

    • Fix high-frequency tokens;
    • Unfreeze only the embedding rows corresponding to business terms;
    • Allocate a separate small embedding module for new tokens;
    • Keep the original vocabulary while supplementing knowledge through external dictionaries or retrieval modules.

    This approach saves more resources than full unfreezing and is more adaptable than complete freezing.

    6. Evaluation Must Look Beyond Parameter Count

    The most common problem with vocabulary compression is that parameters decrease while real user experience deteriorates. A complete evaluation should include at least four categories of metrics.

    The first category is language modeling metrics, such as perplexity and next-token prediction accuracy, used to observe whether the overall distribution has shifted significantly.

    The second category is task metrics, including classification accuracy, extraction consistency, question answering correctness, and structured-output validity. Different tasks vary greatly in sensitivity to vocabulary changes.

    The third category is engineering metrics, including model file size, peak GPU memory, first-token latency, generation throughput, and long-context cache usage.

    The fourth category is boundary scenarios, including low-frequency terms, numbers, code symbols, multilingual text, mixed encodings, and abnormal inputs. Vocabulary compression losses often appear first in these scenarios.

    In addition, the input side and output side should be evaluated separately. Some approaches have little impact on understanding tasks but significantly reduce generation quality. Other approaches preserve output capability but increase input sequence length. Only by analyzing them separately can specific problems be located.

    7. An Executable Engineering Workflow

    In actual projects, the following steps can be used:

    1. Collect real business corpora covering common requests, long text, professional terminology, and abnormal inputs.
    2. Measure token frequency, average sequence length, and domain word coverage.
    3. Establish an uncompressed baseline and record quality, GPU memory, storage, and latency.
    4. Prioritize input-output weight sharing.
    5. Then test quantization, low-rank factorization, and vocabulary pruning separately.
    6. Apply differentiated protection to high-frequency tokens, special tokens, and domain tokens.
    7. Use frozen training to verify whether the main network can handle domain adaptation.
    8. Manually review boundary samples to prevent average metrics from masking serious defects.
    9. Choose the final approach based on deployment constraints rather than pursuing the smallest parameter count alone.

    Conclusion

    For small models, the vocabulary is not a peripheral component that can be ignored. It may be an important source of model size, GPU memory usage, and training cost. Freezing the vocabulary can reduce the optimization burden during fine-tuning. Weight sharing and quantization can further compress storage. Low-rank factorization and layered vocabularies provide more aggressive structural optimization paths.

    However, vocabulary compression is fundamentally a trade-off: fewer parameters may mean longer token sequences; cheaper training may mean weaker domain adaptation; a smaller model may also lose quality on low-frequency text and special formats. A reliable solution should be based on real business data, place quality, latency, GPU memory, and maintenance cost in the same evaluation framework, and gradually find the compression boundary that fits the target scenario.