TL;DR
While AI agents excel at writing high-quality text, they often generate poorly formatted, unprofessional documents. This paper introduces DocReward, a vision-based reward model trained to evaluate document structure and style independently of text quality. By leveraging a massive new dataset of 117K content-matched pairs, DocReward significantly outperforms models like GPT-5 in judging layout professionalism and successfully guides reinforcement learning workflows to produce beautifully formatted documents.
What Problem Does This Paper Address?
AI agents are increasingly used to automate the generation of complex, multi-page professional documents like research reports, legal briefs, and technical manuals. However, current agentic workflows focus almost entirely on what the text says (textual quality) while completely ignoring how it looks (visual structure and style). A document with brilliant insights can still look amateurish if it suffers from inconsistent fonts, bad margins, misaligned tables, or poor whitespace utilization.
The root cause is a lack of effective reward models that can evaluate document aesthetics. Standard LLMs struggle to judge visual layout from text alone, and multimodal models often conflate good writing with good formatting. To bridge this gap, the authors propose a textual-quality-agnostic framework designed to isolate layout and style evaluation from the underlying text content.
Methods
The authors built DocReward using the multimodal Qwen2.5-VL as a base architecture, adding a regression head to output a scalar professionalism score from rendered document images.
To train the model without text quality biasing the score, they optimized it using the Bradley-Terry loss on preference pairs. The model is fed pairs of documents that contain the exact same text but feature different layouts.
The core innovation lies in how they generated these pairs at scale using LLM agents:
- Textual Content to Document Agent: Discards all original formatting from a source document and uses advanced models (like GPT-4o or Claude) to regenerate a new Word document via
python-docx. - Refinement Agent: Compares the generated document against the human-authored original to create a refinement plan, iteratively improving layout, alignment, and formatting.
To rank the pairs automatically during training data collection, they used a clever oracle setup: human-authored documents always beat AI-generated ones, and AI vs. AI pairs are ranked by GPT-5 using the original human document as a visual reference anchor.
Datasets
- DocPair: A massive new dataset containing 117K document pairs spanning 32 domains and 267 document types. The source documents were curated from GovDocs1, NapierOne, and CommonCrawl, and filtered strictly to ensure high professional quality.
- DocPairBench: A high-quality evaluation benchmark consisting of 1,443 human-annotated document pairs. Human experts meticulously ranked these pairs solely based on structural and stylistic professionalism to provide a gold standard for testing.
Key Insights and Ideas
- Content-Independent vs. Content-Agnostic: The framework is textual-quality-independent but not content-agnostic. The model still reads and understands the text to ensure the style is contextually appropriate (e.g., a formal government report shouldn't look like a casual flyer), but its judgment isn't swayed by how well the text itself is written.
- Visual Cues Matter Most: Ablation studies revealed that adding explicit OCR text and bounding box coordinates actually decreased model accuracy compared to an image-only approach. The model performs best when it relies purely on visual perception, mimicking how humans scan a page for layout quality.
- Cross-Lingual Generalization: Even though DocReward was trained exclusively on English documents, it maintained high accuracy when tested on French, Spanish, and Russian documents. This proves that professional layout principles—like uniform margins, balanced whitespace, and clear hierarchies—transcend language barriers.
Key Results
- Human Preference Alignment: On the DocPairBench benchmark, DocReward-7B achieved an overall accuracy of 82.3%, outperforming GPT-5 by 14.6 percentage points and GPT-4o by 27.4 percentage points in the same setting.
- Best-of-N Reranking: When used to select the best layout out of $N$ candidates generated by an agent, DocReward achieved a 60.8% win rate against GPT-5 in human evaluations.
- Reinforcement Learning Boost: Integrating DocReward into a reinforcement learning pipeline (using GRPO) dramatically improved the document generation capabilities of Qwen2.5-Coder and GPT-4o, leading to higher compilation success rates, better ROUGE-L scores, and vastly superior visual layouts.
Limitations and Future Work
The primary limitation is that DocReward is a scalar reward model—it outputs a single numerical score but cannot explain why a document looks unprofessional or give actionable feedback. The authors note that extending DocReward into an interpretable model capable of generating natural language diagnostic rationales is the key focus of their future work.
Summary updated