← Blog

/

News

News

Gemini vs Claude: How Google’s and Anthropic’s models compare

Fraud hides in the history: an open card-fraud benchmark, and small models that catch it

Toloka Arena is live. See how your model ranks.

One of the fraud models we tested missed all five fraudulent purchases at shops in Monroe, Michigan. A second flagged them from the third purchase on, using only the simulated card history: the card was swiped, although its owner almost always paid by chip.

Payment companies are moving to large models that read a card’s whole transaction history, but running one on every payment is expensive. We built an open benchmark with card-fraud practitioners to test how well models recognize patterns like the one in Monroe. We also wanted to know how much smaller we could make a model before it started missing fraud. On our benchmark, a model with one-twelfth as many parameters caught 83.6% of the fraud at the same rate of false alarms, close to the larger model’s 85.0%, and ran 4.1 times as fast.

In short

  • An open benchmark where fraud hides in the transaction history. We extended IBM's open TabFormer data into CardHistory-Fraud: seven fraud patterns, legit look-alikes such as trips and new subscriptions, and a bank that blocks compromised cards and issues new ones. [Dataset] · [Code]

  • Fraud investigators reviewed the data on the Toloka Platform and spotted a missing detail: compromised cards were active for weeks. On their advice, we added card blocking and reissue.

  • Reading the raw history beats hand-made features. A 5M-parameter transformer catches 85.0% of fraud at 5 false alarms per caught fraud, against 76.1% for XGBoost with 46 hand-made features. Without the fraudsters' tiny test payments, the lead grows to 15 points.

  • Small students keep almost all of it. A 2.6M-parameter student matches the teacher at 1.8× the speed. A 0.4M student keeps 98% of the teacher's catch at 4.1× the speed: 3.8 ms per transaction on one CPU thread.

Why we built a new benchmark

Fraud models are moving from hand-made features to models that read a card's raw history. Visa (TransactionGPT, TREASURE), Revolut (PRAGMA) and Nubank (nuFormer) have published such transaction models. None of them can publish the data, so open research needs a public benchmark where the history matters.

Of the open datasets we reviewed, only IBM's TabFormer has card-by-card histories, fraud labels, real card-payment fields and scale: 24 million transactions from 2,000 simulated US cardholders. Its fraud, though, is too easy for this question. In the test years, 96% of it happens abroad, so one field gives it away, and a model that sees a single transaction does as well as one that reads the history.

So we kept IBM's 24 million transactions and added our own fraud, in six versions, each fixing what the previous one made too easy. IBM's own fraud stays in the data and models train on it, but it does not count in the benchmark result, since one field gives it away. The release contains seven fraud patterns:

Fraud pattern

What happens

Card-testing burst

3-7 tiny online payments ($0.10-3) minutes apart, about 60% declined, then a purchase

Distributed testing

a few tiny probes at small online shops over 1-3 days; most cards are used later

Network testing wave

20-60 cards probed at one small online shop within hours; some are used later

Stolen card

near home: a $5-30 first purchase, then $100-500 and growing, at shops where goods resell

Counterfeit card

a cloned card, mostly swiped, used for days in towns the owner never visits, while the owner keeps shopping

Breached merchant

a card used at a breached shop is misused weeks later

Fraudulent recurring charge

a fraudster's subscription that keeps charging the card

Around them sit legit look-alikes that resemble fraud: trips abroad, domestic trips and new subscriptions. When fraud is detected, the bank reacts: it blocks the card, declines the fraudster's next attempts and issues a new card. One labelling rule holds throughout: every transaction the fraudster makes is fraud, including test payments and declined attempts, and the owner's own transactions stay legit.

Timeline of six benchmark versions built on IBM TabFormer's 24 million synthetic transactions, each with more realistic fraud. TabFormer's fraud is easy to spot: 96% happens abroad. v1 adds card testing, takeovers and breached merchants. v2 makes fraud copy real legit purchases. v3 adds six fraud types only a card's history reveals. v3.1 makes fraud follow the victim's hours, amounts and chip use. v3.2 adds realistic trips and online shops and was reviewed by card-fraud practitioners. The released v3.3 adds their changes: the bank reacts, with realistic travel times and card testing.

Built with people who fight card fraud

Synthetic fraud is only useful if the people who fight real fraud would recognise it. So we asked card-fraud practitioners from fraud operations and investigations to review the data in two steps, both run on the Toloka Platform. First, a blind check: card histories to mark as fraud or legit, without knowing what we had added. Then they read our methodology and graded every assumption behind it, from 1 (not realistic) to 5 (very realistic), with comments.

They rarely called our fraud patterns artificial. Most of the odd details they spotted came from the base data, such as hotels in unexpected cities or refunds recorded before the purchase. One reviewer explained why a transaction history alone can leave an investigator unsure:

"From those transaction tables alone, I would not confidently identify either case as account takeover; the contact-change and verification history I relied on in my work is not shown."

A fraud operations specialist who handled cardholder fraud claims

The clearest gap was the bank's reaction. In the version they reviewed, a compromised card was never blocked:

