DocThinker: Explainable Multimodal Large Language Models with Rule-based Reinforcement Learning for Document Understanding

Wenwen Yu, Zhibo Yang, Yuliang Liu, Xiang Bai

TL;DR

This paper introduces DocThinker, a novel framework that uses rule-based reinforcement learning to make multimodal large language models (MLLMs) more explainable and adaptable for document understanding. By dynamically refining reasoning strategies at inference time, DocThinker generates transparent intermediate steps, leading to improved performance and trustworthiness in high-stakes domains.

What Problem Does This Paper Address?

Multimodal Large Language Models (MLLMs) have become powerful tools for understanding documents, but their "black-box" nature makes it difficult to trust their reasoning, especially in critical fields like law, finance, and medicine. Existing methods, like Chain-of-Thought (CoT) prompting, often rely on fixed reasoning templates, which are inflexible, prone to forgetting past knowledge, and struggle to generalize across different document types and tasks. This lack of adaptability and transparency hinders their real-world applicability.

Methods

DocThinker tackles this challenge by employing a rule-based Reinforcement Learning (RL) framework for inference-time reasoning. Instead of relying on static CoT templates, DocThinker uses a policy learning approach to dynamically refine its reasoning strategies. The core of the method is built upon the Group Relative Policy Optimization (GRPO) algorithm, which is adapted for multimodal inputs (images and text).

Key methodological contributions include:

  • Dynamic Reasoning Refinement: DocThinker learns to generate explainable intermediate steps, including structured reasoning traces, rephrased questions for clarity, and identified Regions of Interest (RoI) that support the final answer. This is achieved through policy learning, allowing the model to adapt its reasoning process on the fly.
  • Multi-Objective Reward Functions: A novel set of verifiable reward functions is designed to guide the RL training. These rewards evaluate:
  • Format Compliance: Ensuring the output adheres to a structured XML/JSON format.
  • Accuracy: Verifying the correctness of the final answer against ground truth.
  • RoI IoU: Measuring how accurately the model identifies relevant visual regions in the document.
  • Rephrased Question Quality: Assessing the clarity and informativeness of the rephrased question.
  • KL-Constrained Optimization: GRPO is used to ensure stable policy updates, preventing reward exploitation and maintaining coherence in reasoning. This helps mitigate catastrophic forgetting and enhances adaptability.

Datasets

The paper utilizes the Visual CoT dataset for training, which provides annotated bounding boxes for key regions, facilitating the RoI IoU reward calculation. Two training configurations are used:

  • 4data4k: Focuses on document understanding tasks, using 1,000 samples each from DocVQA, InfographicsVQA, TextCaps, and TextVQA (totaling 4,000 instances).
  • 8data8k: Extends training to general VQA and relational reasoning by adding Flickr30k, GQA, Open Images, and VSR (totaling 8,000 instances).

Evaluation is performed on the Visual CoT Benchmark and also includes zero-shot evaluations on SROIE, DUDE, and Visual7W datasets. The TextREC dataset is used to evaluate visual grounding capabilities.

Key Insights and Ideas

  • RL for Adaptable Explainability: The paper strongly advocates for RL as a superior approach to static methods for achieving both explainability and adaptability in MLLMs for document understanding. The dynamic nature of RL allows models to learn and refine reasoning strategies, which is crucial for diverse and complex documents.
  • Multi-objective Rewards Drive Performance: The carefully designed reward functions, particularly those for RoI IoU and rephrased questions, are shown to be critical for improving not only accuracy but also the transparency and interpretability of the model's reasoning.
  • Beyond Static CoT: DocThinker demonstrates that moving beyond fixed CoT templates to a learned, adaptive reasoning process can unlock significant improvements in generalization and robustness.
  • Visual Grounding Enhancement: The RoI IoU reward specifically helps the model to precisely localize relevant visual elements, which is essential for understanding documents containing charts, images, and complex layouts.

Key Results

DocThinker achieves state-of-the-art or highly competitive performance across various benchmarks.

  • Visual CoT Benchmark: DocThinker-7B (15362, 8k) outperforms baseline models, particularly in document-oriented tasks, showing strong generalization. For instance, in chart understanding (InfoQA), DocThinker-7B achieves 0.689, significantly surpassing VisCoT-7B (0.324) and Qwen2.5VL-7B (0.674).
  • Zero-Shot Capabilities: The model demonstrates competitive zero-shot performance, especially in DUDE (0.814) and SROIE (0.568), outperforming non-RL-based models.
  • RL vs. SFT: A direct comparison shows DocThinker (RL) significantly improving performance over its SFT counterpart (Qwen2.5VL-7B) on tasks like DocQA (0.579 vs. 0.355) and TextQA (0.802 vs. 0.740).
  • TextREC Dataset: DocThinker-7B achieves 82.4% Precision@1, outperforming specialized models like TAMN (80.8%) and MDETR (63.3%), highlighting its strong visual grounding capabilities.
  • Qualitative Results: The paper provides examples of DocThinker's explainable outputs, showcasing how it generates structured reasoning traces, rephrased questions, and bounding boxes, making its decision-making process transparent.

Limitations and Future Work

  • Limitations:
    • The paper acknowledges that while GRPO helps stabilize training, the choice of the KL divergence coefficient (β) is crucial for balancing exploration and stability.
  • Ablation studies show that removing RoI IoU or Rephrase Question rewards leads to performance degradation, indicating their importance and the need for careful reward function design.
  • Future Work:
    • The authors suggest expanding DocThinker to larger multimodal models and applying it to broader reasoning tasks and scenarios, such as scientific and legal document analysis, to further improve adaptability.
  • Further exploration of RL-based frameworks for enhancing explainability and adaptability in MLLMs is encouraged.

Summary updated

BibTeX
@inproceedings{yu2025docthinker,
  author = {Wenwen Yu and Zhibo Yang and Yuliang Liu and Xiang Bai},
  title = {{DocThinker: Explainable Multimodal Large Language Models with Rule-based Reinforcement Learning for Document Understanding}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure