Five test set-ups, from easiest to hardest
Random splits reuse the same merchants in training and test. On brand-new merchants an exact lookup collapses to 4.1%, while character n-grams keep 51.2%. Run: expense_categoriser_train_test.ipynb, 27 Oct 2026.
Is the confidence honest?
Points above the diagonal mean the model is cautious. 0.7–0.8 confidence was right 95% of the time.
Auto-file or ask?
The chosen threshold (0.60) is the lowest at which auto-filed brand-new-merchant purchases are at least 90% correct.
From categories to answers
Error propagation
The same 30 gold queries, run on true categories and on out-of-fold predicted ones.
| Question type | Known merchants | Brand-new merchants |
|---|---|---|
| Control: no category (10) | 100% | 100% |
| Category questions (20) | 55% (median error 5%) | 5% (median error 89%) |
Where the LLM went wrong
All 30 questions
✓ / ✗ = the LLM's SQL returned the gold answer. Answers and amounts are in the locked tab.
Why advice goes through tools next
"How can I save 1,000 AED a month?"
Three cuts that add up to about 295 AED, then "these adjustments should help you reach your goal".
"Give me 5 best places to cut"
Three places, priced in dollars ($484, $1230, $176) when the data is in AED.
"Where can I save next month?"
Describes government fees as "parking fines or utility bills", which belong to other categories.
Every number the model was given was real; its arithmetic and reasoning were not. The locked tab shows the proposed fix running: fixed analysis tools compute every figure, and the text only ranks and phrases them.
Per-user spending
Pseudonymous card-holders (U01–U12, volunteers and public-dataset users mixed). The data is encrypted (AES-GCM) and only decrypts in this browser.
Spending by month and category
Total by category
Top merchants
Where could I cut? tool-based
Query this card-holder's expenses
The same guard as the notebook: one SELECT/WITH only, data-changing keywords blocked, and the database is set to query-only. Table: expenses(txn_id, user, bank, date, month, year, merchant, amount_aed, category). The live LLM runs in Colab; here you write or pick the SQL.