Mind Cast

Code is the Key — Building Verifiably Correct AI

Adrian Season 3 Episode 34

Use Left/Right to seek, Home/End to jump to start or end. Hold shift to jump forward or backward.

0:00 | 19:22

Send us Fan Mail

In this episode of MindCast, host Will breaks down exclusive, unreleased academic research titled "Epistemological Verification in Code Intelligence: A Comparative Analysis of Pretraining Curation, Preference Boundaries, and Automated Theorem Proving". Discover why shifting AI training from messy natural human language to the rigid rules of computer programming code provides an objective foundation for machine reasoning. Learn how researchers are eliminating hallucinations, using AI to audit its own data , and engineering loops where machines mathematically prove their own correctness. 

What You'll Learn in This Episode

  • The Epistemological Advantage: Why programming languages offer a perfect "closed-world system" for AI verification , unlike the fluid, paradox-ridden nature of human language. 
  • Curing "Garbage In, Garbage Out": The three-tiered curation hierarchy and Direct Preference Optimization (DPO) techniques that vaulted a math reasoning benchmark score from 35.9% to 88.8%. 
  • The Zero-Trust Self-Verifying Loop: How generative AI models partner with automated proof checkers to build software with absolute mathematical certainty. 
  • The Shift to Specification Engineering: Why manual syntax typing is facing rapid automation and how developers must adapt to survive. 

Actionable Takeaways

1. Pivot Your Value Proposition Away From SyntaxThe parts of software engineering that involve memorizing syntax, calling basic libraries, and typing boilerplate code are rapidly being automated. To thrive, developers must elevate their skills to focus on system architecture, deep context analysis, complex problem-solving, and cross-functional decision-making. 

2. Upskill in "Specification Engineering"As models write code faster but remain prone to subtle logical hallucinations, human developers must transition from writing code manually to designing precise mathematical specifications. Explore languages like Dafny at a surface level , and start training your brain to think in terms of code assertions, pre-conditions, post-conditions, and loop invariants. 

3. Advocate for the Secure CoreFor critical infrastructure—such as blockchain smart contracts, operating system kernels, cryptographic libraries, and financial protocols—"tested and seems fine" is no longer acceptable. Organizations must redirect AI capabilities inside self-verifying proof loops to create mathematically secure software that is entirely immune to translation bugs and logical exploits. 


SPEAKER_00

