Skip to content

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

Grab Engineering 11 min read Case study mediumAdept

Part 1: Simulation-first AI experimentation for ads at Grab

Grab built an offline ads simulator that sequentially replays historical ad opportunities, applies candidate bidding, ranking and pacing logic, and probabilistically generates user responses from calibrated engagement models. Shortlisted candidates that pass business and user guardrails across many traffic conditions then go to live A/B tests. Fidelity is checked continuously at the mechanism level (matching production logic) and the outcome level (comparing metric distributions against production). Two use cases illustrate the approach: narrowing the mix-ranking alpha parameter that blends ads with organic results, and comparing a Primal-Dual Adaptive Pacing controller against a harder-to-tune PID budget pacer. Lessons include treating the simulator as a product and recognizing that idealized spend-signal timing can hide live instability.

Assumes: ad auctionsA/B testingPID controllers

Related posts

  • Part 2: Generative bidders for ads at Grab

    Grab Engineering hardMaster

    Grab Ads replaces reactive PID budget pacing with a generative bidder that plans 30-minute sequences of per-minute pacing actions. A diffusion Generator, conditioned on campaign context and steered by classifier-free guidance, proposes candidate plans. A differentiable Aligner predicts fulfillment progress and ROAS for each plan, and the planner refines the plans by gradient descent at inference time and picks the lowest-error one. Training starts with behavioral cloning on production logs, then moves to simulator-driven learning, with Ray fanning out simulator replays across dates, markets and policy variants. Before any scoped live experiment, candidates must pass three validation gates: model metrics such as Wasserstein distance and MAE, simulator comparison against the PID baseline, and stress tests. Live results are then fed back to calibrate the simulator.

  • Turning Opportunistic AI Inference Capacity Into Better Ads Recommendations

    Meta Engineering mediumAdept

    Meta aggregates locally idle inference capacity, stranded by peak provisioning, delivery timing, resource-ratio and accelerator-type mismatches, into a preemptible opportunistic pool used to improve ads recommendations. Two elasticity levers consume it: Rank More Ads (RMA) raises the number of candidates through the ranking stages and needs both CPU and accelerator surplus, while Serve Better Models (SBM) routes a larger share of requests to a more powerful model and needs only accelerator surplus. Baseline serving is protected by physical isolation for SBM and a logical global budget for RMA. A PID controller driven by tail latency sets RMA candidate volume, and an explore/exploit router picks SBM requests by request value. Because the central loops act on the order of minutes, millisecond-level value-aware load shedding on both servers and clients removes low-value optional work when capacity is suddenly reclaimed.

  • How we built ChatGPT’s novel ad stack for user trust and relevance

    OpenAI mediumAdept

    ChatGPT's ad stack replaces the event-driven request/response ads pipeline with stateful ads sessions that track evolving intent across turns and conversations, orchestrated by a post-trained LLM that calls tools for query rewriting, ANN retrieval over multiple embedding indices, eligibility filtering (budget, pacing, targeting, policy, dedup), relevance and engagement scoring, and a separate auction tool that handles pricing and final selection. The ads service runs alongside, and fully separate from, answer generation, with separate models and code, so it cannot influence or delay ChatGPT responses. Returning no ad, or timing out before the response is ready, counts as a normal outcome. A model-generated neutral preamble is kept separate from the advertiser creative, and the system reportedly reached a $1B annualized run rate within 200 days.

  • Powering AI-led research through simulation

    Grab Engineering mediumAdept

    Grab built sim-rs, a self-contained tick-based marketplace simulator that replays a city-day of bookings and drivers through a closed dispatch loop (demand, supply movement, cancellation models, batching, solver-based allocation, recycling) in tens of minutes, with pluggable stages, portable reproducible run packages, and built-in switchback/spatial A/B/n experiments. An autoresearch loop lets agents propose code changes, run them, and keep only those that improve a computed metric and pass checks. To counter specification gaming, the environment enforces immutable core data, metrics the agent cannot redefine, branch-scoped diffs and layered compile and evaluation gates. Across about 150 overnight experiments, agents made driver-eligibility checks roughly 10x and cost adjustment roughly 24x faster, derived a deadline-bounded trip-recycling rule, and help keep the simulator faithful by porting production logic and fitting held-out-validated cancellation models.

  • Ensuring Even Ad Spend on the Zalando Homepage: How Our New Bidding Algorithm Maximizes Value for Advertisers and Shoppers

    Zalando Engineering mediumAdept

    Zalando Marketing Services replaced its homepage ad bidding formula with a feedback-controlled pacing strategy that scales each bid by (1 − spent)/(1 − expected even spend), splitting budget into hourly buckets based on traffic forecasts. The old factor, 1 − r·t·(1 − t), lowered bids in the first half of each hour and raised them in the second regardless of whether a campaign was over- or under-spending. The new factor raises bids when underspending, lowers them when overspending, and holds steady at even spend, converging to an equilibrium price. A budget-split A/B test showed 10% more ad views, roughly 10% lower CPV, 23% more clicks and 11% higher CTR, with no significant impact on homepage experience metrics.

The quest for software engineering knowledge.

Look:
Layout: