Credit teams are being told that deep learning is the next step beyond gradient-boosted trees, and model-risk committees are being asked to approve neural networks for lending decisions. The decision is whether a neural net earns its extra complexity on the kind of data a lender actually has: a few dozen fields per loan, a lender name, an industry code and a location.

I tested it on 772,591 real small-business loans from the US Small Business Administration's public loan file. Three models were trained on loans approved in 1990–2003, tuned on 2004–05, and judged on 2006–07, the vintages that went through the 2008–09 recession. The hypotheses were fixed before any model was trained.

0.687 vs 0.681
Out-of-time AUC on 2006–07 loans: neural net with embeddings vs gradient boosting (logistic regression: 0.622)
$23.3m vs $26.0m
Charge-offs avoided per $1bn approved at an 80% approval rate: neural net vs gradient boosting
17% vs 39%
Average predicted default probability vs the actual charge-off rate on 2006–07 loans
23 seconds
Neural net training time on two CPU cores (gradient boosting: 15 seconds)

Executive summary

The question. On real loan data, does a neural network beat gradient boosting at ranking and pricing default risk, out of time?

The approach. The SBA 7(a) and 504 FOIA loan file: 772,591 resolved loans approved in fiscal years 1990 to 2007, with actual charge-off outcomes and charged-off principal. The same features for every model: loan size, SBA guarantee share, employees, new business, franchise, revolving line, low-documentation program, out-of-state lender, jobs, days to disbursement, urban or rural, and three identities (state, industry, lender). Loan term is excluded because in this file it partly reflects what happened after default. Three models: a logistic regression without lender identity, gradient boosting (LightGBM) and a Keras neural net that learns an embedding for each of 839 lenders, 92 industries and 51 states.

The answer. The neural net ranked defaults slightly better (AUC 0.687 against 0.681; the difference of 0.006 holds in a bootstrap and across three random seeds), and a 50/50 blend did best at 0.689. But used to approve the safest 80% of loans, gradient boosting avoided more charged-off dollars: $26.0m per $1bn approved against $23.3m for the neural net. Both beat a simple logistic regression by a wide margin. And both were badly miscalibrated for the recession: they predicted a 16–17% average default probability against an actual charge-off rate of 39%.

The decision. Keep gradient boosting as the production model. Use the neural net as a challenger and in a blend, judge every model on dollar losses at the actual approval rate rather than on AUC, and recalibrate both to current conditions before using any probability for pricing or reserves.

Business outcomes

DecisionWhat the data showedWhat it means
Replace boosting with a neural netAUC 0.687 vs 0.681 (difference +0.006, 95% CI +0.005 to +0.008)A real but small ranking gain
Approve loans with the best AUC modelAt 80% approval, boosting avoided $26.0m per $1bn approved; neural net $23.3m; blend $24.7mThe leaderboard winner saved less money
Keep the simple scorecardLogistic regression AUC 0.622; avoided $15.2m per $1bnLender identity and non-linearity are worth about $11m per $1bn
Use the predicted probabilities for pricingPredicted 16–17% average default vs 39% actual on 2006–07Recalibrate before pricing or reserving
Pay for GPUs23 seconds on two CPU coresCompute is not the constraint; governance is

Out-of-time test: 147,405 loans approved in fiscal 2006–07. Dollar figures are charged-off principal avoided relative to approving every loan, per $1bn of approved principal, approving the 80% of loans with the lowest predicted risk.

End to end in five steps

StepWhat happensOutput
1. SourceSBA 7(a)/504 FOIA loan file via a public mirror, checksum-pinned899,164 loans; 772,591 resolved and dated 1990–2007
2. FeaturesThirteen numeric loan and borrower fields plus state, industry and lender; term excludedLeakage-safe feature set
3. SplitTrain 1990–2003, tune 2004–05, test 2006–07480,033 / 145,153 / 147,405 loans
4. ModelsLogistic regression, LightGBM, Keras neural net with embeddings, 50/50 blendOut-of-time scores
5. JudgeAUC with bootstrap intervals, calibration, dollar losses at 80% approvalPre-registered hypotheses

