MTGR: Putting Generative-Recommendation Scaling Laws into Production at Meituan Food Delivery

20 minread-scoreDeep dives
Contents · 8 sections1What problem does it solve?2How the model is built3Data layout and masking4Keeping training cost down despite 65x compute5Results6Limitations7How a ranking team might try it8Verdict

This is a May 2025 engineering blog post from Meituan's food-delivery recommendation team. It is worth reading for teams thinking about replacing their ranking model with a Transformer architecture in the style of Meta's generative recommender (GR). The core idea in one sentence: reuse Meta's HSTU sequence encoder, but keep the cross features of the old DLRM (deep learning recommendation model, the usual "concatenate features and feed an MLP" ranker), and pack all of one user's impressions into a single training row. Per-sample forward compute at serving time grows 65x, training cost stays level with the old model, and orders on the delivery home-page feed rise 1.22%, which the team calls its largest single gain in two years. The model went fully live at the end of April 2025 on the home page, channel pages and mini-program.

What problem does it solve?

Meituan's delivery ranker had been iterated in the DLRM style for nearly ten years, in two phases. From 2018 to 2022 the team grew the cross module, which concatenates context, user profile, behaviour sequence and candidate features and learns their combinations with networks such as MoE and DCN. Gains faded as it grew, and each doubling of compute doubled serving cost too. From 2023 the team grew the user module instead: context and profile produce several queries that attend over the behaviour sequence, followed by a 16-expert MoE. Because the user part is computed once and broadcast to every candidate, serving cost rose only 24% while model compute rose 182%, for +0.60% orders.

The team saw both paths hitting a ceiling: they relied on MLPs to learn feature co-occurrence, attention was little used, and training was expensive with little room to optimise. Meta's GR reads the full behaviour sequence with one Transformer, which addresses both problems, but GR uses no cross features at all. Food delivery has low click-through and heavy repeat ordering, so statistics like "how many times this user has ordered from this shop" matter a lot. In the blog's test, removing cross features from MTGR-small cost 1.25 points of CTR GAUC and 0.91 points of CTCVR GAUC (per-user AUC for click-then-order). For scale, the largest model's total gain over the old ranker is 1.53 and 2.88 points.

So MTGR (Meituan Generative Recommendation) takes a hybrid path: generative-style data layout and HSTU encoding, but it scores each impressed shop directly for click and conversion and keeps all the old features.

How the model is built

MTGR architecture. Left: user profile, behaviour sequence and impressed shops with context become tokens, pass through N HSTU layers, and the impression outputs feed an MMoE multi-task head. Right: one HSTU layer, with Group LayerNorm, the U, Q, K, V projections, SiLU attention instead of softmax, and a second Group LayerNorm on the output.
MTGR architecture. Left: user profile, behaviour sequence and impressed shops with context become tokens, pass through N HSTU layers, and the impression outputs feed an MMoE multi-task head. Right: one HSTU layer, with Group LayerNorm, the U, Q, K, V projections, SiLU attention instead of softmax, and a second Group LayerNorm on the output.

Each sample is split into tokens. Every user-profile feature is one token. Each shop in the behaviour sequence becomes one token by concatenating the embeddings of its ID and side information (tags, brand, past orders, dwell time) and passing them through a non-linear projection. Each candidate shop to be scored is built the same way from its ID, side information, cross features and time-and-place context, which is how cross features enter the model.

HSTU then encodes all tokens. Each layer uses a linear layer with SiLU to produce U, Q, K and V together. Attention weights are SiLU(QKᵀ) with no softmax; they weight V, the result is normalised, multiplied element-wise by the gate U, and passed through a final linear layer. MTGR changes two things. Group LayerNorm gives each token type its own normalisation parameters, because profile, behaviour and candidate tokens have very different distributions; removing it costs MTGR-small 0.17 and 0.18 points. The second change is the dynamic mixed mask, described next. Embedding sizes also grow with the model: if a token concatenates k features, each feature gets about d_model/k dimensions, so with d_model 768 and four features, about 192 each.

Data layout and masking

DLRM stores one row per impression. As an illustration, a user shown 20 shops in a day with a behaviour sequence of 1,000 needs 20 rows, each carrying the same 1,000-item sequence, encoded 20 times and padded to a fixed length. MTGR packs those 20 impressions into one row, so 1,000 behaviour tokens and 20 candidate tokens are encoded together and the user part is computed once. Jagged tensors and a variable-length HSTU kernel remove padding entirely.

Packing creates a leakage risk: a 6 pm impression must not see an 8 pm click from the same day. The data therefore keeps timestamps for every behaviour and impression, and the mask is built from them.

Dynamic mixed mask. Each row shows which tokens that token can see. History tokens see each other; same-day real-time behaviours, ordered newest to oldest, see history and older real-time behaviours; impressions see all history but only the real-time behaviours that happened before them, and not each other.
Dynamic mixed mask. Each row shows which tokens that token can see. History tokens see each other; same-day real-time behaviours, ordered newest to oldest, see history and older real-time behaviours; impressions see all history but only the real-time behaviours that happened before them, and not each other.
Token typeCan seeWhy
Profile and historyEach other onlyAll before today, so no leakage
Same-day real-time behaviourHistory plus older real-time behaviourCausal mask with timestamp filtering
Impressions to scoreHistory plus earlier real-time behaviour; not each otherEarlier impressions cannot see later actions

Compared with a plain causal mask, this adds 0.12 points of CTR GAUC and 0.16 of CTCVR GAUC on MTGR-small, because the history block can be read in both directions like an encoder.

Keeping training cost down despite 65x compute

