Skip to content Enterprise Perfect Docs Guaranteed — a per-field accuracy SLA in your contract. You only pay for documents we get right. Learn more
A Closing Disclosure loan terms table turning into structured JSON, with a check mark on each verified field and a warning on one
Industry Insight AI/Tech Explainer Thought Leadership

Mortgage Document Extraction at Scale: Closing Disclosures, Failure-Prone Fields, and How to Measure Per-Field Accuracy

ET Engineering team 20 min read
Table of contents

Looking for the product? Invofox’s Closing Disclosure OCR extracts loan terms, closing costs and cash-to-close data from Closing Disclosures. For the whole loan file, see mortgage document automation.

A note on sources

We’re the engineering team at Invofox, and we sell a document extraction API. Read what follows with that in mind. To keep this post useful to anyone, whichever tool they use, every statement about a regulation, a form or an agency requirement links to the primary source: Regulation Z on eCFR, the CFPB, the Fannie Mae Selling Guide, Freddie Mac and the IRS. The measurement method later in the post is our advice from running extraction in production. It isn’t a standard, and we say so where it applies. What we say about Invofox is in one clearly labeled section near the end.

Why mortgage files are a different extraction problem

A mortgage file is a bundle, not a document. Every page in it feeds a decision: whether the borrower qualifies, whether the loan can be sold, whether the disclosures were right. A wrong value doesn’t stay in a spreadsheet. It ends up in an income calculation, an asset check or a tolerance test.

This is also where demos and production part ways. Run a demo on a clean, native-PDF Closing Disclosure for a purchase loan and almost anything looks good. Production brings refinances with no seller, corrected disclosures, scanned W-2s on substitute forms, and pay stubs from every payroll system in the country. The edge cases that never show up in a demo are what break production, and in mortgage the regulations themselves create many of them.

What’s actually in a mortgage origination file

The list below covers loans sold to Fannie Mae or Freddie Mac, because their guides publish the documentation rules. Other programs have their own requirements, so treat this as the common core rather than a complete checklist.

  • The loan application. Fannie Mae requires a “complete, signed, and dated version of the final Form 1003” in every loan file (Selling Guide B1-1-01). The same form is the Uniform Residential Loan Application, Freddie Mac Form 65. Freddie Mac notes that the redesigned URLA became mandatory for all new loans to the GSEs on March 1, 2021. The same page notes that the Supplemental Consumer Information Form (Form 1103) is a required document in the loan file for new conventional loans sold to the GSEs.
  • Employment and income. Under Selling Guide B3-3.2-01, the most recent paystub “must be dated no earlier than 30 days prior to the initial loan application date and it must include all year-to-date earnings.” W-2s must cover the most recent one- or two-year period, depending on the income type. A year-end paystub, an IRS Wage and Income transcript or a Request for Verification of Employment (Form 1005) can stand in for a W-2.
  • Tax returns and transcripts. When tax returns are required, they must be copies of the filed originals with all supporting schedules, or IRS transcripts instead. For self-employed borrowers that can mean Schedules B through F, Schedule K-1 and business returns such as Forms 1065, 1120 and 1120S. Each borrower whose income is used to qualify generally signs an IRS Form 4506-C at or before closing so the lender can request transcripts (Selling Guide B3-3.1-02).
  • Assets. Bank or investment statements, or a Request for Verification of Deposit (Form 1006). For a purchase, the statements must cover “the most recent full two-month period of account activity”; for a refinance, the most recent full month (Selling Guide B3-4.2-01).
  • The disclosures. The Loan Estimate is a three-page form the lender must provide within three business days of receiving the application. The Closing Disclosure is a five-page form the borrower must receive at least three business days before closing (12 CFR 1026.19(e) and (f)). Reverse mortgages are the exception: the CFPB notes that those borrowers receive a HUD-1 Settlement Statement and a final Truth in Lending disclosure instead.
  • Everything else used to decide. The application package must also include the credit report, the appraisal and inspection reports, and “any other information or documentation used to verify, clarify, or substantiate information in the borrower’s application” (B1-1-01).

