Problem
Mercado Libre (MELI) has to turn raw transaction text from several Latin American countries into structured categories such as restaurants, subscriptions or transport. The first system relied on country-specific regular expressions and manually reported Merchant Category Codes (MCC). It reached about 60% accuracy, needed constant edits, and needed separate tuning per country and language. Later, running every transaction through an external LLM API became slow and expensive at hundreds of millions of transactions.
Example from the article: a gas station named "Posto de Gasolina" was filed under "8220-Educational Services", and a "Digital Subscriptions" class needed hundreds of regex lines that broke when Spotify or Netflix changed their naming slightly.
Solution in brief
An LLM, prompted with a fixed category list, labels transactions in batches, and humans validate the output and feed corrections back into the prompt. The LLM-labeled corpus is then used to fine-tune BERT-style embeddings, which categorize transactions in near real time at lower cost than the API.
Questions this case answers
- How to classify short noisy text records into a fixed category set at high volume when hand-written rules break across languages and labeled data is scarce
- How to move the labeling quality of a paid LLM API into a cheaper low-latency in-house model
- How to categorize millions of financial transactions in several languages without maintaining regex rules per country?
- How to build a labeled transaction corpus quickly when manual labeling takes weeks?
Tools and methods
- GPT-3.5 Turbo — first-generation LLM labeler, called through the public API in batches
- Human-in-the-loop validation — checks LLM labels and returns feedback to the prompt
- BERT-style embeddings fine-tuned on regional financial text — cheap semantic categorizer trained on LLM labels
- Model-agnostic design — the labeling model can be swapped (GPT-4o-mini adopted, Gemini and Claude tested)
Google or a one-time email code. No password.