The data

The SBA's national 7(a) and 504 loan file, released under the Freedom of Information Act, covers loans approved from 1962 to 2014 with each loan's outcome: paid in full or charged off, and the principal charged off. The copy used is the public mirror MaddRaf/SBAnational on Hugging Face, the same file described by Li, Mickel and Taylor (2018) in the Journal of Statistics Education. Only resolved loans are included, so later vintages over-represent defaults: the charge-off rate is 7.7% in the training years, 21.9% in 2004–05 and 38.8% in 2006–07. That makes the test a hard one, and a fair test of ranking; the levels need a separate adjustment.

FeatureDefinitionWhy it matters
Loan size and guaranteelog approved amount; SBA-guaranteed shareSize and the lender's own risk retention
Borrowerlog employees, new business, franchiseOperating history and support
Structurerevolving line, low-documentation programProduct type and underwriting depth
Lenderout-of-state lender; lender identity (839 lenders with 50+ training loans)Underwriting standards differ by lender
Location and industrystate (51), 3-digit NAICS industry (92), urban or ruralLocal and sector conditions
Processdays from approval to disbursement; jobs created and retainedDeal mechanics
Excludedloan termIn this file it partly reflects post-default changes (a leakage source)

The method

All three models see the same rows and the same features. Lenders and industries with fewer than 50 training loans, and any category first seen after 2003, are pooled into an "other" group, so nothing from the test years leaks into the encoding. The logistic regression uses the numeric fields plus one-hot state and industry, without lender identity. LightGBM uses all features with native categorical handling and stops adding trees when the 2004–05 AUC stops improving (214 trees). The neural net, built in Keras on TensorFlow, learns a 16-number embedding for each lender, 12 for each industry and 8 for each state, joins them with the numeric fields and passes them through two layers of 128 and 64 units with dropout; it has 29,693 parameters and stops training when the 2004–05 AUC stops improving (10 epochs). Seeds and deterministic operations are fixed, and the neural net is also run with two further seeds. Differences in AUC are tested with a paired bootstrap on the test loans.

The four hypotheses, fixed in advance, were: H1, the neural net beats gradient boosting on out-of-time AUC; H2, both beat the logistic regression by at least 0.03; H3, a 50/50 blend beats either alone; H4, the neural net is no worse calibrated than gradient boosting.

The results

Bar chart of AUC for logistic regression, gradient boosting, the neural net and a blend, on 2004-05 tuning loans and 2006-07 test loans
AUC on the 2004–05 tuning years (light) and the 2006–07 out-of-time test (dark).

On the tuning years the two challengers were level (AUC 0.737 for gradient boosting, 0.736 for the neural net). Out of time, the neural net held up slightly better: 0.687 against 0.681. The difference of 0.006 has a 95% bootstrap interval of 0.005 to 0.008, and across three random seeds the neural net scored between 0.686 and 0.689, always above gradient boosting. H1 holds, by a small margin. The blend scored 0.689 (H3 holds), and both challengers beat the logistic regression (0.622) by about 0.06 (H2 holds).

ROC curves for the four models on 2006-07 loans
ROC curves on the 2006–07 test loans; the challengers' curves nearly overlap.
Bar chart of charged-off principal avoided per one billion dollars approved, approving the safest 80 percent of 2006-07 loans, for each model
Charged-off principal avoided per $1bn approved, relative to approving every 2006–07 loan, when each model approves the 80% of loans it rates safest.

The money tells a different story. Approving every 2006–07 loan would have lost 19.9% of principal to charge-offs. Approving the 80% each model rated safest, gradient boosting avoided $26.0m of charge-offs per $1bn approved, the blend $24.7m, the neural net $23.3m and the logistic regression $15.2m. The neural net's edge came from small and mid-sized loans (AUC 0.657 and 0.660 against 0.651 and 0.648). On the largest third of loans, which carried 70% of the charged-off dollars, the two were level (0.719 against 0.718), and weighted by loan size gradient boosting was marginally ahead (0.752 against 0.751). Which loans fall just inside or outside the cut-off decides the dollars, and AUC counts every loan the same. A model is judged on dollars, not on how many loans it ranks correctly.

