Back to Decisions

Use GPT-4 for spending categorisation

Accepted
Tom Bakker2024-02-18
aicategorisationbackend
Context
Why this decision needed to be made

Transaction descriptions from banks are often cryptic (e.g. 'AMS NL 1234'). Need to auto-categorise them accurately for budget tracking.

Options Considered
Comparison of available options
OptionProsConsChosen
GPT-4 (OpenAI)Selected
  • High accuracy
  • Handles edge cases
  • Easy integration
  • API cost at scale
  • Latency
Rule-based regex
  • Zero cost
  • Instant
  • Brittle
  • High maintenance
  • Poor accuracy for edge cases
—
Fine-tuned BERT
  • Fast inference
  • Self-hosted
  • Months to train
  • Needs labeled data
—
Outcome
What was decided

GPT-4 for categorisation with local caching layer

Rationale
Why this option was chosen

Accuracy is critical for user trust. GPT-4 achieves 94% accuracy in testing. Added Redis cache to avoid re-classifying known merchants.