Skip to content

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

Meta Engineering 7 min read Case study easyNovice

Meta’s approach to machine learning prediction robustness

Meta keeps its ads recommendation models reliable with a prediction robustness framework built from three parts: prevention guardrails, root-cause understanding and intrinsic model hardening. The framework covers models, features, training data, calibration and interpretability. Snapshot Validator evaluates every new model snapshot against holdout data before it serves traffic, which cut snapshot corruption by 74% across more than 90% of ads ranking models. Feature and label anomaly detection automatically blocks bad data, and the Hawkeye debugging toolkit with model graph tracing halved time to root-cause. The account stays high-level, naming techniques such as gradient clipping, robust quantization and training-serving consistency without implementation detail.

Related posts

  • AI debugging at Meta with HawkEye

    Meta Engineering mediumAdept

    HawkEye is Meta's internal toolkit for monitoring and debugging production ML workflows behind recommendation and ranking models, structured as a guided decision tree that has cut debugging time by an order of magnitude. It isolates top-line metric anomalies to specific models and snapshot rollouts. It then localizes prediction anomalies to features using real-time correlation of sampled inputs and outputs plus slower feature-ablation importance analysis, and traces feature problems upstream through data lineage graphs. For model-side issues it compares snapshot weights against stable predecessors, walks the model graph from NaN or extreme activations back to input features, and inspects training data partitions for label drift or imbalance, with mitigations such as pausing bad pipelines.

  • DrP: Meta’s Root Cause Analysis Platform at Scale

    Meta Engineering easyNovice

    DrP is Meta's root cause analysis platform that lets engineers codify incident investigation playbooks as "analyzers" using an SDK with helpers for anomaly detection, event isolation, time series correlation and dimension analysis. Analyzers are backtested in code review, chained across dependent services, auto-triggered by alerts, and run on a multi-tenant backend with a request queue and worker pool. A post-processing system annotates alerts and can open tasks or pull requests for mitigation. Used by 300+ teams with 2,000 analyzers running 50,000 analyses daily, DrP has cut MTTR by 20-80%.

  • Meta Adaptive Ranking Model: Bending the Inference Scaling Curve to Serve LLM-Scale Models for Ads

    Meta Engineering hardMaster

    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. Key techniques include in-kernel broadcast of request-level embeddings, the Wukong Turbo architecture refinements, GPU-offloaded feature preprocessing, selective FP8 post-training quantization, operator fusion with grouped GEMM, and multi-GPU embedding sharding, reaching 35% MFU across heterogeneous hardware. Launched on Instagram in Q4 2025, it delivered +3% ad conversions and +5% CTR for targeted users.

  • 5 Steps for Building Machine Learning Models for Business

    Shopify Engineering mediumAdept

    A five-step workflow for building ML models in a business context: confirm ML is warranted (defer it for brand-new products and beat a heuristic baseline first), start with simple models and basic features or off-the-shelf pretrained components, and pick a metric tied to business impact before optimizing. The advice also covers sanity-checking outputs via confusion matrices and residuals, since 98% accuracy on rare-event fraud data can mean a useless model. Model iteration should run through staging flows or A/B tests with fair comparisons and attention to run-to-run variance, and teams should watch prediction stability for individual users across retrains.

  • From User Sequences to Scaling Laws: A Multi-Stage Architecture for Meta’s Ads Ranking

    Meta Engineering hardMaster

    Meta scales sequence learning for ads ranking by splitting it into two stages: an offline transformer user model processes thousands of user events asynchronously and caches user-level embeddings, and a lightweight online ranking model combines those embeddings with fresh signals and ad candidates under strict latency budgets. Dense tokenization folds sparse features into a single vocabulary, and target-aware multi-head attention weighs past behavior against the ad being scored, so feature interactions are learned rather than hand-engineered. The system shows LLM-style log-linear scaling of normalized entropy with compute. Scaling works best when depth, width and sequence length grow together, and diverse action-type sequences beat homogeneous ones. Together with other model work it contributed to 6% more conversions on Instagram and 3% on Facebook.

The quest for software engineering knowledge.

Look:
Layout: