Alleviating Hallucinations in Large Vision-Language Models through Hallucination-Induced Optimization

Xinyu Lyu, Beitao Chen, Lianli Gao, Jingkuan Song, Heng Tao Shen

Introduction

The recent success of Large Vision-Language Models (LVLMs) marks a major milestone in artificial intelligence research OpenAI (2023); Alayrac et al. (2022); Li et al. (2023a); Liu et al. (2023d); Zhu et al. (2023); Bai et al. (2023); Dai et al. (2023); Wang et al. (2023b); Driess et al. (2023). By seamlessly integrating visual cues with Large Language Models (LLMs), LVLMs have demonstrated unparalleled expertise in multimodal comprehension, logical reasoning, and interactive engagement. This integration has ushered in a new era in AI, breaking through traditional limitations and enabling a more holistic understanding of complex information OpenAI (2023); Yang et al. (2023); Lu et al. (2023). Despite these advancements, certain challenges remain, particularly the issue of hallucination Li et al. (2023b); Gunjal et al. (2023); Liu et al. (2023b); Lovenia et al. (2023). Hallucination occurs when the language model generates content that deviates from the image’s actual content, including imagined objects, fabricated scenes, incorrect spatial relationships, and misidentified categories.

Substantial research efforts have been directed towards mitigating hallucinations in Large Vision-Language Models (LVLMs). These efforts include post-hoc correction methods that refine LVLM outputs after the fact Zhou et al. (2023) and self-correcting frameworks specifically designed to reduce object hallucinations Yin et al. (2023). Additionally, numerous decoding strategies have been developed to minimize hallucinations through the enhanced use of textual and visual priors Leng et al. (2023); Zhang et al. (2024); Favero et al. (2024); Zhu et al. (2024); Wang et al. (2024); Chen et al. (2024). These methods aim to alleviate hallucinatory tendencies by integrating visual uncertainty, thereby increasing the contrastive disparity between hallucinatory and target logits. For example, Leng et al. (2023) augment the hallucinatory effect by introducing Gaussian noise into the images. Similar approaches by Zhang et al. (2024) and Favero et al. (2024) introduce substantial image noise, effectively reducing the original image to pure noise or unrecognizable content. Zhu et al. (2024) use instructional bias to enable the model to amplify its own hallucinations, while Wang et al. (2024) focus on deliberately amplifying the inherent image bias in LVLMs.

However, the inherent uncontrollable nature of global visual uncertainty challenges the precise induction of hallucinatory tokens. This limitation significantly undermines the effectiveness of these methods in reducing hallucinations and may inadvertently lead to undesired hallucinatory outputs. As shown in the left portion of the Fig. 1 ‘Spoon’, ‘Table’, and ‘Fork’ are identified as hallucinated words, while ’People’ being the accurate term. For Greedy Decoding method shown in Fig. 1 (a), ‘Table’ is selected as the final output based on the logits distribution. Moreover, although Visual Contrastive Decoding introduces perturbations to images to enhance hallucinations in Fig. 1 (v), it fails to widen the logits gaps between hallucinatory and targeted tokens, yielding a new hallucination as ‘Fork’.

To tackle this issue, we conducted the theoretical analysis to explore mechanisms for more effective contrast decoding (refer to Section 5 for detailed information on the process). Theoretically, a clear distinction between hallucinatory and target tokens can significantly enhance the effectiveness of contrast decoding methods in mitigating hallucinations. Based on this crucial insight, we introduce a novel optimization strategy called Hallucination-Induced Optimization (HIO). This strategy enhances the distinction between hallucinatory and targeted tokens by utilizing a refined theoretical preference model(as shown in the Fig. 1 on the left, section (c)), accurately outputting the correct result, ‘People’. Consequently, this improves the efficiency of contrast decoding, thereby mitigating hallucinations in Large Vision-Language Models (LVLMs). Furthermore, our proposed method significantly reduces hallucinations in LVLMs compared to existing contrast decoding methods(as shown in the Fig. 1 on the right). To sum up, our main contributions are as follows:

We conducted a comprehensive theoretical analysis to explore mechanisms that enhance the effectiveness of the contrast decoding process.

