用动态分组压缩冗余嵌入,让小模型也能高效扩展记忆能力。
Beyond N-gram: Data-Aware X-GRAM Extraction for Efficient Embedding Parameter Scaling

- 基于频率感知的动态注入框架,压缩长尾词并保留头部容量。
- 在0.73B和1.15B模型上提升准确率最多4.4点,表大小减少50%。
- 适合追求低资源下高效扩展记忆能力的模型开发者。
大型索引查找表提供了与计算解耦的扩展路径,但其实际收益常受限于参数效率低下和内存快速增长。我们归因于长尾部分的齐夫分布训练不足、层间需求异质性以及导致冗余嵌入的‘槽坍缩’现象。为此,我们提出X-GRAM,一种频率感知的动态令牌注入框架。X-GRAM采用混合哈希与别名混合压缩尾部,同时保持头部容量,并通过归一化SwiGLU ShortConv优化检索向量,提取多样化的局部n-gram特征。这些信号通过深度感知门控整合进注意力值流与层间残差中,有效对齐静态记忆与动态上下文。该设计引入以内存为中心的扩展轴,实现模型容量与浮点运算量的解耦。在0.73B和1.15B规模上的大量实验表明,X-GRAM相较原始基线模型平均准确率最高提升4.4点,较强检索基线提升3.2点,且在50%配置下使用更小的表格。总体而言,通过高效的内存管理实现容量与计算的解耦,X-GRAM为未来内存增强型架构提供了一种可扩展且实用的新范式。代码见https://github.com/Longyichen/X-gram。
原文摘要 · Abstract (English)
Large token-indexed lookup tables provide a compute-decoupled scaling path, but their practical gains are often limited by poor parameter efficiency and rapid memory growth. We attribute these limitations to Zipfian under-training of the long tail, heterogeneous demand across layers, and "slot collapse" that produces redundant embeddings. To address this, we propose X-GRAM, a frequency-aware dynamic token-injection framework. X-GRAM employs hybrid hashing and alias mixing to compress the tail while preserving head capacity, and refines retrieved vectors via normalized SwiGLU ShortConv to extract diverse local n-gram features. These signals are integrated into attention value streams and inter-layer residuals using depth-aware gating, effectively aligning static memory with dynamic context. This design introduces a memory-centric scaling axis that decouples model capacity from FLOPs. Extensive evaluations at the 0.73B and 1.15B scales show that X-GRAM improves average accuracy by as much as 4.4 points over the vanilla backbone and 3.2 points over strong retrieval baselines, while using substantially smaller tables in the 50% configuration. Overall, by decoupling capacity from compute through efficient memory management, X-GRAM offers a scalable and practical paradigm for future memory-augmented architectures. Code aviliable in https://github.com/Longyichen/X-gram.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。