The problem: propagation, not invention

Meta's ads ranking systems serve billions of daily requests across many products and optimization goals, and they run on a large fleet of production models. At that scale, the hard part of improving relevance and advertiser value is no longer coming up with new techniques — it is getting those techniques to every model they apply to. Adapting each idea one model at a time does not scale with the fleet.

Fragmentation makes this worse over time. A new architecture reaches one model quickly but can take years to spread across the ecosystem. A platform migration works for one model family and breaks on a long tail of specialized configurations. A tuning insight helps a single model but carries little information about the next one, because the underlying setups differ too much. Meta's ecosystem grew architectures, features, training settings, serving constraints, and platform-specific logic alongside its growing number of models. That diversity bought flexibility at the cost of high engineering effort to ship ideas broadly, high reliability cost from multiplying corner cases, and low predictability when estimating ecosystem-wide impact.

The underlying scaling law is unfavorable for engineering: when every idea must be evaluated and adapted per model, the work grows linearly with the number of models. Fragmentation also weakens automation. AutoML and optimization systems need a structured space; when every model has a different shape, the highest-potential techniques reach only a subset of models.

The response was not another layer of automation over the complexity, but a reduction of the complexity itself: Standard Model Templates (SMT), which standardize model design into a curated set of reusable templates.

Figure 1: Before SMT, each technique was tuned by hand on each model, and the combinations to try grew exponentially. With SMT, multi-model optimization tunes techniques once across representative models, and the ones that generalize go into the next template version.

Templates as the operating unit

A template is an opinionated, minimal model setup assembled from shared components: architecture choices, feature logic, training settings, and serving configs. Rather than maintaining each production model as a largely independent design, similar models are grouped around a smaller number of standard templates. Model-specific logic remains where necessary, but common parts are represented explicitly and shared.

In practice, a small set of templates covers the major ranking and retrieval patterns across model sizes, packaging reusable components for feature selection, feature interaction, model parallelism, training configuration, and hardware-aware serving. New ideas can then be evaluated on a much smaller set of representative templates and propagated to the model groups that use them — template-level iteration instead of per-model iteration.

That shift yields three benefits:

  • Lower propagation cost: one shared implementation serves many downstream models.
  • Better reliability: with fewer unique setups, validation, guardrails, and debugging workflows become stronger and more transferable. Training instability or serving regressions can be reasoned about within a shared structure instead of an unbounded configuration space.
  • Better predictability: representative models become a much stronger signal for the rest of their group, grounding ecosystem-level planning.

Over time the approach outgrew standardization and became the foundation for a broader ML development system.

Figure 2: The SMT development loop (left) and the layered architecture inside each template (right). Techniques are tuned once across representative models, added to a new template version, and rolled out to every model built on it.

Transferring whole designs, not isolated techniques

SMTs let the ecosystem be optimized as a single unit: the model landscape becomes a shared innovation surface. Proven holistic model designs move from strong source models into target families through the shared template layer. This matters because gains often arise from interactions between architecture, scaling decisions, and training strategy rather than from components applied independently.

Over two years, the approach reduced per-model engineering time by 92% and shipped 5000+ technique-model combinations across the fleet. It improved offline model quality by 0.63% on average at neutral serving capacity and delivered 0.86% cumulative online lift. It also challenged the assumption that diverse optimization goals require highly diversified designs — a well-designed shared template generalizes further than expected. Standardized structure also made scaling decisions reusable: cost-performance trade-offs learned in template space can be applied more broadly, enabling scaling-law-based optimization workflows that allocate resources less ad hoc.

Gating techniques with multi-model optimization

Template iteration is kept rigorous by multi-model optimization, which evaluates candidate techniques across representative models and searches for configurations that improve aggregate performance while limiting regressions. Because a technique with a strong average gain but frequent regressions is hard to ship at fleet scale, consistency counts as much as peak improvement: both aggregate performance and regression rate determine readiness.

Validated candidates are then checked on held-out models to confirm the gains transfer beyond the representative set. Those that pass are integrated into the next template version. Over the last two years, 80 new ML techniques shipped through this workflow. The effect compounds: every model adopting a mature template inherits a history of generalized improvements rather than starting from an isolated baseline.

Why structure matters for agentic systems

An end-to-end agent exploring a large design space with tools, training pipelines, and evaluation results runs into an unconstrained search space: without strong priors, it wastes effort on unproductive regions, recovers from avoidable failures, and proposes changes that are hard to explain and harder to ship. Templates encode known-good design patterns, giving agents a structured starting point, a bounded search space, and a quality floor, and letting model building be decomposed into specialized subproblems.

SMTs are the foundation of Meta's multi-agent approach to model building: templates supply structure, agents supply adaptive exploration and automation. At the template level, agents help build, evaluate, and improve templates themselves — proposing optimization ideas from proven techniques, launching experiments across representative models, diagnosing failures, and iterating over the multi-day loops template development requires. They also take on harder work such as migrating models to new hardware platforms. A technique validated this way reaches every model built from that template at a fraction of the compute needed to adapt each model separately.

Constraints and next steps

Automation gets more powerful as the underlying system becomes more structured; template-driven development made the ecosystem easier not only for humans but for optimization systems, scaling workflows, and agents to reason about. The design tension is that standardization must be opinionated enough to remove unnecessary diversity while preserving the limited flexibility that matters — a template system that accommodates every historical edge case eventually recreates the fragmentation it was meant to solve.

Remaining work includes improving template coverage, strengthening scaling-law-based optimization, and moving toward fully end-to-end agentic workflows covering agentic template building, model generation, online evaluation, and continuous optimization from online signals, with more reliability and explainability in those workflows. The central idea holds: scaling ML innovation across a large ecosystem requires standardizing the surface on which that innovation lands. Designing once and deploying at scale is an architectural choice about how a large ML ecosystem learns faster.

The full work is detailed in the paper, “Design Once, Deploy at Scale: Template-Driven ML Development for Large Model Ecosystems.”