---
title: "Turning Opportunistic AI Inference Capacity Into Better Ads Recommendations"
description: "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."
url: "https://swe.quest/articles/turning-opportunistic-ai-inference-capacity-into-better-ads-recommendations-a2893f4d3d62c2b4"
canonical: "https://engineering.fb.com/2026/10/12/ml-applications/turning-opportunistic-ai-inference-capacity-into-better-ads-recommendations/"
source: "Meta Engineering"
published: "2026-10-12"
difficulty: "medium"
kind: "Case study"
reading_minutes: 10
tags: ["ads","inference","recommendation-systems","resilience","capacity-planning"]
---

# Turning Opportunistic AI Inference Capacity Into Better Ads Recommendations

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2026-10-12, 10 min read, Case study. Original: [https://engineering.fb.com/2026/10/12/ml-applications/turning-opportunistic-ai-inference-capacity-into-better-ads-recommendations/](https://engineering.fb.com/2026/10/12/ml-applications/turning-opportunistic-ai-inference-capacity-into-better-ads-recommendations/)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Ads](https://swe.quest/tags/ads.md) (Domains)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md) (AI & ML)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Capacity planning](https://swe.quest/tags/capacity-planning.md) (Reliability & operations)

## Prerequisites

- multi-stage ranking pipelines ([easy posts on Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md?difficulty=easy))
- load shedding ([easy posts on Resilience](https://swe.quest/tags/resilience.md?difficulty=easy))
- PID control loops

## Keywords

Meta, Rank More Ads, Serve Better Models, PID controller

## Related posts

- [Intelligent Delivery: Making Every Unit of Compute Serve Better Ads](https://swe.quest/articles/intelligent-delivery-making-every-unit-of-compute-serve-better-ads-e2f91280ba29b622.md): Meta Engineering · 2026-11-11 · Medium · 9 min read · Ads, Recommendations & ranking, Inference & serving, Capacity planning, AI agents
  Meta's Intelligent Delivery is an ML-driven layer that allocates serving compute across requests, models, hardware fleets and ranking stages by predicting the marginal utility of each unit of compute, adding about 10% ads ranking performance since 2017.
- [Taming the tail utilization of ads inference at Meta scale](https://swe.quest/articles/taming-the-tail-utilization-of-ads-inference-at-meta-scale-01fc8f077015384a.md): Meta Engineering · 2024-07-10 · Hard · 11 min read · Load balancing, Inference & serving, Capacity planning, Multi-tenancy, Performance engineering
  Meta tightened the server utilization distribution of its ads inference fleet, letting it absorb 35% more load with no added capacity, cut timeout errors by two-thirds and halve p99 latency.
- [Meta Adaptive Ranking Model: Bending the Inference Scaling Curve to Serve LLM-Scale Models for Ads](https://swe.quest/articles/meta-adaptive-ranking-model-bending-the-inference-scaling-curve-to-serve-llm-b02b370caa05f2c4.md): Meta Engineering · 2026-03-31 · Hard · 9 min read · Recommendations & ranking, Inference & serving, Ads, Performance engineering, Hardware
  Meta Adaptive Ranking Model serves LLM-scale ads ranking models (O(10 GFLOPs) per token, O(1T) parameters) at O(100 ms) latency by routing each request to an appropriately complex model and computing user signals once per request instead of once per ad candidate.
- [How Meta Uses AI Agents to Scale ML Innovations Across Ads Ranking Models](https://swe.quest/articles/how-meta-uses-ai-agents-to-scale-ml-innovations-across-ads-ranking-models-28ddfb209a194469.md): Meta Engineering · 2026-11-18 · Easy · 10 min read · AI agents, Recommendations & ranking, Ads, ML platforms, Model training
  Meta uses AI agents to propagate proven ranking-model techniques (e.g. Wukong layers, Interformer, training optimizations) across a large, heterogeneous fleet of ads ranking models, where a technique rarely transfers without adaptation.
- [Ranking Engineer Agent (REA): The Autonomous AI Agent Accelerating Meta’s Ads Ranking Innovation](https://swe.quest/articles/ranking-engineer-agent-rea-the-autonomous-ai-agent-accelerating-meta-s-ads-906821be3888f8ab.md): Meta Engineering · 2026-03-17 · Easy · 7 min read · AI agents, ML platforms, Recommendations & ranking, Ads
  Meta's Ranking Engineer Agent (REA) runs ads ranking ML experiments end to end with little human involvement.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
