编码器就足够了吗?面向大语言模型对抗评估的编码器与解码器安全评判器系统性比较 Do Encoders Suffice? A Systematic Comparison of Encoder and Decoder Safety Judges for LLM Adversarial Evaluation 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-06-24
👁️ 预览文献
💡 AI 中文简介
大语言模型的安全评估通常依赖大模型裁判,但速度慢、成本高。本研究测试了ModernBERT和Ettin等微调编码器分类器,看它们能否在识别有害输出时接近大模型裁判的性能。研究在多个开源对抗数据集上,对比了编码器与规则匹配、微调大模型分类器及多种大模型裁判方法。结果显示,编码器在保持较低延迟和成本的同时,能达到有竞争力的F1分数和低漏报率,为实际部署提供了高效替代方案。
领域自然语言处理/大语言模型安全与评估
适合谁读需要一定专业背景(了解大语言模型、分类器评估指标)
核心贡献1. 首次系统比较了现代编码器分类器与多种大模型裁判在LLM对抗安全评估中的表现;2. 提供了按攻击技术细分的性能分析,明确了编码器适用与不适用场景。
关键数据编码器分类器在多数攻击技术下F1分数与LLM裁判相当,但延迟和成本显著降低;具体数值未在摘要中给出。
推荐理由如果你关心如何低成本、低延迟地给大模型加安全护栏,这篇论文用扎实的对比实验告诉你编码器到底够不够用。
关键词["大语言模型安全", "对抗评估", "编码器分类器", "大模型裁判", "安全护栏", "性能基准"]

原文摘要

查看英文原文摘要

With the widespread adoption of large language models (LLMs) in chatbots and everyday applications, companies increasingly need guardrails that are effective while remaining low-cost and low-latency. Safety evaluation of LLM outputs has generally relied on LLM-based judges, which can be effective but are often slow and expensive to deploy at scale. In this paper, we evaluate whether fine-tuned modern encoder classifiers from the ModernBERT family, including ModernBERT and Ettin, can reliably identify harmful LLM outputs in user-model conversations without substantial performance loss relative to LLM-based judges. We benchmark these encoder classifiers against rule-based prefix matching, fine-tuned LLM classifiers, and LLM judges using a range of judge-prompting strategies across open-source adversarial datasets. The LLM judges include evaluation methodologies from StrongReject, ShieldGemma, JailbreakBench, AILuminate, SorryBench, and a Claude-as-a-judge setup, as well as fine-tuned safety classifiers such as LlamaGuard 3 and LlamaGuard 4. The encoder classifiers are fine-tuned on judge-labeled data using a majority-voting label strategy and are then evaluated on a gold-standard holdout dataset to assess their performance relative to LLM judges. We report absolute performance using F1 score, false negative rate, and precision-recall metrics. We also break down results by attack technique, including single-turn prompting, decomposition, escalation, and context manipulation, to identify where encoder classifiers align with or diverge from LLM-based judges. Our findings provide guidance on when encoder classifiers can serve as cost- and latency-efficient alternatives to LLM-based safety evaluation.