RODS: Robust Optimization Inspired Diffusion Sampling for Detecting and Reducing Hallucination in Generative Models

Yiqi Tian, Pengfei Jin, Mingze Yuan, Na Li, Bo Zeng, Quanzheng Li

Introduction

Despite their ability to generate stunning, high-fidelity images, diffusion models remain vulnerable to "hallucinations"—outputs that are anatomically impossible (like six-fingered hands) or semantically nonsensical. These errors typically occur because the model's "score function" (the guide dictating how to denoise an image) is imperfect. When the sampling path wanders into low-density regions rarely seen during training, the guide becomes unreliable. Standard samplers blindly follow these erroneous directions, leading the trajectory off-manifold.

Current solutions often require expensive retraining, fine-tuning, or heavy-handed filtering that can reduce image diversity. To address this, researchers introduce RODS (Robust Optimization-inspired Diffusion Sampler), a plug-and-play method that treats diffusion sampling as a "cautious" optimization process. By detecting high-risk sampling steps through local curvature analysis and applying robust updates, RODS identifies over 70% of hallucinations and corrects more than 25% of them—all without retraining the model or significantly increasing inference time.

Reinterpreting Sampling as Optimization

RODS reinterprets diffusion sampling through the lens of numerical optimization. Specifically, it views sampling as a "continuation method"—a technique where a sequence of gradually harder problems is solved to reach a final goal.

RODS Framework Overview

RODS introduces two key components to the standard sampling loop:

  1. Curvature Change Detection: Instead of blindly stepping forward, RODS calculates a "hallucination index" $H(x)$ that measures the local curvature of the score field. A spike in curvature signals that the model is entering an unstable, high-risk region prone to hallucinations.
  2. Robust Updates: Upon detecting a high-risk region, RODS switches from a standard step to a robust update. It "probes" the surrounding neighborhood to find the worst-case perturbation and adjusts the sampling direction to neutralize that instability. The authors propose two variants: Sharpness-Aware Sampling (SAS) and Curvature-Aware Sampling (CAS), with CAS proving particularly effective.

Key Insights

  • The "Cautious Climber" Analogy: If standard samplers are like climbers descending a mountain in dense fog by blindly following the local slope, RODS acts like a cautious climber who probes the ground for hidden cliffs before taking a step.
  • Geometric Signatures of Hallucinations: Hallucinations are not merely random bad luck; they are preceded by measurable geometric changes in the score landscape. This allows for real-time detection during generation rather than relying on post-generation filtering.
  • The "Middle" Matters Most: The most critical steps for hallucination occur in the middle of the sampling trajectory (roughly 10% to 50% into the process). By targeting these specific steps, RODS remains computationally efficient.
  • Direction Over Step Size: Simply increasing the number of sampling steps (e.g., from 40 to 200) does not fix the problem if the underlying direction is fundamentally wrong. RODS corrects the direction itself.

Experimental Results

The researchers evaluated RODS on three diverse benchmarks using pre-trained EDM (Elucidating the Design Space of Diffusion Models) checkpoints: AFHQv2 (animal faces), FFHQ (human faces), and 11k-hands (a stress test for complex joint structures).

Visual Results and Detection Confusion Matrix
  • High Detection Rate: On the AFHQv2 dataset, RODS-CAS successfully detected 87.5% of labeled hallucinations.
  • Effective Correction: On the challenging 11k-hands dataset, RODS improved the correction rate to 26.3% (compared to 17.7% for the advanced Heun sampler) while introducing zero new hallucinations.
  • Efficiency: RODS adds minimal overhead. For instance, on the hands dataset, it took 4.82 seconds per batch, compared to 2.71s for a basic Euler sampler and a sluggish 13.76s for a 200-step Euler solver.
  • Quality Preservation: Unlike methods that blur images or reduce variety, RODS maintained comparable FID (Fréchet Inception Distance) scores, ensuring outputs remained high-quality and diverse.

Limitations and Future Work

While RODS represents a significant step forward in robust generative modeling, the authors note areas for future improvement. First, while the curvature index is a strong signal for instability, more precise spatial localization could yield even higher correction rates. Second, balancing interventions is delicate: early-stage corrections tend to alter global structure (like head pose), whereas late-stage corrections refine local details. Finally, future research could extend RODS beyond image generation to text-to-image models (like Stable Diffusion) or video generation, where temporal hallucinations remain a major hurdle.

Summary updated

BibTeX
@inproceedings{tian2025rods,
  author = {Yiqi Tian and Pengfei Jin and Mingze Yuan and Na Li and Bo Zeng and Quanzheng Li},
  title = {{RODS: Robust Optimization Inspired Diffusion Sampling for Detecting and Reducing Hallucination in Generative Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=fhuqIxoPcr},
}
Figure