Reflector: Internalizing Step-wise Reflection against Indirect Jailbreaks

Jiachen Ma, Jiawen Zhang, Xiangtian Li, Bo Zou, Chaochao Lu, Chao Yang

While Large Language Models (LLMs) demonstrate remarkable capabilities, their safety mechanisms are often superficial. Standard alignment techniques, such as Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO), typically act as gatekeepers. They train models to recognize and refuse harmful prompts at the very beginning of a response. However, sophisticated attackers have developed a workaround: indirect jailbreaks.

To address these vulnerabilities, researchers have introduced Reflector, a principled two-stage framework that internalizes self-reflection directly within the model's generation trajectory. By teaching models a "search-and-recovery" process, Reflector achieves a defense success rate exceeding 90% while surprisingly boosting the model's performance on complex math and logic benchmarks.

The Threat: Trajectory-Level Risks and Stealthy Latency

In an indirect jailbreak, the initial prompt appears benign, but the model is coerced into a multi-step reasoning process that eventually reconstructs harmful content. The researchers identify a phenomenon called "stealthy latency," where malicious tokens emerge 20 to 30 tokens deep into the generation rather than at the start.

Because the harm does not manifest immediately, prefix-based, surface-level defenses fail. The model's own reasoning capabilities are effectively weaponized against its safety filters. Existing defenses either guard the initial "gate" too narrowly or rely on external monitors that add significant latency and computational overhead.

The Reflector Framework: A Two-Stage Defense

Reflector overcomes the limitations of surface alignment by embedding safety directly into the model’s "inner monologue." It achieves this through a dual-phase training paradigm:

Stage I: Reflection Capability Injection (SFT)

Base models are not naturally adept at catching their own mid-generation errors. To solve this, the researchers utilized a high-capacity teacher model (GPT-5) to generate a specialized dataset of "reflection trajectories." In this supervised fine-tuning (SFT) phase, the model learns to recognize a "strategic truncation" point when a response is veering into unsafe territory. It then uses <|reflect|> tags to analyze why the current path is unsafe, followed by <|explore|> tags to map out a safe alternative.

Stage II: Dual-Reward Enhancement (RL)

To move beyond simple imitation and instill robust, autonomous self-reflection, the framework employs a variant of Reinforcement Learning called GDPO (Group reward-Decoupled Normalization Policy Optimization). This stage utilizes a dual-reward system:

  • Safety Reward: A binary score based on whether the final output is genuinely safe, as judged by an ensemble of classifiers.
  • Reflection Bonus: A fine-grained reward that incentivizes the model to reflect only when necessary and effective. If the model reflects but still outputs harmful content, it is heavily penalized.

Key Insights and Performance Breakthroughs

The research team evaluated Reflector across a rigorous suite of safety and utility benchmarks (including BeaverTails, AdvBench, StrongREJECT, and WildChat) and tested it against four major indirect attack methodologies: DRA, PAP, ReNeLLM, and DrAttack.

Unprecedented Defense Success

Reflector achieved a Defense Success Rate (DSR) exceeding 90% against complex indirect attacks on both Llama-3.1-8B and Qwen-2.5-7B architectures. For context, the original Llama-3.1-8B-Instruct model demonstrated a DSR of only ~10% against the DRA attack.

Reversing the "Alignment Tax"

Traditionally, making a model safer makes it more prone to refusal and less capable at complex tasks—a phenomenon known as the alignment tax. Reflector does the exact opposite. By teaching the model to monitor its own reasoning for safety, it inadvertently learns a general-purpose "monitor and correct" skill. This resulted in a 5.85% absolute gain on the GSM8K math benchmark and new performance peaks on the MMLU-Pro knowledge benchmark.

True Internalization

A common concern with "Chain-of-Thought" safety is that models merely learn to parrot safety tags without understanding them. The authors conducted a "token suppression" test, forcing the model to generate responses without the <|reflect|> tags. The model remained safe, proving that the safety logic was deeply internalized into the model's weights, not just tied to surface-level text templates.

Limitations and Future Directions

While Reflector offers a highly efficient and scalable solution for safe LLM development, it is not without limitations. The initial SFT stage relies heavily on a high-quality teacher model to provide gold-standard reflection data; it remains unclear how effectively this framework could be implemented using weaker models for data synthesis.

Additionally, although the RL stage optimizes generation trajectories, the model still produces more tokens than a standard refusal when it chooses to reflect and redirect, marginally increasing inference costs. Finally, as defenses evolve, so do attackers. Future research will need to investigate adaptive adversaries that might attempt to stealthily bypass the reflection mechanism itself.

Summary updated

BibTeX
@inproceedings{ma2026reflector,
  author = {Jiachen Ma and Jiawen Zhang and Xiangtian Li and Bo Zou and Chaochao Lu and Chao Yang},
  title = {{Reflector: Internalizing Step-wise Reflection against Indirect Jailbreaks}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=y5kHeBZgVn},
}
Figure