Skip to main content
QUICK REVIEW

[論文レビュー] DocETL: Agentic Query Rewriting and Evaluation for Complex Document Processing

Shreya Shankar, Chambers, Tristan|arXiv (Cornell University)|Oct 16, 2024
Semantic Web and Ontologies被引用数 4
ひとこと要約

DocETL は、大規模言語モデル(LLM)で駆動される複雑なドキュメント処理パイプラインの正確性を向上させるために、エージェント駆動のクエリリライトと評価を用いる宣言的システムである。新しいリライトディレクティブ、エージェントガイドドの計画評価、最適化アルゴリズムを適用することで、非構造化ドキュメントタスクにおいて、手動で最適化されたベースライン比で出力品質が 1.34 倍から 4.6 倍向上した。

ABSTRACT

Analyzing unstructured data has been a persistent challenge in data processing. Large Language Models (LLMs) have shown promise in this regard, leading to recent proposals for declarative frameworks for LLM-powered processing of unstructured data. However, these frameworks focus on reducing cost when executing user-specified operations using LLMs, rather than improving accuracy, executing most operations as-is (in a single LLM call). This is problematic for complex tasks and data, where LLM outputs for user-defined operations are often inaccurate, even with optimized prompts. For example, an LLM may struggle to identify {\em all} instances of specific clauses, like force majeure or indemnification, in lengthy legal documents, requiring decomposition of the data, the task, 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 define 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 that synthesizes and orchestrates task-specific validation prompts, and (iii) an optimization algorithm that efficiently finds promising plans, considering the latencies of agent-based plan generation and evaluation. Our evaluation on four different unstructured document analysis tasks demonstrates that DocETL finds plans with outputs that are 25 to 80% more accurate than well-engineered baselines, addressing a critical gap in unstructured data analysis. DocETL is open-source at docetl.org, and as of March 2025, has amassed over 1.7k GitHub Stars, with users spanning a variety of domains.

研究の動機と目的

  • 複雑なドキュメント処理において、コスト削減を重視するが正確性を犠牲にする既存の LLM ベースの宣言的フレームワークにおける重要なギャップを埋める。
  • 長大で複雑なドキュメントの処理において LLM が欠落した節や事実を捏造するなどの限界を克服するため、モノリシックな処理をより正確でモジュラーなパイプラインに分解する。
  • ユーザーが事前に定義した静的プロンプトに依存するのではなく、LLM エージェントを用いて自律的にドキュメント処理パイプラインを最適化するシステムを開発する。
  • 正確性が最重要となる、法的文書や警察記録など、多様で長大なドキュメントからの包括的かつ高品質な情報抽出と要約を可能にする。
  • テンプレートドキュメントにとどまらない多様な非構造化データワークロードをサポートする柔軟でオープンソースのフレームワークを提供し、LLM ベースの ETL パイプラインの適用範囲を拡大する。

提案手法

  • ドキュメント処理に特化した、より単純で正確なサブオペレーションに、エラーを起こしやすい LLM 操作を論理的に分解するための新しいリライトディレクティブを導入する。
  • タスク固有の検証プロンプトを合成・評価するエージェントベースのフレームワークを採用し、リライトされたパイプライン計画の品質を評価する。
  • 時間制約のもとで有望なパイプライン計画を探索する最適化アルゴリズムを用い、計画生成中に機会的リライトを活用する。
  • パイプライン計画が十分に最適化されているかどうかを判断する検証エージェントを適用し、必要に応じてさらなるリライトをトリガーする。
  • 低レベルの実装詳細を抽象化するため、ユーザーがドキュメント処理パイプラインを指定できる宣言的 YAML ベースのインターフェースをサポートする。
  • 新しく合成されたオペレーションが直ちに再びリライトおよび評価対象となるフィードバックループをオーケストレーションし、反復的改善を可能にする。
Figure 1. Optimization for a pipeline designed to accomplish the task in Example 1.1 . The diagram illustrates the system mid-optimization of the initial map operation. DocETL employs LLMs to synthesize new plans using novel rewrite directives. The process begins with an LLM verifier determining if
Figure 1. Optimization for a pipeline designed to accomplish the task in Example 1.1 . The diagram illustrates the system mid-optimization of the initial map operation. DocETL employs LLMs to synthesize new plans using novel rewrite directives. The process begins with an LLM verifier determining if

実験結果

リサーチクエスチョン

  • RQ1LLM ベースのドキュメント処理パイプラインを、複雑で長大なドキュメントにおいて正確性を向上させるために、どのように体系的に再ライティングできるか?
  • RQ2モノリシックな LLM オペレーションを正確でモジュラーなコンponents に分解するのに最も効果的な論理的リライトディレクティブの種類は何か?
  • RQ3タスク固有の検証プロンプトを用いたエージェントガイドドの計画評価は、ドキュメント分析タスクにおける LLM 出力の品質を顕著に向上させることができるか?
  • RQ4計画の品質と生成時間のバランスを取る最適化アルゴリズムは、現実世界のドキュメント処理において、手作業で作成されたベースラインパイプラインをどの程度上回ることができるか?
  • RQ5エージェント駆動の反復的リライトプロセスは、静的プロンプト工学に比べて、出力の包括性と正確性においてどのように異なるか?

主な発見

  • DocETL は、3 つの異なる非構造化ドキュメント分析タスクにおいて、手作業で最適化されたベースライン比で、正確性と包括性の両面で 1.34 倍から 4.6 倍の高い出力品質を達成した。
  • システムのエージェントガイドドの計画評価メカニズムは、長大なドキュメントにおける節の欠落や捏造された内容といった LLM の一般的な失敗を的確に特定・是正した。
  • リライトディレクティブにより、複雑なオペレーションの効果的な分解が可能になり、LLM のコンテキストオーバーロードのリスクが低下し、全体的理解が向上した。
  • 最適化アルゴリズムは、実用的な時間制限内で計画空間を効率的に探索し、網羅的探索を必要とせずに高品質なパイプラインを発見できた。
  • 実世界のユースケースによる検証を通じて、法的、医療的、社会科学的ドキュメント分析の多様な分野において、同フレームワークの頑健性が示された。
  • 2024 年 10 月現在、DocETL は GitHub で 800 スター以上を獲得しており、さまざまなアプリケーション分野での広範な採用と実用性を示している。
Figure 2. Iterative folding in a reduce operation, illustrating the step-by-step evolution of both the scratchpad and accumulated output when processing multiple batches of documents. New input is integrated with the previous scratchpad state, updating mention counts and the intermediate output for
Figure 2. Iterative folding in a reduce operation, illustrating the step-by-step evolution of both the scratchpad and accumulated output when processing multiple batches of documents. New input is integrated with the previous scratchpad state, updating mention counts and the intermediate output for

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。