What to Format and How: A Benchmark and Workflow Approach for Document Formatting

TL;DR

DocFormFlow improves formatting accuracy by 72.53% while reducing token consumption.

cs.CL 🔴 Advanced 2026-06-01 4 views
Shihao Rao Liang Li Jiapeng Liu Tong Lin Bing Li Xiyan Gao Peng Fu Jing Huang Can Ma
document formatting large language models content-aware workflow algorithm optimization

Key Findings

Methodology

DocFormFlow separates target localization from modification execution, employing a four-stage process: requirement expansion, intent classification, target element localization, and verified format modification. This method enhances formatting accuracy and reduces token consumption.

Key Results

  • DocFormFlow achieves 72.53% formatting accuracy on GPT-5, a 49% improvement over baseline methods.
  • Average token consumption reduced to 2998, over 70% less than GUI baselines.
  • Stable performance across multimodal models, with accuracy ranging from 65.8% to 80.4%.

Significance

This research provides a new benchmark and workflow approach for automated document formatting, addressing challenges in content-aware formatting and advancing intelligent document processing technologies.

Technical Contribution

By separating localization and modification processes, DocFormFlow reduces redundant document reading and improves efficiency. It offers new theoretical guarantees and engineering possibilities, surpassing existing SOTA methods.

Novelty

First to propose splitting the formatting process into localization and modification stages, significantly improving content-aware formatting accuracy, fundamentally innovating compared to existing methods.

Limitations

  • May occasionally over-modify elements beyond intended scope, leading to higher hallucination formatting rate.
  • Relies on model's accurate localization capabilities, potentially performing poorly on weaker models.

Future Work

Future work could explore further optimization of target localization algorithms and extend to more document types and language environments.

AI Executive Summary

Recent advances in large language models have opened new possibilities for automated document formatting. However, existing solutions still face challenges in content-aware formatting. DocFormFlow proposes a new workflow method by separating target localization from modification execution. This method significantly improves formatting accuracy and reduces token consumption. Experimental results show that DocFormFlow performs stably across various models, with accuracy significantly higher than baseline methods. This research provides new directions for intelligent document processing technologies and highlights areas for future improvement.

Deep Analysis

Background

With the development of large language models, automated document formatting has become possible. However, content-aware formatting still faces challenges, primarily due to the lack of dedicated evaluation datasets. Existing methods often rely on templates or regular expressions, unable to effectively handle complex content-aware requirements.

Core Problem

The core problem is how to accurately locate target elements in a document and execute formatting modifications. Existing methods often require repeated reading of the entire document, leading to inefficiency.

Innovation

DocFormFlow separates target localization from modification execution, dividing the formatting process into four stages: requirement expansion, intent classification, target element localization, and verified format modification. This method improves formatting accuracy and reduces token consumption.

Methodology

  • �� Requirement Expansion: Use LLM to expand the original request.
  • �� Intent Classification: Determine how target objects are specified.
  • �� Target Element Localization: Convert requirements into execution mappings.
  • �� Verified Format Modification: Execute formatting operations and verify results.

Experiments

Experiments use the DocFormBench dataset to evaluate performance across various models. Baseline methods include GUI and API approaches, using formatting accuracy, hallucination formatting rate, and token consumption as evaluation metrics.

Results

DocFormFlow achieves the highest formatting accuracy on multimodal models, with token consumption significantly lower than baseline methods. Hallucination formatting rate is slightly higher, but performance is excellent in terms of accuracy.

Applications

This method can be used for automated document processing, suitable for scenarios requiring high accuracy and efficiency, such as legal document formatting.

Limitations & Outlook

Relies on model's accurate localization capabilities, potentially performing poorly on weaker models. Future work should further optimize algorithms to reduce hallucination formatting rate.

Plain Language Accessible to non-experts

Imagine you're cooking in a kitchen. You need to first find the ingredients and then decide how to cook them. DocFormFlow is like a smart chef who first identifies the ingredients to be processed and then decides how to cook them. This reduces the time spent repeatedly finding ingredients and improves efficiency.

ELI14 Explained like you're 14

Imagine you're playing a game where you need to find treasure and complete tasks. DocFormFlow is like a smart game assistant that first helps you find the treasure and then tells you how to complete the tasks. This way, you can win the game faster!

Glossary

DocFormFlow

A workflow method that separates target localization from modification execution, improving formatting accuracy.

Used in the design of automated document formatting processes.

DocFormBench

A benchmark dataset for evaluating content-aware formatting.

Provides evaluation across various document types and formatting requirements.

Hallucination Formatting Rate

The proportion of formatting modifications applied outside the intended scope.

Evaluates the precision of formatting methods.

Token Consumption

The number of tokens used during formatting operations.

Measures the efficiency of formatting methods.

Content-aware Formatting

Formatting that requires understanding document semantics to identify target elements.

Handles complex formatting requirements.

Open Questions Unanswered questions from this research

  • 1 How to further reduce hallucination formatting rate and improve the precision of target localization?

Applications

Immediate Applications

Legal Document Formatting

Improves the efficiency and accuracy of legal document formatting, reducing manual operations.

Long-term Vision

Intelligent Document Processing

Achieves more intelligent document processing systems, automatically identifying and executing complex formatting tasks.

Abstract

Recent advances in large language models (LLMs) have opened up new possibilities for automated document formatting. However, real-world formatting often requires identifying targets based on document content. This content-aware setting remains challenging and underexplored, primarily due to the lack of dedicated evaluation datasets.To enable evaluation in realistic content-aware scenarios, we introduce DocFormBench, a benchmark that extends Text-to-Format evaluation to diverse formatting requirements, along with metrics for both accuracy and efficiency.To mitigate redundant document reading in existing methods during formatting, we propose DocFormFlow, a workflow formatting method that decouples target localization from modification execution into what to format and how. Extensive experiments across multiple LLMs and multimodal models show that DocFormFlow consistently improves formatting accuracy while reducing token consumption compared to representative baselines. Further analysis reveals that precise target localization is the primary factor influencing formatting performance. We hope DocFormBench and DocFormFlow will facilitate future research toward more intelligent and reliable document formatting.

cs.CL