CertiK and Columbia University Bring Math Proofs to the GPU Code Behind Every Large AI Model

CertiK and Columbia University Bring Math Proofs to the GPU Code Behind Every Large AI Model

Amazon, Microsoft, Alphabet and Meta plan to spend about $725 billion on capital projects in 2026, most of it on AI data centers and chips, while the cost of the largest AI training runs has grown about 2.4 times a year since 2016 and is on track to pass $1 billion by 2027. Nearly all of that money turns into time on graphics processing units (GPUs). Every second of that time runs through kernels, the small, heavily tuned programs that tell a GPU how to multiply large tables of numbers or how to compute attention, the step that lets a language model weigh every word against every other word. Those kernels are some of the most valuable code in AI and some of the hardest to check. A bug in one rarely crashes anything, so the job keeps running while quietly producing wrong numbers that flow into the next step of training or into the answers a model gives. CertiK and researchers at Columbia University have now built TensorLean, a system that uses mathematics to prove a production GPU kernel computes what it should. The team has applied it to more than 100 kernels from DeepSeek and the widely used FlashAttention library, finding 25 bugs along the way.The Compute Boom Runs on GPU Kernels The 2026 plans are large at every company. Amazon expects to approach $200 billion, Microsoft has guided to $190 billion for the calendar year, Alphabet to between $180 billion and $190 billion and Meta to between $125 billion and $145 billion, while Alphabet has already told investors that its spending will rise significantly again in 2027. Hardware such as chips, servers and the networking between them makes up 47% to 67% of the cost of developing a frontier model, so the efficiency of that hardware is where most of the money is won or lost. Big Tech plans about $725 billion of AI spending in 2026 as training runs head past $1 billion. That efficiency is decided by kernels. FlashAttention, the open-source attention library with more than 25,000 stars on GitHub, supplies features used in models such as Mistral 7B, Gemma-2 and Grok, while DeepSeek released kernels such as DeepGEMM, which reaches up to 1,550 trillion operations a second on an H800 GPU. Because a training cluster runs the same few kernels billions of times, a small speed gain in one of them is worth more than almost any other software change, which is why some of the best engineers in AI spend their careers making kernels faster.The Cost of a Silent Error The TensorLean team puts the stakes in simple terms. If a training run spends $100 million on compute and 1% of that work must be repeated because of an error, the extra cost is $1 million. At the $1 billion scale Epoch AI expects the largest runs to reach by 2027, the same 1% would cost $10 million (our arithmetic). Failures are already routine at that scale: Meta's Llama 3 405B run on 16,384 H100 GPUs saw 419 unexpected interruptions over 54 days, about one every 3.1 hours. At frontier scale, one percent of wasted compute costs millions of dollars. Source: TensorLean team, Epoch AI, Tom's Hardware, Ma et al.; rerun costs are our calculation.The failures that crash a job are the easy ones, since the job stops and restarts from a saved checkpoint. The hard ones are silent: Meta traced six interruptions in a 54-day window to silent data corruption, where a chip returns a wrong answer without any error, while Google has estimated one such event every one to two weeks during Gemini training. Researchers at Harvard and Amazon found that a model's loss curve, the main health signal engineers watch, can look normal while its weights drift away from where they should be. A bug in a kernel behaves like silent corruption with one difference that makes it costlier, because a faulty chip affects one machine while a faulty kernel is copied to every GPU that runs it.Why Faster Kernels Are Harder to Check FlashAttention shows how quickly the code has changed. The second version ran at about 350 trillion operations a second on Nvidia's H100, around 35% of the chip's peak, before FlashAttention-3 reached 740 trillion in July 2024, about 75% of peak, with close to 1.2 quadrillion using 8-bit numbers. FlashAttention-4 then reached 1,613 trillion operations a second on Nvidia's newer B200 in March 2026, a 4.6-fold rise in under three years across two chip generations. The fastest attention kernels got 4.6 times faster in under three years. Source: Together AI, FlashAttention-4 paper, DeepGEMM, FlashAttention GitHub.Each jump came from a trick that makes the code harder to reason about. The kernels copy data while doing math at the same time, assign some groups of GPU threads only to loading data while others only compute, change how they split the work depending on the size of the input and use lower-precision numbers such as FP8, which doubles speed but adds rounding. Testing checks a kernel on the inputs someone thought to try, so a bug that only appears for one unusual input size, or only when a copy finishes a moment late, can pass every test and still ship.How TensorLean Works Formal verification replaces examples with proof. A tester runs a program on chosen inputs and checks the outputs, while a formal proof shows mathematically that the program meets its requirements for every input inside a defined range. TensorLean writes these proofs in Lean, a proof language in which a small, trusted checker confirms every step, so anyone can rerun the check and get the same answer without trusting the people who wrote the proof. How TensorLean checks a production GPU kernel. Source: CertiK and Columbia University TensorLean research; diagram is our summary.The system works on PTX, the low-level instruction set Nvidia's compiler produces just before code runs on a GPU, so the proof covers the code that actually executes after the compiler has made its changes. TensorLean models the speed tricks together, including data transfers that overlap with computation, layouts that change with the size of the task and lower-precision arithmetic held to set numerical tolerances.Specifications written for one kernel can be reused for related kernels, which lets the approach spread to more code and repeat each time that code changes. That reuse is what makes the method practical for teams that ship new optimizations every few weeks.What the Proofs Found The team has applied TensorLean to more than 100 production GPU kernels across several generations of GPU architecture, including kernels from DeepSeek and from FlashAttention. The work uncovered two bugs in DeepSeek's kernels and 23 in FlashAttention. When a proof fails, it points to the case that breaks. Once the code is repaired, the team proves the new version again so the fix is confirmed to meet its requirements. TensorLean verified more than 100 production kernels and found 25 bugs.The choice of targets matters because both codebases are shared. FlashAttention has more than 3,000 forks on GitHub while DeepSeek's kernels were released openly for anyone to build on, which means a bug in either one travels into many other projects. A fix proved at the source protects every team downstream, which turns one research effort into a gain for a large part of the open-source AI stack.What It Means for Model Builders For teams that train or serve large models, TensorLean fits into the work they already do. After each round of optimization an engineer can measure the speed gain, rerun verification to check that the change did not introduce a computational error and, when the code meets its requirements, keep a machine-checkable proof alongside it. That record lowers the risk of wasted compute, costly training reruns and wrong results feeding into later calculations, which are the losses that grow with every increase in cluster size. The need will grow as AI writes more of its own code. Researchers are already using language-model agents to generate GPU kernels and prove them correct in Lean. Kernel code produced that way will arrive faster than any human team can review it. The practical starting point is the code that runs most often, such as attention, matrix multiplication and mixture-of-experts routing, where a proof protects the largest share of compute and where specifications can be reused across versions.Where Formal Verification Goes Next Formal verification has a long history in systems software. seL4 became the first fully verified operating system kernel in 2009. CertiKOS, a verified concurrent operating system kernel, followed at Yale with Ronghui Gu as a lead designer. Gu and Yale professor Zhong Shao founded CertiK in 2017. The company has since worked with more than 5,500 enterprise and institutional clients and found more than 119,000 code vulnerabilities. Machine-checked proofs have grown from one operating system kernel to the code that trains AI. AI has made proofs far cheaper to produce. DeepMind's AlphaProof reached silver-medal level at the International Mathematical Olympiad in 2024 with proofs written in Lean, while Anthropic formalized Fermat's Last Theorem in Lean with Claude in 11 days in September, producing about 13 million lines. In October, Claude worked with the firm Theorem to prove 123 open-source libraries free of crashes with about 180 million lines of proof, roughly 900 times the size of the seL4 proof (our arithmetic). TensorLean carries that progress into the computing code that AI itself runs on.The Road Ahead As training budgets head toward $1 billion per run, a proof of correctness is likely to become as routine a part of shipping a kernel as a speed benchmark is today. Teams that can prove each optimization correct can push for speed with more confidence, while teams that rely on testing alone carry a growing risk of finding errors only after the compute has been spent. For CertiK, TensorLean extends formal verification from blockchains and operating systems into AI infrastructure, the fastest-growing category of computing spend. The next test is adoption: whether the labs and library maintainers who write the fastest kernels start shipping proofs alongside them, which would give the industry a firmer base for every gain in AI computing efficiency that follows.Don’t forget to like and share the story!Vested Interest Disclosure: HackerNoon has reviewed the report for quality, but the claims herein belong to the author. #DYOR.

Original Source

Read the full article at Hackernoon →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.