The technology foundation that supports Facebook Ads, Instagram Ads, and Reels Ads is going through a major self-rebuild driven by AI agents. Facing rapidly growing computing needs and the large-scale rollout of Meta’s custom MTIA chips, the old way of having engineers manually tune performance has hit its limit. Meta’s newest research reveals the secret behind this change: an agent-based framework that uses tree-like thinking and search is now rewriting the bottom layer of Meta’s ad system in an almost self-driving manner. This new approach uses automatic code generation to cut kernel development time from weeks down to just hours across NVIDIA GPUs, AMD chips, and Meta Training and Inference Accelerator (MTIA) hardware, while delivering up to 17 times performance gains in live production.
Meta’s deep learning recommendation models (DLRM) support the daily habits of billions of users across its family of apps.
However, behind this massive recommendation engine, a system once known as a “three-dimensional explosion” is quickly becoming a performance bottleneck that limits growth.
These three dimensions are:

Figure 1 shows the layout of Meta’s MTIA chip and how its processing units are arranged. The chip uses a modular design that allows the AI computing power to scale up smoothly as MTIA versions grow.

Figure 2 shows the MTIA 2i processing unit layout. Built as an 8 by 8 grid of processing elements (PEs), the chip connects these units through on-chip networks. Each PE contains dual RISC-V cores and special hardware blocks including matrix transformation (MLU), dot product engine (DPE), reduced precision engine (RE), SIMD vector units, and control processors (CP).
These three dimensions have created a “model-operator-hardware” combination that runs into the thousands.
Under the old manual tuning model, a team of highly skilled kernel engineers would spend weeks turning a single idea into working code. This approach simply cannot keep up with the speed of modern AI business needs.
To solve this problem, Meta built KernelEvolve, a system that can automatically create and improve kernels for any hardware platform.

Paper link: https://arxiv.org/abs/2512.23236
KernelEvolve uses ideas from nature-inspired search methods. It turns kernel optimization into a structured search problem with four main parts:
First, it uses a smart selection policy. Second, it has a universal operator that can adapt to any situation. Third, it measures how good each solution is using a fitness function. Fourth, it knows when to stop searching using clear termination rules.
This breakthrough has shocked not just the hardware world but also caught the attention of top AI leaders around the globe.
Jack Clark, co-founder of Anthropic, placed KernelEvolve at the top spot in his widely-read weekly newsletter “Import AI” (Issue 439). He praised Meta for using a mix of GPT, Claude, and Llama/CWM models to achieve “automation at trillion-scale infrastructure level.” He also stated that this shows “LLM agents will become the universal compilation layer for mixed AI systems,” marking a deep change in how software engineering works.

Article source: https://jack-clark.net/2026/01/05/import-ai-439-ai-kernels-decentralized-training-and-universal-representations/
Multi-Level Code Support
One key strength of KernelEvolve is its support for many levels of code, from high-level design languages down to low-level hardware commands, covering the full software-to-hardware optimization stack:

Figure 3 shows the Triton multi-target build system. Source code goes through MLIR step by step, moving from platform-free Triton-MLIR down to hardware-specific versions for GPU, AMD GPU, and MTIA, finally producing native binary files for NVIDIA (PTX), AMD (AMDGCN), and MTIA (RISC-V) platforms.
This multi-level design lets KernelEvolve pick the best code level for each hardware platform.
More importantly, the system includes a long-lasting knowledge base that stores the special rules and optimization tips for each type of hardware. This means even for custom chips like MTIA that large language models have never seen in their training data, the system can still create working kernel code.
Agent System and Self-Improvement
KernelEvolve connects to a much broader agent system that can handle complex tasks through several specialized parts:
The system keeps a graph-like data store that records how each node connects to its parent and children, supporting both long-term learning and short-term decision making.
ai porn video generator
Figure 4 shows the KernelEvolve system at work. During the search process, the system uses tree search with a shared knowledge base, working together with large models like Claude 4.5, GPT-5, and Meta’s own CWM models. It creates Triton kernel choices and uses a persistent knowledge base and graph data store to close the loop on kernel girlfriend gpt optimization, squeezing out every bit of performance.
Tree Search: The Core Engine
If we had to pick one thing that makes KernelEvolve special, it would be its “tree search” engine, which works like a smart GPS for finding the best code.
Meta did not simply hand the task to a large language model and hope for good results. Instead, they built a complete self-checking system that can explore, test, and learn. KernelEvolve runs on a special job system that acts as the main brain of the operation. The system uses several key models to form a stack of optimization skills:

