Want a quick email when a new article is published? Subscribe
AI wrote it. But is it right?
Among professional developers surveyed, use of AI tools in the development process rose from 44.2% in 2023 to 80.8% in 2025.
Among respondents who used AI tools, the proportion who highly or somewhat trusted the accuracy of their output fell from 46.3% in 2023 to 38.4% in 2025.
The most experienced developers, those with 21 years or more, also declined, from 43.2% in 2023 to 37.3% in 2025, a change of 5.9 points.
Language models wrote those three sentences, word for word, from real results computed from Stack Overflow’s developer survey. Every number in them is correct. But the third sentence isn’t supported by the data.
This is part of a bigger question: how far can we rely on what AI produces, and how do we check it before we use it? This article looks at one answer, through an AI-written report on that public dataset.
So what went wrong here?
In 2023 and 2024 the survey asked “How many years of working experience do you have?”. In 2025 it asked “How many years of professional work experience do you have?”. Someone with 25 years of working life, ten of them before they wrote code for a living, was in the “21 years or more” group in 2023 and may not be in 2025. The two figures describe different groups of people, so the 5.9-point fall could be real, or it could be the question. Nobody can tell from these numbers. (The sentence also says “developers” when it can only speak for the people who answered an opt-in survey, but that is the smaller problem.)
The third sentence as the validator saw it. The validator stopped it because the experience question changed, and the writer rewrote it to compare 2023 with 2024, when the question was the same. Select it for the full screen.
Checking the numbers is not enough
Few readers would catch the problem, and nor would most automated checks. The usual guard for a model writing about data is grounding: make sure every figure in the text matches a figure in the source. All three sentences pass that check. The mistake in the third one is in the words around the numbers: what is being compared with what, and whether the comparison is fair.
The same problem turns up anywhere a model writes about numbers: financial reporting, product analytics, operational dashboards.
Wrong conclusions from right numbers come in a handful of recurring shapes:
- a change described as a fall when it is within the noise (“trust fell in New Zealand”, from 34.5% to 34.0%, p = 0.93);
- a confident claim about a group too small to say anything about (Estonia, 56 respondents one year and 49 the next);
- a ranking that the gap to second place doesn’t support;
- a comparison across years where the question changed, as above;
- “developers” when the data covers only the developers who answered;
- “experience drives distrust”, when a survey taken at one moment can show that two things go together but never that one causes the other.
None of these needs a statistician to spot once someone points it out. All of them get past a numbers-only check.
Let code judge the claims
I wanted a check that looked at claims rather than just numbers, deterministically, without asking another model for the verdict. So I built a proof of concept: a brief goes in, a report narrative comes out, and every sentence is tested against the data before anything is published.
The design rests on keeping three jobs apart.
- Code computes the results. An engine with no model in it reads the survey and produces every proportion, base, 95% interval and year-on-year test, each as a cell with a stable, readable ID such as
trust.professional.country=uk.2025. It also decides whether two years are comparable, by checking the wording of each question and its answer options year by year. The model never sees a respondent’s row. - A model writes. It gets the result tables and cites cell IDs instead of typing figures. Code renders each figure from the cell it cites, and any number the model types for itself must match a cited cell or the sentence fails. What the model can still get wrong is what it says about a figure.
- Code judges. Two cheaper models from different families read each sentence back into fields: what it compares, which direction it claims, how strongly it is worded, whether it claims a cause. Then a deterministic validator applies nine written rules to those fields and the cells the sentence cites. If the two readers disagree in a way that changes the verdict, a person decides.
The nine rules are in plain words in a config file: cites its evidence, numbers trace to a result, direction matches the data, wording no stronger than the evidence, ranking matches the data, enough respondents, comparison is like for like, scope matches the sample, no causal claims. Each has an example of a sentence it would stop.
The writer can rewrite a failed sentence up to twice, and the validator checks each rewrite again. Then the system decides: publish, publish with claims softened, or route to a human. It routes when the expected cost of a wrong claim reaching a reader outweighs the cost of a person reviewing it.
The eight steps. The dark steps are code with no model in them; the outlined steps use a language model.
39 stopped sentences, every number right
The clearest test was a brief written to invite trouble: a newsletter piece on trust in AI tools by country and by experience, run with a writer prompt that asks for a journalist’s punch. Over five runs, a numbers-only check would have published every report, and the validator stopped every one and sent it to a person. Across ten runs of that writer on two briefs, it stopped 39 sentences in first drafts. Every one of them had correct numbers and would have passed the numbers-only check.
The same report under the full validator, which routes it to a person, and under the numbers-only check, which publishes it. Select either for the full screen.
Some sentences can be read two ways. One model wrote: “Respondents in India stood apart, with trust at 60.9% in 2025, little changed from 62.1% in 2023.” One of the two readers took that as a claim that trust fell slightly, which the data doesn’t support (p = 0.46). The other took it as a claim that trust held steady, which is fine. The verdict depends on the reading, so the sentence goes to a person.
Here is one where the engine refuses outright. The 2026 survey reports 22.8% trust against 38.4% in 2025, which reads like a collapse. But in 2026 the survey changed both the trust question and the way it identified professional developers. The engine marks the comparison as not like for like, and no sentence resting on it can pass.
A report takes 10 to 90 seconds and costs a few cents at most in model calls. Every stage, model, token count, timing and cost is on screen, measured in that run.
How it was built
Claude Code built it from my written spec, working through requirements cards on a Kanban board. Each card had its definition of done before work started. A gate (lint, types, more than 400 tests) ran on every commit, and a second agent verified the work for each card against its definition before it was merged. The decision log has 26 entries, one for each time I corrected or overruled a choice the build made. Several of the best changes came from that log.
The data is public: Stack Overflow’s developer survey for 2023 to 2026, under the Open Database License. The statistics are deliberately plain (Wilson intervals, a two-proportion z test at 5%, a minimum of 100 respondents) and written in a few lines of Python each, so each one can be checked. All model calls are routed through a common layer, and the page lets you pick each stage’s model from a configured list.
Testing a checker without fooling yourself takes some care. A model family that none of the writers use wrote the test set, and code planted the faults, so the labels come from the planting, not from the validator. The validator stopped all 60 planted faults, 95% of them with the rule meant to catch them; the numbers-only check caught 3%. I also read 20 real claims myself, blind to the validator’s verdict, and answered four plain questions about each one’s wording, to check the one place a model’s judgement sits inside the validator.
Strict is easy. Useful takes the time
The first working version stopped nearly everything, and every reason it gave was correct. Most of the work after that went into deciding what should get through.
A sentence’s own caveat counted for nothing. A writer that said “Estonia’s 2025 base of 57 is thin, so comparisons should be treated cautiously” still failed the minimum-base rule, because the rule saw a cell under 100 and stopped. Now a thin figure passes, with a caveat, if the sentence states its base, uses cautious words and claims nothing strong from it.
Every headline failed, because headlines summarise in words and cite nothing. So the headline is the one sentence a model judges: a separate model, from a different family, in a clean context, decides whether it follows from the report.
When I gave the writer every rule in plain words, it passed, by writing one group’s figures per sentence: the UK fell this much, the US that much, India this much. Code could have written that. So the prompt now asks the careful writer for synthesis (what every group did, which one stands apart), and the check also says whether a report reads as analysis or as a list. Both fixes were to the prompts, not the rules.
Another, separate LLM looked at a screenshot and noticed that the page showed a fall from 46.3% to 38.4% as 8.0 points. The engine had subtracted the unrounded values. Its arithmetic was correct, but it would have made every reader stop and do the sum. The page now shows each change as the difference of the two figures as displayed.
Some of it still looks pedantic. The rule that stops most first drafts is scope: write “developers surveyed”, not “developers”. In an opt-in survey that is the right call, though I expect it is the rule people will argue with first.
Conclusion
You can do deterministic evaluations against non-deterministic results. Or put another way, you can verify LLM output in code you can reason about. With a good harness, you can readily build such a system, but you need to tune it to make sure it’s catching what you want caught, whilst letting through what should pass. It’s an effective way to achieve a much higher level of trust in an AI system.
Share this article
Comments
Leave a Comment
All comments are moderated and may take a short while to appear.
Loading comments...