Meta uses machine learning to allocate ads serving compute
Meta built Intelligent Delivery, a machine learning layer that decides which region, chip and share of a server each ad request gets, with AI agents tuning the system's settings.
MetaUnited StatesInternet platforms and advertisingScaled since 2017
- Scale
- Ads serving fleet with many data center regions and millions of hosts
- Scenario
- ML-driven compute allocation for ads serving
- Business function
- IT operations
- Kind of solution
- Process optimization and control
- Who built it
- Built in-house
- Where it runs
- On premises
- Human oversight
- Acts on its own
- Organization
- Enterprise, 10,000 to 99,999 employees
- AI types
- Generative AI, Agentic AI, Machine learning, Optimization
tl;drIntelligent Delivery added about 10% to Meta's ads ranking performance from 2017 to mid-2026.See the results
Meta uses Intelligent Delivery, a machine learning system, to decide where each unit of compute in its ads serving stack goes1. Deep learning models predict which ad requests gain most from extra compute, and decision engines move regions, chips and server time toward them1.
The system answers a squeeze on capacity: ads ranking models are growing toward large language model scale faster than the hardware to run them1. AI agents now also tune its settings, and engineers approve each change before it ships1.
From 2017 through the first half of 2026, Intelligent Delivery added about 10% to ads ranking performance across major surfaces, on top of model and system advances1. Meta described the system and its results in November 20261.
Before the deployment
Meta’s ads serving fleet handles more than 5 million requests per second on average, over 400 billion per day across all monetized surfaces3. Each request runs through multi-stage ranking, hundreds of models, generations of hardware and many data centers1.
- Compute that lags the models: Compute resources don’t scale at the rate that models and system complexity do1.
- Uneven returns: The same extra unit of compute returns very different gains by product surface, user intent, candidate quality and system state1.
- Segment policies: Engineers grouped requests into coarse segments by surface, context and ad creative representation, and wrote an allocation policy for each group1.
- Rules that didn’t scale: Every new signal multiplied the rules, and independent segments couldn’t capture the nonlinear interactions among thousands of signals1.
- A moving target: Every new model, hardware generation or architecture can invalidate previously optimal allocation decisions1.
What was built
Intelligent Delivery is an adaptive optimization layer that directs resources toward the requests, models, hardware fleets and ranking stages with the highest marginal utility1. It has to compute a result for each request across a vast decision space within milliseconds1. Models, decision engines, agents and engineers divide the work:
- Request models: The Resource Core Model and the specialized models fine-tuned from it predict each request’s gain from extra compute and its cost in compute and latency1.
- Decision engines: A dedicated engine at each layer of the serving stack turns those predictions into actions, such as which region serves a request and which hardware it lands on1.
- AI agents: Monitor the whole system for changes and inefficiencies, propose changes to its settings and run the experiments that test them1.
- Engineers: Review and approve the final change before it ships1.
Alternatives considered
Meta replaced or ruled out three ways to find good settings before it turned to agents1:
- Brute-force search: Testing every configuration across millions of tunable dimensions for each new change would take too much time and far more hardware than Meta has1.
- Engineers’ prior knowledge: Every new model, mechanism and hardware generation expanded the search space faster than engineers could explore it1.
- Constrained optimization: It delivered improvements but stayed inflexible and slow, and it could only cover a few key knobs1.
Meta also rejected a single allocation mechanism, because one mechanism can’t control the resource distribution end to end1.
Technology and architecture
- AI component
- Data
- Trigger or control
- Handoff to people
The Resource Core Model is a set of deep learning models with 6 billion sparse parameters and 20 million dense parameters1. It runs once before candidate retrieval, and the whole delivery funnel shares it1. Learned embeddings and deep feature interactions capture request patterns that manually defined segments can’t1.
Stack
| Layer | What they used | Role | Source |
|---|---|---|---|
| Solution platform | Intelligent Delivery | ML-driven layer that allocates resources across the ads serving stack | 1 |
| Predictive model | Resource Core Model | Predicts which ad requests benefit most from additional compute, once per request before candidate retrieval | 1 |
| Predictive model | Specialized fine-tuned models | Predict each request’s incremental outcome, compute consumption and latency impact | 1 |
| Optimizer | Regional traffic shifting | Shifts traffic between data center regions in a cycle of minutes | 1 |
| Optimizer | Hardware assignment | Assigns each workload to the hardware type that turns it into the most useful work | 1 |
| Optimizer | Host-level constrained optimization | Divides a host’s compute among concurrent requests within its latency budget | 1 |
| Control system | Kernel-level scheduler and application thread pools | Enforce the allocation decisions on each host | 1 |
| Task agent | AI agents | Monitor the system, propose configuration changes and run experiments | 1 |
| Simulation testing | Closed-loop hardware testing environment | Validates allocation changes end to end before they ship | 1 |
| Compute and servers | Meta Training and Inference Accelerator (MTIA) | Meta’s own accelerators, part of the serving fleet next to NVIDIA and AMD accelerators | 1, 2 |
Data inputs
- Request signals: Each ad request brings signals such as product surface, context, user intent, candidate quality and ad creative representation1.
- System state: Per-host load and each region’s hardware mix and headroom feed the decision engines1.
- Hardware benchmarks: Meta measures the efficiency of every pair of workload and hardware type1.
- Engineering history: The agents read mechanism source code, design documents and a decade of experiment logs1.
Integrations
- Ads ranking stages: Intelligent Delivery sets the number of ads to rank for each request in each ranking stage and which ad candidates enter the pool1.
- Regional traffic routing: Real-time infrastructure shifts traffic between regions in a cycle of minutes1.
- Hosts: The enforcement framework spans from the kernel-level scheduler up to application-level thread pools1.
- Serving fleet: The fleet runs CPUs from Intel, AMD and Arm and accelerators from NVIDIA, AMD and Meta’s own Meta Training and Inference Accelerator (MTIA)1. MTIA is Meta’s family of homegrown AI chips, developed with Broadcom, with hundreds of thousands in production2.
How one ad request flows through the system
- Someone opens their feed and an ad request is created. Over the next few hundred milliseconds, it passes through a chain of allocation decisions1.
- The Resource Core Model reads the request once, before candidate retrieval. The specialized models predict its outcome, compute consumption and latency impact1.
- The regional engine decides which region serves the request. It moves traffic toward the point where every region gets the same efficiency from its marginal unit of capacity1.
- The hardware assignment places the workload on its best-matched hardware. Retrieval is bound by memory capacity, ranking by compute and model inference by accelerator throughput1.
- The host engine solves a constrained optimization that maximizes impact within the host’s latency budget, under a hard tail-latency SLO1.
- If host load rises, the host engine trims resource-intensive low-impact work first1.
- The ranking stages rank the number of ads set for this request at each stage1.
The decisions are coupled. Shifting traffic between regions changes per-host load, which drives the feedback controller that sets how much work each request gets1. Meta validates changes in an end-to-end, closed-loop hardware testing environment so that they move the system toward its global optimum1.
Agent optimization loop
- AI component
- Data
- Trigger or control
- Handoff to people
- Feedback
In the first half of 2026, agents contributed to about 20% of Intelligent Delivery optimizations1. On the most automated mechanism, they cover the work from forming hypotheses to converging on the final change1.
Results
| Metric | Before | After | Scope and timeframe | Reported by |
|---|---|---|---|---|
| Incremental ads ranking performance | Not disclosed | about 10% | On top of model and system advances, major surfaces, 2017 to mid-2026 | Meta, measured1 |
| Better identification of the highest-impact ad requests | Not disclosed | about 20% | Offline benchmarks on major surfaces, against the previous production model | Meta, pilot1 |
| Engineering effort contributed by agents | Not disclosed | about 80% | The most automated allocation mechanism, 2026 | Meta, measured1 |
| Length of the optimization loop | Months | weeks | Intelligent Delivery optimizations with agents, 2026 | Meta, measured1 |
- Ads ranking performance: The about 10% gain is incremental to model and system advances over the same period, across major surfaces, from 2017 through the first half of 20261. Meta published it in November 20261.
- Request identification: The about 20% improvement measures how well the new models identify the highest-impact ad requests, in offline benchmarks on major surfaces, against the previous production model1.
- Agent contribution: Agents contribute about 80% of the engineering effort on the most automated mechanism1.
- Optimization loop: With agents, the optimization loop takes weeks instead of months1.
Lessons learned
Learned request models replaced rules that couldn’t keep up. Engineer-written segment policies multiplied with every new signal, while learned embeddings capture the interactions among thousands of signals1.
The ranking gain and the identification gain are different kinds of figure. The ranking gain covers production on major surfaces from 2017 into 2026, while the identification gain comes from offline benchmarks1.
Decisions made in one layer ripple through the others, so Meta tests changes end to end. Local optimality doesn’t translate to global optimality, which is why changes go through a closed-loop hardware testing environment1.
Agents do part of the tuning, and people still decide. Engineers review and approve every final change before it ships1. An earlier constrained optimization approach was inflexible and slow, and couldn’t incorporate human intuition from prior experience1.
The system has two documented limits. Understanding a request and deciding how to serve it are still two separate steps1. The levers built for CPUs have to be reimagined for large ranking models such as GEM, which increasingly run on GPUs1.
The figures are Meta’s own, from its engineering blog1.
Case study scorecard
- about 10% Incremental ads ranking performance1
- about 20% Better identification of the highest-impact ad requests1
- about 80% Engineering effort contributed by agents1
- weeks Length of the optimization loop1
Sources by publication date
- Organization 3
Build this solution yourself
Analysis
What you need
- A serving stack you can steer per request: The predictions only pay off because engines can shift traffic between regions, assign hardware and trim work on a host1. Check that your stack exposes such controls.
- Efficiency measured on your own hardware: Meta benchmarks every workload and hardware pair before it solves the assignment1. A mixed fleet needs that table first.
- An engineering history agents can read: The agents narrow their search by reading source code, design documents and a decade of experiment logs1.
- An end-to-end test environment: Coupled decisions need a closed-loop hardware test before a change ships1.
Reference architecture
Process optimization and control
A process optimization and control solution learns from a site's operating data how a physical process responds to its settings and works out better settings as conditions change. A process model predicts how the process responds to live readings, and an optimizer picks the settings that do best within limits that operators set. An operator accepts and enters each recommendation, or the control system carries the settings out while operators watch and can take the process back.
- Sensors and meters
- Site data link
- Operating history
- Optimization platform (documented in this case study)
- Forecasting model
- Process model (documented in this case study)
- Optimizer (documented in this case study)
- Control model
- Process simulation
- Operating limits
- Operations console
- Control system (documented in this case study)
- Process equipment
- Cloud platform
A check mark shows a building block that this case study's sources document.
Open the reference architectureOthers who built it
- Aramco: Aramco's AI agents cut amine and steam use at a gas plant. Amine and steam use fell 10% to 15% and power use around 5% in initial results at Fadhili.
- Cebi: Cebi cuts scrap with an AI digital twin of its plants. Cebi's AI digital twin lifted OEE 20% in its first year and now runs in all Cebi plants.
- ArcelorMittal: ArcelorMittal applies AI across its Differdange steel mill. AI cuts energy use and CO₂ emissions at several stages of ArcelorMittal's Differdange mill.
- Deutsche Telekom: Deutsche Telekom AI agents handle network events in minutes. Managing a major network event fell from hours to around a minute, a more than 95% improvement.
- Schneider Electric: Schneider Electric cuts silver paste waste 73% with AI. Waste from the silver paste washing step fell 73% in one year, and per-batch lab tests ended.
- Carglass: 3D vision guides windshield packing at Carglass in Bilzen. Field tests in Bilzen showed fewer actions to fill each windshield carrier.
Cite this case study
Enterprise AI Case Studies. "Meta uses machine learning to allocate ads serving compute." Updated Nov 26, 2026. https://case-studies.ai/case-studies/engineering-and-research/ER-068-ads-compute-allocation-meta/
@misc{csai-er-068,
author = {{Enterprise AI Case Studies}},
title = {{Meta uses machine learning to allocate ads serving compute}},
year = {2026},
note = {Updated 2026-11-26},
url = {https://case-studies.ai/case-studies/engineering-and-research/ER-068-ads-compute-allocation-meta/}
}Sources
The following reporting, and every passage quoted from it, belongs to its publisher, not to this site. Sources and ownership
- Source 1:
Intelligent Delivery: Making Every Unit of Compute Serve Better Ads
Supporting excerpts (49)
It has delivered ~10% incremental ranking performance on top of model and system advancements since 2017.
it has contributed an additional ~10% improvement in ads ranking performance on top of model and system advancements across major surfaces, from 2017 through the first half of 2026
continuously directs resources toward the requests, models, hardware fleets, and ranking stages with the highest marginal utility
Ads ranking models are growing toward LLM scale faster than the hardware to run them can keep up.
Compute resources do not scale at the rate that models and system complexity do.
The same additional unit of compute can generate very different returns depending on the product surface, user intent, candidate quality, and system state.
We need to produce a per-request result calculation across a vast decision space within milliseconds.
Local optimality does not translate to global optimality
Ads delivery spans multi-stage ranking, hundreds of models, generations of hardware, and many data centers.
Every new model, hardware generation, or new architecture changes the landscape and can invalidate previously optimal allocation decisions.
Initially, we captured these differences through coarse segments: Requests were grouped by attributes such as surface, context, and ad creative representation, with engineers creating policies to allocate resources for each group.
Every new signal multiplied the rules, making the effort unsustainable, and independent segments could not capture the nonlinear interactions among thousands of signals, which limited accuracy.
We achieved about a 20% improvement in identifying the highest-impact ad requests in offline benchmarks on major surfaces, relative to our previous production model
Which ad requests are most likely to benefit from additional compute? And how will different resource settings affect their outcomes and serving performance?
we built the Resource Core Model, deep learning models with 6B sparse parameters and 20M dense parameters that run once before candidate retrieval and are shared across the delivery funnel
Learned embeddings and deep feature interactions capture nuanced request patterns that manually defined segments cannot.
We then fine-tune the Resource Core Model into a set of specialized models, each generating incremental signals about outcome, compute consumption, and latency impact.
The Resource Core Model understands each request and its serving behavior, while individual mechanisms determine how to translate those predictions into actions.
Ads serving runs on a globally distributed, heterogeneous fleet with many data center regions, several hardware generations, and millions of hosts, all shared by a multi-tier serving stack.
A single allocation mechanism cannot control the complex resource distribution end to end. So we decomposed the problem into a hierarchy of layers and built a dedicated decision engine for each.
An ad request is created, and over the next few hundred milliseconds it passes through a chain of resource allocation decisions.
each region carries a different hardware mix and a different amount of headroom
We built real-time infrastructure to dynamically shift traffic between regions in a cycle of minutes, driving toward the point where every region achieves the same level of efficiency on its marginal unit of capacity.
Our fleet spans CPUs from Intel, AMD, and Arm and accelerators from NVIDIA, AMD, and our own Meta Training and Inference Accelerator (MTIA), across several generations of each.
retrieval by memory capacity, ranking by compute, and model inference by accelerator throughput
We benchmark measured efficiency for every workload-SKU pair, then solve the assignment so that scarce hardware goes to the workloads that convert it into the most useful work.
Concurrent requests differ in latency budget and impact, under a hard tail-latency SLO.
solve a constrained optimization that maximizes impact delivered within the host
as the host load increases, the performance trade-off rises and resource-intensive low-impact work is trimmed first
Enforcing those decisions takes control across the whole stack, so the framework spans from kernel-level scheduler up to application-level thread pools.
we optimize the number of ads to rank for each request in each ranking stage, what ad candidates enter the pool, and much more.
Shifting traffic between regions changes per-host load, which drives the feedback controller that sets how much work each request gets.
We validate these changes in an end-to-end, closed-loop hardware testing environment to make sure we are optimizing for the global optimum instead of a local optimum.
brute-force every single configuration across millions of tunable dimensions built in our system for a new change
because every new model, mechanism, and hardware generation expanded the search space faster than engineers could explore it.
We tried automating this with a constrained optimization approach, which delivered improvements but remained inflexible and slow.
We found that it lacked the ability to generalize (it could only cover a few key knobs)
effectively incorporate human intuition from prior experience
That would require too much time and far more hardware resources than we have.
AI agents continuously monitor the entire system landscape, identifying changes and inefficiencies to address.
In a long context window, an agent reads mechanism source code, design documents, and a decade of experiment logs and narrows that to a handful of changes worth testing.
Engineers review and approve the final change before it ships.
Today, agents can already propose well-reasoned changes and design and run rigorous experiments.
In the first half of 2026, agents contributed to about 20% of Intelligent Delivery optimizations.
On our most automated mechanism, they now contribute to about 80% of the engineering effort, from understanding the system landscape and forming hypotheses to running experiments and converging on the final change.
This shortens the optimization loop from months to weeks while keeping people firmly in control.
Today, understanding a request and deciding how to serve it are still two separate steps.
The levers we built for a CPU world have to be reimagined
increasingly run on GPUs, which opens a different optimization space
- Source 2:
Four MTIA Chips in Two Years: Scaling AI Experiences for Billions
Supporting excerpts (2)
the Meta Training and Inference Accelerator (MTIA), our family of homegrown AI chips developed in close partnership with Broadcom
we have deployed hundreds of thousands of MTIA chips in production
- Source 3:
Modernizing the Meta Ads Service With an Open-Source Kernel Scheduler
Supporting excerpts (1)
ads serving fleet handles more than 5 million requests per second on average at the serving platform entry point, which is over 400 billion per day across all monetized surfaces
Comments
Start the conversation.
Invited members of the library comment here. Sign in to join the conversation.