Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agents
Shuvendu K. Lahiri · 2026
Read Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agents by Shuvendu K. Lahiri (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-17150.txt.
Introduction
Lahiri argues that the central challenge for AI coding agents is formalizing user intent. Agents now write fluent code, but whether it does what the user meant stays unclear. He calls the gap between informal requests and precise behavior the intent gap. Intent formalization turns intent into checkable specifications. Options range from light tests, through full specifications for verification, to domain languages from which correct code is synthesized. The hard part is validating the specifications themselves, since only the user can judge them.
Catalog record
| CREATOR | Shuvendu K. Lahiri |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 32776 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2603.17150
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agents Shuvendu K. Lahiri Abstract . Agentic AI systems can now generate code with remarkable fluency, but a fundamental question remains: does the generated code actually do what the user intended? The gap between informal natural language requirements and precise program behavior—the intent gap —has always plagued software engineering, but AI-generated code amplifies it to an unprecedented scale. This article argues that intent formalization —the translation of informal user intent into a set of checkable formal specifications—is the key challenge that will determine whether AI makes software more reliable or merely more abundant. Intent formalization offers a tradeoff spectrum suitable to the reliability needs of different contexts: from lightweight tests that disambiguate likely misinterpretations, through full functional specifications for formal verification, to domain-specific languages from which correct code is synthesized automatically. The central bottleneck is validating specifications : since there is no oracle for specification correctness other than the user, we need semi-automated metrics that can assess specification quality with or without code, through lightweight user interaction and proxy artifacts such as tests. We survey early research that demonstrates the potential of this approach: interactive test-driven formalization that improves program correctness, AI-generated postconditions that catch real-world bugs missed by prior methods, and end-to-end verified pipelines that produce provably correct code from informal specifications. We outline the open research challenges—scaling beyond benchmarks, achieving compositionality over changes, metrics for validating specifications, handling rich logics, designing human-AI specification interactions—that define a research agenda spanning AI, programming languages, formal methods, and human-computer interaction. Key Insights • AI-generated code is plausible by construction but not correct by construction. The intent gap —the distance between what a user means and what a program does—is the central reliability bottleneck. • Intent formalization —automatically translating informal user intent into checkable specifications—can close this gap. It offers a tradeoff spectrum suited to different reliability needs: from lightweight tests, through full functional specifications for formal verification, to domain-specific languages from which correct code is synthesized automatically. • The central bottleneck is validating specifications : since there is no oracle for specification correctness other than the user, we need semi-automated metrics that assess specification quality with or without code, through lightweight user interaction and proxy artifacts such as tests. • Early research demonstrates the potential —improved developer correctness, new bugs caught, and verified pipelines from informal prose to correct code—but key challenges remain: scaling beyond benchmark problems, validating specifications without an oracle, and integrating intent formalization into agentic developer workflows. • Sustained research investment is needed across AI, programming languages, formal methods, and HCI to scale intent formalization to production systems. 1. Introduction Vibe coding —a term coined by Andrej Karpathy ( 12 ) —captures the new reality of AI-powered software development: developers describe what they want in natural language, accept AI-generated code with minimal or no review, and “forget that the code even exists.” A growing ecosystem of agentic coding tools—GitHub Copilot coding agent, Claude Code, and others—now synthesizes entire functions, modules, and systems from brief prompts, planning, writing code, running tests, and iterating—often autonomously. This represents the purest manifestation of the intent gap: the user has intent but never inspects the implementation , relying entirely on the AI to bridge the two. But a fundamental question remains unanswered: does the generated code actually do what the user intended? Consider a simple request: “given a list of integers, remove duplicates.” Does this mean keep one copy of each element (e.g., [1,2,3,2,4] \to [1,2,3,4] )? Or does it mean remove all elements that appear more than once, keeping only unique ones (e.g., [1,2,3,2,4] \to [1,3,4] )? A human developer resolves such ambiguities through domain knowledge and conversation. An LLM resolves them through statistical pattern-matching against training data—with no grounding in the user’s specific intent. The result is code that looks right but may silently deviate from what the user actually wanted. For example, a typical LLM response to this prompt produces: Listing 1: Plausible but wrong if the user intended to remove all numbers that have duplicates. ⬇ 1 def remove_duplicates ( numbers ): 2 return list ( dict . fromkeys ( numbers )) This keeps one copy of each element in order: remove_duplicates([1,2,3,2,4]) returns [1,2,3,4] . But a user who meant “remove all numbers that appear more than once” ( 4 ) expected [1,3,4] —the 2 should be gone entirely. A formal postcondition disambiguates the intent: Listing 2: A postcondition capturing the “remove elements with duplicates” intent. ⬇ assert all ( numbers . count ( x ) == 1 for x in result ) assert all ( x in result for x in numbers if numbers . count ( x ) == 1) The ambiguity in this simple example illustrates a broader phenomenon. The intent gap —the semantic distance between what a user means and what a program does—has always existed in software engineering (Figure 1 ), but AI amplifies it in two ways: Natural Language Requirements Program Implementation Large Semantic Gap informal “what” \longrightarrow operational “how” Formal Specifications Natural Language Requirements Program Implementation “what” \to “what” test / verify / synthesize refine specs Status Quo: AI code generation without formalization Proposed: Intent formalization bridges the gap Figure 1. The intent gap in software development. Top: Traditional AI code generation translates informal, ambiguous natural language directly into operational code, leaving a large semantic gap. Bottom: Formal specifications serve as an intermediate “what” layer, reducing the gap and enabling enforcement through testing and verification. (1) Scale without scrutiny. AI generates code faster than humans can review it. The ratio of code produced to code carefully examined is growing rapidly, and traditional safeguards—code review, manual testing—cannot keep pace. (2) Plausibility without correctness. LLM-generated code is plausible by construction —it looks right, compiles, and often passes a few tests—but it is not correct by construction . Subtle errors hide behind surface-level fluency, making AI-generated bugs harder to spot than hand-written ones. We argue that the path to reliable AI-generated code is not better code generation—it is intent formalization : the automatic translation of informal user intent into checkable formal specifications. Rather than asking “can AI write the code?” we should ask “can AI help us specify what the code should do—and then verify that it does?” Intent formalization offers a tradeoff spectrum suited to different reliability needs. At one end, lightweight specifications including tests target points of likely ambiguity —the places where different LLMs or agents would generate semantically different code from the same prompt—acting as cost-effective guardrails . In the middle, full functional specifications in verification-aware languages like Dafny, F*, and Verus enable machine-checked proofs of correctness. At the far end, domain-specific languages (DSLs) serve as complete specifications from which provably correct code is generated automatically. This article presents a framework for intent formalization, surveys early research that demonstrates its promise, and outlines the open problems that define a research agenda for the next decade. The goal is to make a case for sustained investment by the research community and industry in intent formalization as a first-class research priority . 1.1. Why Now? The need for intent formalization was recognized with the advent of the first generation of neural