arXiv:2508.15068cs.AI2025-08被引 1

通过分析模型微调更新,自动剪枝不安全层,提升智能体规划安全性。

S3LoRA: Safe Spectral Sharpness-Guided Pruning in Adaptation of Agent Planner

  • 仅分析微调权重变化,无需原始模型或标注数据。
  • 识别高集中度危险更新层,剪枝后安全提升30%以上且性能不降。
  • 适合资源受限场景下的AI智能体安全部署,无需复杂依赖。

使用参数高效微调(PEFT)技术如LoRA适配大语言模型(LLM),可赋予基于LLM的智能体强大能力,但可能导致安全对齐失效,引发不安全或不稳定行为,尤其在智能体规划任务中。现有安全感知适配方法通常需访问基础模型和指令微调模型的检查点,但在实际中常不可用,限制了应用。本文提出S3LoRA(Safe Spectral Sharpness-Guided Pruning LoRA),一种轻量、无数据、与模型无关的框架,仅通过检查微调权重更新即可缓解安全风险。我们引入广义球面归一化奇异值分解(MAS-SVD),稳健分析LoRA更新的结构特性并保留全局幅度信息;设计谱锐度指数(SSI),用于检测具有高度集中且潜在危险的更新层,并在事后进行剪枝以降低风险,同时保持任务性能。大量实验与消融研究显示,S3LoRA在智能体规划和语言生成任务中均持续提升安全指标,维持或改善效用指标,并显著降低推理开销。结果表明,S3LoRA是真实世界中资源受限、安全关键环境下部署LLM智能体的一种实用且可扩展的解决方案。

原文摘要 · Abstract (English)

Adapting Large Language Models (LLMs) using parameter-efficient fine-tuning (PEFT) techniques such as LoRA has enabled powerful capabilities in LLM-based agents. However, these adaptations can unintentionally compromise safety alignment, leading to unsafe or unstable behaviors, particularly in agent planning tasks. Existing safety-aware adaptation methods often require access to both base and instruction-tuned model checkpoints, which are frequently unavailable in practice, limiting their applicability. We propose S3LoRA (Safe Spectral Sharpness-Guided Pruning LoRA), a lightweight, data-free, and model-independent framework that mitigates safety risks in LoRA-adapted models by inspecting only the fine-tuned weight updates. We first introduce Magnitude-Aware Spherically Normalized SVD (MAS-SVD), which robustly analyzes the structural properties of LoRA updates while preserving global magnitude information. We then design the Spectral Sharpness Index (SSI), a sharpness-aware metric to detect layers with highly concentrated and potentially unsafe updates. These layers are pruned post-hoc to reduce risk without sacrificing task performance. Extensive experiments and ablation studies across agent planning and language generation tasks show that S3LoRA consistently improves safety metrics while maintaining or improving utility metrics and significantly reducing inference cost. These results establish S3LoRA as a practical and scalable solution for safely deploying LLM-based agents in real-world, resource-constrained, and safety-critical environments.

模型安全剪枝LoRA

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。