Two details from the Selling Guide matter a lot for extraction. First, borrower copies “may be photos or scanned versions of the original documents” (B1-1-01), so image quality is part of the problem by design. Second, credit documents, which include income and asset documentation, “must be no more than four months old on the note date” (B1-1-03). That turns statement and pay dates into fields that decide eligibility, not just metadata.

Standardized is not the same as fixed-layout

People usually split mortgage documents into “standard forms” and “everything else”. That’s a useful first cut, but it hides the problem. The more accurate picture is a spectrum: some documents have their content standardized, fewer have their layout fixed, and even the fixed ones have regulated variants.

DocumentWho defines itHow fixed is the layout?
Closing DisclosureCFPB, Regulation Z §1026.38 (form H-25)Order and position fixed; regulated variants allowed (see below)
Loan EstimateCFPB, Regulation Z §1026.37 (form H-24)Order and position fixed; similar permitted modifications
URLA (Form 1003 / Form 65)Fannie Mae and Freddie MacField names and section order fixed; rendering flexible
Form W-2 (employee copies)IRS, Publication 1141Box titles fixed; substitute formats allowed
Form 1040 and schedulesIRSStandard form, but attachments vary by borrower
Pay stubsEach employer or payroll providerContent requirements only, no prescribed layout
Bank statementsEach financial institutionContent requirements only, no prescribed layout

The Closing Disclosure: fixed, with regulated variants

For a federally related mortgage loan, the disclosures “must be made using form H-25”. Other transactions covered by the rule use a form “substantially similar” to it. The content must appear “in the same order, and positioned relative to the master headings, headings, subheadings, labels, and similar designations in the same manner, as shown in form H-25” (§1026.38(t)(1)–(3)). That’s about as close to a fixed layout as mortgage paperwork gets.

The same paragraph also lists the exceptions, and each one is a layout variant your pipeline will see (§1026.38(t)(5)):

  • Unused line numbers in the Loan Costs and Other Costs tables “may be deleted and the deleted line numbers added” to other subsections. Row counts per subsection change from file to file.
  • If the itemization doesn’t fit, the Closing Cost Details may be disclosed on two pages.
  • Creditors may add administrative information, text or codes at the bottom of each page.
  • The seller can receive a version with the borrower’s information blank or deleted (form H-25(I)).
  • Transactions without a seller, or with simultaneous subordinate financing, may use alternative tables (form H-25(J)). That includes an alternative “Calculating Cash to Close” table and a “Payoffs and Payments” table.
  • The form may be translated, and an additional page may be attached for “customary recitals and information used locally in real estate settlements.”

Because corrected Closing Disclosures are required when terms change (§1026.19(f)(2)), one loan file can also contain several of them.

The URLA: fixed content, flexible rendering

The GSEs’ URLA rendering options say “the field names, descriptions, and order of sections may not be altered in any way”. The same document then allows a lot else to change. Pages may be letter or legal size. Fonts may change. Subsections such as “1c” (additional employment) and “3c” (additional property) may repeat as often as needed. Asset and liability lists may grow or shrink. Dates may appear as MM/DD/YYYY or YYYY-MM-DD. Social Security and account numbers may be masked on copies exchanged during origination. Two URLAs from two loan origination systems can carry the same fields and look quite different.

The W-2: the copy you receive is often a substitute

The W-2 a borrower hands over is an employee copy (Copy B, C or 2). IRS Publication 1141 lets employers furnish substitute versions of those copies. Their dimensions may differ from the official form, “either horizontal or vertical format is permitted”, boxes 7 through 14b may be left off when they don’t apply, and employers may enter more than four codes in box 12. The core boxes 1 through 6 must keep the official order in the upper right, but identifying items such as the employer’s name and address may sit elsewhere on the form. Employers may also truncate the employee’s SSN on employee copies (General Instructions for Forms W-2 and W-3).

