TL;DR
When one company buys another, lawyers have to sift through chaotic digital dumps of thousands of files to uncover hidden legal risks—a grueling process called due diligence. This paper introduces LEXI, an end-to-end AI workflow that sorts these messy documents, extracts key facts with exact page citations, and drafts structured reports. Crucially, it puts lawyers at strict "review gates" between steps, ensuring AI does the heavy lifting while humans retain total control over legal judgment.
What Problem Does This Paper Address?
Imagine someone hands you a flash drive with thousands of unlabeled PDFs—employment contracts, tax filings, real estate deeds, corporate charters—and gives you two weeks to figure out if buying their company is a good idea. Welcome to Mergers & Acquisitions (M&A) legal due diligence.
In these transactions, sellers upload documents into a Virtual Data Room (VDR). Because seller-provided folder structures rarely match how lawyers actually assess risk, legal teams spend massive amounts of time just opening files to figure out what they are, which subsidiary they belong to, and which specialist lawyer should read them.
While NLP researchers have studied how to extract clauses from single English contracts, real-world due diligence involves wildly heterogeneous, multi-language data rooms. Lawyers need a system that handles the entire pipeline—from messy file dump to polished client report—without hallucinating facts or overriding human legal judgment.
Methods
Developed alongside a corporate law firm, LEXI (Legal Extraction and Intelligence) connects zero-shot Large Language Models (LLMs) across three stages, separated by mandatory human "review gates":
- Ingestion & Zero-Shot Classification: Documents undergo OCR and layout analysis to preserve text coordinates (paragraphs, tables, page numbers). An LLM then classifies each file into a practitioner-defined taxonomy (72 document types across 14 legal areas) and tags which target corporate entities it involves. Because it operates zero-shot using human-written descriptions, lawyers can tweak the categories per deal without retraining a model.
- Chunked Extraction & Verification: Once a lawyer confirms a document's type, LEXI triggers a tailored checklist of questions ("extractables," like Governing Law or Notice Period). To prevent "context rot" on long contracts, documents are split into overlapping multi-page windows processed in parallel, followed by a reconciliation LLM call to merge answers. Every answer requires structured output: a derivation label (
exact,inferred, ornot_foundto discourage guessing) and verbatim source snippets. Crucially, LEXI programmatically verifies these snippets against the parsed text to highlight the exact lines on the original PDF.
- Grounded Report Preparation: Only lawyer-verified extractions move forward. Lawyers add risk ratings and recommendations, and an LLM compiles these reviewed records into customizable Word report tables—strictly prohibited by prompt constraints from altering the lawyer's assessments.
Datasets
Because corporate M&A documents are fiercely confidential, there is no training dataset—the entire pipeline runs zero-shot. For evaluation, the authors used two real-world, German-language M&A Virtual Data Rooms:
- Data Room 1: 76 documents annotated by experts with ranked ground-truth document types.
- Data Room 2: 73 similarly annotated documents.
- Extraction subset: 41 German-language document–question pairs reviewed by a legal expert.
Key Insights and Ideas
- Workflow Architecture Over Raw Autonomy: AI hallucinations are unacceptable in law. By chaining structured LLM outputs through human review gates, unverified AI text can never silently slip into a final client report.
- Programmatic Grounding: High answer accuracy doesn't guarantee a model isn't making up citations. Mapping verbatim LLM quotes back to OCR coordinates visually separates verified facts (highlighted on the page) from unverified model claims.
- "Thinking" Boosts Confidence and Routing: Enabling reasoning ("thinking" tokens) didn't just make classification more accurate; it also shrank the number of candidate labels the models returned per document, showing higher confidence and reducing human review clutter.
Key Results
The authors tested GPT-5.4, GPT-5.4 mini, and GPT-5.4 nano on document classification, toggling medium-effort "thinking" on and off:
- Top-Tier Routing: With thinking enabled,
GPT-5.4achieved a primary-label Hit@1 of 98.1% on Data Room 1 and 95.2% on Data Room 2 (up from 84.2% and 90.4% without thinking). - Small Models Punch Above Their Weight: Turning thinking on lifted the smallest model (
nano) from 66.5% to 84.2% Hit@1 in Data Room 1, and from 72.6% to 89.8% in Data Room 2—matching or beating larger non-thinking models. - Fewer Guesses: Across 5 of 6 comparisons, enabling thinking reduced the average number of predicted labels per document (e.g.,
minidropped from 1.82 to 1.21 labels in Data Room 1). - Preliminary Extraction: On the small 41-prediction sample,
GPT-5.4andGPT-5.4 miniachieved a 100% match (41/41) with human expert answers.
Limitations and Future Work
LEXI is explicitly presented as a work-in-progress. The classification test sets are small (~150 documents total), the 41-item extraction check didn't formally grade snippet highlights, and the report-drafting module hasn't been formally evaluated yet.
Next, the authors plan to run full workflow user studies with practicing lawyers to measure time saved and editing effort. Technically, they aim to move beyond single-document extraction into cross-document reasoning—such as reconstructing "chains of title" (tracking who owns what across historical transfer deeds), matching contract amendments to base agreements, and catching contradictions across the entire data room.
Summary updated