arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.14443cs.SEcs.AI
收藏

基于规范的大语言模型测试

Specification-Based Testing of Large Language Models

Oregon State University(俄勒冈州立大学)

Kausar Moshood, Jace Bolante, Roshan Aditya Murali, Manish Motwani

AI总结:

本研究提出LEST框架,将LLM安全主张作为黑盒测试规范,结合Claude Opus 4.8和GPT-5.5的系统卡片等评估发现,基准提示不足以验证所有LLM安全行为,自动失败检测需人工验证,LEST实现了从安全文档到测试及反例的端到端可追溯。

摘要:

模型卡片、系统卡片和安全报告越来越多地记录大语言模型(LLM)的安全行为,但安全评估通常从预定义的基准开始,而非探究这些基准实际测试的是哪些已记录的主张。我们提出LEST(LLM Evaluation through Specification-driven Testing,基于规范驱动测试的LLM评估)框架,该框架将已记录的安全主张视为黑盒测试的规范。在LEST中,每个主张确定哪个基准提示测试它,以及拒绝遵守(Refuse-to-Comply)转换——即模型拒绝某一提示但遵守其变异版本的情况——是否构成反对该主张的证据。LEST会变异这些提示以寻找反例,手动验证每个候选反例,并将已验证的反例追溯到它们所矛盾的主张。我们使用Claude Opus 4.8和GPT-5.5的系统卡片,结合来自SORRY-Bench的97个种子提示,在心理健康与自我伤害、有害与暴力内容、公平性与偏见三个类别上对LEST进行评估。在56个已识别的安全主张中,29个(51.8%)是可通过提示测试的,但仅有17个(58.6%)被适用的基准提示所检验。两个模型均拒绝了超过95%的基准提示。在两个模型上评估1836个变异提示,自动响应分类器标记出312个候选拒绝遵守转换。然而,人工验证仅确认其中19个(6.1%)既保留意图又真正合规,表明自动评估大幅高估了行为失败。将这19个转换追溯到相关主张,发现9个涵盖主张中有6个存在反例,对于这些主张,拒绝是适用的预言。我们的结果表明,基准提示可能不足以验证所有已记录的LLM安全行为,自动失败检测需要人工验证。LEST提供了从自然语言安全文档到可执行测试及人工验证反例的端到端可追溯性。

英文摘要:

Model cards, system cards, and safety reports increasingly document LLM safety behaviors, yet safety evaluations typically start from predefined benchmarks rather than asking which documented claims those benchmarks actually test. We introduce LEST (LLM Evaluation through Specification-driven Testing), a framework that treats documented safety claims as specifications for black-box testing. In LEST, each claim determines which benchmark prompt tests it and whether a Refuse-to-Comply transition, where a model refuses a prompt but complies with its mutated version, counts as evidence against it. LEST mutates these prompts to search for counterexamples, manually validates each candidate, and traces validated counterexamples back to the claims they contradict. We evaluate LEST using the system cards of Claude Opus 4.8 and GPT-5.5 with 97 seed prompts from SORRY-Bench across Mental Health and Self-Harm, Harmful and Violent Content, and Fairness and Bias. Of 56 identified safety claims, 29 (51.8%) are prompt-testable, but only 17 (58.6%) are exercised by an applicable benchmark prompt. Both models refuse >95% of benchmark prompts. Evaluating 1,836 mutated prompts on both models reveals 312 candidate Refuse-to-Comply transitions flagged by automated response classifiers. However, human validation confirms only 19 (6.1%) as both intent-preserving and genuinely compliant, showing automated evaluation substantially overestimates behavioral failures. Tracing these 19 transitions back to the claims reveals counterexamples for 6 of 9 covered claims for which refusal is an applicable oracle. Our results show that benchmark prompts may not be sufficient to validate all documented LLM safety behavior, and automated failure detection requires manual validation. LEST provides end-to-end traceability from natural-language safety documentation to executable tests and human-validated counterexamples.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