The form itself also changes. On the 2026 Form W-2, box 14 has been split into 14a (“Other”) and 14b, a new box for Treasury Tipped Occupation Codes (Publication 1141, Rev. 08-2026). A W-2 schema built on last year’s form needs a new field, and its accuracy history needs a version boundary.

Pay stubs and bank statements: requirements without a form

For pay stubs, the Selling Guide sets content, not layout. The stub must show year-to-date earnings and the employer’s name, be computer-generated or typed by the employer, and come from a third-party source such as a payroll department or payroll vendor. Stubs the borrower downloads from the internet are also acceptable (B3-3.2-01). For bank statements, it lists what every statement must show: the institution, the borrower as account holder, at least the last four digits of the account number, the period covered, all deposits and withdrawals, and the ending balance. Quarterly statements are allowed (B3-4.2-01). The look is up to each employer, payroll vendor and bank, so a pipeline has to recognize those fields on layouts it has never seen.

Practical takeaway: don’t plan your pipeline, or your accuracy measurement, around “standard forms are easy”. Plan around which variants each document type can legally take.

The Closing Disclosure fields that break extraction

On a Closing Disclosure, getting the words right is rarely the problem. The hard part is assigning each value to the right field, because the form packs many similar-looking values into small tables on purpose. These are the field families most likely to go wrong, each with the rule in Regulation Z that makes it tricky.

1. Which Closing Disclosure is the right one

When disclosures become inaccurate before consummation, the creditor must provide corrected ones. Some changes, such as an APR that becomes inaccurate, a changed loan product or an added prepayment penalty, restart the three-business-day wait. Events after closing can require corrected disclosures within 30 days, and refunds for tolerance violations within 60 (§1026.19(f)(2)). A file can therefore hold several Closing Disclosures, each with its own “Date Issued” (§1026.38(a)(3)(i)). If extraction pulls every field perfectly from the superseded version, every field is still wrong for the loan. Version selection belongs in the test set as a field you score, not as an assumption.

2. Loan Estimate versus Final

The “Calculating Cash to Close” table puts the Loan Estimate figure, the Final figure and a “Did this change?” statement on the same row for each item (§1026.38(i)). The two columns differ in precision: dollar amounts under the “Loan Estimate” subheading of that table are rounded to the nearest whole dollar (§1026.38(t)(4)(i)(C)). Taking the value from the neighboring column is a classic silent error. The number is real, it’s on the page, and it’s in the wrong field.

3. Who paid: the column problem

Loan Costs and Other Costs have columns that show whether each charge was “borrower-paid at or before closing, seller-paid at or before closing, or paid by others” (§1026.38(f) and (g)). On a scanned page, a value one column to the left is a different fact. A pipeline that checks only whether the amount appears somewhere on the row will score well and still be wrong.

4. Signs

The regulation tells you which values carry a minus sign. Lender Credits are disclosed “as a negative number” (§1026.38(h)(3)), and several Final amounts in Calculating Cash to Close are “stated as a negative number”, for example the deposit, seller credits and closing costs paid before closing (§1026.38(i)). A dropped minus sign is a one-character OCR miss and a large error in any reconciliation that sums those lines.

5. Rounding and number formats

Regulation Z sets different number formats for different fields:

  • The loan amount is shown unrounded. If it’s a whole number, it is “truncated at the decimal point” (§1026.38(t)(4)(iii)).
  • Required percentages are rounded “to three decimal places and then dropping any trailing zeros” (§1026.38(t)(4)(ii)), so a rate can appear as 6.875% or 7%.
  • Certain amounts, including some in Loan Terms and Projected Payments, are rounded to the nearest whole dollar (§1026.38(t)(4)(i)).

None of this is an error on the form. It matters because your ground truth has to decide what counts as a match: is “$385,000” equal to 385000.00? Is “7%” equal to 7.000? We come back to this in the methodology section.

6. Variable-length itemizations

