arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.15758cs.LGcs.CLmath.OC
收藏

语言模型激活的分布手术

Distributional Surgery for Language Model Activations

CUHK(香港中文大学);VinUniversity(文大学);UNC-Chapel Hill(北卡罗来纳大学教堂山分校)

Bao Nguyen, Binh Nguyen, Duy Nguyen, Viet Anh Nguyen

AI总结:

本文提出一种两阶段方法:先训练逐层分类器检测不良内容,再通过半定规划计算逐层分布引导策略以最小扰动注意力分布,从而在概率保证下缓解语言模型的有害输出生成。

摘要:

语言模型虽然能够生成高度连贯且看似准确的文本,但偶尔也会产生不良内容,包括有害或有毒的输出。本文提出了一种新的两阶段方法,通过修正激活来检测和缓解不良内容生成。首先,我们训练一组逐层分类器,通过最小化风险感知分数的平滑替代来利用激活检测不良内容。然后,对于检测到的不良内容,我们提出逐层分布引导策略来变换注意力头。这些策略通过有原则的半定规划计算得出,旨在最小程度地扰动注意力分布,同时以概率方式保证编辑的有效性。在多个语言模型和数据集上的实证评估表明,我们的方法在减少不良输出生成方面优于基线方法。

英文摘要:

Language models, while capable of generating remarkably coherent and seemingly accurate text, can occasionally produce undesirable content, including harmful or toxic outputs. In this paper, we present a new two-stage approach to detect and mitigate undesirable content generations by rectifying activations. First, we train an ensemble of layerwise classifiers to detect undesirable content using activations by minimizing a smooth surrogate of the risk-aware score. Then, for detected undesirable contents, we propose layerwise distributional steering policies that transform the attention heads. These policies are computed through principled semidefinite programming, which aims to minimally perturb the attention distribution while probabilistically guaranteeing the effectiveness of the editions. Empirical evaluations across multiple language models and datasets show that our method outperforms baselines in reducing the generation of undesirable output.

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

↑