Anyone who’s glanced at a bank feed has seen it: cryptic transaction lines that look more like a receipt printer hiccup than a real-world purchase. Entries such as “SQ *JAVAHSE 4829 CA” or “POS 129384 07/14” may include merchant IDs, partial names, payment rails, and codes—but not much meaning. Financial apps increasingly use large language models (LLMs) to turn that raw, machine-friendly data into human-friendly explanations like “Coffee shop purchase” or “Ride-share trip,” while keeping the output descriptive rather than directive.
At a high level, the job is translation: converting standardized payment signals—merchant identifiers, Merchant Category Codes (MCCs), and transaction metadata—into plain language that matches how people think about spending. MCCs, for example, are four-digit codes used by card networks and issuers to classify the type of merchant or business involved in a card transaction.
Step 1: Ingest the raw transaction record
A typical transaction record arrives as a bundle of fields, often including:
- Merchant name string (sometimes truncated or stylized)
- Merchant ID / acquirer data (identifiers used in payment routing)
- MCC (a category label based on the merchant’s business type)
- Amount, date/time, currency
- Channel clues (card-present, online, wallet, recurring)
- Free-text descriptors (location fragments, terminal IDs, “SQ *”, “PAYPAL *”, etc.)
The challenge is that two banks can represent similar purchases very differently, and the same merchant can appear in multiple forms. That inconsistency is why many apps run an “enrichment” layer before an LLM ever sees the data.
Step 2: Enrich and standardize the signals
Before generating a natural-language explanation, systems often normalize fields so they become predictable inputs. Common enrichment work includes:
- Merchant normalization: mapping messy strings to a clean merchant entity (for example, consolidating abbreviations and variants). Industry write-ups describe merchant matching and classification as a persistent data quality problem because MCCs and raw names can be misleading or inconsistent.
- Category alignment: using MCC as a baseline and supplementing it with merchant databases or internal taxonomies. MCCs are widely used, but networks and issuers can vary in how codes get applied, and some merchants span multiple services.
- Metadata shaping: extracting meaningful features like “recurring,” “subscription,” “in-store vs. online,” or “travel-related,” based on available descriptors.
This is the moment where raw payment plumbing turns into a more semantic “story starter” for the LLM.
Step 3: Convert structured fields into an LLM-ready prompt
LLMs don’t naturally “read” database rows the way software does. So apps usually transform a transaction into a structured prompt that gives the model context and constraints, such as:
- A compact transaction schema (merchant_clean, mcc, amount, date, channel, location)
- A task instruction (“Generate a short, neutral explanation of what this transaction appears to be.”)
- A format requirement (one sentence, no speculation, avoid advice, return JSON)
Prompt design matters because it shapes consistency and reduces drift. OpenAI’s prompting guidance emphasizes clear instructions, structured formats, and examples when needed—practices that translate well to repetitive transaction explanation tasks.
Some finance-focused research also describes “prompt generation” stages where enriched categorical data is transformed into standardized natural-language inputs optimized for downstream models.
Step 4: Domain-specific fine-tuning (or “specialization”)
Prompting alone can produce generic explanations. To better match financial language and edge cases (pending transactions, refunds, reversals, cash withdrawals, peer-to-peer transfers), some systems use domain adaptation approaches such as:
- Fine-tuning on labeled examples: training a model on pairs like (raw transaction + enriched fields → approved explanation) so outputs match institutional style and terminology.
- Instruction tuning for constraints: reinforcing “neutral, descriptive, non-judgmental” language and consistent formatting.
- Taxonomy alignment: teaching the model the organization’s preferred category names and phrasing.
Regulatory and supervisory discussions of LLMs in finance frequently highlight techniques like fine-tuning and retrieval-augmented generation (RAG) as ways to improve usefulness and reduce hallucinations, while noting that error risk can’t be eliminated entirely.
Step 5: Guardrails for accuracy and “no made-up details”
Transaction explanations have a unique risk: they can sound confident even when the data is ambiguous. Guardrails are the controls that keep outputs grounded and appropriately uncertain. Common guardrail patterns include:
- Grounding with retrieval (RAG): the model receives only verified merchant facts pulled from a controlled database (brand name, known category, official descriptors). RAG is widely discussed as a method to reduce hallucinations by tying generation to retrieved evidence.
- Confidence and abstention logic: when signals conflict (MCC says “gas station,” merchant string resembles “grocery,” location missing), the system can produce a higher-level description (“Card purchase at a retail merchant”) rather than an overly specific guess.
- Constrained outputs: forcing a fixed schema (for example, {“summary”: “…”, “merchant”: “…”, “category”: “…”, “confidence”: “low/medium/high”}) reduces creative wandering and makes downstream validation easier.
- Policy filters: preventing the model from generating sensitive inferences (like guessing medical conditions) from merchant names, and avoiding language that crosses into prescriptive financial advice.
A useful mental model is that the LLM is doing “explanation generation,” while surrounding systems do “truth management”—deciding what facts are allowed into context and how uncertain outputs are handled.
Modeling meaning without prescribing behavior
Well-designed transaction explanations focus on clarity: what the transaction appears to represent based on available codes and metadata. The tone typically stays descriptive—labeling the event, not evaluating the decision. That difference can be subtle but important: “Restaurant purchase” describes; “You spent too much dining out” judges. Many finance sector discussions of LLM risk emphasize the importance of controls to avoid inaccurate or inappropriate outputs, particularly where content could be interpreted as advice.
Why this matters for everyday users
In plain terms, transaction explanations reduce cognitive load. People don’t want to decode payment rails or memorize MCCs. They want to recognize what happened quickly—especially when scanning budgets, disputing unfamiliar charges, or reconciling business expenses. LLMs offer a flexible way to turn scattered signals into readable summaries, as long as the system is engineered to prioritize accuracy, restraint, and transparency about uncertainty.
References (APA)
Consumer-facing definition of MCCs and practical implications. (n.d.). Understanding Merchant Category Codes (MCCs). Investopedia.
Financial Data Exchange-style interoperability context for structured financial data. (2025). The New Quant: A survey of large language models in finance. arXiv.
Fan, X. (2025). Enhancing foundation models in transaction categorization (Industry track paper). ACL Anthology / EMNLP Industry.
Fredrikson, G. (2024). Secure interactions with large language models in financial services (Master’s thesis). Uppsala University.
Mastercard. (2018). Quick reference booklet—Merchant edition: Card acceptor business code (MCC) information (PDF). Mastercard Rules Documentation.
OpenAI. (n.d.). Best practices for prompt engineering with the OpenAI API. OpenAI Help Center.
OpenAI. (n.d.). Prompt engineering guide. OpenAI Platform Documentation.
Amugongo, L. M., et al. (2025). Retrieval-augmented generation for large language models: A survey and research directions. (Article). PubMed Central.
Ramp. (2025). How Ramp fixes merchant matches with AI. Ramp Builder Blog.
Square. (2025). RoBERTa model for merchant categorization at Square. Square Developer Blog.
ESMA & The Alan Turing Institute. (2025). Leveraging large language models in finance: Risks, use cases, and mitigation approaches (Report).



