> ## 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.

# Financial event representation and interpretable credit risk

> Whitepaper 02: event-model architecture, the GAM-24 credit scorecard, credit discrimination, calibration, and defined policy scenarios.

![](https://mintcdn.com/amlok-docs/E2XhE7LcU8Z7MBXL/images/whitepapers/02-financial-event-credit.svg?fit=max\&auto=format\&n=E2XhE7LcU8Z7MBXL\&q=85\&s=e57dbfa42fb53bf76c85cc87b0227681)

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

## What this study compares

This paper examines two configurations in AMLOK's credit research. The **FET-Dual architecture study** describes financial-event representation learning followed by an additive credit model with selected interactions. The **GAM-24 credit scorecard** evaluates a fixed mapping from 24 supplied dimension-health scores to twelve-month default probability.

The credit scorecard uses **40,508 non-fraud Cohort C assessments**, including **2,558 twelve-month defaults**, and reaches **0.876 AUROC**. The configuration comparison reports **0.714** for the Llama-3.3-70B ledger QLoRA configuration, **0.798** for cash-flow LightGBM, and **0.819** for the TabPFN-v2Sub + GBDT ensemble. The numerical differences are 0.162, 0.078, and 0.057 AUROC points at the displayed precision. These are comparisons with the separately identified configurations below; they do not isolate a transformer contribution.

AUROC measures ranking rather than accuracy. Calibration and the unit-exposure policy scenario answer different questions. The [credit supplement](https://docs.amlok.io/research/resources/credit-results.md) defines the scorecard predictions, metrics, deciles, and scenario used on this page.

The [credit validation analysis](https://docs.amlok.io/research/resources/credit-validation.md) reports borrower-cluster confidence intervals for this credit scorecard, with separate regional and lender-segment results.

## Abstract

Financial events arrive at irregular times. Monthly totals can conceal a slowing payment cadence, an interrupted income stream, or changing liquidity. The architecture study describes **FET-Dual**, a 118-million-parameter Financial Event Transformer for business and guarantor histories, and a constrained 24-dimension additive model. The separate credit scorecard consumes dimension-health inputs directly; its performance measures that mapping rather than the event encoder or interaction layer.

The paper defines 19 income, affordability, stability, and credit-history metrics. Fraud remains a separate target. The locked fraud-score evaluation reports 482 true positives and 254 false positives at threshold 0.5; its [lifecycle result](https://docs.amlok.io/whitepapers/03-entity-network-risk.md#capture-before-and-after-funding) uses the same threshold and disjoint post-funding additions.

## Credit scorecard configuration

The scorecard input is a vector of 24 supplied health scores, each in the interval 0 to 100. A higher score means healthier evidence on that dimension. Its six spline knots are collinear, so the mapping is exactly linear in each health score before the sigmoid. There are no pairwise terms in this configuration.

**GAM-24 credit scorecard - fixed health inputs to probability**

$$
\begin{aligned}
\psi_d^{\mathrm{ref}}(S_d)&=5.5-0.11S_d,\qquad 0\le S_d\le100,\\
\widehat p^{\mathrm{ref}}&=\sigma\!\left(-3.926229+\sum_{d=1}^{24}w_d\psi_d^{\mathrm{ref}}(S_d)\right),
\qquad w_d\ge0,\quad\sum_dw_d=1.
\end{aligned}
$$

The [credit supplement](https://docs.amlok.io/research/resources/credit-results.md#credit-scorecard-weights) lists every fixed weight. This evaluation measures the mapping from supplied dimension-health scores to default probability. Event extraction, transformer learning and interaction functions belong to the separate architecture configuration. Unsupported dimension scores are not replaced with zero.

## Financial event architecture study

The architecture has separate representation, fraud-ranking, and non-fraud credit stages. It joins supported business and guarantor histories before calculating credit dimensions. A relationship or a risk signal alone does not establish fraud.

### Architecture study: financial histories to distinct outputs

Representation learning and the credit scorecard have separate evaluation scopes.

<ol />

### Variable-length histories and elapsed time

Each event at or before assessment time contains up to 24 key-value pairs. The architecture uses variable-length packing with FlashAttention-2. Its training comparison reports a 2.77-times speed improvement over padded sequences. That training comparison is separate from the credit scorecard evaluation.

**2.1 - Continuous-time position encoding**

$$
\begin{aligned}
\theta_{m,r}&=(t_0-t_m)\,10000^{-2r/d_{\mathrm{head}}}\\
\left(\mathbf R(\theta_m)\mathbf q_m\right)^\top
\left(\mathbf R(\theta_n)\mathbf k_n\right)
&=\mathbf q_m^\top\mathbf R\!\left((t_m-t_n)\omega_r\right)\mathbf k_n.
\end{aligned}
$$

`t_0` is assessment time. Query and key rotations depend on elapsed days, so their inner product depends on relative event time rather than the number of intervening transactions.

### Learning events and supported periods without events

The architecture combines masked-field prediction, a marked neural Hawkes point process, and temporal contrastive learning. The source specifies an approximately **1.425-billion corpus-token budget** for Cohort A. A processed token position is one position consumed by the financial encoder under the declared tokenizer and pass schedule, including repeated positions on later passes and excluding padding. Token accounting must identify that tokenizer and pass schedule; this budget is not an exact canonical-event count or an inferred text-subword count. Cohort A contains 924,630,000 canonical events, and up to 24 fields per event does not specify the number of encoder positions.

For each completely observed interval, set its start to `T_start` and its fixed end to assessment cutoff `T=t_0`. A missing feed interval is unsupported coverage, not a period of confirmed silence. Evaluate the likelihood only over intervals with the required event coverage and declared starting history.

**2.2 - Joint objective over a fixed observation interval**

$$
\begin{aligned}
\mathcal L_{\mathrm{pretrain}}={}&\mathcal L_{\mathrm{MFM}}
-\eta_{\mathrm{TPP}}\left[
\sum_{m:T_{\mathrm{start}}<t_m\le T}
\ln\lambda_{g_m}(t_m\mid\mathcal H_{t_m^-})
-\int_{T_{\mathrm{start}}}^{T}\sum_{g\in\mathcal G}
\lambda_g(\tau\mid\mathcal H_{\tau^-})\,d\tau
\right]
+\eta_{\mathrm{TID}}\mathcal L_{\mathrm{InfoNCE}}.
\end{aligned}
$$

`g_m` is the observed event type; `G` contains all modeled event types. The event term uses the intensity of that event's type, while the survival integral uses the sum of all type intensities. Gauss-Legendre integration approximates the integral. The integral continues from the last event to `T`, including when no event occurs in the interval. At constant total intensity 0.1 per day, ten additional observed days without an event add 1.0 to the negative log-likelihood. An event-ended sampling design must declare its different endpoint instead of reusing this fixed-cutoff interpretation.

## Business and guarantor cash-flow conservation

The corpus reports 210,115 deals with personal guarantors, or 76.4% of 275,019 assessments. These are corpus-level counts. Matched business owner distributions are not independent guarantor repayment support when the business is stressed.

The method matches business owner-distribution outflows to personal deposits within zero to three business days. Net deposits alone do not establish gross income; the gross-income metric requires supporting pay, tax, or equivalent evidence.

**2.3 - Independent income and interruption**

$$
\begin{aligned}
I_{\mathrm{pers,indep}}(W)&=I_{\mathrm{pers,ver}}(W)-\sum_{j\in\mathrm{MatchedDraws}}a_j^{(\mathrm{bus}\to\mathrm{pers})},\\
\operatorname{residual\_monthly\_income}&=N_{\mathrm{ver}}-E_{\mathrm{essential}}-\operatorname{Housing}-\operatorname{DS}_{\mathrm{pers}},\\
\operatorname{income\_interruption\_days}&=\max_{s\in\{1,\ldots,S\}}
\max\left(0,\left\lfloor t_0-\widehat t_{s,\mathrm{next}}^{\mathrm{Hawkes}}-\delta_{\mathrm{grace},s}\right\rfloor\right).
\end{aligned}
$$

Remove matched draws once, and deduct essential spending, housing, and debt payments once each. The expected next payday is fixed from the last observed payment history. `delta_grace,s` is the declared non-negative grace period for that income stream; it is zero only when the configuration specifies no grace. Five days after an expected payday with a three-day grace period gives two interruption days. Missing timing or coverage produces an unsupported metric rather than zero interruption.

## Separate fraud ranking

The architecture's fraud objective combines focal loss with pairwise ranking against the highest-scoring 5% of non-fraud training examples. This objective is separate from the credit scorecard probabilities and from non-fraud credit-default labels.

**2.4 - Focal and pairwise fraud loss**

$$
\begin{aligned}
\mathcal L_{\mathrm{fraud}}={}&\mathcal L_{\mathrm{focal}}(y^{\mathrm{fraud}},\sigma(s_i);\gamma=2)\\
&+\frac{\mu_{\mathrm{rank}}}{|\mathcal P|\,|\mathcal N_{\mathrm{hard}}|}
\sum_{i\in\mathcal P}\sum_{j\in\mathcal N_{\mathrm{hard}}}
\max\left(0,\zeta-(s_i-s_j)\right)^2.
\end{aligned}
$$

`P` contains confirmed fraud and `N_hard` selected difficult negatives. Skip the pairwise term for a batch without either set; the denominator must not be zero. `zeta` and `mu_rank` are the declared margin and weight.

## Constrained additive architecture

The architecture study groups declared risk-oriented features into 24 dimensions and allows ten selected pairwise interactions. Each evaluation fixes its feature map, training reference values, spline knots, and interaction-pair list before fitting. The credit scorecard above has an empty interaction set and a different, explicit input mapping.

For each supported numeric feature `x_k`, use a declared direction `a_k` of +1 or -1 and a positive scale `s_k`: `u_k=clip((a_k*x_k-mu_k)/s_k, l_k, h_k)`. Reference values, scales, and clipping bounds are fitted on training data and frozen for evaluation. Incremental windows must be disjoint. A residualization that mixes features can change monotonicity; it is not implicit in this transform. Missing inputs need a declared supported route, not a fabricated neutral score. Direction constraints apply to these specified financial features; they do not imply causality for the underlying transactions.

**2.5 - Dimension health and twelve-month default risk**

$$
\begin{aligned}
\psi_d(\mathbf x)&=\sum_{k\in\mathcal D_d}g_{d,k}(u_k),\qquad
S_d(\mathbf x)=100\left(1-\sigma(\psi_d(\mathbf x))\right),\\
z(\mathbf x)&=\beta_0+\sum_{d=1}^{24}w_d\psi_d(\mathbf x)
+\sum_{(r,s)\in\mathcal I}h_{rs}(\psi_r,\psi_s),\qquad
\widehat{\mathrm{PD}}_{12m}=\sigma(z),\\
w_d&\ge0,\qquad g'_{d,k}(u)\ge0,\qquad
\frac{\partial h_{rs}}{\partial\psi_r}\ge0,\quad
\frac{\partial h_{rs}}{\partial\psi_s}\ge0,\\
\Theta^{rs}_{i+1,j}&\ge\Theta^{rs}_{i,j},\qquad
\Theta^{rs}_{i,j+1}\ge\Theta^{rs}_{i,j}.
\end{aligned}
$$

`Theta` contains lattice knot values. Coordinatewise nondecreasing knots with bilinear interpolation preserve the two interaction directions. Define centered dimensions before fitting the interaction surfaces: subtract each main function's scalar mean on the fixed training reference distribution. Center each fitted interaction by its scalar mean, and absorb the removed additive constants into the intercept. This constant centering preserves derivatives. To reparameterize an already fitted model, also shift each interaction's input coordinates and knot locations by the removed dimension constants; changing the intercept alone cannot compensate for changed interaction arguments. Do not subtract row- or column-dependent means from a constrained interaction without rechecking the total model derivatives. The displayed sufficient constraints give `partial z / partial psi_d >= 0`; a larger risk-oriented feature cannot decrease predicted risk while all other specified inputs stay fixed.

## Credit scorecard results

All figures in this section use the same scorecard probabilities and twelve-month non-fraud labels. Results use 40,508 assessments and 2,558 defaults. Ranking ties receive half credit for AUROC; KS is evaluated at complete tied-score groups. Average precision uses step integration and is separately named from trapezoidal precision-recall area. Brier is the mean squared probability error.

| Measure | GAM-24 credit scorecard |
| - | -: |
| AUROC | 0.876002 |
| KS separation | 0.589539 |
| Average precision (step integration) | 0.410613 |
| Precision-recall area (trapezoidal integration) | 0.410408 |
| Brier score | 0.046248 |
| ECE, ten equal-count bins | 0.001815 |
| ECE, ten equal-width bins | 0.002248 |

### Credit configuration comparisons

These AUROC values identify the model configurations evaluated in the study. Compare them alongside the GAM-24 credit scorecard while retaining each configuration's input and architecture scope. The ledger-tuned Llama row describes that specific configuration; its result does not generalize to every system using that model family. The scorecard comparison does not isolate upstream feature extraction or transformer learning.

| Evaluated configuration | Reported AUROC |
| - | -: |
| Bureau logistic baseline | 0.721 |
| Llama-3.3-70B ledger QLoRA | 0.714 |
| Cash-flow LightGBM | 0.798 |
| Bureau + reconciled cash-flow GBDT | 0.816 |
| TabPFN-v2Sub + GBDT ensemble | 0.819 |
| CRA-Business architecture comparison | 0.854 |
| CRA-Network architecture comparison | 0.866 |

### Risk-decile calibration

Sort the credit assessments by ascending predicted PD, then by assessment identifier to break ties deterministically. Allocate the first eight bins 4,051 records and the last two 4,050 records. Observed rates and predictions below come from those exact bins; displayed rounding does not enter any calculation. Equal-count ECE weights each bin's absolute probability gap by its number of records. Equal-width ECE instead uses ten intervals of width 0.1, with probability 1 included in the last bin and empty bins contributing zero.

| Risk decile | Deals | Defaults | Observed default rate | Mean predicted PD | Absolute gap (percentage points) |
| - | -: | -: | -: | -: | -: |
| 1 | 4,051 | 3 | 0.0741% | 0.0943% | 0.0202 |
| 2 | 4,051 | 13 | 0.3209% | 0.2937% | 0.0272 |
| 3 | 4,051 | 22 | 0.5431% | 0.5736% | 0.0305 |
| 4 | 4,051 | 42 | 1.0368% | 0.9738% | 0.0630 |
| 5 | 4,051 | 52 | 1.2836% | 1.5611% | 0.2774 |
| 6 | 4,051 | 104 | 2.5673% | 2.4582% | 0.1091 |
| 7 | 4,051 | 159 | 3.9250% | 3.9152% | 0.0097 |
| 8 | 4,051 | 287 | 7.0847% | 6.5159% | 0.5688 |
| 9 | 4,050 | 473 | 11.6790% | 12.2049% | 0.5259 |
| 10 | 4,050 | 1,403 | 34.6420% | 34.4586% | 0.1834 |
| **Total** | **40,508** | **2,558** | **6.3148%** | **6.3041%** | **0.1815, weighted ECE** |

### Unit-exposure approval scenario

This scenario gives every eligible non-fraud deal one exposure unit. A default incurs a modeled loss equal to that record's predicted LGD; a non-default incurs zero. It applies no discounting, extra costs, or realized-recovery claim. Sort by predicted PD and assessment identifier, then accept the first `floor(0.70*N)` records for the 70% target. The 4.5% scenario chooses the largest nonempty prefix whose modeled loss divided by accepted exposure units is at most 0.045. This is an outcome-based retrospective policy curve, not a deployable threshold selected without outcome knowledge.

$$
L_{\mathrm{scenario}}(k)=\frac{\sum_{i=1}^{k}y_i\widehat{\mathrm{LGD}}_i}{k}.
$$

| Policy scenario | Accepted deals | Approval share | Count-default rate | Modeled loss rate |
| - | -: | -: | -: | -: |
| Target 70% approval | 28,355 | 69.9985% | 1.3931% | 0.4654% |
| Largest prefix within 4.5% modeled loss | 40,508 | 100.0000% | 6.3148% | 2.4328% |

The 4.5% limit is nonbinding under these assumptions: the full book remains below it. These scenario rates do not measure realized monetary losses or compare baseline policies with different inputs. [Policy definition and totals](https://docs.amlok.io/research/resources/credit-results.md#unit-exposure-policy-scenario).

## Metric definitions (19)

These definitions retain the source notation and its scope. `W` is the observation window; `t_0` is the assessment time; `I(condition)` is one when the condition holds and zero otherwise. `Div+` denotes the catalog division operation with a supported positive denominator. Missing evidence or an unsupported denominator does not establish a zero. Currency expressions use a consistent reporting currency. Source: [RP-2026-02](https://docs.amlok.io/whitepapers/02-financial-event-credit.md), metric-definition table.

### Income and affordability

**`verified_gross_monthly_income`**

Scope and unit: person \[currency].

`GrossRecurringPretaxIncome_mo  [requires paystub/T4/NOA; NULL on net bank deposits alone]`

**`verified_net_monthly_income`**

Scope and unit: person \[currency].

`NetRecurringPostDeductionIncome_mo  [excluding borrower-dependent owner draws under stress]`

**`debt_to_income`**

Scope and unit: person \[ratio].

`Div+( PersonalRequiredDebtService_mo + ProposedPayment_mo, verified_gross_monthly_income )`

**`housing_to_income`**

Scope and unit: person \[ratio].

`Div+( RequiredMonthlyHousingCost, verified_gross_monthly_income )`

**`essential_monthly_spend`**

Scope and unit: person \[currency].

`SupportedNonDebtNonHousingEssentialLivingSpend_mo  [housing & debt counted once]`

**`residual_monthly_income`**

Scope and unit: person \[currency].

`verified_net_monthly_income - essential_monthly_spend - HousingCost_mo - TotalDebtPayments_mo`

**`payment_to_income`**

Scope and unit: person \[ratio].

`Div+( ProposedRequiredMonthlyPayment, verified_gross_monthly_income )`

**`liquid_reserve_months`**

Scope and unit: person \[months].

`Div+( UnrestrictedLiquidFunds_person, essential_monthly_spend + HousingCost_mo + TotalDebtPayments_mo )`

### Income stability

**`income_source_count`**

Scope and unit: person \[count].

`|ResolvedRecurringIncomeStreams_person|`

**`income_volatility`**

Scope and unit: person \[ratio].

`Div+( std_m(VerifiedMonthlyIncome_m), mean_m(VerifiedMonthlyIncome_m) )`

**`income_growth_yoy`**

Scope and unit: person \[ratio].

`Div+( VerifiedIncome(W) - VerifiedIncome(W - 365d), VerifiedIncome(W - 365d) )`

**`days_since_last_income`**

Scope and unit: person \[days].

`min_{s in IncomeStreams} floor( t_0 - t_{s,last} )`

**`income_interruption_days`**

Scope and unit: person \[days].

`max_{s in IncomeStreams} max(0, floor(t_0 - FrozenExpectedNextDue_s - GraceDays_s))`

**`income_continuity_share`**

Scope and unit: person \[ratio].

`Div+( MatchedExpectedIncomePeriods(W), ElapsedExpectedIncomePeriods(W) )`

### Credit history

**`open_credit_obligation_count`**

Scope and unit: business, person \[count].

`|DistinctOpenTradelines_BureauUnionLender(t_0)|`

**`bureau_utilization`**

Scope and unit: business, person \[ratio].

`Div+( ReportedRevolvingBalances_bureau, ReportedRevolvingLimits_bureau )`

**`recent_credit_inquiry_count`**

Scope and unit: business, person \[count].

`|SupportedHardCreditInquiries(W)|`

**`severe_delinquency_count`**

Scope and unit: business, person \[count].

`|ReportedObligationsMeetingSevereDelinquencyPolicy(W)|`

**`public_record_event_count`**

Scope and unit: business, person \[count].

`|MatchedInsolvencyBIAOrJudgmentEvents(W)|`

## Supporting material

* [RP-2026-02](https://docs.amlok.io/whitepapers/02-financial-event-credit.md): equations 2.1-2.5, benchmark table, and Figure 2.1.
* [RS-2026-03](https://docs.amlok.io/research/resources/credit-results.md): credit discrimination, loss, and risk-decile calibration tables.
* [RS-2026-01](https://docs.amlok.io/research/resources/study-cohorts.md): corpus and cohort definitions.
* [Transaction classification and reconciliation](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md): the financial event inputs.
* [Entity and network risk](https://docs.amlok.io/whitepapers/03-entity-network-risk.md): relationships and network-enhanced features.


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