The training engine builds on Meta's open-source TorchRec, adding dynamic hash tables and gradient accumulation and borrowing model parallelism from FSDP and Megatron. A hand-written fused HSTU kernel based on Cutlass, in the spirit of FlashAttention, handles variable lengths and runs 2-3x faster than the Triton version. Because user sequence lengths are long-tailed, a fixed batch size leaves some GPUs waiting for others, so each GPU's batch size is set to keep total tokens roughly equal, with gradients weighted by batch size; in the blog's example one GPU goes from 4 users to 5.

ModelForward GFLOPs per sampleDaily training cost (GPU-hours)
DLRM baseline0.8642.6
MTGR-small9.1128.4
MTGR-middle18.5949.6
MTGR-large55.7689.6

Without any sequence sampling, the small model with 10x compute trains more cheaply than the baseline, and the large model costs about 2.1x. The "level with DLRM" claim applies after GR's stochastic length sampling, which trains on a random shorter sub-sequence of long histories while serving still uses the full sequence; the authors report essentially no loss. On the serving side, TensorRT and Triton Inference Server are used. Batching feature copies into one host-to-GPU transfer cut that step from 7.5 ms to 12 µs and overall latency from 19 ms to 12 ms. CUDA Graph added 13% throughput and FP16 added 50%. Serving resources fell 12%, because one request encodes the user once and candidate tokens add little, so MTGR needs one shard where DLRM split candidates across several.

Results

ModelLayers, widthGFLOPsOffline CTR GAUCOffline CTCVR GAUCOnline PV_CTROnline UV_CTCVR
MTGR-small3, 5129.11+0.36pp+1.54pp+1.04%+0.04%
MTGR-middle5, 76818.59+0.71pp+1.82pp+2.29%+0.62%
MTGR-large15, 76855.76+1.53pp+2.88pp+1.90%+1.02%

Offline metrics rise with size, which is the blog's scaling evidence, and per-user order conversion online rises too. Page-level click-through does not: middle beats large by 0.39 points. The large model also used a 1k maximum sequence length against 3k for the others. The old DLRM had learned online for over two years while MTGR used about six months of data.

Daily order lift during the A/B test from 17 to 30 April 2025. Orange is MTGR-large; blue is the AA curve, where both groups run the old model, measuring day-to-day noise.
Daily order lift during the A/B test from 17 to 30 April 2025. Orange is MTGR-large; blue is the AA curve, where both groups run the old model, measuring day-to-day noise.

MTGR-large's daily order lift stays between 0.9% and 1.4% while the AA (null-test, both groups on the old model) curve stays within ±0.3%, and the lines never cross, so the gain is clearly above noise.

Limitations

This is a blog post, not a paper: ablations are on MTGR-small only, one number each, with no run-to-run spread. The scaling evidence is three points, one of which also changes sequence length. The headline +1.22% orders and the table's +1.02% UV_CTCVR are different metrics, and "flat training cost" depends on length sampling. The gain cannot be split across data layout, encoder, mask and normalisation, since only three of those were tested separately.

How a ranking team might try it

Pack each user's daily impressions into one row with timestamps first; that alone makes a 10x-compute model cheaper to train. Keep cross features inside candidate tokens, especially for repeat-purchase businesses. Use per-type normalisation and the history/causal/earlier-only mask. Get the pipeline and load balancing working at small scale before going deeper, and compare against an AA curve before trusting online gains.

Verdict

MTGR shows that a generative architecture can coexist with a classic feature system, that keeping cross features matters more than going "pure sequence" in repeat-purchase businesses, and that packing data per user is what lets compute grow tens of times without training cost doing the same.

How did this read for you?

One tap, no sign-in; tap again to undo. Only anonymous counts are kept, never who you are.

Related papersMore from Paper Daily

  1. Generative · 2026-07-29Realizing Scaling Laws in Recommender Systems: A Foundation-Expert Paradigm for Hyperscale Model DeploymentDeep dive: Realizing Scaling Laws in Recommender Systems: A Foundation-Expert Paradigm for Hyperscale Model Deployment.
  2. Generative · 2026-10-29PailitaoMMSearch2.0 Technical Report: Scaling Generative Retrieval to Unified End-to-End Multimodal SearchIn Taobao's Pailitao, a user may photograph a shirt and ask for shorts to match it, which calls for a complementary item rather than a duplicate. The usual pipeline classifies intent first and routes to separate retrieval channels, so one wrong step breaks everything after it. Alibaba's report lets a 2B vision-language model read the raw image and instruction and generate product Semantic IDs dir…
  3. Generative · 2026-10-28LoopGR: Parameter-Efficient Scaling for Generative Recommendation via Recurrent DepthMaking a generative recommender stronger usually means adding layers, which means adding parameters and memory. Tencent's LoopGR (a generative recommendation backbone that reuses one decoder in a loop) runs the same decoder several times. Between passes, the decoder's BOS hidden state (its current judgement of the target) is added to every history position and a tiny GRU rewrites the history alon…
  4. Generative · 2026-10-28Octen-WebGR: Scaling Generative Retrieval to 200 Million Web PagesGenerative retrieval has stayed below ten million documents. The Octen team's Octen-WebGR (a model that does web navigational search with generative retrieval) pushes it to 201 million web pages: every page is named by two tokens, a 4B model generates them directly from the query, and a table lookup returns the URL. On real navigational traffic from the month after training, it ranks the target f…
  5. Generative · 2026-10-29Latent Residual Reasoning for Ranking in Generative RecommendationGenerative ranking models usually score every candidate in one forward pass. Refiner, from Meituan and the University of Science and Technology of China, adds a few more steps. Each candidate gets a reasoning token, and each step predicts only a correction added to the original score. The base model stays frozen; only LoRA and a new output layer are trained. On Steam it lifts MTGR's AUC from 0.76…

Discussion

Add experiment details, reproduction notes or a different take. Requires a GitHub sign-in.

Loading the discussion…