AI Engineer8 min
Your Spec Has Bugs. Catch Them Before Your Agent Codes. - Rajath Mahendrappa Kotyal, AWS
Rajath Mahendrappa Kotyal, Rajat Kothiyal
Conference Presentation, Lecture
- Public research indicates a 20 to 40% drop in accuracy for LLM code generation when prompts contain ambiguities, with 60 to 90% of generated valid code remaining incorrect.
- Deploying code derived from specification ambiguities is expected to result in twice as many regressions compared to clear specifications.
- The proposed methodology employs a three-step process where the LLM first attempts to refine and clean ambiguous wording, followed by formalizing English into SMT formulas if refinement fails.
- SMT formulas are passed to a SAT solver to generate Boolean outputs confirming validity, truth, or falsity, with the system detecting and flagging ambiguity between sentences or multiple meanings within a sentence.
- The pipeline iterates the recheck process until ambiguity is resolved, sampling translations seven or ten times to distinguish between inherent LLM capabilities and external factors.
- The system clusters the sampled interpretations based on logical equivalence to identify specific LLM assumptions, allowing users to accept interpretations, provide clarification, or abstain from implementation.
- For vague directives such as "remove the record," the tool offers specific resolution options like deleting the record entirely or retaining it while hiding it from users.
- If no definitive answer is found for a conflict, the workflow plans to utilize LLM judges or abstain from implementing the ambiguous code section.
- The speaker characterizes the field of formalization in agents as emerging technology with thin current evidence and recommends that users verify all parts of a snippet or rule book before submission.
- The system intends to help users ensure they serve as the sole oracle for specification correctness, while the workflow places the final decision on translation completion and verification with the human user.