"In real life, bank blocks the card and sends a new one. A history that keeps going for weeks looks fake, and the block is one of the strongest real signals."

A card-fraud analyst

They also told us how fraud really behaves, with numbers from their own cases:

"Typically the first purchase is small, like fuel or a small shop ($5-30), to see if the card works. Then within minutes or hours come bigger ones, often 3 to 10 times larger ($100-500)."

A card-fraud analyst

"Because counterfeit cards can't reproduce the EMV cryptogram, in-person fraud on cloned cards is mostly swipe."

A card-fraud analyst

The release implements their main requests, and we checked each one against their numbers on the built data:

They asked for

What the data does now

Measured

A bank that reacts

blocks the card, declines the fraudster's next 2-10 attempts, issues a new card

12,585 blocks; a new card after a median of 4.9 days

Realistic travel

door-to-door travel time and time zones on trips

no impossible moves on trips

One labelling rule

every transaction the fraudster makes is fraud, test payments included

no unlabelled test payments

Counterfeit vs stolen cards

counterfeit cards mostly swiped, stolen cards mostly used with the chip

73% swiped (their range: 60-90%); 76% chip (70-80%)

Realistic card testing

$0.10-3, minutes apart, about 60% declined

2.0 minutes apart; 59% declined

Fraud that keeps its own hours

more online fraud at night

24.9% of online fraud at night (their range: 20-30%)

Stolen cards that spend like thieves

near home, a small first purchase, then large and growing amounts

22 km from home (median); amounts grow in 98% of cases

Reading the raw history beats hand-made features

The teacher is a 5M-parameter transformer that reads a card's last 128 transactions, one token per transaction, with no hand-made features. We compared it with XGBoost on 46 features a production team would build: card history, 7/14/30-day windows of declines and tiny payments, and geo-velocity. We compared the models at a point where each flagged five legitimate transactions for every fraudulent one it caught. Using 3 million test transactions spanning July 2018 to March 2020, we measured what percentage of the fraudulent transactions each model picked up. Each transaction is scored with its own fields and the card's history before it. Attempts on a card the bank has already blocked are fraud too, but their decline code gives them away, so they do not count in this score.

Two dot charts comparing five models. At 5 false alarms per caught fraud, Teacher 5M and Student 2.6M each catch 85.0% of fraud, Student 0.4M 83.6%, the same 0.4M model without a teacher 79.7%, and XGBoost with 46 hand-made features 76.1%. As a share of the teacher's catch, that is 100%, 100%, 98%, 94% and 89%. Student 0.4M runs 4.1 times faster than the teacher.

The transformer catches 85.0% of fraud against 76.1% for XGBoost, a lead of 9.0 points (95% interval: 7.1 to 10.7; differences are computed before rounding). Every model catches nearly all test payments, so without them the lead grows to 14.8 points: 75.3% against 60.4%.

The largest gains came on counterfeit cards and fraudulent recurring charges:

Fraud pattern

Transformer

XGBoost

Counterfeit card

58.5%

31.3%

Fraudulent recurring charge

61.1%

36.6%

Stolen card

87.1%

76.9%

Card-testing bursts and probes

99-100%

99-100%

A breached merchant stays hard for every model (65.3% for the transformer): no single card reveals it, and banks find it across cards. On legit look-alikes, the transformer raises fewer false alarms on trips abroad (1.9% of their transactions against 3.3%) and slightly more on domestic trips (4.8% against 3.1%) and new subscriptions (12.8% against 11.6%).

An example from the synthetic test set. Take the Michigan cardholder from the opening. The five purchases in Monroe ranged from $73 to $200 over three days. The owner regularly shopped outside their home town of Fenton, so the location alone gave little away. What stood out was the repeated use of the magnetic stripe. From the third purchase, every training run of the transformer flags it. XGBoost misses all five. None of its 46 features captures the cardholder’s preference for chip payments. It flags only the attempts after the bank blocks the card, from their decline codes. The owner's own purchase at home the day before is flagged by no model.

Distillation: what worked, and what didn't

A large model that reads the history is expensive to run on every payment. Distillation trains a small, fast student to imitate it, from the teacher's scores as well as the fraud labels.

On the final benchmark, a 2.6M-parameter student (the teacher cut to 3 of its 6 layers) catches 85.0%, the teacher's level, at 1.8× the speed. A 0.4M student trained from scratch catches 83.6%, 98% of the teacher, with 12× fewer parameters, at 4.1× the speed: 3.8 ms per transaction on one CPU thread. The teacher makes the difference: the same small model trained on the labels alone catches 79.7%.

Scatter chart of 45 experiments to improve Student 0.4M, each scored as its share of Teacher 5M's fraud catch. A step line tracks the best result so far. It rises from the no-teacher baseline of 73.7% to 93.1% at experiment 9 (patient, consistent distillation), 97.4% at experiment 38 (two-stage distillation) and 98.3% at experiment 43, the released student. Most other experiments score between 55% and 97% without improving the best.

