Latch

Could a model reword a passage freely while every locked fact stays exactly the same (who did what to whom, the numbers, the dates) and could software prove it? I tried seven designs and two blind tests, and none did it reliably, so I stopped.

Made
Built with
Python, spaCy, a semantic role labelling model
Status
Concluded

The question

When a model writes text for you, it decides what varies. I wanted to flip that: write down a contract of the facts that must not move, let the wording change as much as it likes, and check every output against the contract.

The locked parts are the entities, the values and their operators (so "at least 40" can't turn into "about 40"), who acts on whom, scope, whether something must or may happen, and the order of events.

The question was whether that could be made materially more reliable than careful prompting alone.

How it works

It started as a generation harness. A contract goes to a model, which renders it many times, and a different model checks each rendering claim by claim. I used the models' command-line tools (Claude Code, Codex and Antigravity), not their APIs.

That harness produced the first surprise. When two models disagreed about whether a claim survived, I read every disagreement by hand. One model, acting as the checker, flagged about ten times as many false violations as the other. It even flagged the unmodified reference text itself. So the checking model's verdicts needed checking as well.

So the work became a verifier. Given a reference and a rewrite, it tries to prove each locked dimension was kept, or prove it wasn't. When it can't prove either, it says so and abstains. Abstaining is allowed. The failure I was trying to prevent is a confident wrong "yes".

How I tested it

I froze the rules first. The metrics, gates and datasets were fixed and checksummed before any design was scored, and no design was patched after seeing its own results. Every fix became a new design, scored separately, and each design changed exactly one thing from the one before, so every result has a single cause.

The main number is the false-accept rate: of the rewrites that broke a locked fact, the share the verifier passed. The gate applied to the upper end of the rate's 95% Wilson interval, not the point estimate, and it had to be 1% or lower. A second gate required at least 70% of cases to be decided correctly, so abstaining on everything couldn't pass.

There were 440 cases in three rounds of my own holdout sets, and 3,200 sampled from HANS and PAWS, two public benchmarks built to trick language models. Later I built two blind sets of 900 cases each, set in two fictional domains the verifier had never seen.

The ladder

DesignWhat changedFalse accepts
ADeterministic checks for entities, values and negation24.4%
B+ dependency parsing, to catch swapped rolesnot kept
CA + semantic role labelling (in place of B)28.9%
C2Same model, stricter rule for combining evidence3.0%
C2 v2Three general bug fixes1.0%
C3Scope judged by meaning, not by category names0.67% blind
C3The same design, second blind set1.34% blind
C4Every declared dimension must be proven5.9–7.0% blind

Rows A to C2 v2 are measured on my holdout sets. Rows marked "blind" are measured on the unseen sets. Design B fixed the templated role swaps in HANS but barely changed results on real prose. It also added twelve new false rejections, so it didn't earn its place.

The biggest single lesson is the jump from C to C2. The model and the representation were identical; only the rule for combining evidence changed. Under C2, the deterministic checks could reject a rewrite on their own but never accept one on their own, and every locked dimension needed positive proof. False accepts fell about tenfold. Here the rule for combining evidence mattered more than the choice of representation.

7designs, one change at a time
5,440test cases, 1,800 of them blind
0.67%best false-accept rate, first blind set
1.34%on the second blind set, over the bar

What didn't work

No design cleared the safety gate on any test set. C2 v2 hit 1.0% on my holdouts, but the upper end of its interval was 3.55%.

Almost none of the first blind test counted. The verifier decided what was in scope by matching category names from my own benchmarks, so only 25 of 900 blind cases counted. C3 replaced that with a check based on meaning, and scope then generalised cleanly, to 895 of 900.

The best result didn't repeat. C3's 0.67% on the first blind set was the best number the project produced. On the second, independent set it was 1.34%, with an upper bound of 2.62%. Every miss traced to a limitation I had already written down: sentences built on "is", phrases about location and manner (which weren't checked), a missing check on which way a limit points ("at least" against "at most"), and pronouns that refer back to something earlier.

The last fix made it worse. C4 fixed exactly the case that motivated it, but it credited a dimension as proven when any single matching role proved it. False accepts rose four to five times, mostly on the cases that matter most.

Coverage never came close. Being careful meant abstaining on most cases, and the best designs decided roughly 30 to 48% of cases correctly, against a bar of 70%. And the model behind every good result was licensed for research only, so even a passing score couldn't have shipped as it was.

Three designs in a row fixed the problem they targeted and exposed a new, equally serious one a layer deeper. I don't read that as progress towards a working system, so I stopped and didn't build C5.

Worth keeping

Reopening it

I'd reopen it only if something new turns up, such as a much better way to represent who does what to whom, or a way to prove preservation without recreating the evidence-combining problem that sank C4. I won't reopen it out of an obligation to finish what I started.