back to top
HomeTechLeanstral 1.5: Mistral's AI Built to Prove Math Ended Up Finding Real...

Leanstral 1.5: Mistral’s AI Built to Prove Math Ended Up Finding Real Software Bugs

- Advertisement -

Mistral built Leanstral to do something most AI models don’t attempt, write formal mathematical proofs that a compiler can verify as correct. Not “pretty sure this is right” correct. Mechanically, provably, no-exceptions correct.

That’s a narrow use case, and the audience for it is small. What nobody expected was that a model trained on IMO-level math problems and abstract algebra benchmarks would end up running against open-source codebases and finding bugs that testing and fuzzing had both missed. Five of them previously unreported on GitHub.

What Leanstral actually is

Lean 4 is a proof assistant, a programming language where you don’t just write code, you write mathematical arguments that the system checks for logical correctness. It’s used by researchers to verify things like properties of cryptographic systems, compiler correctness guarantees, and graduate-level mathematics. The barrier to entry is high and the tooling has historically required either deep expertise or a lot of patience.

Leanstral is Mistral’s attempt to lower that barrier. It’s a 119B parameter MoE model with only 6.5B parameters active at inference time, built on the Mistral Small 4 architecture, trained specifically to work inside Lean 4’s environment. It doesn’t just suggest proofs, it submits them, reads the compiler feedback, revises, and keeps going until it either solves the problem or runs out of budget. That means it can work on a single theorem for millions of tokens across dozens of compaction cycles, the same way a human researcher might spend days on a hard proof, except it doesn’t stop for sleep.

Its Apache 2.0 licensed, free API endpoint available, and it runs inside Mistral Vibe with a setup that takes about five minutes.

The part that surprised everyone: it found real bugs

The formal verification angle is interesting to a small audience. The bug discovery is interesting to anyone who writes software.

Mistral built an automated pipeline to test it: Aeneas translates Rust code into Lean 4, Leanstral infers what the code is supposed to do, generates correctness properties, then tries to prove them. If all four attempts at proving a property fail, it flips direction and tries to prove the negation instead. A successful negation proof means the property doesn’t hold, which means the code has a bug.

Across 57 open-source repositories, the pipeline flagged 47 violated properties. Eleven pointed to genuine bugs. Five had never been reported.

One of them was an integer overflow in the sign function of a Rust library used for zigzag decoding. On the maximum possible input value, the expression added one to an unsigned 64-bit integer, wrapping it to zero. In debug mode that crashes. In release mode it silently corrupts data. The kind of edge case that only shows up under a specific input that testing suites rarely think to try and fuzzing can miss entirely. Leanstral caught it automatically.

That’s the result that changes the frame on what this model is. Built for math, useful for software correctness. Those two things turn out to be closer than they look.

Related: Mistral Small 4: The Open Source Model Replacing Three of Mistral’s Own AI Models

The math benchmarks: what the numbers actually mean

Via Leanstral 1.5 HF Model Card

miniF2F is a standard formal math benchmark covering problems from algebra, combinatorics, and number theory, ranging from high school competition level up to IMO problems. Leanstral 1.5 hits 100% on both the validation and test sets.

PutnamBench is harder. 672 problems from the Putnam Mathematical Competition, which is the most prestigious undergraduate math competition in North America. Problems that routinely stump PhD students. Leanstral 1.5 solves 587 of them at a token budget of 4 million tokens per problem. The number that matters more than the raw score is the scaling curve: at 50,000 tokens it solves 44 problems. At 200,000 tokens, 244. At 1 million, 493. The performance climbs the entire way without plateauing, which means the model is genuinely using additional compute to reason deeper.

FATE-H and FATE-X cover graduate and PhD-level abstract algebra, group theory, ring theory, module theory. Leanstral 1.5 sets a new state of the art on both at 87% and 34% respectively.

The number that puts all of this in context is the cost. Solving a PutnamBench problem with Leanstral runs around $4. The next strongest competitor, Seed-Prover at its high setting, costs an estimated $300 or more per problem and requires 10 H20-GPU-days of compute. That’s not a small gap. It’s the difference between something a researcher can run routinely and something that requires a grant.

