AI Engineer Summit
November 11, 2026Online track3 min read

Specs have bugs too

An e-commerce specification says that an order should become a backorder when inventory is unavailable. Elsewhere, it says that no order should ever become a backorder.

Rajath KotyalAmazon Web Services

Day 1 livestream · 1:50:46–1:58:35 on YouTube. The player starts and stops at this session’s boundaries.

Introduction

An e-commerce specification says that an order should become a backorder when inventory is unavailable. Elsewhere, it says that no order should ever become a backorder.

Each sentence is easy to understand on its own. Together, they ask the coding agent to implement an impossible combination. Better code generation cannot settle which business rule the author actually meant.

Rajath Kotyal's talk moves the first check earlier: inspect the specification before handing it to the agent that writes the implementation. The project he describes combines an LLM's ability to translate natural language with a solver's ability to check relationships between formal statements.

1:51:20 ↗

Find the problem before it becomes code

The backorder example illustrates a conflict across sentences. Other problems can hide inside a single sentence: a vague verb, an unstated condition, or a level of detail that leaves the implementation to guess.

There are also gaps. A set of rules may cover submitted and completed orders while saying nothing about an idle order. Nothing has to be directly contradictory for the agent to be left making a decision the specification's author never made.

This is familiar work in design reviews. Engineers draw flows and read requirements together to discover cases that prose obscures. Kotyal's proposal is to automate part of that first review, surfacing questions while they are still questions about intended behavior rather than bugs embedded in a codebase.

1:54:20 ↗

Let the LLM translate and the solver check

The pipeline begins by refining the wording. It then translates requirements into a formal representation and analyzes that representation for conflicts, gaps, and scenarios.

Source slide shows the three stages: LLM refine, LLM formalize, and SMT solver analyze.

At 01:54:20, the slide separates the LLM's translation work from the solver's checking work. It runs on requirements before code generation.

An SMT solver checks logical constraints expressed in a formal language. For the order example, the important relationship is between the condition “submitted with no available inventory” and the required backorder state, together with the global prohibition against that state. Expressing those relationships makes it possible to ask whether the relevant constraints can hold together.

That precision applies to the formalized requirements. It does not prove that the translation captured the author's intent. An LLM can turn an ambiguous sentence into one perfectly consistent interpretation while silently discarding another plausible reading.

Kotyal therefore adds a second kind of check: compare translations rather than trusting the first one.

1:55:00 ↗

Sample interpretations, then compare their meaning

At 01:55:00, Kotyal describes asking the model to translate the same requirement multiple times, then clustering the outputs by logical equivalence.

Different wording is not necessarily disagreement. Two formal expressions can mean the same thing. Conversely, superficially similar outputs can encode different assumptions. Clustering by meaning is meant to separate those cases.

Source slide shows sample, cluster by logical equivalence, and decide: accept, ask, or abstain.

The 1:55:40 slide turns model disagreement into an explicit decision point instead of letting one arbitrary interpretation reach the codebase.

The next action depends on the result. The system can accept a sufficiently clear interpretation, ask the author to resolve the ambiguity, or abstain from implementing the requirement. Repeating a translation is useful because it exposes alternative assumptions, not because repetition converts generated text into ground truth.

“Remove the record” is the talk's concrete example. Does that mean deleting the data, or retaining it while hiding it from users? Both can produce plausible implementations. They have different consequences for retention, recovery, and future queries. The tool should present the choice rather than settle it accidentally through code.

1:56:35 ↗

The author still owns the intended behavior

The ending puts a limit on the entire pipeline. There is no automatic oracle for what a specification should mean. Domain knowledge can be implicit, and even a logically consistent specification can describe the wrong product.

Formal checking is useful precisely when its scope stays clear. It can expose a contradiction in the represented rules or show that the sampled interpretations disagree. It cannot decide whether the business wants backorders, whether “remove” should preserve a legal record, or whether an omitted state is intentionally outside scope.

Kotyal also describes the evidence for this emerging approach cautiously. The useful takeaway is a division of work: the LLM translates, the solver checks, and a human makes the consequential choice when the intended rule is unresolved.

That gives the coding agent a better starting point. Instead of asking it to repair code written from conflicting instructions, resolve the contradiction before the implementation exists.

Full transcript 161 timestamped passages

Machine-generated source transcript; recognition errors remain. Timestamps and subtitles use the selected source recording’s clock, not clip-relative time. Section links use cited source moments; sections without a verified moment return to the talk start.

1:50:48I'm part of the automated reasoning

1:50:50group at AWS and today I'm going to talk

1:50:53about a project I worked on recently

1:50:56called KO specification analyzer and u

1:51:00we use certain techniques which involves

1:51:02formal methods and automated reasoning

1:51:04to prove specification that goes to your

1:51:07coding agent before it writes code.

1:51:16So let's take a certain bug right

1:51:20this is a specification

1:51:23uh snippet and there are two rules for

1:51:26example and uh the rule two says when an

1:51:29order is submitted and this is for a a

1:51:32general e-commerce website let's say

1:51:35when an order is submitted and the

1:51:36inventory is unavailable we place the

1:51:39order as a back order which makes sense

1:51:41when you read it individually and

1:51:43there's also another rule in the same

1:51:45specification file uh which you hand to

1:51:47the coding agent which says u no order

1:51:50shall be placed as a back order and this

1:51:52is a rule we've set so individually read

1:51:56these two lines make sense right but in

1:52:00when an LLM reads this reads both the

1:52:02rules together both cannot hold true at

1:52:05the same time so we need to make sure

