TL;DR
POLARIS bridges the gap between formal software testing and AI safety by automatically converting natural-language safety policies into First-Order Logic representations. By exploring these rules as a unified semantic graph, it systematically generates diverse, highly effective adversarial test queries that are fully traceable back to specific policy clauses.
What Problem Does This Paper Address?
Evaluating the safety of Large Language Models (LLMs) currently relies on two main approaches: static benchmarks (like AdvBench) and dynamic red-teaming. However, both suffer from a critical verification gap:
- Static benchmarks are expensive to build, prone to data contamination, and quickly become obsolete as models evolve.
- Dynamic red-teaming uses heuristic or adversarial LLMs to find flaws, but it probes the model blindly without a systematic map of the policy space.
Crucially, neither approach offers traceability or coverage guarantees. They can tell you that a model failed, but they cannot prove which specific policy clauses were tested, nor can they systematically ensure that the entire boundary of prohibited behavior has been explored.
Methods
The authors introduce POLARIS (POlicy-guided Logic-Assisted Red-teaming and Instantiation System), a framework inspired by specification-based software testing. Instead of guessing how a model might fail, POLARIS uses the safety policy itself as a blueprint to systematically generate attacks.
The pipeline consists of three main stages:
- Policy-to-Logic Compilation: Unstructured safety policies are broken down into atomic rules and translated into First-Order Logic (FOL) axioms called Abstract Violation Templates (AVTs). This creates a machine-verifiable link between high-level rules and test cases.
- Semantic Policy Graph Construction: These logical axioms are mapped into a heterogeneous graph of entities and actions. POLARIS then "densifies" this graph using embedding-based merging (unifying synonyms like "user" and "client") and LLM-driven link prediction to uncover implicit, multi-hop compositional risks (e.g., connecting a "Chemistry Lab" to "Precursor Chemicals").
- Graph-Guided Query Instantiation: Controlled random walks traverse the graph to sample violation pathways. A generator LLM then instantiates these abstract paths into natural-language queries, applying context injection (wrapping the attack in a benign setting like "creative writing") and intent masking to bypass model defenses.
Datasets
To evaluate POLARIS, the authors constructed a normative framework compiling 16 distinct safety policies from 9 leading AI corporations (including OpenAI, Google, Meta, and Anthropic) alongside 4 pivotal regulatory documents from China.
The generated test suites were evaluated against six target LLMs (including Llama-3.1, Mistral, and Qwen-7B) and compared against several established static benchmarks and dynamic baselines:
- AdvBench
- AirBench 2024
- HarmBench
- JBB-Behaviors
- SORRY-Bench
- SOS-Bench
- Curiosity-driven Red-Teaming (dynamic baseline)
Key Insights and Ideas
- Inverting the Shield: The core philosophical insight is that a safety policy, while designed as a shield, explicitly defines the exact boundary an attacker must cross. Formalizing the policy allows you to systematically invert it into targeted test cases.
- Compositional Risk Discovery: Traditional red-teaming often tests single policy violations. By using a semantic graph, POLARIS uncovers complex, multi-policy violation pathways that human experts or simple heuristics might miss.
- Traceability is Paramount: Because every test query is generated from a specific path in the logical policy graph, developers don't just see that a model failed—they know exactly which clause of their corporate or regulatory policy was violated.
Key Results
POLARIS demonstrated substantial improvements in both coverage and attack efficacy over existing methods:
- 100% Policy Clause Coverage: POLARIS successfully exercised every single unique policy rule in the knowledge base, a feat baseline datasets failed to achieve.
- Higher Attack Success Counts: Across almost all target models, POLARIS uncovered significantly more total violations than baseline methods. On modern models like Mistral-7B and Qwen-7B, POLARIS achieved a 4× to 6× improvement in attack success counts over the strongest baseline, AirBench 2024.
- High Efficiency and Low Cost: Generating a massive batch of 28,660 queries cost a total of $70.52, averaging just $2.47 per 1,000 queries. Once the one-time cost of building the Semantic Policy Graph is paid, continuous query instantiation drops to a marginal cost of $0.94 per 1,000 queries.
Limitations and Future Work
The authors note two primary limitations of the current framework:
- Policy Dependency: POLARIS is bound by a "garbage-in, garbage-out" constraint; the quality and comprehensiveness of the generated test suite are fundamentally dependent on the clarity and completeness of the input natural-language policies.
- Static, Single-Turn Interactions: The current implementation only tests single-turn prompts. The authors highlight extending this logical formalism to handle the stateful, emergent risks of multi-turn dialogues and autonomous AI agents as a crucial direction for future research.
Summary updated