Table of Contents
Fetching ...

How Do Large Vision-Language Models See Text in Image? Unveiling the Distinctive Role of OCR Heads

Ingeol Baek, Hwan Chang, Sunghyun Ryu, Hwanhee Lee

TL;DR

The paper addresses how LVLMs locate and interpret text embedded in images by proposing OCR heads as a distinct class of attention heads. It introduces a scoring-based method (OCR Score) and an image-based Passkey/NIAH dataset to identify OCR heads, showing they are less sparse, qualitatively distinct, and statically activated compared to retrieval heads. Through CoT prompting, head masking, and sink-token redistribution, the work demonstrates the specialized role of OCR heads in OCR-VQA and their potential for improving robustness and reducing hallucinations. The findings offer a mechanistic view of text extraction in LVLMs and present practical levers to enhance multimodal reasoning tasks involving embedded text.

Abstract

Despite significant advancements in Large Vision Language Models (LVLMs), a gap remains, particularly regarding their interpretability and how they locate and interpret textual information within images. In this paper, we explore various LVLMs to identify the specific heads responsible for recognizing text from images, which we term the Optical Character Recognition Head (OCR Head). Our findings regarding these heads are as follows: (1) Less Sparse: Unlike previous retrieval heads, a large number of heads are activated to extract textual information from images. (2) Qualitatively Distinct: OCR heads possess properties that differ significantly from general retrieval heads, exhibiting low similarity in their characteristics. (3) Statically Activated: The frequency of activation for these heads closely aligns with their OCR scores. We validate our findings in downstream tasks by applying Chain-of-Thought (CoT) to both OCR and conventional retrieval heads and by masking these heads. We also demonstrate that redistributing sink-token values within the OCR heads improves performance. These insights provide a deeper understanding of the internal mechanisms LVLMs employ in processing embedded textual information in images.

How Do Large Vision-Language Models See Text in Image? Unveiling the Distinctive Role of OCR Heads

TL;DR

The paper addresses how LVLMs locate and interpret text embedded in images by proposing OCR heads as a distinct class of attention heads. It introduces a scoring-based method (OCR Score) and an image-based Passkey/NIAH dataset to identify OCR heads, showing they are less sparse, qualitatively distinct, and statically activated compared to retrieval heads. Through CoT prompting, head masking, and sink-token redistribution, the work demonstrates the specialized role of OCR heads in OCR-VQA and their potential for improving robustness and reducing hallucinations. The findings offer a mechanistic view of text extraction in LVLMs and present practical levers to enhance multimodal reasoning tasks involving embedded text.

Abstract

Despite significant advancements in Large Vision Language Models (LVLMs), a gap remains, particularly regarding their interpretability and how they locate and interpret textual information within images. In this paper, we explore various LVLMs to identify the specific heads responsible for recognizing text from images, which we term the Optical Character Recognition Head (OCR Head). Our findings regarding these heads are as follows: (1) Less Sparse: Unlike previous retrieval heads, a large number of heads are activated to extract textual information from images. (2) Qualitatively Distinct: OCR heads possess properties that differ significantly from general retrieval heads, exhibiting low similarity in their characteristics. (3) Statically Activated: The frequency of activation for these heads closely aligns with their OCR scores. We validate our findings in downstream tasks by applying Chain-of-Thought (CoT) to both OCR and conventional retrieval heads and by masking these heads. We also demonstrate that redistributing sink-token values within the OCR heads improves performance. These insights provide a deeper understanding of the internal mechanisms LVLMs employ in processing embedded textual information in images.

Paper Structure

This paper contains 27 sections, 4 equations, 8 figures, 5 tables.

Figures (8)

  • Figure 1: Visualization of image attention maps from InternVL2-8B. L and H denote the layer and attention head of the LVLM, respectively.
  • Figure 2: The figure illustrates the image input format designed to identify tokens responsible for copy-pasting text within the image. Tokens corresponding to the patch-to-bounding box intersection ratio serve as evidence patch tokens. The retrieval score computation utilizes attention between generated tokens and evidence patch tokens.
  • Figure 3: Proportion of OCR Heads and Retrieval Heads (RH) identified in the InternVL2 and Qwen2-VL models.
  • Figure 4: Visualization comparing the OCR Score for OCR Heads and Retrieval Score for Retrieval Heads. OCR Score and Retrieval Score measure token-level recall, how many correct tokens were copied, while Activation Frequency indicates how often a head activates on at least one token above a threshold.
  • Figure 5: In the OCR-VQA task, we calculate the OCR score and Retrieval score based on the CoT prompting. L5_H19 refers to Layer 5, Head 19. The blue and green lines indicate the token positions with the highest attention.
  • ...and 3 more figures