AssumptionMiner reveals hidden assumptions in LLM code generation
LLMs make guesses your code depends on - now you can see them.
When you ask an LLM to generate code from a natural-language prompt, it fills in unspecified details—input formats, error handling, design choices—with implicit assumptions. These hidden guesses can make code pass tests yet violate your actual intent. AssumptionMiner, introduced by Jie Wu and colleagues in a new arXiv paper, makes those assumptions a first-class artifact. Alongside generated code, it produces an explicit 'assumption layer'—a structured representation of inferred constraints and design decisions. An AST-based dependency graph lets you trace which code lines are affected by each assumption, so when you revise an assumption, only the affected code is regenerated.
The team built a benchmark of 180 ambiguous programming tasks with 676 annotated assumptions (including a human-verified subset). Across open-source LLMs, a confidence-weighted ensemble achieved an F1 score of 0.816 for assumption extraction—a 3.6x improvement over the strongest offline baseline. For localizing code impacted by an assumption, AST-guided methods outperformed keyword-based and whole-file approaches. During assumption revision, targeted regeneration modified less code than non-targeted alternatives, though cascading edits remain a challenge. This work transforms LLM code generation from a black box into a transparent, controllable process, letting developers inspect, confirm, or revise what the model silently assumed.
- A confidence-weighted ensemble achieved an F1 score of 0.816 for assumption extraction, improving on the strongest baseline by 3.6x.
- Introduced a benchmark of 180 ambiguous programming tasks with 676 annotated assumptions, including a human-verified subset.
- AST-guided dependency graphs enable targeted regeneration that modifies less code than whole-file approaches when assumptions are revised.
Why It Matters
Makes LLM code generation transparent and controllable, letting developers catch hidden bugs before they ship.