← Latest papers
🤖 machine learning

Toward Compiler World Models: Learning Latent Dynamics for Efficient Tensor Program Search

This paper proposes a world-model-inspired evaluator that learns latent dynamics of scheduling actions to efficiently rank tensor program candidates, achieving significant latency improvements over existing auto-schedulers like Ansor while drastically reducing the number of required measurements.

Original authors: Haolin Pan, Lianghong Huang, Xvlin Zhou, Mingjie Xing, Yanjun Wu

Published 2026-06-09
📖 5 min read🧠 Deep dive

Original authors: Haolin Pan, Lianghong Huang, Xvlin Zhou, Mingjie Xing, Yanjun Wu

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to find the absolute fastest route to drive from your home to a friend's house. You have a map, but the traffic conditions change constantly, and there are millions of possible routes you could take.

In the world of computer science, specifically for Machine Learning, this is exactly what a "compiler" does. It tries to find the most efficient way for a computer to perform complex math tasks (called "tensor programs"). The problem is that there are so many possible ways to write the code that checking every single one by actually running it on the computer is incredibly slow and expensive. It's like trying to drive every single possible route just to see which one is fastest; you'd run out of gas before you found the best one.

The Old Way: Taking a Snapshot

Previously, computer programs that tried to solve this (called "auto-schedulers") acted like a photographer taking a snapshot of the final destination. They would look at the finished code, guess how fast it would be, and decide if it was good.

The paper argues this is a bad idea because:

  1. It ignores the journey: It doesn't understand how the code got there. Two different routes might end up at the same spot, but one might have been a smooth highway while the other was a bumpy dirt road. The snapshot looks the same, but the experience (and speed) is different.
  2. It gets confused by small details: If you change a few words in the code that don't actually change how it works, the old system might think it's a completely different (and worse) route.

The New Idea: A "World Model" (The GPS Simulator)

The authors propose a new approach inspired by World Models. Think of this not as a photographer, but as a high-tech GPS simulator.

Instead of just looking at the final destination, this new system simulates the entire journey step-by-step in its "mind" (a mathematical space called a "latent space").

Here is how it works, using a cooking analogy:

  • The Ingredients (Initial State): You start with a raw recipe (the unoptimized code).
  • The Chef's Moves (Actions): The compiler makes decisions, like "chop the onions," "sauté for 5 minutes," or "add salt."
  • The Old Way: The chef looks at the final dish and guesses, "Hmm, this tastes okay."
  • The New Way (World Model): The chef has a mental simulation. They imagine: "If I chop the onions then sauté them, the texture will be X. If I sauté then chop, the texture will be Y." They simulate the process of cooking in their head to predict the final taste without actually cooking the whole meal first.

How They Built It

The researchers built a system with three main parts:

  1. The Translator (Encoder): It turns the messy computer code into a clean, mathematical "thought" (a vector) that the computer can understand easily.
  2. The Simulator (Transition Model): This is the core innovation. It takes the "thought" of the current code and applies the "chef's moves" (scheduling actions) one by one. It predicts what the code will look like after each step, all inside the computer's memory, without actually running the code.
  3. The Judge (Ranking Model): Once the simulation is done, the judge looks at the predicted final result and says, "This route is likely the fastest," or "That one looks slow."

The Results

They tested this on two types of computers: a powerful CPU (Intel Xeon) and a high-end Graphics Card (NVIDIA RTX 4090).

  • Faster Results: They found better code schedules much faster than the previous best method (called Ansor).
  • Less Work: They achieved results that were just as good as the old method, but they only had to run "test drives" (measurements) 10 times fewer.
  • Real-World Speed: When they used this to run actual AI models (like image recognition or language models), the programs ran 4 to 5 times faster than standard versions, and in some cases, up to 58 times faster.

The Bottom Line

The paper claims that by teaching the computer to understand the process of optimization (the journey) rather than just the result (the snapshot), we can find the fastest code much more efficiently. It's like having a GPS that simulates traffic in its head to find the best route, rather than just guessing based on a photo of the destination.

Limitations mentioned in the paper:

  • This system is a "judge" that helps pick the best route; it doesn't invent the routes itself. If the search engine doesn't propose any good routes to begin with, the judge can't fix it.
  • If the "journey" is extremely long and complex, the simulation in the computer's head might make small mistakes that add up, making the prediction less accurate.
  • It is designed to rank options against each other (which is faster?), not to predict the exact time down to the millisecond.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →