I trained a model for 11.5 hours and it learned to copy, not write

I trained a model for eleven and a half hours and it looked excellent. Validation "accuracy" 76.6%, flatlined but high. The loss curve descended like a textbook. Top-5 accuracy 99.96%. By every number on the dashboard, the edit-head had learned its job.
It had learned to cheat.
This is post 1 of 7 in a series on training a small non-autoregressive model to edit real repository code, and on everything that went wrong on the way. Each post has a 30-second narrated video: watch this one here.
The bug
The trainer fed the model the answer as part of the question. In a next-token setup, the input at position j is supposed to be the token at j−1 — the model writes forward, one step behind its own output. Ours fed the gold token at j as the input at j. The attention mask happily let output position j look at input position j. The optimal solution to that puzzle is not generation. It is transcription.
A copier scores beautifully. 76.6% "decode accuracy" was just copy fidelity, failing only on rare codebook entries it had never seen in training. 99.96% top-5 was the answer sitting in the input, ranked first.
The tell we ignored
The metric was flat from the very first checkpoint — 76.6% at step 2,500, identical at step 11,300. A real learner does not plateau at its first exam. A copier does, exactly at its rare-code ceiling. We read a flat line as "converged" when it was actually "never started."
The catch
I wrote a demo script that decodes freely — no gold in the input, the model writing an edit from scratch. The copier produced 0 out of 8 correct, empty padding output, similarity 0.0. One probe, run in minutes, against eleven hours of reassuring dashboard. (The probe itself crashed twice on the way — a partial-prefix mask bug — and fixing that crash is what made me read the call chain and see the wiring.)
The fix and the guard
shift_right() — one function, now imported by the trainer, the eval, the overfit falsifier, and the generator, so they cannot disagree again. Every autoregressive trainer in this project now carries a free-decode probe in its eval: no gold in the input, ever. The rule that fell out of this, which I'd now carve into any trainer:
Teacher-forced metrics cannot distinguish copying from generation when the label is also an input. Any AR trainer must pass a free-decode check before its numbers mean anything.
What it cost, honestly
One GPU-night and the embarrassment of a dashboard that lied by telling the truth about the wrong question. The fix, regression tests, and ledger entry landed in one morning. And the falsifier ladder got its sharpest rung: the overfit test's final gate is now free decode — a 10-episode memorization run that passes by generating with no answer in sight (CE 0.0003, 10/10) is the only kind of pass that counts.
Every number above is from the run log and the failure ledger, both public in the repo: hr1juldey/Chintak.
Post 2 is the opposite disease: a model that took the exam blindfolded. Same grade.