We introduce Hallucination-Induced Optimization (HIO), an innovative strategy that utilizes a finely-tuned theoretical preference model to intensify the contrast between hallucinatory and target tokens. This enhancement strengthens the effectiveness of contrast decoding and effectively reduces hallucinations in Large Visual Language Models (LVLMs).

Extensive experimental research demonstrates that our Hallucination-Induced Optimization (HIO) strategy effectively reduces hallucinations in Large Visual Language Models (LVLMs), surpassing state-of-the-art methods across various benchmarks.

Related Work

Before the advent of Large Language Models (LLMs), "hallucination" in natural language processing (NLP) primarily referred to generating nonsensical or source-deviating content Lee et al. (2018); Zhou et al. (2020); Lin et al. (2021); Ji et al. (2023); Zhang et al. (2023); Shi et al. (2023). Recent studies have tackled the complexities of object hallucination in Large Vision-Language Models (LVLMs), focusing on evaluation and detection methods Wang et al. (2023a); Liu et al. (2023a); Li et al. (2023b); Lovenia et al. (2023). The CHAIR metric Rohrbach et al. (2018) evaluates the exact match between generated and ground-truth image captions, while POPE Li et al. (2023b) assesses the model’s awareness of object existence through binary classification.

Decoding Method.

The decoding method determines the generation of text tokens at each time step within language models. Traditional decoding strategies such as beam search Boulanger-Lewandowski et al. (2013), top-k decoding Fan et al. (2018), and sampling methods Holtzman et al. (2019), despite their widespread use, are prone to producing hallucinatory content. Recent research Li et al. (2022); Chuang et al. (2023); Leng et al. (2023); Huang et al. (2023) has made attempts to address this issue by proposing better decoding methods. For instance, Leng et al. (2023) uses contrastive decoding in LVLMs; However, global visual uncertainty poses challenges to the precise induction of hallucinatory tokens, limiting the effectiveness of mitigation strategies and risking unwanted hallucinations. To address this, we developed Hallucination-Induced Optimization (HIO), a novel strategy that enhances the contrast between hallucinatory and targeted tokens. Fig.1 presents the comparison results, where our approach demonstrates superior performance than other decoding methods.

Preliminaries

We first review the Contrast Decoding pipeline in Leng et al. (2023) (and later Zhang et al. (2024); Favero et al. (2024)). Then take a close look at the Bradley-Terry model Bradley and Terry (1952) and its application such as Direct Preference Optimization Rafailov et al. (2024). Inspired by these studies, we propose our Hallucination-Induced Optimization. Visual Contrastive Decoding. We consider an LVLM parameterized by θ\theta. The model takes a textual query input xx and a visual input vv, where vv provides contextual visual information to assist the model in generating a relevant response yy to the textual query. The response yy is sampled auto-regressively from the probability distribution conditioned on the query xx and the visual context vv. Mathematically, this can be formulated as:

where yty_{t} denotes the token at time step tt, and y<ty_{<t} represents the sequence of generated tokens up to the time step t−1t-1. Specifically, given a textual query x{x} and a visual input v{v}, the model generates two distinct output distributions: one conditioned on the original v{v} and the other on the distorted visual input v′{v^{\prime}}, which is derived by applying pre-defined distortions (i.e., Gaussian noise mask) to the original v{v}. Then, a new contrastive probability distribution is computed by exploiting the differences between the two initially obtained distributions. The new contrastive distribution pvcdp_{vcd} is formulated as:

where larger value of α\alpha indicate a stronger amplification of differences between the two distributions (α=0\alpha=0 reduces to regular decoding). Direct Preference Optimization. Reinforcement learning (RL) effectively fine-tunes Large Language Models (LLMs) to align with human behavior. Given an input xx and a response yy, a language model policy πθ\pi_{\theta} generates a conditional distribution πθ(y∣x)\pi_{\theta}(y\mid x). RL aims to maximize the average reward of outputs, with the reward function r(x,y)r(x,y). To prevent overoptimization Gao et al. (2023), the objective loss includes a KL-divergence term, controlling the divergence between the language model policy and its reference policy πref(y∣x)\pi_{\text{ref}}(y\mid x), typically derived from supervised fine-tuning. Thus, the overall objective is formulated as:

