> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amlok.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Document integrity, applicant selection, and loss estimation

> RP-2026-07: document evidence, selection-adjusted credit risk, pre-funding refresh, and expected-loss pricing.

![](https://mintcdn.com/amlok-docs/E2XhE7LcU8Z7MBXL/images/whitepapers/07-document-loss-models.svg?fit=max\&auto=format\&n=E2XhE7LcU8Z7MBXL\&q=85\&s=904e88c79b20f59385a84d880b209ab2)

**Research period:** August 2025 - November 2026 · [Research timeline](https://docs.amlok.io/research/index.md#research-timeline)

The November 2026 [completed facility evaluation](https://docs.amlok.io/research/resources/cohort-evaluations.md#facility-calculations-and-population-coverage) adds commitment, draw, repayment, borrowing-base and default-exposure calculation checks. These results measure arithmetic conformance; predictive accuracy against observed exposure at default or recoveries is outside this evaluation.

**RP-2026-07** · [Research library](https://docs.amlok.io/research/library.md) · [Results workbook RS-2026-06](https://docs.amlok.io/research/resources/lifecycle-results.md)

## What this study compares

This paper evaluates two financial tasks before extending them to evidence refresh and loss estimation: detecting document tampering and ranking default risk across all applicants. AMLOK's document pipeline combines a 410M layout encoder, distilled from Qwen2.5-VL-7B, with forensic and financial-consistency checks. Its applicant-risk pipeline adjusts for which applications were historically funded.

| Financial task | Baseline result | AMLOK configuration and result | Difference |
| - | - | - | - |
| Detect document tampering | PDF metadata rules: 0.638 F1 | Document-layout encoder + four-channel forensics: 0.948 F1 | 0.310 F1 points higher |
| Detect document tampering | Zero-shot vision language-model baseline: 0.741 F1 | Document-layout encoder + four-channel forensics: 0.948 F1 | 0.207 F1 points higher |
| Limit false tampering alerts | PDF metadata rules: 4.1% false-positive rate | Document-layout encoder + four-channel forensics: 0.4% | 3.7 percentage points lower |
| Rank default risk across funded and rejected applicants | Funded-only GAM: 0.859 AUROC | Selection-adjusted GAM-24: 0.881 AUROC | 0.022 AUROC points higher |

Higher F1 and AUROC are better; a lower false-positive rate means fewer clean documents are flagged. The all-applicant reference comparison uses **59,009 out-of-time applications**, comprising 41,250 funded and 17,759 rejected applications. Its 365-day credit-default endpoint retains confirmed fraud as a separate competing cause with a zero credit-default label, following the mutually exclusive cohort convention. The 742 known funded fraud cases remain in this denominator; the separate 40,508-case credit-only benchmark excludes them. The forensic rows describe the document-tampering evaluation; the wider **188,388 document-bearing deals** describe source coverage across the full study. Qwen2.5-VL-7B is the encoder's teacher, while the separately tested zero-shot vision baseline remains unnamed in the source.

Sources: [RS-2026-06, document and loss comparisons](https://docs.amlok.io/research/resources/lifecycle-results.md#document-and-loss-comparisons), `01_WP07_Forensics_RAROC`, rows 6-11; [RP-2026-07](https://docs.amlok.io/whitepapers/07-document-loss-models.md), document-forensics and applicant-selection results. Each later refresh, loss, and pricing result retains its own task definition.

## Abstract

A credit assessment depends on more than a probability-of-default score. Its documents must support the extracted facts. Its training population must reflect the applicants it will score. New obligations or changes to the proposed beneficiary can alter risk after approval. Expected loss also depends on how much is outstanding at default and how much can be recovered.

This paper joins four methods: a document-layout encoder with four forensic channels; cross-fitted selection-adjusted estimation across an eligible funded and unfunded applicant population; an evidence refresh between approval and proposed funding; and loss-given-default and exposure models for risk-adjusted pricing. The source reports document-tampering F1 of 0.948 at a 0.4% false-positive rate, all-applicant credit AUROC of 0.881, refresh precision of 0.894 with recall of 0.862, and portfolio RAROC of 19.5% under the study's pricing assumptions. Each result has its own population and metric definition. [RP-2026-07](https://docs.amlok.io/whitepapers/07-document-loss-models.md), [RS-2026-06](https://docs.amlok.io/research/resources/lifecycle-results.md).

## Research question and population

The study asks whether better evidence and explicit selection and loss models improve the assessment of commercial applications. The expanded applicant corpus contains 275,019 funded deals and 118,400 rejected or unfunded applications, totaling 393,419. The all-applicant out-of-time evaluation contains 59,009 applications: the 41,250 funded-deal Cohort C plus 17,759 rejected applications. The larger corpus is the research population; it is not the denominator for every benchmark. [RS-2026-06, applicant-population description](https://docs.amlok.io/research/resources/lifecycle-results.md).

Uploaded bank statements, tax records, receivables schedules, and lease documents appear in 188,388 deals, or 68.5% of the 275,019-deal study. Document availability does not establish authenticity. The extraction and forensic tasks therefore remain separate. [RP-2026-07, section 1](https://docs.amlok.io/whitepapers/07-document-loss-models.md).

| Population | Count | Role in the study |
| - | -: | - |
| Funded-deal corpus | 275,019 | Historical funded assessments across the study cohorts |
| Rejected or unfunded applications | 118,400 | Expanded applicant-population estimation |
| Combined applicant corpus | 393,419 | Through-the-door population |
| Funded Cohort C | 41,250 | Funded out-of-time evaluation component |
| Rejected out-of-time applications | 17,759 | Additional all-applicant evaluation component |
| Combined all-applicant reference evaluation | 59,009 | Complete reference outcomes; fraud retained as a competing cause |

Source: [RP-2026-07](https://docs.amlok.io/whitepapers/07-document-loss-models.md) and [RS-2026-06](https://docs.amlok.io/research/resources/lifecycle-results.md).

## Document extraction and four-channel forensics

The 410-million-parameter document-layout encoder is distilled from Qwen2.5-VL-7B. It associates an extracted fact with a page, bounding box, and extraction confidence. These coordinates let you trace a balance, date, or payment back to the document region that supports it. Source text remains evidence to inspect; it does not become an instruction to an assessment agent.

The forensic model combines four kinds of evidence. PDF revision structure captures changes in the cross-reference graph. Font geometry tests local glyph spacing and baseline patterns. Image analysis looks for inconsistent editing or copied regions. Arithmetic and digit-distribution checks compare balances, transaction totals, and second-digit patterns. The last channel contributes two terms, so the four-channel architecture has five weighted inputs. [RP-2026-07, section 1 and equation 7.1](https://docs.amlok.io/whitepapers/07-document-loss-models.md).

### From a document to reviewable evidence

<ol />

**Equation 7.1 - Document-tampering score**

$$
\begin{aligned}
s_{\mathrm{PDF}}(D)=\sigma\Bigg(&w_1z_{\mathrm{XRef}}(D)
+w_2\max_g\frac{|\Delta\mathrm{kern}_g-\mu_{\mathrm{font}}|}{\sigma_{\mathrm{font}}}\\
&+w_3s_{\mathrm{ELA}}(D)
+w_4\mathbb{I}(\Delta_{\mathrm{arith}}>0)
+w_5\chi^2_{\mathrm{Benford},2d}\Bigg).
\end{aligned}
$$

Here, $D$ is the document and $\sigma$ converts the weighted score to a value between zero and one. The terms measure revision anomalies, unusual font spacing, image-edit evidence, arithmetic disagreement, and second-digit deviation. A high score is a reason to examine the evidence; no single digit-pattern or metadata anomaly establishes fraud.

### Document tampering detection

Compare the reported ability to detect altered documents and the false alarms each method creates.

The comparison reports both F1 and false-positive rate. F1 balances precision and recall; a 0.948 F1 score is not a claim that 94.8% of every document field is correct. The paper separately reports bounding-box intersection over union of 99.1%, which measures localization overlap. Document localization, tampering detection, and the truth of a financial claim are distinct tasks. [RP-2026-07, benchmark table](https://docs.amlok.io/whitepapers/07-document-loss-models.md).

## Selection-adjusted default estimation

A model trained only on funded applicants learns from a population filtered by lender policy. Selection adjustment estimates a target risk over an explicitly eligible applicant population. The method below uses missing-at-random outcome identification; it does not use an inverse Mills term or claim to solve arbitrary unobserved selection.

**Equation 7.2 - Cross-fitted augmented expected loss**

$$
\begin{aligned}
\widehat m_\theta(\mathbf v_i)
&=\widehat q^{(-k(i))}(\mathbf v_i)\ell(1,f_\theta(\mathbf x_i))
 +\bigl(1-\widehat q^{(-k(i))}(\mathbf v_i)\bigr)\ell(0,f_\theta(\mathbf x_i)),\\
\mathcal L_{\mathrm{DR}}(\theta)
&=\frac1N\sum_{i=1}^N\left[
\widehat m_\theta(\mathbf v_i)
+\frac{A_i}{\widehat\pi^{(-k(i))}(\mathbf v_i)}
\left\{\ell(Y_i,f_\theta(\mathbf x_i))-\widehat m_\theta(\mathbf v_i)\right\}
\right].
\end{aligned}
$$

$A_i$ indicates whether the credit outcome is observed; $\mathbf v_i$ contains pre-assessment selection and outcome covariates, including $\mathbf x_i$. For binary default, $\widehat q$ estimates $P(Y=1\mid\mathbf v)$ and $\widehat\pi$ estimates $P(A=1\mid\mathbf v)$. Fit both nuisance models without borrower fold $k(i)$, then predict that fold. The conditional loss $\widehat m_\theta$ changes whenever $\theta$ changes, even though the nuisance fits are fixed. For $A_i=0$, evaluate only the first term; do not access a missing $Y_i$ or multiply an undefined loss by zero.

For each fixed predictor, the augmented risk is consistent if either the observation-probability model or the conditional outcome model is correct, provided $Y\perp A\mid\mathbf v$, consistency of the reference facility, and positive overlap hold. Fit the final predictor using the cross-fitted objective and evaluate it on an untouched test set. State a strictly positive overlap bound in the run manifest; if it fails, restrict and name the target population or stop. Clipping inverse weights changes the estimator and its bias, so record that as a separate version rather than retaining an exact doubly robust claim. A lender cutoff is a selection covariate here, not automatically a valid instrument. A nonignorable selection model would require a separate joint model and identification assumptions.

### All-applicant target and time protocol

The all-applicant reference endpoint uses all 59,009 applications with complete 365-day reference outcomes: 41,250 funded and 17,759 rejected. It predicts the credit-default cause with fraud retained as a separate competing cause. This differs from the 40,508-case credit-only benchmark that excludes fraud.

| Element | Normative definition |
| - | - |
| Credit target | For application i, define Y\_i(p) as first qualifying credit default within 365 days of the index assessment under reference facility p recorded for that application at the index date: product, amount, rate, term, and repayment schedule. Hold that facility fixed across the compared models and apply the same target rule to funded and rejected cases. Generate or observe this target independently of the model being evaluated; its own imputed PD is never the evaluation label. |
| Eligibility and fraud | Use mutually exclusive endpoint labels with confirmed fraud taking precedence over credit default. Set Y\_credit = 1 only for a qualifying nonfraud credit default; fraud and performing cases have Y\_credit = 0. The 742 known funded fraud cases remain in the 59,009 denominator as competing-cause negatives. No additional rejected fraud count is assumed. Both model rows use the same independent reference outcomes and all 59,009 rows. A credit-only exclusion, combined default-or-fraud target, or incomplete-follow-up analysis is a separately named endpoint with its own denominator; incomplete follow-up is censored, not labeled zero. |
| Retrospective split | Freeze borrower-disjoint training, tuning, and test membership; features stop at each assessment cutoff. Training and tuning labels may mature after early test assessment dates in this retrospective design. Model and calibrator are frozen before test outcomes are scored; no claim of availability at the earliest test date follows. |
| Prospective alternative | For a walk-forward result, freeze the model and calibrator at each deployment date using only labels already matured on that date. Fit transforms and selection models on the same permissible past data. Report this as a separate evaluation version. |
| Ranking and bias | AUROC gives half credit to positive-negative score ties. Make ten ascending-PD bins with a stable application-ID tie break and include their counts in the result record. Decile bias = 100 × (mean predicted PD - observed default fraction), in percentage points. A D9-D10 summary pools their counts; it is not an unweighted mean when sizes differ. |

The signed D9-D10 bias improves from -2.45 to -0.11 percentage points. The separate AUROC comparison rises from 0.859 to 0.881. AUROC measures ranking; the decile bias measures probability calibration. Improvement in one does not establish the other. [RP-2026-07, Figure 7.1 and benchmark table](https://docs.amlok.io/whitepapers/07-document-loss-models.md).

## Evidence refresh before proposed funding

An approval uses evidence available at a point in time. The paper evaluates the following 1-to-14-day interval for changed beneficiary instructions, new inquiries, and newly initiated payment obligations. A change can warrant renewed assessment even if the original credit estimate was reasonable.

The refresh model combines a beneficiary-account-change probability with the intensity of new inquiries and debit obligations. Its output is an assessment signal. The institution decides how to investigate it and whether to release funds in its own systems. [RP-2026-07, section 3](https://docs.amlok.io/whitepapers/07-document-loss-models.md).

**Equation 7.3 - Approval-to-funding hazard score**

$$
\begin{aligned}
h_{\mathrm{prefund}}(i;t_{\mathrm{app}},t_{\mathrm{disb}})
=1-&\left(1-p_{\mathrm{ATO}}(\Delta\mathrm{Transit}_i,p_{\mathrm{owner}})\right)\\
&\cdot\exp\left(-\eta_1N_{\mathrm{inq},(t_{\mathrm{app}},t_{\mathrm{disb}}]}
-\eta_2N_{\mathrm{newACH},(t_{\mathrm{app}},t_{\mathrm{disb}}]}\right).
\end{aligned}
$$

The first term represents beneficiary-change evidence, including the holder-match probability. The exponential term incorporates inquiry and new-debit counts in the interval. The coefficients determine how strongly these observations change the modeled hazard.

The selected method reports **89.4% precision and 86.2% recall**. Precision asks how many alerts are relevant; recall asks how many relevant events are detected. The static routing baseline reports 41.2% precision. These definitions follow the source benchmark table and workbook. [RS-2026-06, refresh benchmark](https://docs.amlok.io/research/resources/lifecycle-results.md).

## Loss, exposure, and risk-adjusted pricing

Probability of default alone cannot estimate the amount a lender expects to lose. Loss given default (LGD) estimates the loss fraction after recoveries. Exposure at default (EAD) estimates how much is outstanding when default occurs. Revolving borrowers can draw on unused capacity before default, so the current balance can understate EAD.

The source combines a hurdle-beta loss model with a distressed credit-conversion-factor model. Its conditioning evidence includes eligible collateral, priority claims, and collectible guarantor coverage. The hurdle separates the chance of loss from the severity of a loss. Boundary cases require the source's zero/one-inflation treatment; the compact equation below displays the mean loss component. [RP-2026-07, section 4](https://docs.amlok.io/whitepapers/07-document-loss-models.md).

**Equation 7.4a - Loss severity, revolving exposure, and expected loss**

$$
\begin{aligned}
\widehat{\mathrm{LGD}}_{i,p}
&=\pi_{\mathrm{loss}}(\mathbf u_{i,p})\,
\mathrm{BetaMean}(\mu_{i,p},\nu_{i,p}),\\
\widehat{\mathrm{EAD}}_{i,p}
&=B_{\mathrm{drawn}}(t_0)
+\widehat{\mathrm{CCF}}_i\left(L_{\mathrm{limit}}-B_{\mathrm{drawn}}(t_0)\right),\\
\mathrm{EL}_{i,p}
&=\widehat{\mathrm{PD}}_{12m,i}\,
\widehat{\mathrm{LGD}}_{i,p}\,
\widehat{\mathrm{EAD}}_{i,p}.
\end{aligned}
$$

For borrower $i$ and product $p$, the loss estimate combines the chance and size of loss. EAD adds expected future use of the undrawn line to the current balance. Expected loss multiplies default probability, loss fraction, and exposure.

**Equation 7.4b - One-year risk-adjusted return constraint**

$$
\begin{aligned}
\mathrm{EL}_{H,p}&=\mathrm{PD}_{H,p}\,\mathrm{LGD}_{H,p}\,\mathrm{EAD}_{H,p},\\
K_{H,p}&=\kappa_p(\mathrm{PD}_{H,p},\mathrm{LGD}_{H,p},M_p)\,\mathrm{EAD}_{H,p}>0,\\
\mathrm{RAROC}_{H,p}
&=\frac{I_{H,p}+F_{H,p}-C_{\mathrm{fund},H,p}-C_{\mathrm{op},H,p}-\mathrm{EL}_{H,p}}
{K_{H,p}}\geq\tau_H,\qquad H=1\text{ year}.
\end{aligned}
$$

Every numerator term and $K$ is in CAD over the same one-year horizon. $I$ and $F$ are contractual interest and fees before the separately modeled credit loss; principal repayments are excluded from income. Funding cost sums period-average funded balances times the period funding rate. $\kappa$ is a dimensionless, versioned economic-capital rate; its input schedule and positive bounds belong to the pricing configuration. A zero-capital case has no RAROC ratio.

Use the actual amortization schedule for term and equipment loans, projected utilization for revolving lines, and purchased-receivable cash flows for receivables finance. For revenue-based contracts, separate return from principal in each contingent payment and apply the same horizon. Do not replace these schedules with original principal times a spread. Report portfolio RAROC as total net risk-adjusted income divided by total allocated economic capital, not a mean of borrower ratios.

For a reference one-year constant-balance facility, interest CAD 8,000, fees CAD 0, funding cost CAD 4,000, operating cost CAD 1,000, PD 2%, LGD 40%, and EAD CAD 100,000 give expected loss CAD 800. With $\kappa=10\%$, capital is CAD 10,000 and RAROC is 22%. This passes a 15% reference hurdle. The separate 19.5% portfolio scorecard uses its own portfolio assumptions; it is not derived from this facility example.

| Assessment | Baseline | Selected result | Additional source measure |
| - | - | - | - |
| Document tampering | Metadata-rule F1 0.638 | F1 0.948; FPR 0.4% | Bounding-box IoU 99.1% |
| All-applicant credit | AUROC 0.859 | AUROC 0.881 | D9-D10 bias -0.11 percentage points |
| Pre-funding refresh | Precision 0.412 | Precision 0.894 | Recall 0.862 |
| LGD | MAE 16.8 percentage points | MAE 5.4 percentage points | Spearman correlation 0.794 |
| Revolving EAD | Bias -22.4% | Bias -3.1% | $R^2=0.912$ |
| Portfolio RAROC | 13.4% | 19.5% | Study hurdle 15.0% |

Source: [RP-2026-07, complete benchmark table](https://docs.amlok.io/whitepapers/07-document-loss-models.md) and [RS-2026-06](https://docs.amlok.io/research/resources/lifecycle-results.md).

## Interpretation and connection to the research

The methods address different failure modes. Forensics strengthens the evidence entering the model. Selection adjustment changes how applicant risk is estimated. Refresh checks account for changes after the assessment date. LGD and EAD translate risk into an amount and a return calculation. Their metrics should remain separate rather than being collapsed into one accuracy claim.

You can follow the foundations in [transaction evidence](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), [credit modeling](https://docs.amlok.io/research/credit-models.md), and [lending capacity](https://docs.amlok.io/research/lending-capacity.md). [Borrower state estimation](https://docs.amlok.io/whitepapers/08-borrower-state-agents.md) extends the refresh logic to repeated evidence changes; [counterfactual analysis](https://docs.amlok.io/whitepapers/10-adaptive-defense-recourse.md) uses the risk and capacity equations to test conditional alternatives.

## References

* [RP-2026-07 - Document integrity, applicant selection, and loss estimation](https://docs.amlok.io/whitepapers/07-document-loss-models.md): methods, equations 7.1-7.4, Figures 7.1-7.2, and benchmark definitions.
* [RS-2026-06 - Document and agent evaluation results](https://docs.amlok.io/research/resources/lifecycle-results.md): document, applicant, refresh, loss, and return aggregates.
* [Chakrabortty et al., M-estimation with missing outcomes](https://arxiv.org/abs/1911.11345): parameter-dependent augmented risk and missing-at-random identification.
* [Research: document integrity](https://docs.amlok.io/research/document-integrity.md): research overview and related evidence.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.