Efficient End-to-End Visual Document Understanding with Rationale Distillation

Wang Zhu, Alekh Agarwal, Mandar Joshi, Robin Jia, Jesse Thomason, Kristina Toutanova

Introduction

Rationale Distillation (RD) is a novel training framework designed to enhance the performance of small, efficient image-to-text models on visual document understanding (VDU) tasks. By teaching a student model to generate intermediate "rationales"—distilled from sophisticated OCR tools and Large Language Models (LLMs) during training—the framework achieves a 4–5% accuracy boost with negligible impact on inference speed. This approach effectively eliminates the need for complex, multi-stage pipelines during runtime.

Overview of the Rationale Distillation framework, showing how various tools inform a small vision-language model for tasks like posters, documents, and charts.

The Challenge of Visual Document Understanding

Visual Document Understanding (VDU) requires models to interpret text within complex layouts, such as infographics, scanned forms, and charts. Currently, researchers face a significant trade-off:

  1. Heavy Pipelines: These use Optical Character Recognition (OCR) to extract text, which is then processed by an LLM. While accurate, they are computationally expensive and engineering-heavy.
  2. End-to-End Small Models: Models like PIX2STRUCT map pixels directly to answers. These are fast and simple but often lack the reasoning depth of multi-stage pipelines.

The authors propose RD to bridge this gap, embedding the reasoning power of heavy pipelines directly into the weights of small, efficient models.

Methodology: Rationale Distillation

The core innovation of RD is training the student model to output a rationale before the final answer. This rationale acts as a bridge, guiding the model through the necessary reasoning steps.

Training with Teacher Tools

During the training phase, high-quality intermediate steps are generated using "expensive" teacher tools that are only available during training:

  • OCR & Summarization: Google Cloud OCR extracts text, and PaLM 2-L summarizes it into concise "evidence" for document-based questions.
  • LLM-Programmer: For numerical reasoning on charts, an LLM writes Python-like snippets (e.g., Diff(5, 93)) to perform calculations.
The rationale generation process, illustrating how OCR and LLMs create evidence and programs to guide the student model during training.

Filtering and Robustness

To ensure high data quality, a massive multimodal model (PaLI-X) acts as a verifier, filtering out rationales that do not lead to the correct answer. Additionally, the model undergoes multi-task training to ensure it can recover and find the correct answer even if its predicted rationale is slightly noisy at runtime. Crucially, none of these external tools are required during inference; the student model operates entirely from raw pixels.

Evaluation and Results

The method was evaluated on three major VDU benchmarks: InfoVQA (infographics), DocVQA (scanned documents), and ChartQA (charts and plots).

The RD-enhanced PIX2STRUCT-Base (282M parameters) demonstrated significant improvements over standard fine-tuning:

  • InfoVQA: +4.0 points (ANLS score).
  • DocVQA: +4.6 points (ANLS score).
  • ChartQA: +7.7 points (Relaxed Accuracy on the human-generated set).

Notably, a 282M model trained with RD outperformed a 1.3B model trained with standard methods on several benchmarks, highlighting the efficiency of the approach. While still trailing massive 5B+ parameter models, RD significantly closes the gap for "edge-compatible" model sizes.

Key Insights

  • "Baking In" the Pipeline: The reasoning process of an OCR-LLM pipeline can be effectively distilled into a smaller model's weights. The student learns the process of looking for evidence rather than just memorizing answers.
  • Query-Dependent Rationales: Unlike full-page OCR, RD focuses on short, query-specific rationales, keeping inference costs low (only ~1% increase in FLOPs).
  • Programmatic Reasoning: Using programs for charts allows small models to perform complex mathematical reasoning far beyond simple pattern matching.

Limitations and Future Work

While promising, the current work focuses on single-page documents. Extending RD to multi-page documents would require handling longer-distance dependencies. Additionally, while inference is cheap, the training phase is expensive due to the reliance on high-end OCR and LLM APIs. Future work may explore other types of rationales, such as object detection coordinates or image captions, to further enhance visual reasoning.

Summary updated

BibTeX
@inproceedings{zhu2024efficient,
  author = {Wang Zhu and Alekh Agarwal and Mandar Joshi and Robin Jia and Jesse Thomason and Kristina Toutanova},
  title = {{Efficient End-to-End Visual Document Understanding with Rationale Distillation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.465},
}
Figure