Manuscript Offprint

arXiv:2610.31646

Low-Bit N-Gram Embeddings for Language Models

Stephen Chung, Wenyu Du

Stephen Chung Wenyu Du

DualverseAI

Many recent open-weight language models use n-gram embedding tables to improve performance. These tables store learned representations of short token sequences, such as pairs or triples of consecutive tokens, which the model retrieves during processing. However, they can require substantial memory: DeepSeek-V4.1-Flash, for example, allocates 196 billion parameters to its Engram n-gram memory. We therefore investigate whether this memory cost can be reduced while preserving the performance improvement that the tables provide. We propose storing n-gram embeddings at low precision and systematically investigate different quantization methods and bit allocations across tables. Across nanochat-, Llama-, and GPT-2-family models trained from scratch, four-bit tables save approximately 75% of table memory while preserving more than 99% of the validation-loss improvement from adding the tables. Using fewer bits leads to a larger drop in performance, although we find that a short fine-tuning phase recovers a significant part of this loss. In addition, reinvesting the saved memory in larger tables can improve performance beyond that of the original full-precision tables while still using less memory. These table memory savings also extend to large existing models: on DeepSeek-V4.1-Flash and Qwen3.8-Flash-Next, low-bit tables save 47–55% of table memory, with perplexity increases of less than 1.2% and largely preserved downstream task performance. These findings establish low-bit precision as a practical way to reduce the memory requirements of n-gram embeddings and use the saved capacity to improve model performance.

Date: 22-Oct-2026

Correspondence: info@dualverse.ai

DUALVERSE AI

1 Introduction

Recent studies have shown that n-gram embedding tables can improve language model performance with little additional computation [1, 2]. These tables store learned representations of short token sequences, such as pairs or triples of consecutive tokens. At each position, the model retrieves the corresponding representations to supplement its processing of the text. Because each lookup accesses only a few embeddings, the tables can add substantial model capacity while keeping the computation per token small. This approach has been adopted in DeepSeek's Engram memory, which contains 196 billion parameters in DeepSeek-V4.1-Flash [3]. However, storing these large tables requires substantial memory, motivating methods that preserve their performance benefits with a smaller memory footprint.

The memory cost arises from the enormous number of possible token combinations. To accommodate them, existing methods map n-grams into a fixed number of table embeddings, allowing multiple n-grams to share the same embedding [1, 2]. Smaller tables force more unrelated sequences to share representations, which can reduce their benefit to the model. Increasing the number of embeddings alleviates this problem but requires more memory. We therefore investigate a different way to reduce table memory: keeping the embeddings while using fewer bits for each embedding value. This also raises an opportunity: if lower precision preserves most of the tables' benefit, the saved memory could support more embeddings and ultimately improve performance.

We propose compressing n-gram embedding tables by storing each value at low precision. At such low precision, the choice of representable values can affect how well the embeddings are preserved. We therefore systematically compare evenly spaced values, values chosen from normal quantiles, and values fitted to the

This work extends a human-verified finding made by an rStation agent (https://rstation.ai/) as part of our Autonomous Research Program (https://dualverse.ai/auto_research). See Section 6 for a discussion of AI use.

(a) Four n-gram lookups

Figure

Figure 1: Four n-gram lookups, stored at low precision. (a) The bigram and trigram ending at the current token each retrieve two embeddings. The four embeddings are concatenated and added to the token embedding to form utu_t. (b) Each two-bit index selects one of four codebook values. Multiplying each selected value by the embedding's 16-bit scale reconstructs the embedding. Codebook values use 16 bits and are shared across all embeddings of a table.

learned embedding distribution using Lloyd–Max quantization [4, 5]. We also examine whether bigram and trigram tables benefit from different precision levels, allowing us to allocate bits according to their sensitivity to compression. Together, these experiments offer practical guidance on choosing quantization methods and bit allocations to balance table memory and model performance.

We evaluate this approach on nanochat-, Llama-, and GPT-2-family models trained from scratch [6–9]. We train each model with and without n-gram tables to establish how much the tables improve performance. We then compress the trained tables to different precisions and measure the table memory saved and the improvement retained. Beyond compression alone, we investigate whether a short fine-tuning phase can recover lost performance and whether reinvesting the saved memory in additional embeddings can outperform the original full-precision tables. To test whether these savings extend to large existing models, we also compress the tables in DeepSeek-V4.1-Flash and Qwen3.8-Flash-Next, saving 47–55% of table memory while largely preserving performance on downstream tasks.

Our main contributions are:

  • Substantial table memory savings with little loss of performance. Across three model architectures, three-bit n-gram tables save 80% of table memory while retaining approximately 97% of the validation-loss improvement from adding the tables. We also demonstrate substantial table memory savings in DeepSeek-V4.1-Flash and Qwen3.8-Flash-Next.

  • Practical guidance on quantization and precision allocation. We systematically compare codebook construction, scale fitting, and precision allocation across bigram and trigram tables.

  • Performance recovery through fine-tuning. A short fine-tuning phase substantially reduces the performance loss from low-bit compression, making aggressive compression more effective.

  • Better performance by reinvesting saved memory. Tables with four times as many embeddings, stored at two bits, achieve 122–126% of the original tables' improvement while still using 46–48% less table memory. This shows that reducing precision can enable larger, more effective n-gram memories.

References (27)