TLA-Bench: An Execution-Grounded Benchmark and Dataset for Natural-Language to TLA+ Specification Generation
TLA-Bench introduces an execution-grounded benchmark with 403 model-checked specifications that reveals a wide "correctness envelope" in evaluating LLM-generated TLA code, demonstrating that current models produce syntactically valid but semantically incorrect specifications far more often than they produce truly correct ones.
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 teaching a robot to write a recipe for a very complicated cake. You give the robot a description like, "Make a cake that rises, doesn't burn, and has exactly three layers." The robot spits out a list of instructions. Now, how do you know if the robot actually did a good job? If you just check if the instructions look like a real recipe, you might be fooled; the robot could write a beautiful poem that looks like a recipe but tells you to "eat the oven." If you just ask a human to read it, they might miss a tiny mistake that causes the cake to explode.
This is the challenge of "formal verification" in computer science. It's about making sure computer programs do exactly what they are supposed to do, with zero room for error. The language used in this paper, called TLA+, is like a super-precise, mathematical recipe book for complex systems (like traffic lights or internet servers). The big question researchers are asking is: Can Artificial Intelligence (AI) write these perfect mathematical recipes just by reading a plain English description? The answer matters because if AI can't get the math right, we can't trust it to design the safety systems for our future technology.
The "Truth-O-Meter" for AI Recipes
A team of researchers from Loyola University Chicago decided to stop guessing and start testing. They built a new playground called TLA+-Bench. Think of it as a massive, automated kitchen where they can test if AI-written recipes actually work.
Before this paper, checking if an AI wrote a good TLA+ specification was like judging a cake by looking at the frosting. Researchers would check if the AI's output looked similar to a human-written example or if it could even be read by a computer (a "parse"). But looking pretty doesn't mean the cake won't collapse. The old methods were too easy and made the AI look smarter than it really was.
This new benchmark is different. It uses a "Truth-O-Meter" called a model checker. Instead of just looking at the recipe, the Truth-O-Meter actually tries to bake the cake in a simulation. It runs through every single possible step the system could take to see if the rules hold up. If the AI makes a mistake, the simulation crashes, and the Truth-O-Meter says, "Nope, that's wrong."
The Big Discovery: The "Correctness Envelope"
The most surprising thing the researchers found is that there isn't just one number that tells you how good an AI is. It's more like a range, which they call the Correctness Envelope.
Imagine you ask an AI to write a recipe.
- The Easy Grade: If you just ask, "Did the AI write something that looks like a recipe?" the AI gets a 10% success rate.
- The Harder Grade: If you ask, "Did the AI write a recipe that actually works when you try to bake it?" the success rate drops.
- The Hardest Grade: If you ask, "Did the AI write a recipe that works and actually does something useful (not just a boring, empty cake)?" the success rate plummets to 1.7%.
The paper shows that depending on how strict you are with your grading, the AI's score can swing wildly. If you tell the AI the exact names of the ingredients it needs to use, its score jumps up to 18.7%. But if you make the AI figure out the names itself, it drops to 10%. And if you demand the recipe actually do something complex, it drops all the way to 1.7%.
This means that previous studies, which only looked at the "easy grade," were like giving a student an A+ for writing a sentence that looked like a math problem, even if the math was wrong. The new benchmark reveals that the AI is actually struggling to do the real math.
The Results: Good at Writing, Bad at Solving
The researchers tested several different AI models, including the big, fancy ones (like GPT-5 and Claude Opus) and some open-source ones. Here is what they found:
- The "Fake It" Problem: Every single AI model was much better at writing valid TLA+ (syntax that the computer can read) than correct TLA+ (logic that actually works). The best AI could write valid code 87% of the time, but it only got the logic right 16% of the time. The open-source models were even worse, getting correct less than 1% of the time.
- The Difficulty Cliff: The AI gets much worse as the problems get harder. On simple, basic tasks, the AI got about 25% right. But on intermediate and advanced tasks, the success rate crashed down to 2%. It's like a student who can add 2+2 but fails completely when you ask them to solve a calculus problem.
- The "Name Game": A huge chunk of the mistakes happened because the AI got the names of the variables wrong. If you gave the AI the names of the ingredients (the interface), it did much better. This suggests the AI isn't failing to understand the logic as much as it is failing to remember the specific labels the system needs.
Why This Matters
The paper concludes that we can't just trust AI to write these safety-critical systems yet. The "Truth-O-Meter" shows that while AI can mimic the look of a perfect specification, it often fails to capture the reality of how the system behaves.
The researchers released their dataset, the "Truth-O-Meter" tools, and all the test results so that other scientists can use them. They aren't saying AI is useless; they are saying we need a better way to measure it. Just like you wouldn't let a robot drive a bus until it passed a real driving test, not just a written one, we need to make sure AI passes the "execution test" before we let it design our future systems. The gap between "looking right" and "being right" is huge, and TLA+-Bench is the tool that finally measures exactly how big that gap is.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.