Large-scale behavioral pretraining offers a promising route to generalizable representations in online payment systems. However, high-cardinality identity fields such as card, device, and account IDs, though rich in behavioral signals, remain underexploited. Their continually growing vocabularies and limited semantic meaning make existing vocabulary-based and semantics-based encodings ill-suited. Their generalizable signal lies not in specific values, but in the identity behavior patterns they exhibit across a transaction sequence. Building on this insight, we propose ID2Pattern, a pretraining framework that brings these patterns into transaction foundation models. ID2Pattern first encodes identity fields with a Local Anonymous ID (LAID) tokenizer, which captures how each identity appears and recurs within the sequence, independent of its specific value. It then pretrains a multi-scale pattern codebook on unlabeled sequences, which abstracts LAID sequences into discrete behavior patterns for downstream prediction. Experiments on an industrial dataset with over 100M sequences and six public datasets show that ID2Pattern consistently outperforms strong baselines, improving industrial by 4.13% and public datasets by 8.83% on average. Notably, ID2Pattern remains equally effective even when all identity values are unseen during training, highlighting its potential to generalize to new users and markets.
Figures & tables
Figure 1. Identity fields vs. semantic attributes on our industrial payment data: (a) continual vocabulary growth; (b) limited semantic meaning.
Figure 2. Overview of ID2Pattern . (A) Pattern tokens and event tokens are jointly modeled for risk prediction. (B) The LAID tokenizer encodes each identity by its relative identity within the sequence. (C) The multi-scale pattern codebook quantizes LAID sequences over short, medium, and long windows into discrete pattern tokens.
Dataset
Domain
#Sequences
#ID Fields
Pos. Rate
Industrial
Risk
100.0M+
9
–
Elliptic++
Risk
37.3K
2
5.69%
IBM AML
Risk
1.54M
2
0.20%
CCT
Risk
7.44M
2
0.12%
RetailRocket
Commerce
540.4K
1
2.78%
Synerise
Commerce
6.12M
2
24.44%
Table 1. Statistics of evaluated datasets. #Sequences counts the supervised targets, each with its own history sequence; the positive rate is computed on the test set.
Method
AUC-ROC (%)
T1 (%)
AddCB (%)
Semantic-attribute-only
—
—
—
+ Hash ID
−5.87
−11.91
−8.07
+ Hash ID (relabeled)
−8.00
−50.53
−46.96
+ LAID
+1.11
+6.96
+6.09
+ LAID (relabeled)
+1.11
+6.96
+6.09
ID2Pattern
+4.13
+22.64
+19.67
Table 2. Relative performance changes on the industrial payment-risk test set, using the semantic-attribute-only baseline as the reference.
Figure 3. Online shadow evaluation from July to August. AUC is normalized by the average AUC of the semantic-attribute-only model over the first three days.
Table 3. Performance on six public datasets in terms of PR-AUC (PR) and recall at a false positive rate of at most 0.5% ([email protected]%). Best results are in bold, and second-best results are underlined.
Ablation Variants
Risk
Commerce
CCT
IBM AML
RetailRocket
Synerise
w/o LAID
.0338
.2018
.7814
.4228
Local ID Only
.0600
.2695
.8152
.4718
w/o Pattern Branch
.0418
.1880
.8064
.4734
Single-scale
.0526
.2263
.8087
.4700
w/o Codebook
.0419
.2047
.8092
.4630
Table 4. Ablation study of different components (PR-AUC).
Figure 4. Generalization to unseen identities on CCT and Taobao. Left: PR-AUC with original and fully relabeled identities. Right: PR-AUC under increasing relabeling ratios.
Figure 5. Case study on learned codebooks. Left: positive-rate lift of codes at each scale. Right: multi-scale code combinations describing behavior patterns on CCT and Taobao.
Risk
Commerce
Backbone
IBM AML
CCT
RetailRocket
Taobao
GRU
.1600
.0315
.7358
.2102
+ ID2Pattern
.2397
.0345
.7700
.2756
Improv.
+49.8%
+9.5%
+4.6%
+31.1%
LSTM
.2014
.0318
.7255
.2078
+ ID2Pattern
.2543
.0268
.7763
.2678
Table 5. PR-AUC of different backbones with and without the identity modeling of ID2Pattern , averaged over 3 seeds.
Pretraining data
Taobao
RetailRocket
Synerise
Without pretraining
.2608 ± .0042
.8011 ± .0055
.4561 ± .0036
Target only
.2686 ± .0022
.8283 ± .0067
.4776 ± .0047
Other two datasets
.2698 ± .0025
.8313 ± .0016
.4836 ± .0010
Table 6. PR-AUC with the pattern encoder pretrained on the target dataset alone or on the other two commerce datasets.
Figure 6. Efficiency of identity representations. (a) Parameters per identity field; numbers give identities per hash bucket. (b) Inference time per sample.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Strategy
Size grows with IDs
Unseen IDs
Identity behavior
Vocabulary-based
Linear
OOV vector
Value-tied
Hashing
No
Arbitrary code
Value-tied
Hand-crafted
No
Supported
Predefined
Semantics-based
No
If content
Not captured
LAID (ours)
No
Invariant
Learned
Appendix
Table 7. Comparison of strategies for encoding high-cardinality identity fields.
Dataset
Positive class
Identity fields
Subjects
Train
Valid
Test
Lmax
CCT
fraud
merchant name, city
6,139
125,304
3,657,794
3,656,690
512
IBM AML
laundering
receiving bank, account
496,999
15,936
760,071
760,345
512
Elliptic++
illicit
two output addresses
46,564
18,360
7,765
11,184
256
Taobao
purchase
item, category
987,991
2,683,554
10,944,062
25,628,669
100
RetailRocket
purchase
item
58,653
428,761
55,209
56,467
100
Synerise
7-day conversion
SKU, URL
2,032,633
4,944,430
529,289
642,336
512
Appendix
Table 8. Details of the public datasets: positive class, identity fields, number of sequence subjects and supervised targets in each split, and maximum history length Lmax .
Ant International accumulates large volumes of transaction history across users and payment businesses. Confirmed fraud and chargeback outcomes, by contrast, are scarce, delayed, and specific to each business. A single encoder pretrained on unlabeled histories could serve all businesses, but only if pretraining captures the behavior that separates risk. Coarse activity differences can make contrastive pretraining on transaction logs too easy: transaction volume, amount, and timing can distinguish a history's continuation from arbitrary candidates without modeling how payment resources are used. We present TRIDENT-Seq, a transaction foundation model trained with Prefix-Future Contrast (PFC). PFC matches each prefix to a summary of its subsequent behavior among candidates with similar activity profiles; activity prediction and dispersion regularization act on the encoder output. Across three production payment businesses, the pretrained encoder improves average precision (AP) and recall at a 0.5% intervention budget over architecture-matched scratch training in all six business-budget settings. With a fixed validation set, it exceeds full-label scratch training in mean AP and recall using 10% of the training labels on Wallet and 25% on Shopping and SME. Pretraining only on another business's histories still helps. Replacing profile-matched candidates with random ones cuts recall from 24.62% to 5.64%. In Ant International's deployment evaluation, recorded amount-based chargeback and overall loss rates are 37.7% and 37.9% lower than those of the previous XGBoost-based system under the same intervention budget.
Weiyu Han, Haoyu Jiang, Jie Sheng +7
Ant International · East China Normal University · Tongji University +1
Acquiring fraud labels for payment transactions is expensive and inconsistent across tasks, and high-cardinality identifiers such as merchant names make one-hot feature pipelines infeasible at scale. We present CARTA, a self-supervised encoder that learns a compact 16-dim embedding from raw transactions without labels; the frozen embedding is then reused for label-efficient fraud probing and exploratory unsupervised risk stratification without retraining the encoder. CARTA uses type-specific projections with learned embedding tables for high-cardinality identifiers, trained with token excision and InfoNCE contrastive loss. On IEEE-CIS, its linear probe at 1% of labels exceeds a raw-feature probe at 100%; on IBM TabFormer (2M rows), its frozen embedding reaches GBDT AUPRC 0.508, above frequency encoding (0.411) and the merchant-dropping baseline (0.022), though fully-supervised CatBoost is stronger. CARTA is a label-free, reusable representation that complements task-specific supervised models.
Shreyas K. Chandrahas, Jose Munoz, Satish Babu Bellapu
Visa Inc. Foster City, CA, USA · Massachusetts Institute of Technology Cambridge, MA, USA
Transaction event sequences support diverse prediction tasks in online commerce and digital financial services. The same transaction records can yield prediction targets with different semantics, including values, changes, and relations to past events. These targets impose different constraints on history representations, but their predictability alone does not establish the downstream utility of a target set. Moreover, target-wise prediction losses do not explicitly model conditional co-occurrence among targets. To address these challenges, we propose TAPES, a task-aligned joint predictive pretraining framework for transaction sequences. TAPES constructs a finite collection of candidate target sets from admissible field-operator combinations. It selects a target set according to the downstream utility of representations learned through short joint pretraining trials under matched budgets. It then reinitializes the encoder and pretrains it on the selected targets through a joint likelihood parameterized by a shared discrete latent variable, before downstream supervised adaptation. Experiments in a real-world transaction-risk setting and on multiple public financial benchmarks spanning diverse downstream tasks demonstrate that TAPES outperforms representative baselines. Ablation studies further validate the contributions of predictive target selection and joint modeling.
Ruobing Zuo, Weiyu Han, Huilin He +6
East China Normal University · Ant International · Tongji University