CALM: Curiosity-Driven Auditing for Large Language Models

Xiang Zheng, Longxiang Wang, Yi Liu, Xingjun Ma, Chao Shen, Cong Wang

Introduction

Auditing black-box Large Language Models (LLMs) for harmful behaviors is a critical yet challenging task. As these models are increasingly deployed in high-stakes environments, identifying potential for toxic content generation, private information leakage, or hallucination is paramount. However, most commercial LLMs are "black boxes" accessible only via APIs, preventing auditors from using internal gradients or parameters to find vulnerabilities.

Traditional black-box auditing relies on manual prompt engineering, which is labor-intensive and often fails to explore the vast input space effectively. Automated approaches often struggle with the "sparse reward" problem: adversarial prompts that trigger specific bad behaviors are rare, making it difficult for standard reinforcement learning (RL) agents to learn.

The CALM Framework

To address these challenges, we introduce CALM (Curiosity-Driven Auditing for Large Language Models). CALM fine-tunes a small "auditor" LLM (e.g., GPT-2) using Proximal Policy Optimization (PPO) to generate adversarial prompts. The core innovation lies in its use of intrinsically motivated RL through a novel token-level curiosity bonus.

Curiosity-Driven Exploration

CALM employs two types of rewards:

  1. Extrinsic Reward: Awarded when the target LLM produces a specific undesirable output (e.g., a toxic word or a sensitive name).
  2. Intrinsic Reward (Curiosity): Rewards the auditor for generating tokens in previously unexplored regions of the embedding space.

This intrinsic bonus, inspired by policy cover theory and implemented via a method similar to Random Network Distillation, prevents the auditor from repeating failed prompts. By rewarding novelty at the token level, CALM forces the model to continuously explore the prompt space until it identifies the target model's vulnerabilities.

Experimental Evaluation

CALM was evaluated on its ability to trigger "Toxic Completion" (using an NSFW word list) and "Inverse Suffix Generation" (leaking specific names from a "NameSet" of U.S. Senators). The framework was tested against several target models: GPT-2, Dolly-2-7B, Llama-2-7B, and Llama-3-8B.

Performance and Efficiency

CALM significantly outperforms standard RL and other curiosity-based baselines. In toxic completion tasks, CALM exceeded baseline success rates by over 35% on GPT-2 and 50% on Llama-3-8B during the early stages of training.

Auditing Objective across different target models. CALM (blue) consistently achieves higher success rates and faster convergence compared to standard RL (orange).

As shown in the figure above, CALM demonstrates remarkable efficiency, reaching a 50% success rate on Llama-3-8B in just $1 \times 10^4$ queries and exceeding 80% success by $1.5 \times 10^4$ queries.

Exploration and Coverage

The effectiveness of the curiosity bonus is further evidenced by the diversity of vulnerabilities discovered. CALM achieves much higher "Set Coverage" (the number of unique target behaviors triggered) than vanilla RL, particularly in the more challenging Llama-3-8B model.

L0 Norm of Set Coverage across target models. CALM's curiosity-driven approach explores a wider range of the target model's vulnerabilities.

Key Insights

  • Efficiency of Small Auditors: A lightweight model like GPT-2, when properly motivated by curiosity, can effectively audit much larger "Goliath" models like Llama-3-8B.
  • Token-Level Granularity: Token-level intrinsic bonuses are more effective than sentence-level diversity scores for the sequential nature of LLM generation, providing a more stable training signal.
  • Robustness: By using simple word-matching classifiers for rewards rather than complex neural networks, the auditing loop remains transparent and resistant to evasion by the target model.

Conclusion and Future Work

CALM provides a powerful, automated framework for black-box LLM auditing. While currently using GPT-2 as an auditor, future iterations could leverage more sophisticated open-source models to generate even more complex adversarial prompts. Additionally, further research will compare CALM against a broader range of evolutionary black-box optimization algorithms to further establish its state-of-the-art performance.

Summary updated

BibTeX
@inproceedings{zheng2025calm,
  author = {Xiang Zheng and Longxiang Wang and Yi Liu and Xingjun Ma and Chao Shen and Cong Wang},
  title = {{CALM: Curiosity-Driven Auditing for Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i26.34991},
}
Figure