where D\mathcal{D} is a dataset of prompts and α\alpha is a coefficient to control KL-divergence term. However, optimizing the above loss term with common strategies like proximal policy optimization (PPO) Schulman et al. (2017) is complex to tune. Recently, direct preference optimization (DPO) Rafailov et al. (2024) simplifies the above process by leveraging preference data for optimization. Here, the preference data is defined as D={x(i),yw(i),yl(i)}i=1N\mathcal{D}=\{x^{(i)},y_{w}^{(i)},y_{l}^{(i)}\}_{i=1}^{N}, where yw(i)y_{w}^{(i)} and yl(i)y_{l}^{(i)} represent preferred and dispreferred responses given an input prompt xx. These are then presented to human labelers who express preferences for one answer, denoted as yw≻yl∣xy_{w}\succ y_{l}\mid x where ywy_{w} and yly_{l} denotes the preferred and dispreferred respectively. Following a Bradley-Terry model Bradley and Terry (1952), the probably of obtaining each preference pair is:

DPO enables learning πθ\pi_{\theta} from a fixed dataset of preferences, which is lightweight. However, the challenge arises because the direct application of DPO does not reliably induce hallucinations in a manner that meets the criteria specified in Eqn. (17).

Method

An overview of the proposed HIO method is shown in Fig. 3. It constructs a more-hallucinated LVLM by inducing hallucinations from the original LVLM to amplify the contrast between hallucinatory and targeted tokens, thereby enhancing the efficiency of contrast decoding and mitigating hallucinations in LVLMs. In Section 4.1, we harness a fine-tuned theoretical preference model to amplify the contrast between hallucinatory and targeted tokens. Furthermore, to induce more potential hallucinations for effective contrast decoding, we propose to amplify multiple hallucination tokens based on a theoretical foundation in Section 4.2. Section 4.3 introduces additional constraints to overcome the limitations of existing classification loss in amplifying the contrast between hallucinatory and targeted tokens.

We harness a fine-tuned theoretical preference model (i.e., Contrary Bradley-Terry Model Bradley and Terry (1952)) to amplify the contrast between hallucinatory and targeted tokens. The studies on hallucination mitigation Zhao et al. (2023); Yu et al. (2023); Zhou et al. (2024) utilize BT model by defining the non-hallucinatory output as ywy_{w} and the hallucinatory output as yly_{l}. Subsequently, they employ BT model training to incentivize the model to prioritize outputs without hallucinations over those containing them. However, within the context of contrast decoding, inducing hallucinations is crucial, and the resulting model output must satisfy the criteria outlined in Eqn. (17). (The detailed derivation of this formula is provided in Section5). To meet the requirements specified in Eqn. (17), the logits associated with hallucinated tokens li^{v,x,y<t}{\hat{l_{i}}^{\{v,x,y_{<t}\}}} need amplification, while at least one of the logits for the correct token lj^{v,x,y<t}{\hat{l_{j}}^{\{v,x,y_{<t}\}}} must be reduced. In contrast to the prevailing research efforts focused on alleviating hallucinations, our approach enables the model to learn to fit the distribution containing hallucinations while avoiding convergence with the distribution of correct outputs. The details are outlined as follows. To regulate li^{v,x,y<t}{\hat{l_{i}}^{\{v,x,y_{<t}\}}} and lj^{v,x,y<t}{\hat{l_{j}}^{\{v,x,y_{<t}\}}}, we utilize the dataset introduced by Yu et al. (2023). This dataset is notable for providing a pair of outputs per input, with the output paragraphs being mostly identical except for differences in certain words or short phrases. By leveraging this dataset, we approximate the conditions outlined in Eqn. (17) within a unified statement. Different from Eqn. (5), we apply the Bradley-Terry (BT) Bradley and Terry (1952) model in a reversed way, the objective is:

where σ(⋅)\sigma(\cdot) is defined as a sigmoid function and the reference model πref(y∣x)\pi_{\text{ref}}(y|x) is usually implemented by an instruction-tuned base model we want to improve, and is kept fixed during DPO training. Only the policy model πθ(y∣x)\pi_{\theta}(y|x) is updated.

2 Amplification of Multiple Targeted Hallucination (AMTH)