The fee sections are lists, not fixed slots. Line numbers can be added or removed. Each item carries the name of “the person ultimately receiving the payment”. Title insurance components start with “Title —”, and some optional products end with “(optional)” (§1026.38(f), (g) and (t)(5)(iv)). In the Summaries of Transactions, items paid outside closing funds are marked “Paid Outside of Closing” or “P.O.C.” along with the payer (§1026.38(j)(4) and (k)(4)). The failure modes are the ones you’d expect from tables: merged rows, a payee read as part of the fee description, a row that runs onto the next page, a P.O.C. amount counted as paid at closing.

7. Transaction-type variants

A schema designed for a purchase loan expects the seller columns and both Summaries of Transactions. A refinance on the alternative form may have neither, and it adds Payoffs and Payments instead (§1026.38(t)(5)(vii)). A seller’s copy may have the borrower’s sections blank. If your schema can’t express “this section legitimately doesn’t exist on this variant”, every refinance turns into a pile of false “missing field” errors, or worse, invented values.

8. Fields whose purpose is comparison

Much of the Closing Disclosure exists to be checked against the Loan Estimate. Items must be labeled consistently with the Loan Estimate and listed “in the same sequential order” (§1026.38(h)(4)). The good-faith rules compare what was charged with what was estimated. As a general rule a charge may not exceed the original estimate; certain third-party services and recording fees may increase by up to 10 percent in aggregate, and a listed set of charges such as prepaid interest and escrow amounts may vary (§1026.19(e)(3)). Any automated check built on those comparisons is only as reliable as the extraction on both documents. One misread fee on either side gives a wrong answer about tolerances.

Beyond the Closing Disclosure

The same pattern of right value, wrong field shows up across the rest of the file. On pay stubs, current-period and year-to-date amounts sit side by side, and the date that counts for the 30-day rule has to be the right date. On W-2s, the amount in box 12 is meaningless without its code, and boxes 1, 3 and 5 hold different wage figures. On bank statements, the ending balance and the statement period drive both the asset amount and the four-month age check. Multi-page statements and quarterly cycles break assumptions about one page per month.

Self-employed borrowers are where this gets hardest, because the income calculation pulls from tax returns that were designed for the IRS, not for extraction:

  • Columns that mean different things. Schedule E reports up to three rental properties side by side in columns A, B and C, so rent, mortgage interest and depreciation for one property can land in another’s field. The Schedule L balance sheet on Forms 1065, 1120 and 1120-S has beginning-of-year and end-of-year columns, and lenders usually need the end of year.
  • Percentages with a time dimension. A partnership K-1 reports the partner’s share of profit, loss and capital at both the beginning and the end of the year. Read the beginning column instead of the ending one and the ownership share is wrong, even though the number is on the page.
  • Losses and checkboxes. Business and rental results are often losses, commonly shown in parentheses, so a missed parenthesis turns a loss into income. Checkboxes such as “Final K-1” or “final return” are single marks that change how the income can be used.
  • Grids on verification forms. A Request for Verification of Employment (Form 1005) breaks earnings into base pay, overtime, commissions and bonus, each for year to date and the two prior years. That is twelve numbers in a small grid, and a value read one cell off is still a plausible number.

These are our observations from production rather than citations, but each one maps to a form or requirement linked above.

How to measure per-field accuracy

Everything in this section is advice: a method we use and recommend, not an industry or regulatory standard. We cite a source only where we state a fact.

1. Build ground truth from your own files

Take a sample of real loan files, not a vendor’s demo set. Have each document keyed by two people working independently, and have a third resolve the differences. A single keyer’s answers are an opinion, not ground truth. Keep the source page and location for every labeled value so disagreements can be resolved by looking at the image.

For Closing Disclosures you don’t need to invent a field vocabulary. The GSEs publish sample numbered Closing Disclosure forms with “Form Field IDs” superimposed by each field as part of the Uniform Closing Dataset, which Freddie Mac describes as a common industry dataset that “allows information on the Consumer Financial Protection Bureau’s (CFPB’s) Closing Disclosure to be communicated electronically.” Labeling against an existing ID scheme makes ground truth comparable across teams and tools.

