Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Grab Engineering 18 min read Case study hardMaster

User foundation models for Grab

Grab built a transformer-based user foundation model that jointly learns from tabular user attributes and time-series clickstream data to produce general-purpose user embeddings, replacing siloed hand-engineered features. A universal key:value tokenisation with custom positional embeddings and attention masks treats tabular columns as an unordered set and events as an ordered sequence. Modality-specific adapters (pre-trained language models for text, embedding layers for IDs, custom encoders for locations and numbers) feed an alignment layer before the transformer. Pre-training is unsupervised, combining masked token reconstruction with next-action prediction across verticals, so the embeddings serve many downstream tasks such as ads, fraud detection and churn prediction, or the model can be fine-tuned directly.

Related posts

  • GenRecs Tokenization: Transforming Ads Recommendation at Meta with Stable Model Vocabulary

    Meta Engineering hardMaster

    Meta's ads recommender replaces per-item IDs with GenRecs Tokenization, a stable semantic vocabulary. Each ad, product or page is encoded with pre-trained multimodal models, decomposed into subspaces (e.g. residual decomposition) and quantized against learned codebooks into short token sequences, so similar items share tokens. This lets new and tail items inherit what the model learned about related items, enabling cold-start generalization and cross-campaign transfer. Paired with GEM and the Adaptive Ranking Model it delivered a +0.35% conversion lift. Across eight tokenizer versions, intrinsic metrics (cluster purity, distribution balance, codebook utilization) correlated with downstream CTR accuracy, so the tokenizer can be iterated without full model retraining.

  • Exploring Hierarchical Interest Representation For Meta Ads Deep Funnel Optimization

    Meta Engineering hardMaster

    Hierarchical Interest Representation is an upstream representation layer for Meta Ads. It learns unified embeddings for users, ads, advertisers and products over a typed, time-decayed heterogeneous engagement graph spanning billions of interactions. A graph transformer injects structural signals such as node-type transitions and shortest-path distance as attention biases, computed on the fly with FlexAttention over packed block-masked subgraphs. It is trained with self-supervised teacher-student cross-view distillation using Sinkhorn-Knopp balancing plus a supervised engagement-prediction objective, with LLM-processed multimodal content enriching sparse nodes. Pipelined data loading from the online graph engine gave a 30x training speedup, strict temporal cutoffs prevent leakage, and embeddings are quantized into Bag-of-Meaning tokens for inverted-index retrieval and use in GEM, Andromeda and ranking models.

  • Introducing TabFM: A zero-shot foundation model for tabular data

    Google Research easyNovice

    TabFM is a foundation model that treats tabular classification and regression as in-context learning, so it predicts on an unseen table in a single forward pass with no training, hyperparameter tuning or feature engineering. Its hybrid architecture combines TabPFN-style alternating row and column attention, compression of each row into a dense vector, and a TabICL-style Transformer over the compressed rows to keep compute low on larger tables. It is pretrained entirely on hundreds of millions of synthetic datasets generated from structural causal models. On TabArena (38 classification and 13 regression datasets, 700 to 150K rows), it is reported to beat tuned tree-based baselines in Elo, and an ensemble variant adds cross and SVD features, NNLS weighting and Platt scaling. It is available on Hugging Face and GitHub and through BigQuery's AI.PREDICT.

  • Meta’s Generative Ads Model (GEM): The Central Brain Accelerating Ads Recommendation AI Innovation

    Meta Engineering hardMaster

    GEM is Meta's LLM-scale foundation model for ads recommendation, trained on thousands of GPUs and used as a teacher to improve hundreds of downstream vertical ranking models; it lifted ad conversions 5% on Instagram and 3% on Facebook Feed. The architecture handles non-sequence features with an extended Wukong design (stackable factorization machines), long user-behavior sequences with a pyramid-parallel structure, and cross-feature learning with InterFormer, plus multi-domain learning across surfaces, for 4x the efficiency of earlier ranking models. Knowledge reaches downstream models through direct and hierarchical transfer that combines distillation with a Student Adapter for stale supervision, representation learning and parameter sharing, which Meta reports as 2x as effective as standard distillation. A rebuilt training stack (HSDP for dense layers, 2D sharding of embedding tables, jagged-sequence kernels, FP8 activations, SM-free NCCLX collectives, compile caching) delivered 23x effective FLOPs with 1.43x MFU on 16x more GPUs.

  • Token Pooling-Aware Training for Multi-Vector Embedding Models

    Hugging Face hardMaster

    Pooling-aware training teaches a multi-vector (ColBERT-style) encoder to keep retrieval-relevant information when document token vectors are merged by Ward hierarchical clustering, improving quality at a fixed storage budget. On a ModernBERT-base model trained on 120k MS MARCO triplets, pool_factor=4 retains 94.6% of unpooled NanoBEIR nDCG@10 with ordinary training versus 97.8% with a loss that averages unpooled and pooled retrieval objectives, while cutting document vectors 4x. Sentence Transformers provides HierarchicalTokenPooling (pool_factor, max_tokens or calibrated distance_threshold), a straight-through estimator for gradients through clustering, a MultiVectorTokenPoolingLoss wrapper, and optional CUDA kernels that make Ward clustering 30-150x faster than SciPy.

The quest for software engineering knowledge.

Look:
Layout: