arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.00028cs.LGcs.AI
收藏

重新思考量化大语言模型中的RoPE缩放:结合权重重缩放的理论、异常值与通道频段分析

Rethinking RoPE Scaling in Quantized LLM: Theory, Outlier, and Channel-Band Analysis with Weight Rescaling

Department of EECS, University of California, Irvine, USA(加州大学尔湾分校电子工程与计算机科学系);Google(谷歌)

Ye Qiao, Haocheng Xu, Xiaofan Zhang, Sitao Huang

AI总结:

针对RoPE位置插值与训练后量化结合导致精度下降的问题,本文提出轻量的Q-ROAR权重重缩放方法,可在无微调、无额外开销的情况下显著降低长上下文困惑度并保留短上下文性能。

摘要:

扩展大语言模型(LLM)的上下文窗口支持能力对长距离依赖任务至关重要。基于旋转位置编码(RoPE)的插值与外推方法(如线性缩放和频率感知方案)无需重新训练即可支持更长输入长度,而训练后量化(PTQ)让模型部署具备可行性。但我们研究发现,RoPE位置插值(PI)与PTQ结合会导致精度下降,其耦合影响因素包括长上下文混叠、动态范围扩张、轴对齐量化器与旋转RoPE对带来的各向异性,以及会产生位置相关logit噪声的异常值偏移。据我们所知,本文首次对PI+PTQ方案开展了系统性分析,并提出两种实用诊断指标:插值压力(各频段对相位缩放的敏感度)与尾部膨胀率(从短上下文到长上下文的异常值偏移程度)。基于分析结果,我们提出Q-ROAR(量化、RoPE插值与异常值感知重缩放),这是一种面向量化LLM的仅权重、感知插值的PI稳定方法。Q-ROAR将RoPE维度划分为少量频段,对键(Key)和查询(Query)权重的各频段缩放因子进行轻量搜索(可选对称变体以保留logit尺度)。该搜索以我们提出的诊断指标为引导,仅需极小的长上下文开发数据集,无需对模型进行微调,无需修改架构或内核,也不会产生额外部署开销。实验结果表明,Q-ROAR将模型在长上下文任务上的困惑度降低了14%以上,同时保留了短上下文性能、推理吞吐量,且与现有LLM系统栈兼容。

英文摘要:

Extending the context window support of large language models (LLMs) is crucial for tasks with long-distance dependencies. RoPE-based interpolation and extrapolation methods, such as linear scaling and frequency-aware schemes, enable longer input length support without retraining, while post-training quantization (PTQ) makes deployment practical. However, we show that combining RoPE position interpolation (PI) with PTQ degrades accuracy due to coupled effects including long-context aliasing, dynamic-range dilation, anisotropy from axis-aligned quantizers vs. rotated RoPE pairs, and outlier shifting that produces position-dependent logit noise. We provide, to the best of our knowledge, the first systematic analysis of the PI+PTQ approach and introduce two practical diagnostics: interpolation pressure (per-band sensitivity to phase scaling) and tail-inflation ratios (outlier shift from short to long contexts). Following the analysis results, we propose Q-ROAR (Quantization, RoPE-interpolation, and Outlier Aware Rescaling), a weight-only, interpolation-aware stabilization of PI for quantized LLMs. Q-ROAR groups RoPE dimensions into a small number of frequency bands and performs a lightweight search over per-band scales for Key and Query weights (with an optional symmetric variant to preserve logit scale). The search is guided by our diagnostics and uses a tiny long-context development dataset, requiring no fine-tuning to the model, no architecture or kernel changes, and no additional deployment overhead. Empirically, Q-ROAR reduces the model's perplexity on long-context workloads by more than 14%, while preserving short-context performance, inference throughput, and compatibility with existing LLM system stacks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