Five Minutes to Set Up, Then Just Start Proving

Mistral Vibe handles the agent layer. Install it, run /leanstall inside it, and Leanstral 1.5 is ready. The free API endpoint means no self-hosting a 119B model just to try it. For teams who want local deployment, vLLM support is there with standard serving configuration.

For anyone already using Lean 4, the lean-lsp-mcp integration is worth adding, it gives the model real-time access to goal states, type information, and compiler errors as it works, which is what enables the long-horizon proof sessions.

What Happens When You Run This Against 5,700 Repositories

Five unreported bugs across 57 repositories isn’t a large sample. But it’s a large enough result to ask the obvious follow-up question: what does that number look like at ten times the scale?

Formal verification has always been confined to teams with the budget, expertise, and patience to make it work. The cost argument alone kept most codebases out of reach. At $4 per problem versus $300 for the nearest alternative, that argument is getting harder to make. A model built to prove graduate-level mathematics, running automatically against Rust code and catching integer overflows that fuzzing missed, is either a curiosity or the beginning of something that shows up in standard CI pipelines. The 57-repository sample doesn’t answer that. But it makes the question worth asking seriously.

Don’t miss any Tech Story

Subscribe To Firethering NewsLetter

You Can Unsubscribe Anytime! Read more in our privacy policy

LEAVE A REPLY

Please enter your comment!
Please enter your name here

YOU MAY ALSO LIKE
Open Source AI Coding Agents That Don't Need a Subscription

7 Open Source AI Coding Agents That Don’t Need a Subscription

0
Open almost any "best AI coding tools" list and you'll see the same names: Cursor, GitHub Copilot, Claude Code. They're good tools but they're also closed source and paid. What's changed over the past year isn't the quality of those products, it's how quickly the open-source alternatives have caught up. Some can orchestrate multiple agents, remember your projects across sessions, and automate complex development workflows. Many let you bring your own model, whether that's a local LLM, OpenRouter, OpenAI, GLM-5.2, Ornith, DeepSeek, or something else entirely. More importantly, you're in control. You decide where your code runs, which model powers it, and how your workflow evolves without being locked into a single company's ecosystem. If you've only looked at the paid options, these are the open-source AI coding tools worth knowing about.
Ornith Coding model that beats Claude opus 4.7

Ornith 1.0: The New Open-Source AI Model for Agentic Coding

0
Most reinforcement learning setups for coding models work the same way. Researchers build a harness, a fixed scaffold that tells the model how to approach a category of task, then the model gets rewarded for solving problems inside that structure. The harness stays fixed. Only the model's answers change. Ornith-1.0, a new open-source coding model family from DeepReinforce is not just about coding, Instead the model writes its own scaffold. At every training step, it looks at the task in front of it and the scaffold it used last time, then proposes a better version of that scaffold before even attempting an answer. The reward doesn't just grade the solution. It grades the scaffold that produced it. That's a small architectural choice with a strange consequence. A model that gets to design its own training process can, in theory, design one that cheats the verifier instead of solving the actual problem, and DeepReinforce is upfront that this happened during training. The fix they built for it is also worth understanding before getting to the benchmark numbers.
OpenAI Built Its First AI Chip. It's Not Trying to Replace NVIDIA

OpenAI Built Its First AI Chip. It’s Not Trying to Replace NVIDIA.

0
When the news broke that OpenAI had built a custom chip, the instinct was to frame it as a NVIDIA story. Another lab trying to cut the cord, reduce dependence on H100s, claw back some margin from the company that's been printing money off the AI boom. That's not quite what's happening here. The chip is called Jalapeño, built with Broadcom, and it doesn't touch training at all. It's an inference chip, meaning it only runs models after they're already built, when a user sends a message and ChatGPT has to respond. The compute-heavy work of actually training those models still runs on NVIDIA hardware. OpenAI isn't replacing NVIDIA. It's going after a different part of the problem entirely, the part that happens millions of times a day, every time someone uses one of their products. That distinction matters because inference is where AI costs actually accumulate at scale. Training happens once per model. Inference never stops.