为教育场景下的大模型提供防越狱与微调攻击的统一防护方案
Unified Defense for Large Language Models against Jailbreak and Fine-Tuning Attacks in Education
- 通过注意力重分配、多层安全判断和双路由机制,同时防御越狱与微调攻击
- 在8种越狱攻击下保持高安全性,且不误拒正常请求;在3个微调数据集上均有效防御有害查询
- 专为教育场景设计,适配教师、教育平台开发者及AI安全研究者
大型语言模型(LLMs)正广泛应用于教育场景,但易受越狱和微调攻击威胁,导致安全对齐失效并生成有害内容。现有研究多关注通用安全评估,缺乏对教育场景独特安全需求的关注。为此,我们构建了EduHarm基准,包含五个典型教育场景的安全部分指令对,支持对教育类LLM进行系统性安全评估。同时提出三阶段防护框架(TSSF),可同时抵御越狱与微调攻击:首先,安全感知注意力重分配引导模型关注关键危险标记,恢复有害性特征;其次,层间安全判断通过聚合多层安全线索检测有害指令;最后,防御驱动双路由分离安全与危险查询,确保良性输入正常处理,恶意输入获得受控响应。在八种越狱攻击策略下的实验表明,TSSF显著提升安全性,同时避免对正常请求过度拒绝。在三个微调攻击数据集上的评估显示,其能持续抵御有害查询,同时保留良性微调带来的性能增益。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are increasingly integrated into educational applications. However, they remain vulnerable to jailbreak and fine-tuning attacks, which can compromise safety alignment and lead to harmful outputs. Existing studies mainly focus on general safety evaluations, with limited attention to the unique safety requirements of educational scenarios. To address this gap, we construct EduHarm, a benchmark containing safe-unsafe instruction pairs across five representative educational scenarios, enabling systematic safety evaluation of educational LLMs. Furthermore, we propose a three-stage shield framework (TSSF) for educational LLMs that simultaneously mitigates both jailbreak and fine-tuning attacks. First, safety-aware attention realignment redirects attention toward critical unsafe tokens, thereby restoring the harmfulness feature that discriminates between unsafe and safe inputs. Second, layer-wise safety judgment identifies harmfulness features by aggregating safety cues across multiple layers to detect unsafe instructions. Finally, defense-driven dual routing separates safe and unsafe queries, ensuring normal processing for benign inputs and guarded responses for harmful ones. Extensive experiments across eight jailbreak attack strategies demonstrate that TSSF effectively strengthens safety while preventing over-refusal of benign queries. Evaluations on three fine-tuning attack datasets further show that it consistently achieves robust defense against harmful queries while maintaining preserving utility gains from benign fine-tuning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。