When The Machine Must Prove It Is Right

AI writes code. It cannot guarantee that code is correct. 

Artificial Intelligence · Education · Software Engineering
When the Machine Must Prove It Is Right
AI can write code faster than any human. It cannot guarantee that code is correct. That single tension is reshaping how universities teach computer science, how research labs build AI systems, and what it means to be a software engineer.
2026

Give a large language model a programming task and it will, almost always, produce something that looks right. The function will be named sensibly. The variables will read cleanly. The code will compile. And sometimes, in a way that is very hard to predict in advance, it will be wrong in a manner that looks right until the moment it fails in production, causes a financial error, or powers a safety-critical system that behaves unexpectedly under conditions the model never encountered during training.

This is the central problem of the current moment in computing. The AI tools that the industry has adopted at extraordinary speed operate by recognizing and completing patterns. They are, in a precise technical sense, very sophisticated autocomplete engines. That description is not an insult. Pattern recognition at the scale and quality that modern language models achieve is genuinely remarkable. But pattern recognition is not the same thing as reasoning, and it is not the same thing as proof. Software, when it runs in the real world, has to be correct, not merely plausible.

The research community has known about this gap for some time. Now the university system is beginning to catch up. At MIT, a four-year-old undergraduate program has become the second-most-popular major on campus, and its design, finalized before ChatGPT was released to the public, reflects a quiet but firm conviction that the next generation of engineers will need to think in two modes at once: the probabilistic mode of machine learning, and the logical, verifiable mode of formal reasoning. At research labs including Google DeepMind, IBM Research, and MIT's own Computer Science and Artificial Intelligence Laboratory, a hybrid architecture called neurosymbolic AI is emerging as the field's most serious attempt to close that gap. The two stories are connected, and together they point toward a version of software engineering that looks quite different from the one practiced today.

01 How a language model generates code
Training on statistical patterns produces outputs that are probable, not proven. No step in the chain creates a correctness guarantee — the model proceeds with equal confidence whether it is right or wrong.
How a language model generates code Training on data Billions of tokens including code Pattern matching Learns what tokens follow tokens Generates output Produces the most probable sequence Output looks correct Compiles, passes surface checks No internal check exists Model cannot detect its own errors
Plausible but unverified output
Structural failure — no correctness check
I. The brilliant guesser at the heart of modern AI

The research community has a name for the failure mode: code hallucination. A 2024 benchmark study called HalluCode, built on top of two standard coding evaluation suites, found that current code-generation models cannot reliably identify their own hallucinations even when asked directly to do so. A 2025 follow-up published in the ACM journal of software engineering found that errors become especially frequent when the model has to handle complex dependencies between different parts of a real codebase. A separate analysis by CodeRabbit of 470 open-source GitHub pull requests found that AI-co-authored code contained roughly 1.7 times as many issues per pull request as human-only code, with logic errors 75 percent more common and certain classes of security vulnerability appearing at nearly three times the rate.

GitClear, which analyzes code changes across repositories maintained by major technology companies, reported in 2025 that the past two years have seen a fourfold increase in code duplication, and an eightfold surge in duplicated blocks of five or more lines. This is a pattern consistent with model outputs that reproduce solutions from training data without understanding the structural implications for the codebase as a whole. A 2024 survey by Stack Overflow found that 63 percent of professional developers had incorporated AI into their workflow. A large controlled study co-authored by GitHub and Microsoft found that developers completed tasks approximately 55 percent faster with AI assistance. The productivity gain is real. So is the quality gap.

The problem, stated plainly, is that the model does not know when it is wrong. That is not a fixable bug in the current architecture. It is a consequence of how the architecture works. A statistical pattern-matcher produces outputs that are consistent with its training distribution. When a prompt asks it to do something that requires compositional reasoning across multiple steps, or requires knowing something that is true rather than something that was common in training data, the model has no internal mechanism to detect the failure. It proceeds with the same apparent confidence regardless of whether its output is correct. Probable is not the same as correct. That distinction is the axis around which the entire research and educational response is organized.

II. Logic returns: what neurosymbolic AI actually is

The computer science field did not always bet on pattern matching. The first decades of AI research, from roughly the 1950s through the 1980s, were dominated by symbolic AI: systems that represented knowledge as formal rules and logical structures, and reasoned over those structures using operations that resemble mathematical proof. Systems of this kind could explain their conclusions, because those conclusions followed from explicit premises by defined inference steps. They were auditable, predictable, and verifiable. They also failed to scale. Real-world knowledge is ambiguous, messy, and incomplete. By the 1990s the field had largely moved on, and by the 2010s the extraordinary success of deep learning had made the older symbolic tradition look like a historical curiosity.

