Introduction
Visual Document Understanding (VDU) is a critical domain in computer vision, encompassing tasks such as analyzing financial reports, interpreting infographics, and extracting data from complex tabular layouts. Modern state-of-the-art approaches have transitioned toward "OCR-free" models, which process document images directly without an intermediate text-recognition step. While effective, these models often struggle with a fundamental limitation: the vision encoder typically processes the image independently of the specific query, leading to a lack of semantic grounding.
Existing "query-informed" methods attempt to bridge this gap by modifying the internal architecture of Vision Transformers (ViTs). However, these modifications often introduce a massive number of new parameters, making them "data-hungry." In specialized fields like legal or medical technology, where labeled data is scarce, these complex models frequently fail or underperform compared to standard fine-tuning. QID (Query-Informed ViT) addresses this by providing a lightweight, architecture-preserving method that excels in data-scarce regimes (500–1,000 samples) with minimal computational overhead.
Methodology: The QID Framework
QID integrates query embeddings into the vision encoder without altering the core attention blocks of the pre-trained ViT. This preservation of the original architecture is key to maintaining the model's pre-trained knowledge while adapting to new tasks. The framework consists of two primary modules: the Query-Aware Module and the Query-Agnostic Module.
Query-Aware Module
Instead of injecting the entire text prompt, QID utilizes only the [EoS] (End-of-Sentence) token embedding. Research indicates that this single token acts as a holistic representation of the query, naturally highlighting relevant semantic regions in the image. This module employs a two-step "fuse and defuse" strategy:
- Fuse Step (Spherical Augmentation): To prevent overfitting on small datasets, adaptive Gaussian noise is added to the query embedding on a hypersphere. This forces the model to learn more generalized and robust visual representations.
- Defuse Step (Entropy Regularization): A specialized loss function is applied to discourage uniform or "blurry" attention. By penalizing high entropy, the model is forced to "sharpen" its focus on specific, query-relevant regions of the document, acting much like a focused flashlight beam.
Query-Agnostic Module
To mitigate the distribution shift caused by the introduction of a new query token, QID introduces a learnable sinusoidal positional bias. A significant advantage of this module is that it can be pre-computed after training, resulting in zero additional computational cost during inference.
Experimental Results
The researchers evaluated QID across five diverse benchmarks, including dense-text datasets (InfoVQA, Kleister Charity, WikiTableQuestions) and scene-text datasets (VizWiz, ST-VQA). The model was specifically tested under data-scarce conditions using subsets of 500, 1,000, and 2,000 samples.
Key Findings
- Superiority in Scarcity: On the Qwen-VL-Chat model with only 1,000 training samples, QID outperformed the previous state-of-the-art (QA-ViT) by an average of 1.4% and significantly exceeded standard LoRA performance.
- Extreme Efficiency: QID adds a negligible 0.009 to 0.02 GFLOPs of overhead. In contrast, QA-ViT adds between 1.88 and 4.53 GFLOPs, making QID approximately 100x to 200x more computationally efficient.
- The [EoS] Advantage: Using a single [EoS] token proved more effective and robust for visual grounding than using full text sequences, which often introduce noise in low-data environments.
Discussion and Limitations
QID demonstrates that architecture preservation and targeted query injection are highly effective for low-data VDU tasks. By focusing the vision encoder's attention through entropy regularization, the model learns to locate relevant text bounding boxes more accurately than baseline models.
However, some limitations remain. The current implementation relies on a pre-trained CLIP text encoder, limiting queries to 77 tokens. Additionally, while QID is excellent at information extraction, it does not inherently improve the underlying Large Language Model's (LLM) logical reasoning or mathematical capabilities. Future work may explore "Long-CLIP" variants and multi-hop reasoning challenges where answers are distributed across multiple document regions.
Summary updated