NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CODE: Contrasting Self-generated Description to Combat Hallucination in Large Multi-modal Models

Junho Kim, Hyunjun Kim, Yeonju Kim, Yong Man Ro

Introduction

Large Multi-modal Models (LMMs), such as LLaVA and InternVL, have demonstrated remarkable capabilities in visual reasoning and dialogue. However, these models frequently suffer from "hallucinations"—generating factually incorrect information or describing objects not present in the visual input. This phenomenon is often driven by strong language priors, where the model's internal language engine predicts a likely sequence of words based on common patterns (e.g., "a dog catching a frisbee") rather than the actual visual evidence (e.g., a dog merely holding a frisbee).

To address this, we introduce CODE (COuntering DEscription Contrastive Decoding), a training-free, plug-and-play decoding strategy designed to suppress language-driven hallucinations by leveraging the model's own self-generated descriptions as a flawed reference point.

Methodology: The Model as Its Own Amateur

CODE is built upon the principle of Contrastive Decoding (CD). Traditionally, CD involves contrasting a "strong" expert model with a "weak" amateur model to amplify high-quality, specific information. CODE innovates by forcing the LMM to act as its own amateur through a multi-step process:

  1. Self-Generated Description: The model first generates a detailed description of the image. Because LMMs are prone to hallucinations, this description often encapsulates the very language biases the system aims to eliminate.
  2. Contrastive Logits: During the primary task (e.g., answering a user query), the model calculates two sets of logits: one conditioned on the actual visual tokens ($v$) and another conditioned on the self-generated text description ($d$).
  3. Dynamic Restriction (DR): To prevent over-correction, CODE employs "Bounded Divergence" to measure the difference between image-based and description-based predictions. If the predictions are too similar, the contrast is amplified to extract subtle visual truths.
  4. Adaptive Information Constraint (AIC): This mechanism dynamically filters the candidate token pool, ensuring that the model does not inadvertently reward low-probability "noise" tokens simply because they were absent in the description.
Overview of the CODE framework: The model generates a description to serve as a contrastive reference, allowing it to distinguish between visual evidence and language priors.

Experimental Setup and Datasets

The effectiveness of CODE was evaluated across six state-of-the-art LMMs, including LLaVA-1.5, LLaVA-NeXT, Yi-VL, and InternVL 1.5. The evaluation spanned several rigorous benchmarks:

  • Discriminative Benchmarks: POPE (object existence), MMVP (fine-grained visual patterns), and RealworldQA.
  • Generative Benchmarks: LLaVA-QA90, LLaVA-Bench, and MMHal-Bench (specifically designed to measure hallucination rates).

Key Results

CODE consistently outperformed standard decoding methods (Greedy, Nucleus sampling) and existing contrastive techniques like VCD and OPERA across all tested models and benchmarks.

  • Hallucination Reduction: On the MMHal-Bench, CODE achieved the lowest hallucination ratios, effectively filtering out "plausible" but incorrect responses. For example, while a standard model might identify a yogurt brand as "Yoplait" due to language frequency, CODE correctly identifies the visual evidence for "Fage" by contrasting it against the generic text-only prediction.
  • Generative Excellence: In the LLaVA-QA90 benchmark, CODE improved performance scores by up to 13.7% compared to other contrastive methods, demonstrating that it enhances factual accuracy without sacrificing conversational quality.
Radar charts comparing CODE against various decoding baselines across multiple benchmarks and model families.

Discussion and Limitations

The primary strength of CODE lies in its training-free integration. It can be applied to any existing LMM without the need for expensive retraining or additional "expert" models. By treating the model's own text descriptions as "lossy" counterparts to raw pixels, CODE effectively identifies where the model is "guessing" versus "seeing."

However, the method does introduce computational overhead, as it requires an initial description generation step and multiple forward passes to calculate contrastive logits. Furthermore, the performance of CODE is partially dependent on the quality of the initial self-generated description; if the description is either perfectly accurate or completely irrelevant, the contrastive benefit may diminish. Future work will explore integrating external knowledge sources to further refine the contrastive reference.

Summary updated

BibTeX
@inproceedings{kim2024code,
  author = {Junho Kim and Hyunjun Kim and Yeonju Kim and Yong Man Ro},
  title = {{CODE: Contrasting Self-generated Description to Combat Hallucination in Large Multi-modal Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=g6nn2AijDp},
}
Figure