The current research moment is a correction to that overreach. The best-performing AI systems on tasks that require rigorous, multi-step reasoning are not pure language models. They are hybrid architectures, called neurosymbolic systems, in which a learning component and a reasoning component operate together. The learning side handles the messy, ambiguous parts of a problem: recognizing patterns in data, handling natural language, generating candidate solutions. The reasoning side handles the parts that require guarantees: verifying that a solution is logically consistent, checking that it satisfies stated constraints, or proving that it is mathematically correct.

The clearest public demonstration of what this architecture can achieve is AlphaProof, developed at Google DeepMind. In 2024, AlphaProof and its companion system AlphaGeometry 2 together reached a silver-medal score on the International Mathematical Olympiad, one of the most demanding tests of structured reasoning that exists. AlphaProof is a reinforcement learning agent that proposes proof candidates and submits them to Lean, a formal theorem-proving system, for verification. Lean either accepts the proof, meaning it is mathematically guaranteed to be correct, or rejects it. Only verified proofs feed back into training. AlphaGeometry 2 pairs a language model with a symbolic deduction engine and solved its assigned problem 19 seconds after it was formalized in machine-readable form. These are not, in the popular phrase, simply large language models. They are language models harnessed to symbolic engines that can refuse, prune, and verify, in a tight loop that neither component could complete alone.

IBM Research has built toward the same destination from a different angle. Its Logical Neural Networks framework is a system in which every computational unit corresponds to a component of a logical formula. The network learns from data as a conventional neural network does, but its internal structure encodes logical constraints that the learning process cannot violate. Inference is bidirectional, meaning the system can reason both forward from premises to conclusions and backward from observations to possible causes. IBM's team has applied this to knowledge-base question answering, achieving strong accuracy on two major benchmarks without requiring the task-specific training data that conventional language models depend on, a result that reflects genuine generalization rather than pattern memorization.

MIT CSAIL's probabilistic programming language Gen, released in 2019, addresses the same problem from a programming language theory perspective. Gen allows a programmer to specify a structured model of a problem explicitly, then use deep learning for the perceptual components and probabilistic inference for the reasoning components. A related language called Scallop, presented at the Programming Language Design and Implementation conference in 2023, frames neurosymbolic learning as differentiable logic programming over relational data: a deep network supplies probabilistic facts, a symbolic solver reasons over them, and gradients flow through both layers so the system can be trained end-to-end while preserving the interpretability of the symbolic component. The dominant research direction at MIT CSAIL, IBM Research, Google DeepMind, and the Allen Institute for AI is no longer simply scaling the transformer. It is pairing the transformer with something the transformer alone cannot provide: a component that can formally verify, reject, or constrain its outputs.

02 The neurosymbolic loop
Neural component proposes. Symbolic verifier evaluates. Rejections feed back into training. Only formally verified outputs escape the loop. The system runs until the verifier is satisfied, not until the model feels confident.
The neurosymbolic loop Neural component Generates candidate solutions from data proposes Symbolic verifier Applies logic, rules, or formal proof evaluates Rejected Loops back to retrain Accepted Formally verified output feeds back into training Verified output Guaranteed correct, not just plausible Real-world examples: AlphaProof (DeepMind) LNN (IBM Research) Gen (MIT CSAIL)
Neural component (generate)
Symbolic verifier (evaluate)
Rejection feedback loop
III. A new curriculum for a new kind of engineer

In November 2021, MIT circulated a proposal for a new undergraduate degree within its Electrical Engineering and Computer Science department: Course 6-4, "Artificial Intelligence and Decision Making." Students could declare it starting in fall 2022. By 2026 it had become the second-largest major at MIT, trailing only the traditional computer science degree. The timing matters: the curriculum was designed before ChatGPT existed, before mass-market AI coding assistants, and before the industry had begun to absorb the quality tradeoffs that came with them. The faculty who built it were betting, based on the research trajectory of the time, that the field was moving toward a synthesis of learning-based and reasoning-based methods. That bet now looks prescient.