Here's a number that stopped me cold. 35.9%. That's the score an AI model got on a standard math reasoning benchmark, a test designed to measure whether a machine can actually think through a problem step by step. Not great, right? Now here's the second number: 88.8%. Same model, same benchmark, same underlying architecture. The only thing that changed, how that model was trained to distinguish good reasoning from bad. That is a fundamental rethinking of what it means to teach an AI to think without adding a single new neuron to the network. If that doesn't make you ask, wait, how is that even possible? Stick around because that is exactly what we're going to unpack today. Welcome to Mindcast, the show where we take the most complex ideas shaping our world and make them genuinely understandable without dumbing them down. I'm Will, and today's episode is one I've been genuinely excited to record. We're diving deep into a research report that came across my desk, and I have to be up front, this report is not publicly available. It's exclusive academic research. What you're getting today is a synthesis and my own interpretation of cutting-edge thinking you won't find anywhere else. The report is titled, Brace Yourself, Epistemological Verification in Code Intelligence: a Comparative Analysis of Pre-training curation, preference boundaries, and automated theorem proving. That's a mouthful, but here's what it's really about. How do we build AI systems that don't just generate plausible sounding answers, but answers we can actually verify are correct? And the researchers answer? Code. Code is the key. By the end of this episode, you'll understand three things. Why programming languages have a unique epistemological advantage over human language, how researchers are solving the garbage in, garbage out problem with borderline astonishing results, and how AI is beginning to mathematically prove that code is correct. Let's go. Key insight 1. The epistemological advantage of code. Let's start with the foundational idea, the philosophical core everything else in this report is built on. When you train an AI on human language, scraped from the internet, books, social media, you are training it on text that is at best approximately true. A Wikipedia article gets a fact slightly wrong. A Stack Overflow answer is outdated. A blog post confidently states something incorrect. The AI doesn't know the difference. It learns the patterns. And this is the root cause of hallucinations. When an AI confidently tells you something completely made up, it literally cannot tell the difference between a true statement and a false one. Here's where code enters the picture. Code exists in what researchers call a closed world system. There is a final objective arbiter of truth. You run the code. Either it compiles or it doesn't. Either the tests pass or they fail. There is no ambiguity. That is an extraordinary property for training in AI. Every training example can be verified. The universe of code has a built-in ground truth mechanism, and that changes everything. Now, Dr. Venkitz Subermanium, a respected software educator, calls AI in its current form an accelerated inference engine, not a thinking machine. An inference engine, extraordinarily good at pattern matching at superhuman speed, but not what we'd call thinking. His historical analogy, when the automobile was invented, people attached them to horse-drawn carriage bodies. It took decades before people designed cars as cars. We are in the horseless carriage phase of AI. From this, he offers four core guidelines for developers. Ideation over commitment. Use AI for brainstorming, but don't commit to its first answer. Verify. Guideline two, amplification of ignorance. AI makes a novice feel like an expert, and that's dangerous. If you can't recognize bad code, AI will generate it confidently and you won't catch it. Guideline 3. Tooling over agency. Use AI as a tool, not an autonomous agent. Keep humans in the decision loop. Guideline 4. Evolution of the compiler. Future compilers won't just check syntax, they'll check intent, security, and logic. AI will be part of that evolution. One final point. The report uses the allegory of who moved my cheese for programmers. The cheese, the economic value of syntax knowledge, memorizing APIs, knowing which function to call, has moved. AI is very good at the syntax. If your value as a developer lives primarily there, that value is under pressure. The developers who thrive will be the ones who move toward higher order thinking, system design, and problem framing. Key insight 2. Solving garbage in, garbage out. We've established that code has a beautiful closed world property. You can verify it. But here's the catch. The internet is swimming in bad code. Think about every buggy script ever posted to a forum, every Stack Overflow answer from 2009 using deprecated libraries, every tutorial written by someone who half understood what they were teaching. Train your AI on that indiscriminately, and you get an AI that writes confidently broken code because that's what most of the training data looks like. This is the garbage-in-garbage out problem, and the researchers address it with a three-tier curation hierarchy. Layer 1. Human compliance filters. Humans define broad rules, filter out problematic licenses, remove obvious spam, exclude non-executable files. A coarse sieve that removes the worst garbage but can't scale to billions of lines of code. Layer 2. Rule-based heuristics. Programmatic rules, flag code with excessive comments, filter files below a certain size, exclude code that fails a basic syntax check. Fast and cheap at scale, but still blunt instruments. A rule can tell you a file is syntactically valid. It cannot tell you whether the logic is elegant or genuinely useful. Layer 3. Researchers train a small, specialized quality scoring model whose only job is to evaluate whether code is high quality. They use a more powerful model, in some cases GPT-4, to generate quality labels on a curated sample, then train the smaller score on those labels. You're using AI to teach AI what good code looks like. With clean data in hand, the report introduces direct preference optimization, or DPO. Standard training shows the model good examples and have it learn to replicate them. DPO goes further, show it pairs of outputs, one good and one bad, and train it to prefer the good one while explicitly penalizing the pattern of the bad one. I think of it as subtractive optimization, not just a pull toward the correct answer, but a push away from the wrong answer. The researchers extended this with zero-shot contrastive prompting, prompting the AI to generate both a high-quality and a deliberately bad version of the same solution, using those pairs as preference training data. Zero human labeling required. And the results? On the GSM 8K benchmark, the model score jumped from 35.9 to 88.8%, a 52.9 percentage point improvement. Same model, just trained differently on better curated data with smarter preference learning. Human Eval, which measures direct coding ability, improved by 5.5 percentage points. This completely upends the conventional wisdom that more data equals better AI. It's not just about more, it's about better, teaching the model the shape of correctness and the shape of failure simultaneously. Now we reach the most forward-looking section, and I genuinely think we are watching history being made in real time. What if, instead of just training an AI to write code, you put that AI inside a closed feedback loop with the very machine that can tell it whether the code works? Here's what that looks like in practice. The AI generates some code, you compile it, if it fails, you capture the error message and feed it back to the AI. The AI tries again. You run the tests, if they fail, you feed back the output. The AI refines. Again and again. This is called a sandboxed execution loop, implemented in frameworks like Reposit, Cycle, and commercial systems like Supercoder 2.0. The numbers are stunning. Deep Seat Coder V2 starts with a fixed success rate of 9 to 20%, correctly fixing broken code less than 1 in 5 times on the first try. After 10 cycles in this refinement loop, that rate rises to over 99%, not through any change to the model itself, just through iterative self-correction within a verifiable environment. The closed world property of code makes this possible. Nothing analogous exists for natural language. You can't compile an essay. But the researchers don't stop there, and this is where we enter genuinely science fiction territory, except it's happening right now. What if AI could not just write code that works, but mathematically prove that it works? Not test it, prove it, with the same certainty that 2 plus 2 equals 4. Formal verification languages like Lean, Daphne, and FSTAR allow you to write not just code, but a formal specification of what the code should do, alongside a mathematical proof that the code satisfies it. The marriage of generative AI with these formal proof systems creates what the report calls a zero-trust self-verifying loop. You start with a specification, a precise mathematical description of what your software must do. The AI generates two things simultaneously, the code itself and a formal proof that the code satisfies the specification. An independent proof checker with no hallucinations, no off days, certifies the proof. A verified compiler, proven to translate code correctly, completes the chain. Every link mathematically guaranteed. Here's the concrete moment that makes this real. Clawed code was recently applied to a formal verification task, and in a matter of days, generated over 7,800 lines of machine-checked formal proof, work that would have previously taken a team of formal methods experts weeks, potentially months. And the report points to what's coming next: energy-based reasoning models, or EBRMs. Instead of directly generating an output, the model learns an energy function, a scoring system, over the space of possible outputs, searching for the solution most consistent with all known constraints. This is better suited for tasks requiring global consistency, where every piece of the solution must fit together perfectly, exactly what formal proof demands. We are watching, in real time, the emergence of AI systems that can verify their own work at a level of rigor that humans simply cannot match consistently. Okay, let me pull all the threads together and give you three concrete takeaways, things you can actually do with this information starting now. Takeaway number one, your job is changing. Don't fight it, redirect. The report is unambiguous. The parts of software development that involve memorizing syntax, knowing which library function to call, translating a well-understood requirement into code, these are being automated. Not tomorrow, now. If your entire value proposition is I know how to write the code, you are in the same position as a typist who defined their value as I type fast when word processors arrived. The developers who will thrive are the ones who can do what AI still does poorly, understand the context of a problem, challenge the assumptions behind a requirement, design systems at a level of abstraction above the code itself, and critically evaluate AI output for subtle logical flaws that pass the syntax checker but fail in production. Double down on those skills. Takeaway number two. Most developers think in terms of write the code that does the thing rather than formally define what the thing must do. But the ability to write precise, unambiguous, machine-checkable requirements and to validate that AI output actually satisfies them is going to be an extraordinarily rare and valuable skill. Explore languages like Daphne, even at a surface level. Start thinking in terms of preconditions, post-conditions, and invariance. You don't have to become a formal methods expert overnight, but you need to start. Takeaway number three. AI plus formal verification equals the future of trustworthy software, and you need to understand why that matters. Think about the domains where software failure is catastrophic. Medical devices, financial systems executing trades worth hundreds of millions in microseconds, smart contracts on a blockchain where a bug causes an irreversible transfer that can never be undone, autonomous vehicles, air traffic control. In all of these domains, we tested it and it seemed fine is not acceptable. And yet that has been essentially the standard. The marriage of AI and formal verification changes that equation. For the first time, it is becoming feasible to build software in critical domains with mathematical certainty that it behaves as intended. Not probabilistic confidence, mathematical certainty. That is a paradigm shift. And the people who can bridge the gap between the AI tools and the mathematical frameworks will be essential. Let's bring it home. Today on Minecast, we took a deep dive into one of the most consequential questions in AI research. How do we build AI systems that don't just sound right but are verifiably correct? We explored that question through the lens of code intelligence, the ideal laboratory for this work, precisely because code lives in a closed world where truth is testable. We started with the fundamental insight that code's binary nature gives AI a verifiable ground truth that natural language simply doesn't. We explored Dr. Van Kat's Subermanium's warning that AI is an accelerated inference engine, not a replacement for human judgment, and his four guidelines for navigating this moment as a developer. We unpacked the three-tier data curation hierarchy and the elegant logic of direct preference optimization, teaching a model not just what good looks like, but what bad looks like and how to avoid it, producing that extraordinary jump from 35.9 to 88.8%. And we looked at the frontier, sandboxed execution loops that take a 9% fixed success rate to 99% through iterative self-correction, and the emerging marriage of generative AI with formal mathematical proof, where systems like Claude Code are generating thousands of lines of machine-checked proof in days. One important note before I let you go the research we drew on today, epistemological verification in code intelligence, is not publicly available. It is exclusive research, and what you heard represents my synthesis and analysis. You won't find this breakdown anywhere else. If this episode sparked something in you, please do three things. First, subscribe to Mindcast wherever you listen. We do this every episode. Take the hard stuff, make it real, and give you something you can actually use. Second, leave us a review. It takes 60 seconds and it means the world. It's how other curious people find this show. And third, think of one developer, one technologist, one curious person in your life who would benefit from hearing this. Send them this episode. The ideas we talked about today, the changing nature of programming work, the rise of specification engineering, the path to formally verified software. These are happening right now. The people in your life who work in tech need to be thinking about them. And I'll see you next time.