2. Write down the comparison rule for every field

Decide, field by field and before you score anything, whether a match means:

  • Exact match: identifiers, loan ID, file number, the account number’s last four digits.
  • Normalized match: amounts compared as signed numbers to the cent (“$385,000” equals 385000.00, but -750 does not equal 750); percentages compared as numbers, so trailing-zero rules like Regulation Z’s don’t count as errors; dates compared in one format such as ISO 8601.
  • Tolerant match for text: payee and employer names, where you have decided which differences (case, punctuation, “Inc.” versus “Inc”) don’t matter downstream.

Write these rules down and version them. If the rules change, the accuracy figure changes, even though the extraction didn’t.

3. Score per field, then roll up

A per-document score (“94% of documents mostly right”) hides the field your workflow depends on. Report accuracy for each field. Also report document-level accuracy, meaning the share of documents where every field you need is correct, because that’s the number that tells you how many files can skip a human. Report each field family separately: Loan Terms, Projected Payments, the Loan Costs and Other Costs itemizations, Calculating Cash to Close, and the Summaries of Transactions. A good average can hide a weak table.

4. Treat nulls as outcomes, not gaps

Every field has five possible outcomes. Count each one separately:

Ground truthExtractionOutcome
ValueSame valueCorrect
ValueDifferent valueWrong value
ValueEmptyMissed
EmptyValueInvented
EmptyEmptyCorrect empty

Invented values are the most dangerous, because they look exactly like correct ones. They’re the reason a raw confidence score isn’t enough. Track the share of wrong or invented values that went through without a flag, separately from overall accuracy. On the Closing Disclosure, “correct empty” matters more than usual, because the regulated variants leave whole sections legitimately blank.

5. Size and stratify the sample

Accuracy measured on a sample is an estimate, so report it with an interval. As a rough guide, with the usual normal approximation, a field measured on 200 documents at 99% observed accuracy has a 95% interval of about ±1.4 percentage points. A field measured on 30 documents can’t tell you much. Small, rare variants need deliberate oversampling or they won’t appear at all.

Stratify the sample along the lines where layouts and failure modes actually change:

  • document type and variant: purchase versus no-seller Closing Disclosures, seller copies, corrected versions
  • source: lender, settlement agent, loan origination system, payroll provider, bank
  • capture: native PDF versus scan or photo
  • form version, such as W-2 tax year

Report accuracy per stratum. An overall figure that’s mostly clean purchase-loan Closing Disclosures says little about your refinance pipeline.

6. Measure again, on a schedule

Re-run the same ground-truth set every time the model, prompt, configuration or schema changes, and compare results field by field. Add a steady sample of production documents to the ground truth so the set keeps up with your real traffic. When a form changes, like the 2026 W-2 box 14 split, start a new schema version instead of quietly redefining the old field.

How the approaches compare

There are three common ways to get structured data out of a mortgage file. The useful comparison isn’t a feature list. It’s who carries the risk when a field comes back wrong.

Generic OCR or a general-purpose model. It reads text well, often very well. What you get back is text or loosely structured output. Everything in this post is still your job: knowing about H-25 variants, column assignment, sign handling, version selection and measurement. That’s a reasonable choice for prototyping and for low-volume work where a person reviews every file anyway.

An in-house build. You control everything, and you own everything: the ground-truth set, the normalization rules, the Closing Disclosure variants, the next W-2 revision, and re-measuring after each change. The first version is rarely the expensive part. The edge cases add up over time, and the maintenance grows faster than most teams expect.

A vendor without an accuracy commitment. This removes the build work but not the risk. If a vendor shows you a benchmark but won’t put per-field accuracy on your documents into a service level agreement, every wrong value is still your cost: in rework, in repurchase exposure, in delayed closings. If a vendor won’t put accuracy in an SLA, the customer is absorbing all the risk.

