用分布损失端到端调控模型激活,低成本实现风格与安全控制
LinEAS: End-to-end Learning of Activation Steering with a Distributional Loss
- 通过全局分布损失联合优化各层激活干预,提升鲁棒性
- 仅需少量无标注样本,毒性抑制效果超越基线,接近有监督方法
- 支持自动神经元选择,适用于文本、图像生成等多种模态
生成模型在日常应用中日益普及,亟需高效可控的生成干预机制,如生成安全内容或支持风格探索。理想方案应仅需少量无标注数据(无需显式偏好),且训练与推理成本低,同时保持输出质量。现有研究发现,仅干预模型激活即可实现此类控制,目标是修正源集(如有毒语句)与目标集(如非毒语句)提示下激活分布的差异。然而,这些快速方法本质粗略:其映射仅局部优化,未考虑对下游层的影响,导致外推时产生意外偏差。本文提出线性端到端激活调控(LinEAS),采用全局损失联合建模所有层的分布偏移。该损失可引入稀疏正则项,实现自动神经元选择。LinEAS仅需少量无标注样本即有效,在语言模型毒性抑制任务中优于同类基线,表现媲美依赖强监督的“神谕”方法。该方法具备模态无关性,实验表明其在单步文生图模型中,对概念消减与引入均优于现有激活调控方法。
原文摘要 · Abstract (English)
The growing use of generative models in daily life calls for efficient mechanisms to control their generation, to e.g., produce safe content or provide users with tools to explore style changes. Ideally, such mechanisms should require low volume of unpaired data (i.e., without explicit preference), and should be cheap, both at train and inference time, while preserving output quality. Recent research has shown that such mechanisms can be obtained by intervening exclusively on model activations, with the goal of correcting distributional differences between activations seen when using prompts from a source vs. a target set (e.g., toxic and non-toxic sentences). While cheap, these fast methods are inherently crude: their maps are tuned locally, not accounting for their impact on downstream layers, resulting in interventions that cause unintended shifts when used out-of-sample. We propose in this work linear end-to-end activation steering (LinEAS), an approach trained with a global loss that accounts simultaneously for all layer-wise distributional shifts. In addition to being more robust, the loss used to train LinEAS can be regularized with sparsifying norms, which can automatically carry out neuron selection. LinEAS only requires a handful of unpaired samples to be effective, and beats similar baselines on toxicity mitigation in language models, becoming competitive with oracle-dependent methods that have access to strong supervision. LinEAS is modality-agnostic and we empirically find that it outperforms existing activation steering methods at mitigating and including new concepts at the output of single-step text-to-image generation models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。