The problem
The common agent pipeline has a model answer a task, a second call to the same model check the answer, and a
retry on a no. The checker sounds the same whether it is right or wrong, it costs as much as the answer, and
when it is wrong the same way as the worker, nothing catches either. On a small local model, the kind a team
runs for privacy or cost, that step let through 68 percent wrong answers in my benchmark while spending
most of the tokens.
Why it is hard
- A checker that can guess is not a checker. Asking a model "is this correct" produces a confident
word, not a verification.
- Hand-written checks become code nobody reviews. A page of regular expressions in a script is not
something a product owner approves.
- No answer is a valid answer. Most pipelines cannot say "I do not know"; they hand over the last
attempt as if it had been checked.
- The cost has to be counted in the AI's own unit. A check that saves nothing per correct answer is
not worth having, whatever it catches.
What it does
- Every line is a relation, never an assignment.
a = w * h binds three names, and a block
holding it can be asked for any one of them: forward or backward, the direction is chosen when you ask.
- Logic is arithmetic over 0 and 1. A gate is a truth table of facts: a regular expression, a JSON
shape, "every number in the answer occurs in the input", "every date occurs in the input, however it was
written".
pass = shape * fields * sourced is AND, and it reads as a sentence.
- The edges are values, not errors. Division by zero gives
refuse; inverting a square gives
fork {3, -3}, which only a decide can turn into a value; after 3: stop and
within 60 tokens: stop cap every loop.
- Every rule carries its label and its source, or it does not parse. The fact ledger is generated from
the program, not written beside it.
- The token is the unit of account. Every check reports the tokens it read and the running total; the
measure of the whole stack, tokens per correct answer, is a relation like any other and reads backward: a
budget gives the number of answers it buys.
- A gate server answers over pipes so a pipeline in any language can call it hundreds of times with no
model call; a browser demo runs the same gate in the page with nothing sent anywhere.
The proof
Same model, same tasks, same prompts, same retry wording. Design B is the common pipeline, a model checking a
model. Design R is identical except the checker is a page of gate rules, and after three refusals it gives no
answer instead of handing over the last try. Forty held-out tasks (classify, extract, calculate, format), three
seeds. The pass bars were written into the plan before the run.
- llama3.2:3b, held-out: the model-checks-model pipeline was right 31.7 percent, wrong 68.3 percent,
at 2,749 tokens per correct answer. With the gate: right 49.2 percent, wrong 4.2 percent, no answer 46.7
percent, at 607 tokens per correct answer. Fewer wrong, more right, 4.5 times fewer tokens, against a bar
of 2. Pass.
- qwen2.5-coder:7b, held-out: the pipeline was right 68.3 percent, wrong 31.7 percent, at 520 tokens;
the gate was right 55.8 percent, wrong 11.7 percent, no answer 32.5 percent, at 468 tokens. Fewer wrong
again, but fewer right and only 1.1 times fewer tokens. Bar not met. Two reasons, read from the
rows: the stronger model's self-check says yes almost every time, so there was little cost to remove; and
a bug in my gate refused correct answers whose input wrote the month as a word. The bug is fixed and the
rerun is reported beside this result, not instead of it.
- The rerun with the fixed gate (labelled post hoc), held-out: on the 3B, right 60.0 percent, wrong 3.3,
no answer 36.7, at 464 tokens per correct answer, 5.9 times fewer than the pipeline. On the 7B, right 69.2
percent against the pipeline's 68.3, wrong 8.3 against 31.7, at 325 tokens against 520, 1.6 times fewer
against a bar of 2. So with the false refusals gone the gate beats the model checker on right and wrong
answers on both models; the token bar still fails on the 7B, and the 7B's remaining wrong answers are all
arithmetic in the right shape, which a shape gate cannot see and a relation that computes the sum would.
- The model answering in the language itself (the second experiment, one call each, same tasks):
on the 7B coding model, relation lines with sources were right 68.3 percent against prose 69.2 and a
Python program the model wrote 60.8, and wrong 0.0 percent against 30.8 and 39.2; on the arithmetic task
100 percent against prose at 0, because the model only read the figures and the rule did the sum. The
half that did not survive: the models could not hold the form unaided (3B a quarter of the time, 7B two
thirds, nearly every miss a right value with its source left off), and relations cost about 1.7 times
prose per correct answer. Never wrong, dearer than prose, not yet native.
- With the form forced by the model server and the language's own date relation (two post-hoc steps,
each labelled): the 7B coding model answering in relations with sources was right 79.2 percent against
prose's 69.2, wrong 0.0 percent against 30.8, at 1.4 times prose's tokens per correct answer; the 3B
matched prose on right answers with none wrong. What it still refuses is mostly the arithmetic task, where
the model cites the label as its source instead of the figure's own words; the values were right, the
citation was lazy, and a value whose stated source does not contain it is not a sourced value. The
"fewer tokens than prose" bar is the one still not met.
- The directive, handed to the model with nothing forcing its output: seven rules in front of the
task, the model free to write anything. The 7B coding model held the form unaided 97.5 percent of the time
and was right 87.5 percent with 1.7 percent wrong, against 69 right and 31 wrong answering plainly; the
two wrong answers were sentiment calls, which no source check can see. A seven-line version of the
directive bought 84.2 percent right at 39 percent of the token cost, and is the one to ship. The 3B model
could not use a directive at all and needs the form forced by the server. Bars and tables:
RESULTS-DIRECTIVE.md in the benchmark folder.
- Writing dense does not save tokens. The same relations in a terse form (each field a two-element
array) against the readable form: 42 percent fewer characters and no fewer output tokens, 44 against about
42 on the 7B, with slightly more wrong answers. Short for a person is not short for the model; brackets and
quotes are tokens too, and the values and sources cost the same in any spelling. A renderer that blooms the
terse form into readable lines and folds it back exactly was built and tested on 2,000 cases, and it has
nothing to save. The token saving has to come from saying fewer facts, not spelling them shorter.
- What the gate let through, on both models, was exactly what a shape-and-source check cannot see:
sentiment misjudged, arithmetic wrong in the right shape, a capitalised title. Judgment and computation,
which belong to a person or to a relation that computes.
- What it refused was mostly a correct JSON object wrapped in "Here's the output:", which the grader
would also have failed and which the pipeline passed as checked.
- The full answerer library that does the exact work in software and makes the model fill a shape was
run beside both: 97.5 percent right at 107 tokens on the 3B. The gate is one part of that design, now
written in a language anyone can read; it is not the whole of it.
- The language's own tests: 41 checks, and a mutation run that plants one bug at a time: 137 planted,
126 caught, the eleven survivors audited by hand as equivalent or unreachable. The first mutation run
found two real bugs and one bug in the mutation tool itself (a stale bytecode cache), all fixed.
- Five classic problems solved the same way, each with a specification as relations, a deterministic
gate and a solver in levels: Towers of Hanoi to a million moves, the travelling salesman exact to sixteen
cities, the dining philosophers model-checked across every reachable state, a Rubik's cube (eight-move
scrambles optimally, full scrambles by the established two-phase solver with our gate checking it), and
an Enigma message cracked without its key in 26 seconds. Every one runs at its textbook complexity; none
claims to be faster.
Technologies and skills
- Python 3, one small interpreter, sympy for reading a relation backward (several roots is a
fork, division by zero is a refusal, both for free).
- A deterministic mutation runner written for the purpose, because the Java harness had no Python
engine and the usual tool does not run natively on Windows.
- Ollama with llama3.2:3b and qwen2.5-coder:7b, local; Node for the benchmark runner; the
gate served over stdin and stdout so any language can call it.
- Vanilla JavaScript for the browser demo: the gate half of the language, ported and tested for parity
against the Python version on the same cases.
- AI-assisted engineering. I set the design, the rules, the bars and every check; the AI wrote and
tested the code under my direction, one step at a time, and told me when a bar was not met.
How it was built: one day, from my prompts
Built on 21 November 2026 in one directed session. The order below is the order I gave it. Everything on this
page was run before it was written down.
- "We want a programming language for AI that can be pure mathematics but contains logic. A truth table, a
circuit, a deterministic graph, a decision tree, and regex can be used to quickly search."
- "Plus you have all the mathematical operators and algebra."
- "It should be very stable."
- "I would like to see something written that actually does some kind of computation, something normally
complex, where it goes through like butter."
- "Then use TestThisPuppy to check, because it's not human readable."
- "Since we are dealing with AI and AI uses tokens, the token is the unit. Using AI's own unit as a basis for
the program."
- "Your verdict." Then: "OK, let's do it." (The benchmark, with the bars written first.)
- "Solve the travelling salesman, dining philosophers, towers of Hanoi, Rubik's cube, and crack the Enigma
code with the algorithm used with this new way of coding." Then: "Report with results and big-O of each,
whether it matches what is already established, and whether that should have been possible on a simple
laptop."
- "The question really is not speed, it is AI reliability with using a native AI language as opposed to a
traditional programming language. And less tokens." (A second experiment, running as this page goes up.)
- "Is this a product?" Then: "OK, let's make something I can demonstrate." Then: "Put it in the same thing
as TestThisPuppy on butterflyfx.us."
What it does not claim
- It is the checker's language and the specification's language, not a language for a model to write
programs in; models are fluent in the languages they were trained on.
- The token saving is a small-model result. On the 7B model it shrank to a tenth; the wrong-answer cut is
what held on both.
- One machine, two models, tasks written by the same person who wrote the gate; the held-out set is the
guard, and a benchmark written by someone else is the next step.
- No speed claim anywhere. The five classic problems run at their established complexity.
68 → 4%wrong answers, 3B model, held-out
4.5×fewer tokens per correct answer (bar: 2)
126/137planted bugs caught by the tests
1bar not met, reported as it is