Abstract
Large Visual Language Models (LVLMs) often struggle with text-rich images like charts and documents. We present Cream (Contrastive Reading Model), an architecture that enhances frozen Large Language Models (LLMs) with fine-grained visual understanding. By employing an auxiliary encoder and a novel contrastive alignment technique, Cream generates compact soft visual prompts that capture intricate textual and spatial details. Experimental results show that Cream outperforms significantly larger models on complex reasoning tasks like ChartQA and DocVQA while maintaining high computational efficiency.
Introduction: The Challenge of Text-Rich Images
While general-purpose LVLMs like LLaVA or BLIP-2 are excellent at describing natural scenes, they frequently fail when faced with "text-rich" images such as infographics, charts, and documents. Understanding these images requires more than a general visual summary; it necessitates pinpointing specific text strings, understanding their spatial layout, and performing reasoning—often arithmetic—based on that data.
Existing solutions typically rely on general vision encoders that miss fine-grained text or "OCR-into-LLM" pipelines that overwhelm the model with thousands of raw text tokens. The latter is computationally expensive and often exceeds the LLM's context window.
Methods: The Cream Architecture
The core of this work is the Cream architecture, which bridges the gap between general vision and fine-grained textual detail through a dual-encoder system:
- Vision Encoder: A standard Vision Transformer (ViT) captures the overall image context.
- Auxiliary Encoder: A specialized encoder (based on BART) processes "feature evidence" such as OCR text and object detection boxes.
- Contrastive Feature Alignment: This novel strategy uses contrastive learning to align features from the general vision encoder with specific features from the auxiliary encoder. This forces the vision encoder to learn the precise location and content of important text and objects, making the model robust even when OCR data is noisy.
The decoder aggregates these aligned features into a fixed-size "soft visual prompt" of 224 tokens. This prompt is then fed into a frozen LLM (e.g., Vicuna-7B), allowing for efficient processing regardless of the image's text density.
Performance and Efficiency
Cream demonstrates state-of-the-art performance across major text-rich VQA benchmarks:
- ChartQA: Cream-Vicuna7B achieved 63.0% accuracy, significantly outperforming OCR-GPT4 (34.3%).
- DocVQA: It reached 79.5%, surpassing specialized models like LayoutLMv3.
- Inference Speed: Cream is roughly 2x faster than standard OCR-Vicuna pipelines (0.25 sec/sample vs 0.5 sec/sample) because it processes fewer tokens in the LLM stage.
The model also exhibits remarkable robustness; even when 50% of the OCR data was intentionally removed during testing, Cream maintained high performance, proving the vision encoder successfully learned to "read" through contrastive training.
Conclusion
Cream effectively addresses the limitations of current LVLMs in text-rich environments by condensing complex visual and textual information into manageable soft prompts. While currently focused on single-page documents, future work will explore multi-page processing and more sophisticated visual instruction tuning for interactive scenarios.
Summary updated