Search Core: Dynamic Thinking Chain
The “thinking” part of the system uses a dynamic reasoning chain. Each node in the tree represents a kernel choice, with both a standard PyTorch version and an improved Triton version running side by side.
The system uses two agents working together to compare results and make sure the AI-generated code matches the math logic of the original code 100%. This prevents large models from making mistakes when they write code. When the system needs to try a new optimization path, it uses the UCB algorithm to guide its search. When it needs to create a new kernel choice, it calls on large language models to write code that meets quality standards and can be put into production.


Quality Check: AI-Powered Verification
The AI-generated code is sent to a special testing area where it must pass strict checks before it can move forward.
What makes this special is that KernelEvolve uses many different testing tools, each looking at a different level of detail. TritonBench checks if the answer is correct. Torch Profiler shows system-level timing charts. NVIDIA NCU looks at GPU instructions one by one. Triton Proton measures how long each kernel takes to run. MTIA Insight gives special views for Meta’s own chips. These tools work together like a team of doctors giving a full health check, pointing out exactly what needs to be fixed.

Hardware Stage: Building for Mixed AI Chips
The “performance stage” of the system gives each hardware platform its own special treatment. Each platform has its own real-time data collection that tracks hardware-specific numbers, such as GPU memory bandwidth, L2 cache hit rates, compute unit usage, and even the exact instructions that cause the GPU to pause.
These hardware details give large language models the exact information they need to write better code.
All of this creates a smooth loop of choose, build, test, measure, learn, and repeat. The system picks a candidate node, creates a kernel using large models, runs it on real hardware to collect performance data, checks if the results are correct, and then feeds what it learned back into the next round of searching.
At the end of this process, KernelEvolve can finish in hours what would take human kernel engineers weeks to do by hand.

Figure 5 shows the end-to-end optimization pipeline. The system uses tree search to create kernel choices with dual implementations, standard PyTorch and optimized Triton. Then it runs on dedicated hardware test beds for GPU, AMD, and MTIA. It collects platform-specific performance metrics through tools like TritonBench, NCU, MPP, and MTIA Insight. These metrics feed back directly to guide the search. The entire system runs on Meta’s AlphaKernel and Bento platforms, forming a complete stack of optimization skills and engineering standards that keep getting better over time.
Real-World Results That Beat Human Experts
KernelEvolve has already proven its worth in both test labs and live production systems.

Standard Test Results
On the public KernelBench test set, KernelEvolve shows strong breakthrough ability:

Live Production Speedups
The numbers below show real results from Meta’s production ad systems:

Figure 6 shows KernelEvolve’s performance gains on mixed AI hardware. Compared to standard baselines, the system achieves speedups ranging from 1.25 times to 17 times on key production models including Transformer, sequence prediction, and recommendation systems in Meta’s ad serving pipeline.

Figure 7 shows accuracy verification for Meta’s custom models. For Convolutional Transformer, KernelEvolve-generated kernels match PyTorch original output within strict error limits (atol=10^-4, rtol=5×10^-4) across NVIDIA, AMD, and MTIA platforms. The generated conv1d kernel reaches standard optimization levels, while conv2d achieves 6.22 times speedup.
MTIA chips face special challenges because their limited kernel library and different programming style make optimization harder than on GPUs. KernelEvolve solves this by injecting hardware-specific knowledge, successfully creating high-performance code even for chips that large language models have never seen before.

What This Means for the Future of AI Systems
KernelEvolve is not just about making kernels faster. It points to a whole new way of building and running AI systems:
Future Growth
KernelEvolve’s success sends an important signal about where AI system optimization is heading:
For Meta, KernelEvolve is a key piece of the puzzle. It helps the company keep investing in AI infrastructure while staying efficient.
For the whole computing industry, every small gain in performance at the infrastructure level means huge business value. KernelEvolve shows that “AI building AI” is no longer just a dream but something that can actually work.
About the Authors
Gang Liao
Research Scientist at Meta, PhD from University of Maryland under database legend Daniel Abadi. He leads bottom-layer optimization for Meta’s AI infrastructure, supporting 98% of Meta’s AI computing and processing.
Carole-Jean Wu
Director of AI Research at Meta FAIR, leading systems and efficient machine learning research. She is also a founding board member of MLCommons. She holds a PhD from Stanford University and has received the ACM SIGARCH Maurice Wilkes Award.
Gaoxiang Liu
Distinguished Engineer at Meta, one of the core leaders behind Meta’s AI system infrastructure. He co-leads the unified code generation platform across all of Meta, supporting large language models and recommendation models with one shared system. He was one of the earliest participants in MTIA chip design and helped build the full software stack for mixed hardware including Nvidia GPU, AMD GPU, and MTIA.
This major breakthrough came from deep teamwork across Meta’s internal teams including Monetization Infrastructure and Ranking, FAIR, Compiler, MTIA, and Serverless Compute.