The curriculum reflects that conviction in concrete terms. Students in 6-4 complete the same algorithmic foundations required for traditional computer science: algorithms, discrete math, linear algebra, and probability. They then satisfy requirements across five thematic areas that MIT calls Centers, covering data-centric, model-centric, decision-centric, computation-centric, and human-centric methods. The model-centric requirement explicitly includes the course titled AI: Representation and Reasoning, which covers classical symbolic AI including logic, constraint satisfaction, and knowledge representation. A student cannot graduate from 6-4 having learned only how to train neural networks. The program structurally requires exposure to the formal, verifiable side of AI as well. MIT's Deputy Dean of Academics for the Schwarzman College of Computing put it plainly in a May 2026 interview: the program is not teaching students to use the latest tools. It is teaching them the underlying principles of how to build systems that make decisions, learn, and adapt. The technology surface changes. The mathematical and logical foundations do not.

Carnegie Mellon launched what it describes as the country's first Bachelor of Science in Artificial Intelligence in fall 2018. Its design reflects the same philosophy: students must complete the same theoretical foundations required for traditional computer science, including courses in imperative computation, functional programming, and theoretical computer science, before layering AI and machine learning on top. UC San Diego announced a new AI degree in September 2025 with its first 200-plus students enrolled and a target of 1,000 by 2029. Stanford has updated its flagship AI course and AI track within the existing computer science degree, with a visible shift in pedagogy: a recent CS221 problem set explicitly instructs students to use an AI chatbot as an interactive tutor for foundational tasks, a signal of how quickly the relationship between student and tool is being renegotiated.

A 2025 report counted 193 bachelor's programs in AI at US universities, roughly double the number from prior surveys. The Computing Research Association's 2024 data found undergraduate computing enrollment grew 9.9 percent year over year through 2024. But a follow-up CRA survey published in October 2025, drawing responses from 134 academic units across 130 institutions, found that 62 percent reported enrollment declines for the 2025 to 2026 academic year, the first broad dip after nearly two decades of uninterrupted growth. The explanation is not that students are abandoning computing. It is that they are sorting with more precision among a set of options that did not exist five years ago, migrating toward dedicated AI programs and away from the undifferentiated computer science major.

AI and computer science education

Universities across the United States are restructuring their computer science curricula around a new conviction: that the next generation of software engineers will need to understand both how AI systems learn and how their outputs can be formally verified. MIT's 6-4 program, now the second-largest major on campus, was designed with this synthesis in mind before the current wave of generative AI tools existed.

IV. Software engineering in the age of the verifier

For most of the history of software engineering as a professional discipline, the structure of the work followed a clear sequence: the human developer specifies what a program should do, writes code that expresses that specification, and the compiler enforces certain correctness properties, checking types, catching syntax errors, and translating the code into machine instructions. The human is the creative agent. The compiler is the verifier. The machine executes. AI-assisted coding changes that structure in ways the field is still working through. The AI becomes a collaborator at the specification-to-code step, proposing implementations that the human developer evaluates and revises.

This is genuinely useful. A large controlled study co-authored by GitHub and Microsoft found developers completed tasks 55 percent faster with AI assistance. But the failure modes are consequential. The Faros AI report, drawing on telemetry from more than 10,000 developers across 1,255 teams, identified what it called the AI productivity paradox: individual output goes up while organization-level delivery velocity often does not, attributed to increased review burden, rising downstream defect rates, and the cognitive overhead of managing code the developer did not fully author and may not fully understand.

The research response to this problem follows the same architectural logic as AlphaProof: add a verifier. Lean and Coq are theorem-proving systems that allow correctness properties to be stated as formal mathematical assertions and checked algorithmically. Type systems, already standard in languages like TypeScript, Rust, and Haskell, enforce structural properties about what values a program can produce and what operations are valid. Probabilistic programming tools like Gen allow the uncertainty in a model's outputs to be propagated explicitly through the system's logic, making it visible and tractable rather than hidden. None of these tools is new. What is new is the urgency of the argument for them. In a world where significant portions of production code are generated by systems that cannot self-verify, the verifier becomes one of the most important components in the engineering stack.

Chain-of-thought reasoning, the technique of prompting language models to show their work step by step, seemed for a time like a bridge between pure pattern matching and genuine reasoning. Recent research has complicated that picture. A 2025 paper titled "Is Chain-of-Thought Reasoning of LLMs a Mirage?" documented brittleness under distribution shifts, and a study presented at ICLR 2025 found that across 16 state-of-the-art models, chain-of-thought and its variants consistently underperformed direct answering on pattern-based in-context learning benchmarks. If chain-of-thought is the lightweight version of symbolic structure, the evidence increasingly suggests that the heavyweight version, formal solvers, type systems, and theorem provers, is not optional for applications where correctness matters. The engineer's job in this new loop is not simply to write prompts or accept suggestions. It is to design the entire system: the specification, the generative step, and the verification layer that determines what the system is actually allowed to do.

03 The old engineering loop versus the new
In the traditional loop, the human is sole author and the compiler is the only check. In the new loop, the engineer designs a three-part system: specification, AI generation, and formal verification. The job shifts from writing code to designing the loop.
THE OLD LOOP THE NEW LOOP Human specifies Defines what the program must do Human codes Writes implementation by hand Compiler checks Types, syntax, basic correctness Machine executes Output delivered to users Human specifies Defines the problem and constraints AI model generates Proposes candidate implementation Verifier evaluates Checks logic, types, formal rules rejected Verified output ships Formally guaranteed, not just likely The engineer's job shifts from writing code to designing the loop
Traditional loop — human is sole author and checker
AI generation (new)
Formal verification (new)
V. What comes next, and who is ready for it

The employment picture for new computer science graduates is more complicated than the enrollment numbers suggest. Entry-level software development postings are down roughly 40 percent compared to four years ago. Major technology companies have collectively reduced their hiring of new graduates by more than half since 2019, according to data cited by the venture firm SignalFire. The unemployment rate for recent college graduates reached 5.6 percent in late 2025, above both the national rate and the rates of recent years, per the Federal Reserve Bank of New York's tracking of bachelor's degree holders between 22 and 27. Some of this is cyclical, a correction after the aggressive hiring of the pandemic era. But part of it is structural: AI tools have compressed the category of routine, well-defined programming work that historically formed the entry point for junior developers, narrowing the pipeline even as demand for engineers capable of more sophisticated work grows.

The students surging into programs like MIT's 6-4, CMU's BSAI, and UCSD's CS29 are reading the same signals the research labs are sending. They are placing a bet that depth in a technically demanding, formally grounded specialization is more durable than breadth in skills that are already being automated. Whether that bet holds depends on how quickly the industry recognizes that the most pressing problem in AI-integrated software is not generation speed but verification. The evidence from the research labs suggests the recognition is already underway. AlphaProof does not simply generate proofs. It generates proofs that Lean has certified as correct. That distinction, between producing a plausible output and guaranteeing a verified one, is the distinction that will define the next decade of computing.

There is a clean way to summarize where all of this is heading. For sixty years, the implicit contract of software engineering was that the human provides creativity and judgment, and the machine provides speed and precision. AI has disrupted that contract by giving the machine a form of apparent creativity, the ability to generate plausible solutions to novel problems. What it has not yet provided is the precision side of the contract, the guarantee that what it generates is actually correct. Closing that gap, through neurosymbolic architectures, formal verification tools, probabilistic programming languages, and the curricula being built around all three, is the defining technical project of this moment. The verifier, long the quietest part of the software stack, is becoming the center of the conversation. The universities, the research labs, and the more perceptive engineering teams already know it.

Key references: HalluCode benchmark study on code hallucination in large language models, 2024. "LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation," Proceedings of the ACM on Software Engineering, 2025. CodeRabbit, "State of AI vs Human Code Generation," December 2025. GitClear, "AI Copilot Code Quality: 2025 Data," gitclear.com. Stack Overflow Developer Survey, 2024. Faros AI, "The AI Productivity Paradox Research Report," 2025. GitHub and Microsoft Copilot controlled study on developer productivity, 2023. Google DeepMind, "AI achieves silver-medal standard solving International Mathematical Olympiad problems," 2024; AlphaProof and AlphaGeometry 2 technical report, Nature, 2025. IBM Research, Logical Neural Networks framework; "Extensions and NLU Applications of Logical Neural Networks," IBM Research, 2022. MIT News, "New AI programming language goes beyond deep learning," Gen programming language release, 2019. Scallop: A Language for Neurosymbolic Programming, PLDI 2023. MIT EECS, Course 6-4 Artificial Intelligence and Decision Making curriculum, eecs.mit.edu. Carnegie Mellon School of Computer Science, B.S. in Artificial Intelligence program, 2018. UC San Diego, "UC San Diego's New AI Major is Here," September 2025. Marketplace, "An artificial intelligence major is gaining popularity at MIT," May 12, 2026. Computing Research Association, Taulbee Survey 2024; CERP Pulse Survey, October 2025. "Is Chain-of-Thought Reasoning of LLMs a Mirage?", arXiv, 2025. "The Curse of CoT: On the Limitations of Chain-of-Thought in In-Context Learning," ICLR 2025.