两比特下的N-Gram记忆:量化大语言模型中的查找表
研究论文 · 2026/10/20
条件记忆通过选择性查找扩展语言模型容量,但完整嵌入表必须为所有可能输入保持可用。我们提出条件程序(CP),一种压缩表示,仅重建输入请求的行。CP用短码和局部尺度表示每一行,并共享一个重建程序。我们以高斯网格、范数恢复和独立可解码行记录实例化该表示。CP的两比特码相对于2比特最近舍入将输出KL降低41-63%。对三个训练过的n-gram记忆家族的分析表明,高斯类坐标统计与行间学习关系共存;在匹配存储预算下,共享网格优于我们测试的拟合码本和低秩残差变体。对于DeepSeek,它将表存储从203GB减少到51GB,当表保留在GPU上时为更大工作负载留出空间。
该文章提出了一种高效的嵌入表压缩方法,显著降低存储需求并保持模型性能,对于在有限GPU内存下部署大型语言模型具有重要意义。
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 203GB to 51GB, leaving room for larger workloads when the table is kept on GPU.