The model never sees the board
In my chess tutor, engines own every fact and a model only words them. A checker stops invented squares; only the facts can stop false relations.
By Nelson D’Souza · · 14 min read
- LLM
- Grounding
- Verification
- Chess
In this note
- Let a capable model explain
- What broke, before anything was built
- Why fluent and wrong go together
- The split: tools own facts, the model owns wording
- Watch: phrasing, checked anyway
- Dropping the sentence
- Reasoning off
- Questions about empty squares
- The checker, and proving it checks something
- False sentences made of true facts
- Labels aren't facts either
- What the split costs
- Back to the Two Knights
My chess tutor has one rule: every sentence it says has to be true about the board the student is looking at. A grounding checker enforces part of that. It stops a language model from inventing a square, a move or a number. It can’t stop the model from combining true tokens into a false relation, and that second failure kept arriving after the first was closed. Five times, the fix went into the facts.
The tutor is Socratic, built for a student rated about 1000. It asks questions about the position on screen, explains what a move cost, and narrates famous games. The rule sounds like a prompt instruction. It turned out to be an architecture, in which engines own every fact and the model only words them.
Let a capable model explain#
Language models are good at chess talk. They’ve read a great many annotated games, and a capable open model can talk about openings convincingly. So the obvious design is to give a capable model the position and ask it the tutor’s questions. Prompt it to be careful, perhaps add a few examples, and let it explain.
Before building it, I measured it.
What broke, before anything was built#
I gave Qwen3.8-27B, a local open model, the position after 1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Ng5 d5 5.exd5 Nxd5. That’s a well-known line of the Two Knights Defence, the doorway to the Fried Liver Attack. I asked it three questions.
| Asked | It answered | Truth |
|---|---|---|
| White’s best reply | O-O | 6.Nxf7 or 6.d4 |
| The tactical point | “the knight on g5 can be captured by Black’s queen” | Not the point: the queen attacks g5, but it’s White to move |
| Black’s improvement | 5...Nxe4 | Nothing to capture: the pawn left e4 on move 5. Correct is 5...Na5 |
Three wrong out of three: a poor move recommended as best, Black’s threat offered as White’s tactic, and a capture of a pawn that was no longer there. All three came out fluently.
That’s three questions on one position. It isn’t an eval, and I’m not presenting it as an error rate. It was a go/no-go probe, and it only had to answer one question: can this model be trusted to establish chess facts for a student? It can’t. A 1000-rated player can’t tell from the notation that there’s nothing on e4 to take, which is exactly why they need a tutor.
The same probe had a second half. I gave the same model a bundle of verified engine facts about the position and asked it to write a Socratic question. In seven seconds it wrote a correct question and follow-up, adding nothing false.
So the model is a poor analyst and a good writer. The design follows from that.
Why fluent and wrong go together#
A language model completes text. Given a chess position as text, it produces the kind of sentence that tends to follow positions like it in its training data. Models can learn a rough internal picture of a board, but nothing in generation checks that picture against the rules. “The knight on g5 can be captured by Black’s queen” is a very chess-shaped sentence, and it’s even true of the board: the queen on d8 does attack g5. But it’s White to move, and the question was about White’s tactic. Nothing in the generation process asks whose move it is or what the question was really about. 5...Nxe4 is the same failure without the luck: a chess-shaped move, and nothing checked that there was still a pawn on e4.
Fluency makes this worse. A visibly confused answer would teach the student to doubt the tutor. A confident, well-formed wrong answer teaches them something false and leaves no trace. The weaker the reader, the less visible the error, and a tutor’s readers are beginners by definition.
So the useful question is which job this model can do, given how it fails.
The split: tools own facts, the model owns wording#
The rule the whole project is built on is one sentence in the README: Stockfish and python-chess establish every chess fact; a language model may phrase those facts and nothing else.
- Computed from the board contains Board (python-chess), Stockfish, Maia-2, Move facts, Concept detectors, Question templates, Licensed fact bundle.
- Board (python-chess) to Stockfish
- Board (python-chess) to Maia-2
- Stockfish to Move facts
- Maia-2 to Move facts
- Move facts to Concept detectors
- Concept detectors to Question templates
- Question templates to The student reads
- Move facts to Licensed fact bundle
- Licensed fact bundle to Model (wording only): “facts, no FEN”
- Model (wording only) to Checker
- Licensed fact bundle to Checker: “licence”
- Checker to The student reads: “pass: sentence”
- Checker to The student reads: “fail: facts only”
Each piece has a narrow job:
- Stockfish decides which moves are good and what they cost. Maia-2, a model trained on human games, predicts which moves a student at a given rating will actually reach for. Neither is enough alone: Stockfish has no model of the student, and Maia has no model of what is good.
- Coaching questions come from templates with machine-checkable trigger conditions. The model doesn’t decide what to ask.
- The student’s answers are squares, moves or counts. Never free text. Grading free text would need a model, and a model that grades can be wrong in exactly the way this design exists to prevent.
- The model never sees a FEN (the standard text encoding of a position), the game, or the board. It gets a list of facts and a question, and returns one or two sentences.
That last point does more work than it looks. The model can still name a square it wasn’t given, by echoing the student’s question or by guessing. But it has no board to have read it from, so a square outside the facts is unsupported by construction, and that’s checkable.
Watch: phrasing, checked anyway#
Watch is where this gets tested hardest. The student steps through a game, a famous one or their own, and can ask a question about any move: “why give up the knight here?” or “why can’t the king take the rook?”
- Student to Server: “why can't Kxd8?”
- Server to Stockfish: “analyse the move”
- Stockfish replies to Server: “lines and evals”
- Server, internally: “build the fact bundle”
- Server to Model: “question and facts, no FEN”
- Model replies to Server: “one or two sentences”
- Server, internally: “check every claim”
- Server replies to Student: “sentence or facts”
A fact in the bundle is a small object: the text the student sees as a chip, and the tokens that naming it permits.
@dataclass(frozen=True)
class Fact:
"""One thing that is true, and what naming it permits."""
text: str # shown to the student as a chip
tokens: tuple[str, ...] = () # what the sentence above may useThe bundle’s licence is the union of every fact’s tokens. A sentence may use a square, move, number or piece only if some fact licensed it. That introduces a licence-dilution tradeoff: larger fact bundles widen the union of licensed tokens, making cross-fact recombination easier to pass the checker.
Dropping the sentence#
When the checker finds a claim outside the licence, the sentence is dropped. It isn’t sent back for a rewrite. A rewrite would still be checked, so it wouldn’t be unsafe, but it’s the model correcting its own work: another few seconds for a sentence drawn from the same habits, when the facts it would paraphrase are already on screen. A refused sentence is replaced by the facts on their own, and the page says what was named that the facts did not contain. Facts alone are worse writing and the same information, and that’s a trade I’ll take every time.
The same fallback covers the model being absent. It runs on a llama.cpp server on my own machine; if that is down, Watch shows the facts and says so. Nothing else in the app depends on the model.
So why keep it, when the chips already carry the facts? A bundle can hold facts the question didn’t ask about. The prompt tells the model to use only the ones that answer the question and ignore the rest, and to turn those into a sentence a person would read. The chips are a list. The sentence is the answer to what the student asked.
Reasoning off#
Qwen3 is a reasoning model, and by default it thinks before answering. I measured both settings. With thinking on, an answer took 35 seconds and came back empty, because the token budget ran out inside the reasoning. With it off, the sentence arrived in 1.4 to 3.6 seconds. Watch can afford that. It is the only place the model runs, and a question there already waits for Stockfish. Stepping through the moves asks the server nothing, so the model’s seconds land on a wait the student chose by asking.
There’s nothing for it to reason about. The reasoning was done by Stockfish before the model was called. Thinking on bought latency and a new way to fail, and the sentence didn’t need anything it offered.
Temperature sits at 0.3, low but not zero. At zero, the same bundle produces the same sentence every time, which reads like a template and removes the only reason to have a model here at all. The checker is what lets me allow that variety.
Questions about empty squares#
Students ask about pieces that are not there. They are looking at move ten and remembering move twelve. A plain pipeline handles that badly: the question names a square, the model repeats it, the square is in no fact, and the sentence is dropped. The student is told the written answer was refused, which is true, unhelpful, and about the machinery.
So the server also reports, from the board, which squares the question names that have nothing on them. The page can then answer with that fact instead of only a refusal. It’s checked against the position after the move, because that’s the board on screen. That distinction comes back later.
The checker, and proving it checks something#
The checker is deliberately dumb. Regular expressions pull out every move in algebraic notation, every square, number and piece name, and each one is compared against the licence. Anything else in the sentence passes unread.
- The model's sentence to Extract claims: moves, squares, numbers, pieces
- Extract claims: moves, squares, numbers, pieces to What kind of claim?
- What kind of claim? to Exact match against the licence: “square, move, piece”
- What kind of claim? to Compare by numeric value: “number”
- Exact match against the licence to Every claim licensed?
- Compare by numeric value to Every claim licensed?
- Every claim licensed? to Show the sentence: “yes”
- Every claim licensed? to Drop it; show the facts and what it named: “no”
A checker can fail in two directions. It can pass what it should stop, or stop what is true. Two details in this one were found by running it and by breaking it on purpose.
Numbers are compared by value. The first failure was the strict kind. The first version compared tokens as text. A fact reading “Nf6 lost 8%” licensed the string “8”. The model wrote “8.0%”, and a perfectly grounded answer was dropped. I found it by running a walkthrough script and reading what it printed: “The written answer named 8.0, which is not in the facts.” The check was working exactly as written, and the sentence was true.
Numbers are now parsed and compared numerically. Squares, moves and pieces stay exact, because they have no equivalent ambiguity: d4 and d5 are different squares however you spell them. Loosening a checker can quietly stop it checking, so I bounded the loosening with mutation testing: deliberately break a piece of the checker and confirm some test fails. A version that lets any number through breaks two tests.
One line was deleted because nothing could break it. Disabling the square pass broke tests. Disabling the piece pass broke tests. A third line, which removed each matched move’s text before scanning for bare squares, broke nothing. It existed so that “Rxd4” would not also count as a claim about the square d4. But the square pattern has a word boundary, and the d in “Rxd4” follows a word character, so the pattern never matched there anyway. The line was doing no work, so I deleted it.
A line whose removal breaks nothing is either redundant or untested. This one was redundant, and keeping it would have told the next reader a guarantee lived there.
There is one more guard. An empty answer is treated as unavailable, because an empty string contains no unlicensed claims, so without that line the checker would report success on nothing at all.
False sentences made of true facts#
The checker stopped invented squares, moves, numbers and piece names from shipping. Containment is necessary, and it’s a proxy. Token containment stands in for truth, and the two come apart wherever a sentence relates tokens rather than names them. The failures in that gap are the most useful part of this project.
The first one came from the Opera Game, Morphy’s famous short win. At the final position, Watch was asked “why can the king not take the rook?” and answered “The rook is defended on a2.”
The mating rook is on d8. It is defended, by the bishop on g5, so half the sentence was right, by luck: nothing in the facts said so. The other half put the rook on the wrong side of the board. And the checker passed it, correctly, because “a2” and “rook” were both licensed.
A concept detector, left_piece_loose, had fired because a pawn was left undefended on a2. Its concept is titled “Keeping pieces defended”. The bundle rendered that as a fact reading keeping pieces defended on a2. The model did what any writer would do with that fragment and turned it into a claim that something was defended on a2. The lesson’s name was the opposite of what the detector had found.
- A true fact, missing a relation to The writer infers the relation
- The writer infers the relation to Every token licensed?
- Every token licensed? to A false sentence ships: “yes”
- Every token licensed? to Dropped: “no”
- A false sentence ships to Put the relation into the fact: “the remedy”
- Put the relation into the fact to A true fact, missing a relation: “next time”
Once I knew to look, it kept recurring:
| What the student read | The true fact underneath | What was missing |
|---|---|---|
| “The rook is defended on a2” | a concept titled “Keeping pieces defended” fired at a2 | that a title names a topic, not a claim |
| “Black can take the undefended knight on c3 and the undefended queen on b6” (Fischer, 17…Be6) | both pieces could be won | colour: both were Black’s own |
| “The knight on b5 is undefended, making the capture Nxb5 the best move” (Morphy, 10.Nxb5) | the knight could be won after the move | before or after: that was the cost of the sacrifice, not its reason |
| “Black to move at move 11”, under a board showing White to move at move 12 | it was Black to move, before the move | which position the fact described |
| A review suggesting “Bxd7+ instead” of Morphy’s Bxd7+ | the move lost ground | that it was still the best move |
Each fix put the missing relation into the fact instead of asking the writer to infer it:
- Concepts are quoted as topics. A fact now reads
the lesson named "Keeping pieces defended" applies here, which claims nothing about what is defended. The system prompt has a rule saying what a quoted lesson name means, with that sentence as its example—an instruction in the prompt, softer than code enforcement. - Facts name colour. A piece that is the mover’s own says it was left undefended.
- There are two positions. Facts about the move (what was played, whether it was best, the engine’s line) come from the position before it. Facts about the position (whose turn it is, which pieces are pinned, which pieces a sentence may name) come from the board on screen, which is the position after. The old version could never report a pin created by the move, which was the case the pin facts were added for. Its test passed because it asked about the next move, by which point the pin existed in both positions.
- Losing ground isn’t an error. In a position resolving by force, the engine’s own first choice can drop 19 points of win percentage. When the played move is the best move, there is nothing to revisit. The coach’s remarks now hold an invariant, checked across every kind of remark: a remark that names an improvement names a different move from the one played.
Checking those rows against the board for this write-up turned up the same shape one level down. A fact says a piece is “undefended” whenever the detector found it can be won: either nothing defends it or something cheaper attacks it. Fischer’s queen on b6 was defended by the pawn on a7, and Morphy’s knight on b5 by his queen and bishop. Both could be won, and neither was undefended. The writer had repeated the fact’s own word.
The containment checker answers “did the writer invent a token?” It can’t answer “did the writer combine true tokens into a false relation?” Putting the relation into the fact makes the true sentence the easy one to write. It doesn’t make the false one impossible. Nothing checks the relation itself, so a sentence built from licensed pieces can still relate them wrongly.
Labels aren’t facts either#
The same rule turned up where no model was involved, which convinced me the problem is grounding in closed-vocabulary domains backed by a deterministic fact oracle (like chess or arithmetic). Language models are only one place it shows up.
The tutor has a puzzle mode built on the Lichess puzzle database. Each puzzle stores one solution line. Then a mate-in-one turned up with four mates on the board. The corpus had recorded one. A student who played any of the other three was told “Not quite”, with the corpus’s move drawn on the board in the best-move colour as though theirs had been the error.
“Mate in one” is satisfied by any mate. The recorded line was a label someone attached to the position; the board was the fact. The fix reads the board: a move that ends the game completes the drill, including a mate found partway through a line the corpus recorded as longer. Nothing reads the puzzle’s “mate in one” theme tag.
Mate is also the one place where accepting a move off the recorded line is safe. Anywhere else, the opponent’s scripted reply was written for a position that no longer exists, and the puzzle would carry on describing a game nobody played. After mate there’s no reply to script, and the recorded one must not be played: it would be an illegal move in a finished game.
A puzzle label, a concept title and a fact computed from the wrong position are each a true statement about something next to the board, presented as a statement about the board.
What the split costs#
The writing is plainer. A model allowed to range freely would produce livelier commentary. The checker drops sentences a human editor would let through, and some days the student sees chips instead of prose. I accept that, because the cost of a wrong sentence to a learner is far higher than the cost of a dull one.
The fact layer is where the work goes. Every new kind of explanation needs new facts, with their tokens and relations, before the model can say anything about it. The model saves writing effort and none of the chess.
The checker checks vocabulary, not reasoning. A sentence built from licensed pieces can still say something silly about them. That’s why the facts are always shown under the sentence, so the student can see exactly what it was built from.
More cases will come. I found the five cases in the table by using the product and reading what it said. The facts no longer call a defended piece “undefended”. There will be more. What has changed is that I know where to look: a relation the fact doesn’t state, or states more strongly than the detector found it.
Back to the Two Knights#
Return to the position this started with, after 5...Nxd5, and ask the tutor what Black should have done instead. The model isn’t asked. Stockfish finds 5...Na5, python-chess confirms it’s legal, and the fact bundle says so in a chip. If the model then writes a sentence about it, the checker reads that sentence against the bundle. 5...Nxe4 can’t reach the student, because no fact licenses it. The queen sentence is the harder case. Every claim in it is true of the board, and it still answers the wrong question, which is the kind of error only the fact can prevent.
So facts have to carry their relations as well as their atoms: whose piece, which position, cost or reason, topic or claim. Every new kind of explanation starts with the fact, and the sentence comes last. In Watch, the checker enforces vocabulary at runtime against Stockfish and python-chess, though aggregate Watch drop-rate telemetry has not yet been published.
Built in: Chess Tutor