How a Modern Ad Ranking System Works
The architecture behind every walled-garden ad platform, explained end to end: retrieval, multi-input ranking, auction, and the closed loop that is the real moat.
Nate Woodman ยท July 24, 2026
Every time someone opens a feed, starts a video, or loads a page, an ad system has milliseconds to answer one question: of all the ads that could run in this slot, in this moment, for this user, which one should serve, at what bid, with what creative. The answer balances predicted user response, advertiser value, publisher economics, platform health, and a stack of constraints, billions of times a day, inside a latency budget measured in tens of milliseconds.
The walled gardens have spent a decade refining the system that answers it. If you want to understand why they outperform the open web, and what parity would actually require, you have to understand the system itself. Here is the whole machine, end to end.
Two stages, because the catalog is too big
Running a deep model over every eligible ad would blow the latency budget by orders of magnitude, so production systems split the problem. A retrieval stage narrows billions of candidates to hundreds using approximate nearest-neighbor search over learned embeddings: the user's current state is embedded, every candidate ad is embedded, and the system pulls the closest matches in roughly 10 to 50 milliseconds. FAISS at Meta, ScaNN at Google, and HNSW in most open-source vector databases are the workhorse algorithms, and large operators typically run several retrieval paths in parallel over different criteria before unioning the results.
The survivors get the expensive treatment: a deep multi-input model scores each one, and auction logic converts scores into bids and picks a winner.
The fact that matters most: rankers are multi-input
The single most consequential architectural fact about modern ad ranking is that the ranker takes many distinct embedding inputs, not one. A serious production ranker sees five to ten separate representations simultaneously: who the user is, how they have responded to recent ads, what content they are consuming, the device and physical setting, the time, the creative itself, what the campaign wants, and the properties of the slot. Each input comes from its own upstream pipeline, each lives in its own latent space, and the ranker learns how to combine them end to end against the ranking objective.
This is why walled-garden rankers beat classical segment targeting, and the gap is not subtle. Boolean segment intersection is a single-input matching operation. Multi-input ranking is a learned cross-product, where the model discovers that the temporal signal matters differently per user and the context signal matters differently per impression. The information content differs by orders of magnitude.
Inside the ranker
The dominant architectures are public knowledge even where the trained weights are not. Meta published DLRM in 2019: each input runs through its own tower, towers interact, and a top network produces predictions, with sparse embedding tables that can reach terabytes. From 2024 Meta's published work moved to sequence-based models (HSTU-class), which consume the user's recent event history as an ordered sequence the way a language model consumes text, with a stated roadmap toward 100x longer sequences.
A production ranker predicts many outcomes at once through separate heads on a shared backbone: click probability, conversion probability, video completion, dwell, satisfaction, and a harm penalty. No single metric captures a good ad serve. A high-click ad with no conversions is clickbait, and a high-conversion ad that erodes satisfaction costs the platform long-term. The heads are combined into a single rankable score, adjusted by bids, pacing, and frequency rules, and then a calibration layer maps raw model outputs to honest probabilities, because pacing and pricing downstream depend on the numbers meaning what they claim to mean.
The hardware underneath is co-designed with the models. The workload is sparse-lookup-heavy and low-batch, which generic GPUs handle poorly, so Meta built custom silicon for it: the MTIA 2i inference accelerator, presented at ISCA 2025, claims 44% lower total cost than GPU inference and serves billions of users. Google runs TPUs in the same role. Everyone else rents GPUs at a structurally higher unit cost per decision.
The experimentation layer nobody sees
A production ranker is never one model. It is a population of variants serving overlapping traffic slices, compared continuously. Google published the pattern in 2010: partition traffic into independent experiment layers so hundreds of tests run concurrently without interfering, while a long-term holdout of a few percent serves as ground truth against slow-acting degradation like ad fatigue.
This layer is the most invisible from outside and the most consequential. Today's walled-garden ranker is the accumulation of thousands of experiments won and rolled in over years. Iteration velocity compounds, and the open web currently has no shared answer to it.
The closed loop is the actual moat
Strip everything else away and the defining property of the system is that it is a closed loop. The ranker decides, the user responds, the response becomes training data, and the next model version is shaped by what the last one learned. An operator that owns the whole loop, the impression decision, the response measurement, the conversion attribution, and the next training cycle, holds an advantage that no participant outside the loop can match.
That is the deepest reason the gardens win. It is not better algorithms. Algorithms are largely published. It is better data, because they own the loop, including quiet but consequential choices like which attribution model labels the training data.
The open web's fragmentation is precisely a shattered loop: identity with one vendor, context with another, measurement with a third, attribution with a fourth, and no shared training signal accumulating anywhere. Which means the open web's parity strategy is not to match the algorithms. It is to rebuild the loop across multiple operators, so the data flows back into training without any single company owning the whole cycle. The standards work emerging around agentic advertising, containerized bidding, and embedding interoperability is best read as exactly that: reassembling a closed loop out of parts no one party controls.
Where this is heading
Three shifts are already visible at the frontier. Rankers are moving from aggregated features to event sequences, so they will reason about behavior the way language models reason about text. Scoring is moving toward world-state prediction, architectures that first predict where the user and the moment are heading in latent space, then score against that predicted future. And single blended scores are giving way to genuinely multi-objective decisions, which are also easier to defend to a regulator than a black-box weighted sum.
Each shift raises the ceiling on what context is worth. A system that reasons over sequences and predicted moments rewards rich, real-time contextual signal over static audience labels, which is the mechanical reason the open web is drifting from an audience economy toward a context economy. The operators who understand this machine, and who position their data and their infrastructure where the loop is being rebuilt, are the ones the next decade will pay.