Is “Wish-Based” LLM Coding Reliable? A Contradiction Test
A reproducible multi-round test of LLM coding agents on conflicting facts shows strong generation but unstable reliability. This article covers the experiment, root causes, and engineering practices for safer use.
1. Background: When “wish-based programming” meets production
Over the past two years, LLM-powered coding tools have moved from autocomplete to conversational generation and agent-driven execution. Developers can often state a goal in natural language and get runnable code. That lowers the barrier and can raise productivity.
A practical question remains: can you trust the answer as-is? In work that depends on precise facts—latest pricing, consistency between announcements and docs—does the model notice contradictions and refuse to invent, or does it paper over conflicts?
This article records a real multi-round test, the reliability gaps it exposed, and practices that help in engineering settings.
2. Experiment: a reproducible reliability case
2.1 Task design
The task was built around conflicting information: an agent-backed coding tool was asked to look up a service’s announcement and price list.
- The announcement was outdated and directly conflicted with the price-list page.
- A sound model should flag the conflict, ask the user, or at least say sources disagree.
- The failure mode is to ignore the conflict and answer confidently from the stale announcement.
This tests lower-bound stability, not peak skill—the line between demo and production.
2.2 Method
Controls:
- Model comparison: two generations of a primary model, same prompt, 30 runs each.
- Vendor check: the same model via official API and a third-party channel, matching fingerprints, to rule out “wrapper” quality drops.
- Objective error: the only criterion was whether the model ignored the announcement vs. price-list conflict.
3. Results: capable, but unstable
In 30-run stats, the older model’s high-reasoning setting erred about 60% of the time; the newer model erred once in 30. That looks like a large generational gain.
Follow-up the same evening on the newer model failed twice in two tries, with the same pattern: skip the conflict, answer from stale data.
The deeper issue is output uncertainty. Same prompt and context, morning vs. evening behaved like different systems. Even a low average error rate does not make a single answer trustworthy.
3.1 “Smart” is not the same as “usable”
Two abilities:
- Generation: structure, logic, fluency of code.
- Epistemic reliability: knowing what it does not know; being cautious when facts conflict.
Generation was often strong and cost-effective; flashes of speed were impressive. Weak reliability still increases cognitive load. A typical developer reaction:
“It does not feel like AI is doing the work. It feels like I am teaching it, and I have to watch for factual landmines.”
If every output must be doubted and checked line by line, efficiency gains disappear.
4. Likely causes
- Implicit ranking of retrieved text: models often prefer earlier, more prominent, or more “authoritative” wording. An outdated announcement at the front of context can override a later price list.
- Preference for fluent generation: LLMs optimize for smooth text. Ignoring a conflict and giving a clean answer can be the easier path; calling out contradiction costs extra reasoning.
- No default self-check: without an explicit instruction or pipeline step, models often skip consistency checks across sources.
- Sampling randomness: temperature and sampling explain “right in the morning, wrong at night” and error-rate swings in small samples.
5. Engineering practices under unstable models
Until models are consistently reliable, process matters.
5.1 Evaluate with many runs, not one demo
Use repeatable batches: at least 20–30 runs of the same task, track error rate and error patterns. Script it if needed:
results = [run_task(prompt) for _ in range(30)]error_rate = sum(not check_consistency(r) for r in results) / len(results)
5.2 Prompt for contradiction detection
Add an explicit rule: if sources conflict, state the conflict and each source’s claim first; do not conclude immediately. That tends to make conflict handling more cautious.
5.3 Deterministic path for critical facts
For billing, config, version numbers, and similar, fetch from official docs APIs or structured sources. Treat model text as a hint, not evidence.
5.4 Validate outputs in the pipeline
In CI/CD or agent flows, add checks: tests on generated code, source backtracking for factual claims. Convert “trust” into “verification cost” and let systems cover model uncertainty.
5.5 Trust by risk level
- Lower risk (scripts, prototypes, refactor suggestions): use freely for cost/speed.
- Higher risk (production commits, user-facing facts): require human review and automated checks.
6. Closing
Calling out failures is not a dismissal. Error rates moving from ~60% toward single digits is real progress. Community complaints are often a form of “we want this to get better.”
An ideal model is not one that never errs, but one that does not bluff: high confidence when sure, and an honest “I need more information” when not. Until then, take the productivity of AI coding tools and keep verifying every output. Wishes can compile in one shot; verification should not be skipped.
