Abstract
Large Vision-Language Models (LVLMs) frequently suffer from object hallucination, generating descriptions of entities absent from the input image. We present Memory-Driven Sparse Attention Matrix (MDSAM), a training-free, inference-time intervention designed to mitigate these errors. By sparsifying attention weights and aggregating them across transformer layers using a memory-driven approach, MDSAM anchors the model to salient visual features. Our results demonstrate significant reductions in hallucination rates across multiple architectures, including LLaVA and MiniGPT4, without the need for expensive retraining or fine-tuning.
Introduction
Despite the impressive capabilities of models like LLaVA and DeepSeekVL, the persistence of object hallucination remains a significant barrier to their reliable deployment. Hallucinations often occur during the autoregressive decoding process when the model's "visual grip" weakens. As the model generates text, the attention allocated to image tokens can become noisy or scattered, causing the model to over-rely on its internal linguistic priors—predicting what usually appears in a scene rather than what is actually present. MDSAM addresses this by intervening in the attention mechanism to filter noise and reinforce visual consensus across the network's layers.
Methodology
MDSAM introduces a three-step pipeline that operates during the model's forward pass at inference time:
- Memory-Driven Sparsification: At each transformer layer, a Top-K selection (governed by hyperparameter $\tau$) is applied to the attention weights of image tokens. This process filters out low-level noise and "distractions" that typically precede hallucinated outputs.
- Weighted Aggregation: The method maintains a "memory" of sparse attention matrices from the previous $L$ layers. These are combined using an exponential decay factor ($\alpha$), prioritizing recent layers while preserving structural context from earlier ones.
- Attention Alignment: The aggregated memory matrix is blended back into the current layer's attention weights using a blending parameter ($\beta$). This "nudges" the model to focus on image regions that the network collectively identifies as important.
Experimental Results
We evaluated MDSAM across several rigorous benchmarks, including CHAIR (Caption Hallucination Assessment with Image Relevance), POPE (Polling-based Object Probing Evaluation), and MME.
Hallucination Reduction
MDSAM consistently outperforms standard greedy decoding and other state-of-the-art inference-time strategies. On the LLaVA-1.5-7B model, MDSAM reduced the sentence-level hallucination rate (CHAIRS) from 48.4 to 37.8—a 10.6-point improvement. Similar success was observed with MiniGPT4, where the CHAIRS score dropped from 35.6 to 26.0.
Perception and Cognition
Crucially, MDSAM does not merely make the model "quieter"; it improves overall perceptual accuracy. On the MME benchmark, the total score for LLaVA increased from 1505 to 1518, proving that fixing hallucinations can enhance the model's fundamental understanding of the scene.
Discussion: Sparsity and Attention Peaks
A key insight from this research is the relationship between attention peaks and hallucinations. The authors observed that both real and hallucinated entities trigger "attention peaks." However, hallucinations typically occur when the overall visual attention is low or scattered. By enforcing sparsity, MDSAM effectively "mutes" the noise that causes the model to drift into imagination.
One of the most significant advantages of MDSAM is its architecture-agnostic nature. It performs well regardless of whether the model uses a simple linear projector (like LLaVA) or a more complex resampler (like MiniGPT4), making it a versatile tool for the broader LVLM community.
Conclusion
MDSAM provides a robust, "plug-and-play" solution for hallucination mitigation in LVLMs. By leveraging cross-layer attention memory and sparsification, it anchors model generation to visual reality without the need for additional training. Future work will explore adaptive hyperparameter selection to automatically optimize performance based on image complexity and prompt context.
Summary updated