The methodology delineated in Eqn. (6), along with the conventional application of Direct Preference Optimization (DPO) for mitigating hallucinations, is limited to highlight the difference between a single hallucination token and the target token. Consequently, these approaches fall short in enhancing the distinctions among other hallucinations relative to the target tokens, which is critical as shown in Eqn. (17). In this section, we will explain how to amplify the differences between multiple hallucination tokens and target tokens through modifications at both the loss function and data levels. Multiple Hallucination-Induced Optimization. Achieving the desired distribution through single positive and negative sample fitting preference training is not feasible, leading conventional Direct Preference Optimization (DPO) applications Zhao et al. (2023); Yu et al. (2023); Zhou et al. (2024) to overlook a significant number of hallucinations. Thus, drawing inspiration from the implications of Eqn. (17), our approach strategically induces multiple hallucinations to increase the probability of producing a correct word in the output. As demonstrated in Eqn. (17), effective contrast decoding necessitates not only the amplification of one hallucination but also the consideration of a diverse set of potential hallucinations. We propose the simultaneous fitting of multiple pairs of preference data when modeling distributions for the same input preference, treating all pairs of preference data with equal importance. Based on Eqn. (6), we apply the Bradley-Terry (BT) Bradley and Terry (1952) model in a multi-pair way, the objective is:

where {yli},i∈{1,2,…,k}\{y_{li}\},i\in\{1,2,\dots,{k}\} represent the multiple potential hallucination tokens. Assuming access to a static dataset of comparisons \mathcal{D}=\bigl{\{}x^{(i)},y_{w}^{(i)},\{y_{li}^{(i)}\}\bigr{\}}_{i=1}^{N} sampled from pp, we can parametrize a reward model r(x,y)r(x,y) and estimate the parameters via maximum likelihood. Framing the problem as a binary classification we have the negative log-likelihood loss:

Acquisition of Multiple Candidate Hallucinations. While numerous hallucination datasets exist Yu et al. (2023); Zhao et al. (2023); Zhou et al. (2024), they are either generated by GPT or manually rewritten, and thus do not accurately represent the model’s potential for multiple hallucinations. Therefore, we propose a novel approach: allowing the model to directly output tokens with high confidence as negative samples. While this approach may incorrectly classify some correct tokens as hallucinations, it compensates by providing true value-labeled data for correction and supplementation. Consequently, this method effectively amplifies multiple hallucinations while reducing the target token. The detailed training process of our method is outlined in Algorithm 1.

3 Advanced Constraints for Inducing (ACI)

To overcome the limitations of existing classification loss in amplifying the contrast between hallucinatory and targeted tokens, we introduces additional constraints. The preference optimization strategy outlined in Eqn. (8) allows the model to accommodate a specific range of preference distributions through the cross-entropy in the classification loss function. The precise formulation is as follows:

where mm represents the length of the sentence yly_{l} and {kT}\{k_{T}\} is token of each word, and the definition of li^{v,x,y<t}\hat{l_{i}}^{\{v,x,y_{<t}\}} is shown in Section 5. While the use of cross-entropy to minimize encoding length helps the model align with the desired output sentence, it does not consistently ensure that the logits of amplified hallucinations meet the conditions specified in Eqn. (17).

For example, the goal of Eqn. (8) is to increase πθ(yl∣v,x)\pi_{\theta}(y_{l}|v,x), but both increasing exp⁡lkt^{v,x,y<t}\exp{\hat{l_{k_{t}}}^{\{v,x,y_{<t}\}}} or decreasing ∑jNexp⁡lj^{v,x,y<t}\sum_{j}^{N}\exp{\hat{l_{j}}^{\{v,x,y_{<t}\}}} can achieve this goal. Meanwhile, decreasing the value of ∑jNexp⁡lj^{v,x,y<t}\sum_{j}^{N}\exp{\hat{l_{j}}^{\{v,x,y_{<t}\}}} can also allow πθ(yw∣v,x)\pi_{\theta}(y_{w}|v,x) to meet the optimization criteria. As shown in Fig. 3, the blue discount, representing the disparity between the logits of the hallucination token and the correct token, typically exhibits a positive trend. Nevertheless, it’s important to note occasional segments where this value dips below zero. To tackle this issue, we further add restrictions based on Eqn. (8):

By implementing this constraint, the model can be fitted to the distribution of preference statements, thereby further expanding the difference between hallucination tokens and target tokens.

Fundamental Requirements for Contrast Decoding