Whichever route you take, these questions sort the options quickly:

  1. Can you measure per-field accuracy on our documents, against our ground truth, with the comparison rules written down?
  2. How are missed and invented values counted, and how are they flagged?
  3. How do you handle no-seller Closing Disclosures, seller copies and corrected versions?
  4. What happens to accuracy when a form changes, and who finds out first?
  5. When we correct a value, does that correction improve future results, or does the same mistake come back?
  6. What happens to the documents after the data is returned?

The fifth question separates a document AI product from a static OCR tool. Models that don’t learn from corrections make the same mistake on the thousandth loan as on the first. The sixth question matters because a mortgage file holds Social Security numbers, account numbers, income and tax data. For documents like these, the vendor needs a clear data retention policy: how long documents and extracted data are kept and why, and whether you can have them deleted as soon as the data is delivered.

Where Invofox fits

This is the vendor section. Invofox is a document data extraction API: you send PDFs or images and get back structured JSON that matches your schema.

  • Per-field accuracy you can contract on. On Enterprise plans, per-field accuracy targets are written into the SLA, per document type, and agreed on your real documents. You only pay for documents extracted perfectly (Perfect Docs Guaranteed). How we measure against ground truth is documented on evaluation and accuracy.
  • Custom schemas. You define the fields and their structure, so a schema can model the Closing Disclosure variants described above (custom documents).
  • Continuous learning. Corrections sent back to us flow into your pipeline configuration, so the same mistake doesn’t reach you twice (continuous learning).
  • Security. SOC 2, ISO 27001 and GDPR compliant, with a zero-retention mode for regulated workflows (opt-in, on Scale and Enterprise plans) in which documents and extracted data are purged on delivery.

For the documents in this post, start with Closing Disclosure OCR, then payslips, tax forms and bank statements. For the whole loan file, see mortgage document automation. The fairest way to judge us is the method above: your files, your ground truth, field by field.

Final thoughts

Most of the regulated forms in a mortgage file are standardized, and that’s what makes them look easy. The difficulty is in the details the regulations allow: rows that can be added, columns that change who paid, numbers that must be negative or rounded, variants for transactions without a seller, and corrected versions in the same file. Pay stubs and bank statements add the opposite problem, required content in layouts nobody controls.

None of that shows up in a ten-document demo. All of it shows up in a per-field, stratified, re-run-on-every-change measurement against your own ground truth. Measure that way before you trust any extraction, including ours.

Frequently asked questions

Which documents are in a typical mortgage origination file?

For a loan sold to Fannie Mae or Freddie Mac, the file is built around the Uniform Residential Loan Application (Fannie Mae Form 1003 / Freddie Mac Form 65), plus income documents such as pay stubs, W-2s and federal tax returns or IRS transcripts, asset documents such as bank statements, the credit report and appraisal, and the TRID disclosures: the Loan Estimate and the Closing Disclosure. The exact set depends on the borrower's income type and the transaction.

Is the Closing Disclosure a fixed-layout form?

Mostly, but not completely. Regulation Z requires form H-25 for federally related mortgage loans and fixes the order and position of its headings, but it also lets creditors add or delete line numbers in the closing cost tables, spread those tables over two pages, use alternative tables for transactions without a seller, give the seller a modified version, and attach an extra page for local recitals. An extraction pipeline has to handle all of those variants.

Which Closing Disclosure fields fail most often in extraction?

Failures cluster where the form puts several similar values close together: the Loan Estimate versus Final columns in Calculating Cash to Close, the borrower-paid, seller-paid and paid-by-others columns in Closing Cost Details, amounts the regulation requires to be shown as negative numbers, variable-length fee itemizations, and picking the right version when a file contains corrected Closing Disclosures.

How should I measure per-field accuracy for mortgage document extraction?

Build a hand-verified ground-truth set from your own documents, write down the comparison rule for every field (exact or normalized), score each field separately, track missed and invented values separately from wrong values, report confidence intervals, split results by document variant and source, and re-run the same set every time the model, configuration or schema changes.