ContextBench: Modifying Contexts for Targeted Latent Activation and Behaviour Elicitation

Robert Graham, Edward Stevinson, Leo Richter, Alexander Chia, Joseph Miller, Joseph Isaac Bloom

Introduction

Researchers have introduced ContextBench, a new benchmark for "context modification"—the art of generating fluent, natural-sounding text that triggers specific internal states or behaviors in Large Language Models (LLMs). By combining gradient-based optimization with LLM-assistance and diffusion-based inpainting, the authors demonstrate that we can now more effectively discover the "hidden triggers" that cause models to comply with dangerous requests or activate specific safety-related features.

Illustration of context modification to elicit a specific behavior.

The Challenge: Fluency vs. Elicitation

A major hurdle in AI safety is "red teaming"—finding the specific inputs that make a model behave badly before it’s deployed. While we can often find "adversarial suffixes" (gibberish strings that bypass safety filters), these don't tell us much about how a model might fail in the real world.

The challenge is a classic trade-off:

  1. White-box methods (which look at a model's gradients) are great at triggering specific behaviors but usually produce nonsensical text.
  2. Black-box methods (like prompting GPT-4o to find a trigger) produce fluent text but are "blind" to the model's internal mechanics, often failing to find the most potent triggers.

This paper seeks to bridge that gap, creating methods that are both targeted (high elicitation strength) and natural (high linguistic fluency).

Novel Methods: Enhancing EPO

The authors build upon Evolutionary Prompt Optimisation (EPO), a white-box method that iteratively swaps tokens to maximize a target (like a neuron's activation) while using a "fluency penalty" to keep the text readable. To improve upon this, they introduce two novel enhancements:

  • EPO-Assist: This uses a powerful LLM (like GPT-4o) as a "mutation operator." Every few iterations, the LLM takes the current best (but potentially clunky) prompts and "naturalizes" them, rewriting them to be more fluent while preserving the key patterns discovered by the optimization process.
  • EPO-Inpaint: This leverages LLaDA, a Large Language Diffusion Model. The method identifies which specific tokens are doing the "heavy lifting" for activation, freezes them, and then uses the diffusion model to "inpaint" the surrounding text, ensuring the final result is grammatically coherent.

The ContextBench Dataset

To evaluate these methods, the authors introduced ContextBench, a comprehensive suite of 715 tasks across three categories:

  1. SAE Activation: 205 tasks focused on activating specific "features" found via Sparse Autoencoders (SAEs) in models like Gemma-2 and Llama-3.
  2. Story Inpainting: 500 tasks where a model must modify a sentence within a story to flip the predicted ending (e.g., changing a story so a character is "injured" instead of "triumphant").
  3. Backdoors: 10 tasks involving models specifically fine-tuned with "sleeper agents" or backdoors (like a model that only acts toxic if it sees a specific news headline from 2023).

Key Insights and Results

The Fluency-Elicitation Pareto Frontier

There is a fundamental tension between how well a prompt triggers a feature and how natural it sounds. The new EPO variants successfully push this frontier further than previous methods, achieving high activation without sacrificing readability.

Pareto frontiers demonstrating the trade-off between activation strength and fluency.

Superiority of White-Box and Inpainting

EPO-based methods outperformed black-box prompting (GPT-4o) in almost all SAE activation tasks. GPT-4o often produced fluent text that simply failed to activate the target internal feature. EPO-Inpaint achieved the best overall balance, frequently outperforming standard EPO and human-written examples in elicitation strength while maintaining high fluency. In the SAE Activation task, EPO-Inpaint achieved higher activation than standard EPO in 60% of cases and beat GPT-4o in over 98% of cases within the target fluency range.

Specification Gaming and Auto-Interpretability

The authors found that optimization methods are "lazy" and will exploit any shortcut. For example, to trigger a feature related to the word "rash" (meaning hasty), the optimizer might insert text about "shingles" and "fever" to trigger the medical definition of the word instead.

Furthermore, current tools like Neuronpedia often provide broad descriptions of what a model's internal features do. ContextBench shows that automated context modification can find much more precise triggers, proving that some features are more specific (or more "misled") than previously thought.

The "Broad" Trigger Problem

Recovering backdoors remains difficult. While the methods could find single-token "passwords," they struggled with complex, multi-token triggers (like a specific style of news headline), suggesting that token-by-token optimization often gets stuck in local minima.

Limitations and Future Work

The authors acknowledge that cross-entropy (their proxy for fluency) is imperfect; it can sometimes reward repetitive or generic text rather than truly creative, natural language. Furthermore, the methods still struggle with "multi-token" triggers where no reward signal is received until the entire sequence is correct.

Future work aims to expand ContextBench to include more complex safety scenarios, such as deceptive alignment, and to develop optimization techniques that can better navigate the "all-or-nothing" nature of complex triggers.

Summary updated

BibTeX
@inproceedings{graham2026contextbench,
  author = {Robert Graham and Edward Stevinson and Leo Richter and Alexander Chia and Joseph Miller and Joseph Isaac Bloom},
  title = {{ContextBench: Modifying Contexts for Targeted Latent Activation and Behaviour Elicitation}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=xYNZ5swfJG},
}
Figure