The results below come from earlier, harder versions of the benchmark. We used them to compare 10 distillation approaches and models ranging from 0.16M to 39M parameters. Compare the scores within each experiment.

What worked

  • Patient and consistent distillation. The teacher sees exactly the student's input, and the student trains twice as long. It was the best recipe for both students we tried: 61.4% and 57.8%, against 57.4% and 52.9% for plain score distillation.

  • Distilling the embedding through the student's embedding head. Besides its score, the teacher outputs an embedding of the card's history that other models can build on. When only the student's embedding head learns it, the student keeps its fraud catch, and a classifier fitted on the teacher's embedding works unchanged on the 2.6M student's: 0.660 area under the precision-recall curve, against 0.714 on the teacher's own.

  • Correcting the teacher when experts know something it doesn't. A student copies its teacher's blind spots. So a correction model first learns where the teacher is wrong, from its score, the labels and the 46 hand-made features, and the students learn from the corrected teacher. On a version where the hand-made features still added a lot, the 2.6M student beat its own teacher by 6.1 points (63.0% against 57.0%). On the final version, the teacher had already learned what those features know, and the gain disappeared.

What didn't

  • Matching the teacher's internals. Matching hidden states or attention patterns gave no consistent gain, and matching rankings hurt (48.4% and 36.5%).

  • A bigger teacher. A 39M-parameter teacher caught no more than the 5M one (61.6% against 63.4%) at 6× the CPU time: with 24 million transactions from 2,000 people, more capacity does not help. Students hold up to about 0.4M parameters, then drop fast (45.4% at 0.16M).

  • A cached embedding. A student that reads the teacher's embedding computed once a day, plus its own short window, is the fastest (1.1 ms), but it misses same-day attacks: 38.9%.

  • Pretrained language models as students. Reading the history as text, about 4,000 tokens per card, two models of 110M and 290M parameters caught at most 13.5% of fraud, against 57.8% for the 0.4M student, and the larger one needed about 204 ms per transaction. Transaction data is structured, and small transformers that read it as rows already learn the task.

    Two dot charts comparing ten ways to train a student from Teacher 5M, on an earlier version of the benchmark. Patient, consistent distillation scores best for both students: 61.4% for Student 1.8M against 55.0% with labels only, and 57.8% for Student 0.4M against 50.8%. Adding a ranking loss scores worst, at 48.4% and 36.5%. Differences below about 3 points are within run-to-run variation.

    What we release

    The data and the code are open under Apache-2.0. The data is built on IBM's TabFormer (Apache-2.0) and is not affiliated with or endorsed by IBM; the city coordinates the generator uses come from GeoNames (CC BY 4.0). [Dataset] · [Code]

    • The data: 24.9 million transactions on 6,139 cards of 2,000 people, 1991-2020, split by time into training, development and test periods. Each fraud carries its pattern and episode, and test payments, attempts on a blocked card and legit look-alikes are flagged.

    • The generator, which rebuilds this exact dataset from IBM's file. It is open, so you can change it to build your own variant: rarer fraud, other patterns, other bank behaviour.

    • The evaluation: the score above (fraud caught at 5 false alarms per caught fraud), with and without test payments, so results are comparable.

    • Baselines: XGBoost with its 46 features, and the teacher and the students: their weights, the code to train and evaluate them, and their scores on the test set.

    • A dataset card: how the data was built, every assumption, and the limitations below.

    Limitations

    • Synthetic data. The legit spending is IBM's simulation, and the fraud is ours. It follows published fraud patterns and the practitioners' numbers, but absolute numbers will differ on a real portfolio.

    • Quirks of the base data. Some legit histories have oddities that real data would not, such as hotels in unexpected cities or refunds recorded before the purchase. We kept IBM's transactions as they are, except where an added event changes them: a trip moves the owner's purchases, and a blocked card stops them.

    • Labels are complete and immediate. In a bank they arrive days to months later, and small or declined attempts often stay unlabelled.

    • Scored after authorisation. A model sees each transaction's outcome, including its decline code. A model that must decide before authorisation would not have it.

    • More fraud than in reality: 0.42% of transactions, against under 0.1% in real portfolios. A view with 2 false alarms per caught fraud gives the same ranking.

    • Signals a bank has but the data lacks: cash-machine, crypto or gift-card cash-outs, devices, IP addresses, 3-D Secure checks, logins and contact changes.

    Why it matters

    How small a model can you run before it starts missing fraud? The benchmark lets a risk team test that trade-off before trying the model on its own transactions. Distillation makes a large model affordable on every payment. Domain experts make the data and the evaluation trustworthy, as they check what is realistic, review the cases where models and labels disagree, and add what the teacher has not learned.

    At Toloka, we do post-training and distillation for production constraints, with domain experts in the loop. The expert review in this study ran on the Toloka Platform, and any team can set up the same kind of review for its own domain. If you build fraud or risk models and want to try this on your own data, get in touch. To set up an expert review yourself, start on the Toloka Platform.

    We thank the card-fraud practitioners who reviewed the data and shared their experience.




Subscribe to our newsletter

Product updates, case studies and the latest news from our team, straight to your inbox