Design an LLM Pipeline That Extracts Lease Terms From Client Contracts

Last updated: November 29, 2026

Quick Overview

A client with 40,000 property and equipment leases must comply with lease accounting standards (ASC 842 / IFRS 16). Design an LLM-based system that extracts commencement date, term, payments, renewal options and escalations from scanned contracts, with accuracy an auditor can rely on.

Deloitte
ML System Design
Machine Learning Engineer
Deloitte
November 29, 2026
Machine Learning Engineer
System Design Round
ML System Design
Hard

0

0

0 solved


A client with 40,000 property and equipment leases must comply with lease accounting standards (ASC 842 / IFRS 16). Design an LLM-based system that extracts commencement date, term, payments, renewal options and escalations from scanned contracts, with accuracy an auditor can rely on.

Deloitte is investing heavily in generative and agentic AI for finance and accounting work, and document extraction with human review is one of the most common client deliverables. The interviewer is checking that you treat accuracy and traceability as the product, design the human in the loop properly, and keep client documents isolated.

What the Interviewer Expects
  • Builds OCR and layout parsing before any LLM step
  • Uses schema-constrained extraction with a citation (page and span) for every field
  • Routes low-confidence or high-impact fields to human reviewers
  • Defines field-level evaluation against a labeled gold set
  • Keeps each client's documents and prompts isolated, with no training on client data without consent
  • Validates extracted values with accounting rules (dates consistent, payment schedule sums)
Key Topics to Cover
document AI
structured extraction
human in the loop
evaluation
grounding and citations
data isolation
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
  • How do you estimate confidence for an LLM-extracted field?
  • An amendment changes the rent in year 3. How does the system link amendments to the base lease?
  • How do you prove to the audit team that the error rate is acceptable?
  • How would you cut cost per document by 5x without losing accuracy?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice ML System Design Problems
Sample Answer
Requirements

Input: scanned PDFs, many with amendments, in several languages. Output per lease: a typed record (parties, asset, commencement, term, payment schedule, escalation rule, renewal and termination option...

High-Level Design
  1. Ingest: documents land in a per-client encrypted store.
  2. OCR and layout: produce text with page coordinates, tables and checkbox states.
  3. Document grouping: classify each file (base...

Submit Your Answer
Markdown supported

Related Questions