1:52:08the we resolve this ambiguity that the

1:52:10LLM is observing

1:52:14and uh

1:52:17the scope and the reason we

1:52:22uh put an effort into this project is

1:52:24based on public research and recent

1:52:27research we've observed there's a 20 to

1:52:2840% drop with unclear prompts on the

1:52:32accuracy the LLM uh generates on the

1:52:35code accuracy right and 60 to 90% % of

1:52:38valid code is still wrong after it

1:52:40writes it and also in that case we

1:52:43observe two times the more more

1:52:45regressions when we uh deploy that code

1:52:51so where do bugs like these hide right

1:52:54we want to detect these bugs before they

1:52:56reach the code base and the way only way

1:52:59to do that it's similar to how we write

1:53:01design docs similar to how we draw

1:53:04diagrams and flowcharts to make sure the

1:53:06flow is set before we write any code. We

1:53:08want to verify that without a human or

1:53:12anyone reading these files as the first

1:53:15reviewer.

1:53:17In one sentence, let's say the ambiguity

1:53:20and wording wrong level of detail, but

1:53:23across sentences, we can observe

1:53:25conflicts and gaps in the specification

1:53:28or rules, right? Sentences need reveals

1:53:31that need search and between them and

1:53:34ambiguity searches.

1:53:36So we have a three-step process to do

1:53:39this where the LLM will first refine it.

1:53:42It will try to clean up the wording on

1:53:43its own and um if it succeeds then well

1:53:47and good but if it cannot we then

1:53:49formalize

1:53:50the um English language into SMT

1:53:54formulas. So SMT lib is a certain set of

1:53:59type of function which we pass to a SAT

1:54:01solver a satisfiability checker where

1:54:04it's going to give out a boolean saying

1:54:06this expression that you've given me is

1:54:09valid true or false invalid

1:54:13and then once the solver gets back to us

1:54:15if that expression is valid then we

1:54:17don't do anything. But if it detects any

1:54:19ambiguity between two sentences or

1:54:21within a sentence where there's two

1:54:23meanings to a sentence, then we detect

1:54:25that and tell the LLM to recheck that

1:54:29sentence and it's going to reiterate on

1:54:31that.

1:54:33For example, the rules we saw,

1:54:37we've seen when order is submitted and

1:54:39inventory is unavailable, we shall place

1:54:41the order as a back order. And in SMT

1:54:45format, it kind of looks like this. This

1:54:47is like a mass formula, right?

1:54:54Once we go deeper, we

1:54:57once we detect this, we also do a

1:55:00three-step process again where we sample

1:55:03the translations again and again. We ask

1:55:05the LLM to translate it seven times or

1:55:0710 times and to understand whether this

1:55:10LLM is behaving this way uh based on

1:55:15its inherent capabilities or is

1:55:17something affecting it to behave this

1:55:18way and then based on logical

1:55:21equivalence of these seven or 10 um

1:55:24different set of interpretations by the

1:55:26LLM we cluster them on logical

1:55:28equivalence which sets which uh um

1:55:33entries came under which uh assumptions

1:55:36that the LLM made for itself and then we

1:55:39accept or ask the user to clear out the

1:55:42ambiguity or abstain from implementing

1:55:44that in the codebase.

1:55:51This is an example of asking the human

1:55:55um what you want to do with that spec

1:55:59rule that was um perhaps contradicting.

1:56:02remove the record is very a very vague

1:56:04statement. The LLM cannot can interpret

1:56:07anything it wants but we shouldn't allow

1:56:09that to happen and we either give two

1:56:12options we keep it as is the record is

1:56:14deleted or we retain it and but hide it

1:56:17from the users which one does the user.

1:56:23Um

1:56:25a conflict is when the examples we

1:56:27example we saw rule one it's conflicting

1:56:29with rule three and a gap is where no

1:56:32rule covers an idle order in this

1:56:35example where the LLM detected an actual

1:56:39sorry

1:56:41process or pipeline detected there's no

1:56:44um entry for this rule where you are

1:56:47missing something

1:56:52all in Well, it cannot do a lot of

1:56:54things. End of the day, we want to make

1:56:58sure there is no oracle uh for for

1:57:01specification correctness other than the

1:57:03user. User needs to make sure to check

1:57:06every part of the snippet part of the

1:57:09rule book before sending it to the LLM.

1:57:11And um we as a tool only can help them

1:57:17and the user is more important here

1:57:20because of implicit domain knowledge.

1:57:22The LLM doesn't know a lot of domain

1:57:24knowledge and there's no guarantee I

1:57:26mean LLM only uh user can give that

1:57:30guarantee right and there's thin

1:57:32evidence right now for formalization and

1:57:34how it can be used in agents we are

1:57:36emerging in this technology

1:57:42what do we take back from this um talk

1:57:46check the spec always before you pass it

1:57:48down to the agent uh cluster the

1:57:51translation We what we do is we cluster

1:57:53the translation by logical equivalent to

1:57:57determine the different LLM

1:57:59interpretations and where it's genuinely

1:58:01going wrong. The LLM translates the

1:58:04solver checks and the human decide. We

1:58:07give give the human uh options and if

1:58:10there's no answer to that we use LLM

1:58:13judges or abstain from implementing that

1:58:15piece.

1:58:18Here are the references and um this work

1:58:21has been majorly contributed by my team

1:58:24um Anda Jin, Stefan, Nia and Delmos. You

1:58:28can check out their blog in the website

1:58:30link provided and um del deeper into

1:58:34this. Thank you.