An agentic system with reinforcement-learned subsystem improvements for parsing form-like documents
Ayesha Amjad, Saurav Sthapit, Tahir Qasim Syed
TL;DR
The paper tackles the challenge of reliably extracting structured data from diverse form-like documents by moving beyond monolithic LLM pipelines to a modular, agentic framework. It combines multiple LLM agents (for classification, schema building, and data extraction) with reinforcement learning and meta-prompting to continuously improve prompts based on past performance, aiming to operate across varying document types, layouts, and LLMs. The approach yields substantial improvements over baseline one-shot prompting on benchmarks like SOIRE and CORD, particularly in handling multi-page documents and complete extraction of line items in financial documents. This agentic system offers a scalable, self-correcting solution for automated document data extraction, while also addressing practical concerns such as processing efficiency, evaluation metrics, and ethical considerations around data privacy and security.
Abstract
Extracting alphanumeric data from form-like documents such as invoices, purchase orders, bills, and financial documents is often performed via vision (OCR) and learning algorithms or monolithic pipelines with limited potential for systemic improvements. We propose an agentic AI system that leverages Large Language Model (LLM) agents and a reinforcement learning (RL) driver agent to automate consistent, self-improving extraction under LLM inference uncertainty. Our work highlights the limitations of monolithic LLM-based extraction and introduces a modular, multi-agent framework with task-specific prompts and an RL policy of rewards and penalties to guide a meta-prompting agent to learn from past errors and improve prompt-based actor agents. This self-corrective adaptive system handles diverse documents, file formats, layouts, and LLMs, aiming to automate accurate information extraction without the need for human intervention. Results as reported on two benchmark datasets of SOIRE, and CORD, are promising for the agentic AI framework.
