通过分析模型权重变化,实现对微调大模型的无监督监控与控制。
Watch the Weights: Unsupervised monitoring and control of fine-tuned LLMs
- 基于权重差异的奇异向量识别新行为模式。
- 检测后门攻击准确率100%,误报率低于1%。
- 适合安全审计和未公开训练数据的模型分析。
开源大语言模型(LLM)发布时常不提供完整训练数据。现有基于激活的可解释性方法通常需假设数据分布相似,难以应对后门等分布外威胁。本文提出一种基于权重而非激活的新方法,通过分析微调模型与基础模型间的权重差异,发现其主奇异向量对应新增行为。监测沿这些方向的激活余弦相似度,可高精度检测微调引入的显著行为。对于触发后门攻击,该方法可完全拦截(100%),误报率低于1%;对已遗忘内容,能以最高95.42%准确率检测推理,并可引导模型恢复被删除信息。此外,该方法可用于预部署审计:分析商业指令微调模型(OLMo、Llama、Qwen)时,揭示出数学解题、表情符号使用、Midjourney提示生成等特定微调重点。
原文摘要 · Abstract (English)
The releases of powerful open-weight large language models (LLMs) are often not accompanied by access to their full training data. Existing interpretability methods, particularly those based on activations, often require or assume distributionally similar data. This is a significant limitation when detecting and defending against novel potential threats like backdoors, which are by definition out-of-distribution. In this work, we introduce a new method for understanding, monitoring and controlling fine-tuned LLMs that interprets weights, rather than activations, thereby sidestepping the need for data that is distributionally similar to the unknown training data. We demonstrate that the top singular vectors of the weight difference between a fine-tuned model and its base model correspond to newly acquired behaviors. By monitoring the cosine similarity of activations along these directions, we can detect salient behaviors introduced during fine-tuning with high precision. For backdoored models that bypass safety mechanisms when a secret trigger is present, our method stops up to 100% of attacks with a false positive rate below 1%. For models that have undergone unlearning, we detect inference on erased topics with accuracy up to 95.42% and can even steer the model to recover "unlearned" information. Besides monitoring, our method also shows potential for pre-deployment model auditing: by analyzing commercial instruction-tuned models (OLMo, Llama, Qwen), we are able to uncover model-specific fine-tuning focus including mathematical problem solving, emoji usage, and Midjourney prompt generation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。