Calibration chart of predicted versus actual charge-off rates by decile for gradient boosting and the neural net on 2006-07 loans
Predicted against actual charge-off rate by decile of predicted risk, 2006–07 loans. Points above the dotted line are under-predicted.

Both models were badly miscalibrated for the recession. They predicted an average default probability of 16–17% on loans that charged off at 39%, and the neural net was slightly worse (calibration error 0.226 against 0.216; Brier score 0.269 against 0.265), so H4 is rejected. Neither model could know the 2008–09 recession was coming; the point is that a probability learned in good years needs recalibration before it is used for pricing or reserves.

Compute was not a constraint: on two CPU cores with no GPU, the logistic regression trained in 4 seconds, gradient boosting in 15 and the neural net in 23.

The commercial case

ElementWhat it is
Who paysChief risk officers, heads of credit analytics and model-risk teams at banks, SBA lenders, fintech lenders and private-credit platforms
The problemModel upgrades are approved on AUC; here the higher-AUC model avoided $2.7m less in charge-offs per $1bn approved
The productA challenger-model validation service: champion vs challenger on the lender's own book, judged on dollar losses at its approval rate, with calibration and stability checks
Proof772,591 real loans; out-of-time test through a recession; pre-registered hypotheses; bootstrap intervals and seed checks
Build vs buy3–4 weeks per engagement on the lender's data; today validation often stops at AUC and Gini
Pricing logic$40–75k per validation (illustrative): under 3% of the $2.7m a year at stake per $1bn of annual originations
Adoption riskModel-risk teams own validation; the KPI is dollar loss rate at the approved cut-off, by vintage

Recommendations

  • Decision: keep gradient boosting in production; run the neural net as a monitored challenger and test a 50/50 blend.
  • Controls: approve model changes on dollar losses at the actual approval rate and by vintage, not on AUC alone.
  • Calibration: recalibrate both models to current default experience before using probabilities for pricing, limits or reserves.
  • Governance: document what the lender embeddings capture; learned lender effects need the same explainability and fair-lending review as any other feature.
  • What to monitor: AUC and dollar loss rate by vintage, calibration-in-the-large, and the share of loans from lenders unseen in training.

Limits

  • Resolved loans only: later vintages over-represent defaults, so the levels are biased and the test is mainly a ranking test.
  • The data ends in 2014 and the test years are 2006–07; today's lenders, products and rates differ.
  • One neural architecture, lightly tuned; a larger search might narrow or widen the gap.
  • Dollar results use charged-off principal, not recoveries after charge-off or the SBA guarantee.
  • Independent research on public data. Not deployed; not investment or credit advice.

How it was built

Pipeline flowchart from the SBA FOIA loan file through features and the out-of-time split to three models and the tests
The full pipeline. Blue: external sources. Lavender: code steps. Red: checks and gates.

Sources

Data

  • US Small Business Administration, 7(a) and 504 national loan data (FOIA), via the Hugging Face mirror huggingface.co/datasets/MaddRaf/SBAnational; described in Li, M., Mickel, A. and Taylor, S. (2018), "Should This Loan be Approved or Denied?: A Large Dataset with Class Assignment Guidelines," Journal of Statistics Education 26(1), 55–66.

Methods referenced

  • Ke, G. et al. (2017). "LightGBM: A Highly Efficient Gradient Boosting Decision Tree." Advances in Neural Information Processing Systems 30.
  • Guo, C. and Berkhahn, F. (2016). "Entity Embeddings of Categorical Variables." arXiv:1604.06737.
  • Grinsztajn, L., Oyallon, E. and Varoquaux, G. (2022). "Why do tree-based models still outperform deep learning on typical tabular data?" Advances in Neural Information Processing Systems 35 (Datasets and Benchmarks).
  • Abadi, M. et al. (2016). "TensorFlow: A System for Large-Scale Machine Learning." 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16).

Independent research on public data, not investment or credit advice; dollar figures are illustrative. Analysis, code, charts and text were produced with AI assistance and reviewed by the author.