Credit risk LLM: Phi-4-mini on anonymized credit records
Role: Owned the LLM fine-tuning and the encrypted data transfer
PayPal-sponsored WPI Graduate Qualifying Project, team of 4
- Problem
- The project tested whether an LLM can assess credit risk from 692,922 anonymized tabular records.
- What was done
- Fine-tuned Phi-4-mini with LoRALow-rank adaptation: a way to fine-tune a large model by training a small set of added weights instead of changing all of them.Read more about LoRA on arxiv.org on Azure, turning each record into a text prompt of 22 features selected from 216.
- What changed
- Matched XGBoost while training on about 5% of the data, and a re-check traced most of every model's score to one feature.
- Accuracy, Phi-4-mini vs XGBoost (different test sets)
- 0.947 vs 0.944
- MCC, Phi-4-mini vs XGBoost
- 0.835 vs 0.826
- Anonymized records
- 692,922
- One binary feature alone (attribute213), accuracy and MCC
- 0.9441 and 0.8261
- KS, Phi-4-mini
- 0.743
- Share of the data used for training
- about 5%
- Good cases no model separates
- 27%
Check the match, the stability tests and the re-check
Matched baselines and the checks behind them
| Model | Accuracy | MCC | KS |
|---|---|---|---|
| Phi-4-mini, LoRA | 0.947 | 0.835 | 0.743 |
| XGBoost | 0.944 | 0.826 | not on record |
Matched, and no more: the two scores come from different test sets, an Azure 5% sample split for Phi-4-mini and seeded 80/20 splits of the full data for XGBoost. Phi-4-mini trained on about 5% of the 692,922 records.
Matched: Phi-4-mini accuracy 0.947 and MCC 0.835, XGBoost 0.944 and 0.826, on different test sets.
Problem
PayPal Global Credit Risk sponsored the project, titled Applications of LLM Generalization Potential for Credit Risk Assessment. The data held 692,922 anonymized records with 216 attributes, 215 features plus the label. The question was whether a fine-tuned LLM could match classic baselines, with the data moved to a GPU cluster without leakage.
Approach
I owned all the LLM fine-tuning, on Azure AI Foundry and on the WPI Turing HPC cluster with SlurmOpen-source software that schedules jobs on shared computing clusters, queuing each job until the GPUs or CPUs it asks for are free.Read more about Slurm on slurm.schedmd.com. Records became CALM-style text prompts over 22 selected features. Phi-4-mini was fine-tuned with LoRA on Azure AI Foundry. Baselines were XGBoostAn open-source library for gradient-boosted decision trees, widely used as a strong baseline for predictions from tables of data.Read more about XGBoost on xgboost.readthedocs.io, random forest and SVM over 10 seeds. I moved the data to Slurm over an AES-GCMA standard encryption method, approved by NIST, that keeps data secret and also detects whether anyone has tampered with it.Read more about AES-GCM on csrc.nist.gov encrypted transfer. Feature selection and imputation were a teammate's work.
Highlights
- Fine-tuned Phi-4-mini with LoRA on Azure, on 22 features selected from 216.
- Matched XGBoost: accuracy 0.947 vs 0.944, MCCMatthews correlation coefficient: a score from minus 1 to 1 for yes or no predictions that stays reliable when one outcome is rare.Read more about MCC on en.wikipedia.org 0.835 vs 0.826.
- The two scores come from different test sets, so the result is a match.
- Baselines were XGBoost, random forest and SVM over 10 seeds, on 692,922 records.
- Trained on about 5% of the data.
- Shuffling input fields moved KS statisticThe Kolmogorov-Smirnov statistic, used in credit scoring to measure how well a model's scores separate good accounts from bad ones.Read more about KS statistic on en.wikipedia.org only from 0.743 to 0.733.
- F1, MCC and KS held steady across cutoffs from 0.2 to 0.8 (Phi-3.5-mini).
- Over 30 Phi-3.5-mini runs, accuracy averaged 0.9431 with SD 0.0023.
- LoRA adapter capacity, not base model size, was the main performance limit.
- Moved the data to WPI's Slurm GPU cluster over an AES-GCM encrypted transfer.
- Re-check: one binary feature, attribute213, alone scores accuracy 0.9441 and MCC 0.8261.
- Most of every model's score comes from that feature, a likely leak.
- The feature also pointed at the 27% of good cases no model separates.