arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.40055cs.LGcs.AIcs.CL
收藏

单个向量还是多个?量化下的聚类最优传输引导

One Vector or Many? Clustered Optimal-Transport Steering under Quantization

National University of Kyiv-Mohyla Academy(基辅-莫希拉国立大学)

Illia Makarov

AI总结:

该研究探究量化下聚类最优传输引导与类别均值差(DiM)的差异,发现差异化处理token的变体在毒性缓解上优于DiM,且在INT8、NF4量化下仍有效,其作用仍待进一步验证。

摘要:

激活引导通过在推理时编辑语言模型的隐藏状态来改变其生成内容,最常见的形式是向每个隐藏状态添加一个向量,即类别均值差(DiM)。CHaRS(概念异质性感知表示引导)采用最优传输替代方法:熵计划将两个类别的聚类配对,每个隐藏状态沿聚类位移的混合移动,权重偏向其最近的聚类。我们在Gemma-2-2B和Granite-3.1-2B中研究这类用于毒性缓解的聚类最优传输映射,探究该计划相较于DiM的增益,以及其在INT8和NF4量化下是否仍有效。我们证明了一个恒等式:无论计划如何,以聚类大小为权重平均的位移等于DiM,因此聚类映射与DiM的差异仅存在于路由权重偏离聚类大小的token。在CHaRS协议中,这些权重与聚类大小接近,在所有8个预先指定的等价测试中,CHaRS与在每一层添加DiM的Mean-AcT统计等价。一种针对单个token拟合的变体,其将每个token主要路由至最近的聚类,在引导强度为3(使用toxic-bert)时,相较于DiM,在Gemma上减少37-39%的毒性,在Granite上减少51-61%的毒性,而DiM已能去除76-85%的毒性。另外两个毒性分类器证实了Granite上的增益,但在Gemma上仅一个分类器支持该结果。在相同强度下,该变体的困惑度略高,但在匹配毒性水平时,其比DiM更流畅。然而,来自相同聚类的近乎恒定映射也能减少约30%的毒性,因此对token进行差异化处理的作用仍待探究。在INT8和NF4量化下,该变体仍比DiM减少更多毒性,且将其从全精度模型迁移至NF4模型而非重新拟合,经多重检验校正后不会增加显著毒性。

英文摘要:

Activation steering changes what a language model generates by editing its hidden states at inference time. Its most common form adds one vector, the difference of class means (DiM), to every hidden state. CHaRS (concept heterogeneity-aware representation steering) uses optimal transport instead: an entropic plan pairs the clusters of the two classes, and each hidden state moves along a mixture of the cluster displacements, weighted toward its nearest clusters. We study this family of clustered optimal-transport maps for toxicity mitigation in Gemma-2-2B and Granite-3.1-2B, and ask what the plan adds to DiM and whether that survives INT8 and NF4 quantization. We prove an identity: whatever the plan, the displacements averaged with the cluster sizes as weights equal DiM, so a clustered map can differ from DiM only for tokens whose routing weights depart from the cluster sizes. In the CHaRS protocol they stay close, and CHaRS is statistically equivalent to Mean-AcT, which adds DiM at every layer, in all eight pre-specified equivalence tests. A variant fitted on individual tokens, which routes each token mainly to its nearest clusters, leaves 37-39% less toxicity than DiM on Gemma and 51-61% less on Granite at steering strength 3 (toxic-bert), where DiM already removes 76-85% of it. Two other toxicity classifiers confirm the gain on Granite, but on Gemma only one does. At equal strength the variant has somewhat higher perplexity, but at matched toxicity it is slightly more fluent than DiM. Yet a nearly constant map from the same clusters also leaves about 30% less toxicity, so the role of treating tokens differently remains open. Under INT8 and NF4 the variant still leaves less toxicity than DiM, and transferring it from full precision to the NF4 model instead of refitting it adds no significant toxicity after correction for multiple tests.

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

↑