← Latest papers
🤖 machine learning

Kernel Contracts: A Specification Language for ML Kernel Correctness Across Heterogeneous Silicon

The paper proposes a formal specification language called "Kernel Contracts" to define, measure, and arbitrate discrepancies in machine learning kernel behavior across different hardware platforms by providing a standardized framework for identifying precision, ordering, and memory errors.

Original authors: Cooper Veit

Published 2026-04-27
📖 4 min read☕ Coffee break read

Original authors: Cooper Veit

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 building a massive, high-tech skyscraper using thousands of different specialized robots. Some robots are experts at laying bricks, some at installing glass, and others at wiring electricity.

To get the building finished, you assume every robot follows the same basic rules of physics. But in the world of Artificial Intelligence (AI), these "robots" are actually tiny pieces of software called kernels, and the "physics" they follow is actually math.

The Problem: The "Silent Liar"

Here is the scary part: In AI, these math robots are "silent liars."

If a construction robot accidentally places a brick two inches to the left, you’ll see it immediately. But if an AI math robot makes a tiny, microscopic error in a calculation—say, it rounds a number slightly differently than it was supposed to—the building doesn't fall down right away. Instead, the skyscraper looks perfect on the outside, but deep inside the foundation, the math is slightly "off."

As you keep building higher and higher, those tiny errors stack up. Eventually, the whole building (your AI model) starts to lean, or the elevators stop working, or it behaves in ways no one can explain.

Currently, when an AI model fails, engineers spend weeks arguing: "Was it the NVIDIA robot's fault? Or the AMD robot? Did the math robot just get tired, or was it programmed incorrectly?" There is no "rulebook" to settle the argument.

The Solution: The "Contract"

This paper proposes a way to stop the arguing by giving every math robot a written contract before it ever starts working.

Think of it like a legal contract for a freelance contractor. Instead of just saying, "Hey, go build a wall," the contract says:

  1. The Scope: "You are building a wall exactly 10 feet high."
  2. The Precision: "You must use high-grade cement, not the cheap stuff."
  3. The Tolerance: "If a brick is off by more than a hair, you must flag it. If it's off by a centimeter, you've broken the contract."
  4. The Penalty (The Signature): "If you fail, we will know exactly how you failed (e.g., 'the wall is too wobbly' or 'the color is wrong')."

The Four Families of "Broken Promises"

The paper identifies four main ways these math robots "break" their contracts:

  1. The Precision Cheat (Family A): The robot promises to use a high-powered calculator but secretly uses a cheap, basic one to save time. This makes the math "blurry."
  2. The Order Chaos (Family B): In math, 2+3+42 + 3 + 4 is the same as 4+3+24 + 3 + 2. But in high-speed AI math, the order in which you add numbers can change the tiny decimals at the end. This robot promises a consistent result but gives a different one every time you ask.
  3. The Compiler Confusion (Family C): This is like a manager giving a robot a set of instructions, but the manager's translator accidentally changes "turn left" to "turn right." The robot does exactly what it was told, but the instruction itself was mutated.
  4. The "Oops" Handling (Family D): What happens if the robot is asked to do something impossible, like "divide by zero"? Some robots scream for help (Raise an error), some pretend nothing happened (Silent failure), and some just guess. The contract forces them to declare exactly which one they will do.

Why does this matter?

As we build bigger and bigger AI (like ChatGPT or the next generation of super-intelligent models), we are using more and more different types of computer chips from different companies (NVIDIA, AMD, Intel, Apple).

Without these Kernel Contracts, we are building the future of intelligence on a foundation of "silent lies." This paper provides the blueprint for a "Quality Control Department" for AI, ensuring that no matter which chip you use, the math is honest, documented, and—most importantly—predictable.

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 →