arXiv:2610.21810cs.LGOct 2026

Manuscript Offprint

arXiv:2610.21810

N-Gram Memories at Two Bits: Quantizing Lookup Tables in Large Language Models

Donghoon Han, Minseop Jung, Dong Woo Kwak, SeungJae Lee, Junhoo Lee

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Conditional memory expands language-model capacity through selective lookup, but the full embedding table must remain available for every possible input. We introduce Conditional Program (CP), a compressed representation that reconstructs only the rows an input requests. CP represents each row by a short code and a local scale, with a reconstruction program shared across the table. We instantiate this representation with a Gaussian trellis, norm restoration and independently decodable row records. CP's two-bit code lowers output KL by 41–63% relative to 2-bit round-to-nearest. Analysis across three trained n-gram memory families shows that Gaussian-like coordinate statistics coexist with learned relationships among rows; at matched storage budgets, the shared trellis outperforms the fitted codebooks and low-rank residual variants we test. For DeepSeek, it reduces table storage from 203 GB to 51 GB, leaving room for larger workloads when the table is kept on GPU.

1 Introduction

Conditional memory expands language-model capacity without a proportional increase in per-token computation. It retrieves learned representations from large embedding tables, allowing a model to use only a small part of its memory for each input (Cheng et al., 2026; Liu et al., 2026). This makes higher capacity attractive under limited compute budgets, but the tables still occupy substantial storage. Moving them from accelerator memory to host memory changes where that cost is paid without reducing it.

Compressing conditional memory presents a different challenge from conventional LLM weight compression. Although its embedding tables contain learned parameters, they are accessed through sparse, input-dependent lookups rather than dense computation. Existing LLM compression methods primarily target dense model weights, leaving the distinct access patterns of conditional memory largely unaddressed. Conditional memory instead requires reducing the footprint of the entire table while preserving independent access to individual rows and the information they provide to the model. Can conditional memory be stored more compactly while reconstructing only the entries needed by the current input?

We propose Conditional Program (CP), a representation that stores instructions for reconstructing each entry through a shared decoder. Our hypothesis is that a compact shared reconstruction rule, together with short row-specific codes and local scales, can preserve the signal that the model consumes from the table. An input selects which entries to reconstruct, so the extra work is confined to the rows it accesses. This exchanges storage across the full table for reconstruction work on a small subset, carrying the selective use of conditional memory into its compressed representation.

Specifically, CP represents each row with a short code and a local scale, using a decoder shared across the table. We model normalized row contents as the accumulation of many small learning contributions dispersed across coordinates; when these contributions are weakly dependent and none dominates, a Gaussian source approximation follows from a central-limit argument. Therefore, we encode rows in their stored coordinate system with a shared Gaussian trellis (Tseng et al., 2024b). The local scale restores the decoded vector's norm, and independently stored row records allow the runtime to fetch and reconstruct only requested entries (Figure 1). At two bits, CP reduces table storage by roughly four- to eightfold, with most reported task scores remaining close to their original values. For a 4,096-token DeepSeek prefill from host memory, its row layout reduces lookup time from 10.78 to 6.54 ms compared with a QTIP tile-window decoder in a layout microbenchmark.

Our contributions are as follows:

Figure

Figure 1: Conditional Program (CP). An input selects row addresses in the compressed memory. Each record contains a trellis code and a bf16 scale; a shared decoder reconstructs the vector, and the scale restores its norm before the existing readout. (a) Offline, the encoder selects a low-error trellis path and stores its code with the norm-restoring scale. (b) Online, only addressed records are fetched, decoded and scaled. Trellis states and paths are schematic.

• We introduce Conditional Program, a representation that exchanges storage across the full memory table for reconstruction work on the few entries selected by each input.

• We instantiate CP with a shared Gaussian trellis, per-row norm restoration and independently addressable records, preserving selective access in the compressed representation.

• We evaluate downstream performance across diverse tasks, analyze compression fidelity, and measure lookup costs and workload capacity under GPU and host-memory placement.

References (63)