DocETL: Agentic Query Rewriting and Evaluation for Complex Document Processing
Authors:
Top Cited Papers
Open Access
- 1 May 2025
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the VLDB Endowment
- Vol. 18 (9) , 3035-3048
Abstract
Analyzing unstructured data has been a persistent challenge in data processing. Recent proposals offer declarative frameworks for LLM-powered processing of unstructured data, but they typically execute user-specified operations as-is in a single LLM call—focusing on cost rather than accuracy. This is problematic for complex tasks, where even well-prompted LLMs can miss relevant information. For instance, reliably extracting all instances of a specific clause from legal documents often requires decomposing the task, the data, or both. We present DocETL, a system that optimizes complex document processing pipelines, while accounting for LLM shortcomings. DocETL offers a declarative interface for users to deine such pipelines and uses an agent-based approach to automatically optimize them, leveraging novel agent-based rewrites (that we call rewrite directives ), as well as an optimization and evaluation framework. We introduce (i) logical rewriting of pipelines, tailored for LLM-based tasks, (ii) an agent-guided plan evaluation mechanism, and (iii) an optimization algorithm that efficiently finds promising plans, considering the latencies of LLM execution. Across four real-world document processing tasks, DocETL improves accuracy by 21–80% over strong baselines. DocETL is open-source at docetl.org and, as of March 2025, has over 1.7k GitHub stars across diverse domains.Keywords
All Related Versions
This publication has 16 references indexed in Scilit:
- Who Validates the Validators? Aligning LLM-Assisted Evaluation of LLM Outputs with Human Preferences2024
- Calibrated Language Models Must Hallucinate2024
- Demonstrating CAESURA: Language Models as Multi-Modal Query Planners2024
- Lost in the Middle: How Language Models Use Long ContextsTransactions of the Association for Computational Linguistics, 2024
- DB-BERT: A Database Tuning Tool that "Reads the Manual"2022
- CDBProceedings of the VLDB Endowment, 2018
- NoScopeProceedings of the VLDB Endowment, 2017
- An overview of query optimization in relational systems1998
- Options in physical database designACM SIGMOD Record, 1993
- Maintaining views incrementallyACM SIGMOD Record, 1993