arXiv:2505.10202cs.CL2025-05被引 1

用向量量化压缩大模型输出层,参数减少99%且推理快6倍。

VQ-Logits: Compressing the Output Bottleneck of Large Language Models via Vector Quantized Logits

  • 用小码本替代大词表映射,通过向量量化降低输出层开销。
  • 在标准数据集上实现99%参数压缩和6倍计算加速,困惑度仅增4%。
  • 适合追求高效推理的部署场景,尤其对资源受限设备友好。

大型语言模型(LLMs)虽取得显著成功,但其庞大的输出词表带来了严重的计算与内存挑战。最终线性投影层将隐藏状态映射到词表大小的logits,通常占模型参数和推理计算的很大比例。现有方法如自适应softmax或分层softmax引入了结构复杂性。本文提出VQ-Logits,利用向量量化(VQ)大幅降低输出层的参数量与计算负载。VQ-Logits将原本大小为V × d_model的输出嵌入矩阵替换为一个小型共享码本(K个嵌入向量,K << V)。词汇表中的每个词被映射到这K个码本向量之一。模型预测码本上的logits,再通过学习或预设的映射快速“散射”到完整词表空间。在WikiText-103、C4等标准语言建模基准上,实验表明VQ-Logits可实现输出层99%的参数压缩和6倍的logit计算加速,困惑度仅比全softmax基线增加4%。我们还进行了关于码本大小、初始化和学习策略的详细消融实验,验证了该方法的鲁棒性与有效性。

原文摘要 · Abstract (English)

Large Language Models (LLMs) have achieved remarkable success but face significant computational and memory challenges, particularly due to their extensive output vocabularies. The final linear projection layer, mapping hidden states to vocabulary-sized logits, often constitutes a substantial portion of the model's parameters and computational cost during inference. Existing methods like adaptive softmax or hierarchical softmax introduce structural complexities. In this paper, we propose VQ-Logits, a novel approach that leverages Vector Quantization (VQ) to drastically reduce the parameter count and computational load of the LLM output layer. VQ-Logits replaces the large V * dmodel output embedding matrix with a small, shared codebook of K embedding vectors (K << V ). Each token in the vocabulary is mapped to one of these K codebook vectors. The LLM predicts logits over this compact codebook, which are then efficiently "scattered" to the full vocabulary space using the learned or preassigned mapping. We demonstrate through extensive experiments on standard language modeling benchmarks (e.g., WikiText-103, C4) that VQ-Logits can achieve up to 99% parameter reduction in the output layer and 6x speedup in logit computation, with only a marginal 4% increase in perplexity compared to full softmax baselines. We further provide detailed ablation studies on codebook size, initialization, and learning strategies, showcasing the robustness and effectiveness of our approach.

大模型压缩向量量化推理加速

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。