arXiv:2510.20428cs.LG2025-10

提出一种语义感知采样法,用更少数据实现大模型安全修复

An Empirical Study of Sample Selection Strategies for Large Language Model Repair

  • 设计语义感知优先采样(SAPS)策略,聚焦关键有害样本
  • SAPS仅用少量数据即达最优去毒效果,比随机采样更高效
  • 适合追求低成本、高效率的模型安全维护团队使用

大型语言模型在实际系统中广泛应用,但常产生有毒或偏见输出,威胁安全与可信度。后处理修复提供可行方案,但参数更新成本高,需精选修复数据。尽管已有大量数据选择研究,但在大生成模型行为修复中的适用性仍不明确。本文系统分析五种样本优先级策略:随机采样、K-Center、基于梯度范数的选择(GraNd)、分层覆盖率(CCS),以及我们提出的语义感知优先采样(SAPS)。通过毒性降低、WikiText-2与LAMBADA上的困惑度,以及修复接近度评分(RPS)、综合性能评分(OPS)、修复效率评分(RES)三项复合指标评估效果。结果表明,SAPS在去毒、性能保持与效率间取得最佳平衡,以更少数据达成可比或更优修复效果。随机采样对大模型仍有效,而高开销方法如CCS和GraNd收益有限。最优数据比例依赖于模型规模与修复方法,说明样本选择应作为修复流程的可调组件。总体而言,基于选择的修复是维持大模型可靠性的高效且可扩展范式。

原文摘要 · Abstract (English)

Large language models (LLMs) are increasingly deployed in real-world systems, yet they can produce toxic or biased outputs that undermine safety and trust. Post-hoc model repair provides a practical remedy, but the high cost of parameter updates motivates selective use of repair data. Despite extensive prior work on data selection for model training, it remains unclear which sampling criteria are most effective and efficient when applied specifically to behavioral repair of large generative models. Our study presents a systematic analysis of sample prioritization strategies for LLM repair. We evaluate five representative selection methods, including random sampling, K-Center, gradient-norm-based selection(GraNd), stratified coverage (CCS), and a Semantic-Aware Prioritized Sampling (SAPS) approach we proposed. Repair effectiveness and trade-offs are assessed through toxicity reduction, perplexity on WikiText-2 and LAMBADA, and three composite metrics: the Repair Proximity Score (RPS), the Overall Performance Score (OPS), and the Repair Efficiency Score (RES). Experimental results show that SAPS achieves the best balance between detoxification, utility preservation, and efficiency, delivering comparable or superior repair outcomes with substantially less data. Random sampling remains effective for large or robust models, while high-overhead methods such as CCS and GraNd provide limited benefit. The optimal data proportion depends on model scale and repair method, indicating that sample selection should be regarded as a tunable component of repair pipelines. Overall, these findings establish selection-based repair as an efficient and scalable paradigm for maintaining LLM reliability.

大模型修复数据采样安全性效率优化

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