Contrast decoding is capable of mitigating hallucinations when specific conditions are met. This section delves into a comprehensive discussion and analysis of these conditions. Definition. Let li{v,x,y<t}l_{i}^{\{v,x,y_{<t}\}} represent the probability of the ii-th token in the model’s vocabulary given the query x{x}, the visual context v{v} and the sequence of generated tokens up to the time step (t−1t-1). The logits can be formulated as:

Definition. Let L^{v,x,y<t}\hat{L}^{\{v,x,y_{<t}\}} represents the ideal logits for contrast decoding, L′{v,x,y<t}L^{{}^{\prime}\{v,x,y_{<t}\}} represents the logits with hallucination and L∗{v,x,y<t}L^{*\{v,x,y_{<t}\}} represents the logits of correct token, where {L′{v,x,y<t},L∗{v,x,y<t}}∈L{v,x,y<t}\{L^{{}^{\prime}\{v,x,y_{<t}\}},L^{*\{v,x,y_{<t}\}}\}\in L^{\{v,x,y_{<t}\}}. The results of contrast decoding of logits can be formulated as:

where larger α\alpha values indicate a stronger amplification of differences between the two distributions (α=0\alpha=0 reduces to regular decoding). The condition for the absence of hallucination in the logits subsequent to subtraction is that the values of the logits corresponding to all hallucinatory tokens are less than the magnitudes of the logits corresponding to the correct lexical tokens. The aforementioned condition is articulated mathematically as follows:

where δ′{v,x,y<t}\delta^{{}^{\prime}\{v,x,y_{<t}\}} denotes the result of the subtraction between the logits of all hallucinated vocabulary tokens and the logits after their ideal amplification. δ′{v,x,y<t}\delta^{{}^{\prime}\{v,x,y_{<t}\}} represents the outcome of the subtraction between the logits corresponding to all correct vocabulary tokens and the logits under the ideal scenario. Upon expansion of the left side of the equation, the following result is obtained:

where nn denotes the total number of correct lexical items. Based on Eqn. (15) and Eqn. (16), Eqn. (14) can be simplified to the form presented as follows:

where JJ represents (1+α)α∑i=k1km(li{v,x,y<t}−lj{v,x,y<t})\frac{(1+\alpha)}{\alpha}\sum_{i=k_{1}}^{k_{m}}({l_{i}^{\{v,x,y_{<t}\}}}-l_{j}^{\{v,x,y_{<t}\}}). In the context of the contrast decoding method, given that the parameters of the original model remain invariant, the output can be characterized as a constant. Equation 17 delineates the logits for all hallucinated tokens li^{v,x,y<t}{\hat{l_{i}}^{\{v,x,y_{<t}\}}} and contrasts these with the logits of a single correct token lj^{v,x,y<t}{\hat{l_{j}}^{\{v,x,y_{<t}\}}}. It postulates that, for an optimal logits output, a pronounced divergence must be maintained between the logits of hallucinated tokens and the logit of the correct token.

Experiments

Benchmarks. We evaluate HIO on three benchmarks including (1) quantitative metrics POPE Li et al. (2023b) on MSCOCO Lin et al. (2014) dataset. The Polling-based Object Probing Evaluation Li et al. (2023b) offers a streamlined approach to assessing object hallucination. In this benchmark, LVLMs are queried about the existence of specific objects in a given image. (2)CHAIR Rohrbach et al. (2018), Caption Hallucination Assessment with Image Relevance, is a specialized tool designed to evaluate the occurrence of object hallucination in image captioning tasks. (3) general-purposed Multimodal Large Language Model Evaluation (MME) Fu et al. (2023) benchmark, which provides an extensive benchmark designed to evaluate LVLMs across multiple dimensions, including ten perception-related subtasks and four cognition-focused ones. LVLM Baselines We evaluate the effectiveness of our HIO on three state-of-the-art LVLMs. Concretely, we apply our HIO to LLaVA-1.5, which employ Vicuna 7B as language decoder Liu et al. (2023c). For a more convincing comparison, we report the averaged results as well as the standard deviation over 55 runs on POPE and MME benchmarks.

2 Experimental Results

POPE. To evaluate HIO’s capability on object hallucination, we compare it with several state-of-the-art Decoding methods on POPE. The results are shown in Tab. 1. Generally, our method achieves superior performance compared to other decoding methods. Concretely, HIO outperforms the VCD 2.5%\%, 2.8%\%, 3.5%\% at Accuray and 2.9%\%, 2.8%\%, 3.0%\% at F1 Score on Random, Popular and Adversarial, respectively. The results demonstrate the effectiveness of our method.

