Lessons learned deploying an LLM document processing system at scale

Mark Andersen, Stefan Jol, Kushal Byatnaik1 Oct 2024

Problem

Vendr, a SaaS purchasing company, holds more than 100,000 order forms, mostly PDFs. It needs structured fields (prices, purchased items) from them to compare pricing and recommend what customers should pay. Extend, the platform vendor, says an LLM typically gets about 90% right on day one. The remaining 5-10% is hard to accept in mission-critical use. Wrong supplier entities distort search and aggregates such as average contract value. Entity errors cluster rather than occur at random, so random sampling does not find them.

Example from the article: the supplier HighTouch came back as "Carry Technologies doing business as HighTouch" in some extractions and as "HighTouch" in others.

Solution in brief

Vendr fixes entities (customer, seller, supplier) before other fields by mapping extracted names to a catalog. Document embeddings then point reviewers to documents that look unlike their seller's other documents. Stored human confirmations stop later LLM runs from overwriting them. Vendr rejected real-time entity resolution at query time because of unknown unknowns and an expected error rate above 5%.

Questions this case answers
  • How to turn a large corpus of unstructured documents into a trusted structured dataset when model errors cluster and cannot be fully verified by humans
  • How to target limited human review at the records most likely to be wrong when no ground truth is available per record
  • How to extract structured fields from hundreds of thousands of messy PDF contracts with an LLM at production accuracy?
  • How to catch the 5-10% of LLM extractions that are wrong without reviewing every document by hand?

Tools and methods

  • Extend — document processing platform with pre-processing, classifier and extraction workflows, and a review UI
  • OpenAI Embeddings — document vectors for similarity and outlier detection
  • Steps 8-9 (embedding outliers, affirmation) are Vendr's own, built on its back-office tool; steps 1-7 and 10 are Extend's general advice.
Continue reading — it's free

Google or a one-time email code. No password.