◆  A. Lech Schiedam  51.92°N 4.39°E

Agentic
Compiler

A small language built around one rule: every program a model writes has to pass an independent checker before it is allowed to run.

Make hallucination a build failure

A language model writing code is confidently wrong in a way that looks exactly like being right. The usual answers are more review, more tests, more prompting — all of which ask a human to catch what the machine got wrong, at machine speed. That trade only gets worse.

So the premise here is different: don’t trust the generator, gate it. AGC is a small Lisp-shaped language whose programs are checked by an independent verifier — under 1,500 lines, standard library only — that reads the compiled binary plus a manifest and decides accept or reject from first principles. It never asks the compiler what it meant. If the program doesn’t hold up, it doesn’t build. Hallucination stops being a debugging problem and becomes a build error.

Verification turned out to be nearly free

The obvious objection is cost: surely all that verifying makes it far more expensive than just asking a frontier model. It did, at first — about eight times more expensive.

The current result is a 7B model, 4-bit quantised, running on my own machine, solving all 30 benchmark problems with every solution machine-verified, at roughly 1.06× the token cost of a frontier one-shot — which is inside the noise of how the two are counted. Reproduced across two consecutive runs. The frontier baseline solves the same 30, but nothing checks its answers.

The part I insist on writing down: four later training runs failed to beat that one. Every new bucket of training data broke something elsewhere in the benchmark. Those are in the repo as a chronicle of negative results, along with a list of things this work explicitly does not claim — the benchmark problems are small, the syntax is more verbose than Python, and none of it has been validated on a held-out set. A result you can only believe if you skip the caveats isn’t a result.

C# Custom verifier Qwen-Coder 7B LoRA fine-tuning 4-bit quantisation 30-problem benchmark

←  All work