CHAIR. To evaluate HIO’s capability on object hallucination with caption, we compare it with several state-of-the-art Decoding methods on CHAIR. The results are shown in Tab. 2. Consistent with the performance on POPE, HIO also achieves competitive results on CHAIR compared to other decoding methods. Concretely, HIO outperforms the VCD 7.2%\% and 4.4%\% at CHAIRS and CHAIRI on MSCOCO Lin et al. (2014), respectively. The results demonstrate the effectiveness of our method.

MME. To evaluate HIO’s capability on object-level and attribute-level hallucination, we compare it with several state-of-the-art Decoding methods on MME. The results are shown in Tab. 3. Consistent with the performance on POPE and CHAIR, HIO also achieves competitive results on MME compared to other decoding methods. Concretely, HIO outperforms the VCD 6.4%\%, 21.7%\%, 4.7%\% and 17.0%\% at Existence, Count, Position on MME, respectively. The results demonstrate the effectiveness of our method.

3 Ablation Study

To verify the effectiveness of each component of the proposed HIO, we conduct ablation studies on Contrary Bradley-Terry Model(CBTM), Amplification of Multiple Targeted Hallucination(AMTH) and Advanced Constraints for Inducing(ACI) under the MSCOCO Lin et al. (2014). The results are shown in Tab. 4. when constrained by CBTM in Exp 2, the model outperforms the baseline(i.e., Exp 1). This helps LVLM amplify hallucinations. Furthermore, after being integrate with AMTH in Exp 3, LVLM obtain sigificant gains on CHAIRS\text{CHAIR}_{S} and CHAIRI\text{CHAIR}_{I}. When integrate with ACI, the LVLM achieve superior performance on CHAIRS\text{CHAIR}_{S}, CHAIRI\text{CHAIR}_{I} and Recall. These results demonstrate the effective of each component.

References

Appendix A Mathematical Derivations

In this appendix, we present a comprehensive verification of Eqn. (17), which is elucidated through the following detailed procedure:

Appendix B Algorithm

This algorithm meticulously outlines the process enabling the model to autonomously generate a spectrum of potential hallucinations. Utilizing the pairs of samples thus produced, we employ our proposed Hallucination-Induced Optimization (HIO) to enhance the disparity between hallucination tokens and target tokens. Ultimately, the hallucinations are mitigated through the application of contrast decoding.

Appendix C Additional experiments

CHAIR. To evaluate HIO’s capability on object hallucination with caption, we compare it with several state-of-the-art Decoding methods on CHAIR. The results are shown in Tab. 2. Consistent with the performance on POPE, HIO also achieves competitive results on CHAIR compared to other decoding methods. Concretely, HIO outperforms the HALC Chen et al. 2.2%\% and 3.3%\% at CHAIRS and CHAIRI on MSCOCO Lin et al. , respectively. The results demonstrate the effectiveness of our method.

MME. To evaluate HIO’s capability on object-level and attribute-level hallucination, we compare it with several state-of-the-art Decoding methods on MME. The results are shown in Tab. 3. Consistent with the performance on POPE and CHAIR, HIO also achieves competitive results on MME compared to other decoding methods. Concretely, HIO outperforms the VCD at Existence, Count, Position, Color, Posters, on MME, respectively. The results demonstrate the effectiveness of our method.

Appendix D Discussion

In this study, we conduct an in-depth examination of the principles governing contrast decoding and the prerequisites for its efficacy. Based on our findings, we introduce HIO, an innovative model optimization approach designed to induce hallucinations. This method significantly amplifies hallucinatory elements within the model, thereby effectively mitigating them through contrast decoding. Extensive experimentation across various datasets has demonstrated that HIO effectively reduces hallucinations and achieves state-of-the-art performance.

Limitations &\& Future Work. Our findings establish a necessary, but not sufficient, condition for the successful operation of contrast decoding. Further exploration of more effective conditions could significantly enhance the efficiency of contrast decoding in mitigating hallucinations. Additionally, exploring training-free methods to induce hallucinations could reduce the computational costs associated with decoding.