Skip to main content
QUICK REVIEW

[논문 리뷰] DocETL: Agentic Query Rewriting and Evaluation for Complex Document Processing

Shreya Shankar, Chambers, Tristan|arXiv (Cornell University)|2024. 10. 16.
Semantic Web and Ontologies인용 수 4
한 줄 요약

DocETL는 대규모 언어 모델(Large Language Models, LLMs) 기반의 복잡한 문서 처리 파이프라인의 정확도를 향상시키기 위해 에이전트 기반의 쿼리 재작성 및 평가를 사용하는 선언적 시스템이다. 새로운 재작성 지시어, 에이전트 가이드 플랜 평가, 최적화 알고리즘을 적용함으로써 DocETL는 비정형 문서 작업에서 수작업으로 설계된 기준보다 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

실험 결과

연구 질문

  • RQ1복잡하고 장문의 문서에서 LLM 기반 문서 처리 파이프라인을 체계적으로 재작성하여 정확도를 향상시킬 수 있는 방법은 무엇인가?
  • RQ2단일 작업을 정확하고 모듈화된 구성 요소로 분해하는 데 가장 효과적인 논리적 재작성 지시어의 유형은 무엇인가?
  • RQ3작업 전용 검증 프롬프트를 사용한 에이전트 가이드 플랜 평가가 문서 분석 작업에서 LLM 출력 품질을 크게 향상시킬 수 있는가?
  • RQ4계획 품질과 생성 시간을 균형 잡는 최적화 알고리즘이 실세계 문서 처리에서 수작업으로 설계된 기준 파이프라인을 얼마나 뛰어나게 성능을 낼 수 있는가?
  • RQ5에이전트 기반의 반복적 재작성 과정은 정적 프롬프트 엔지니어링 대비 출력의 포괄성과 정확성 측면에서 어떻게 비교되는가?

주요 결과

  • DocETL는 세 가지의 서로 다른 비정형 문서 분석 작업에서 잘 설계된 기준 대비 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가 만들고, 인간 에디터가 검토했습니다.