Skip to content

Record the repair fixed-point stop as a measured negative - #6

Merged
asaptf merged 1 commit into
mainfrom
docs/repair-fixed-point-negative
Aug 13, 2026
Merged

Record the repair fixed-point stop as a measured negative#6
asaptf merged 1 commit into
mainfrom
docs/repair-fixed-point-negative

Conversation

@asaptf

@asaptf asaptf commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Implemented the optimisation proposed after the InvariantPolicy measurement, measured it, and it does not work. Recording it so it is not retried blind.

What was tried

Repair retries driven by the arithmetic invariant cost 47% wall clock (116s → 171s on 30 Factur-X documents, Qwen2.5-7B-4bit, temperature = 0) while producing identical field scores to the invariant-off run. So: if a repair attempt reproduces the previous attempt's raw output verbatim at temperature 0, the next prompt would be identical, a deterministic model cannot differ, and the loop can stop. Provable, not heuristic.

Result

It never fires. Zero files got faster on the same 30 documents — 169s → 167s, which is noise.

The mistake worth naming

The inference came from identical field scores, which are not identical raw output. The model varies formatting, ordering, and fields no metric scores, while the scored values land the same. A byte-identical fixed point does not occur, so a rule predicated on one is dead code.

Why it was not shipped anyway

The costs were real where the benefit was not: a source-breaking fourth associated value on ExtractionError.validationFailed (payload-binding switches stop compiling), a changed repair prompt, and eleven tests to maintain. Paying an API break for no measured gain is a bad trade.

Comparing decoded values instead of raw text would fire — but that is a heuristic rather than a proof, since the prompt genuinely differs between those attempts. This project spends its effort removing arbitrary decision rules, not adding them.

What transfers

The repair loop cannot fix arithmetic. The model re-derives the same numbers from the same document because it does not consider them wrong. The lever is not stopping more cleverly — it is not asking the model to do arithmetic at all. That is what InvariantPolicy.reportViolations provides, and why line items reconstructed from detected table geometry are the more promising direction.

Docs only.

…tive

Implemented and measured: the rule never fires. Identical field scores are not
identical raw output — the model varies formatting and unscored fields between
attempts while the scored values land the same, so a byte-identical fixed point
never occurs. Zero files got faster on the same 30 documents.

Names the inference error, and why the decoded-value variant is a heuristic we
decline rather than a proof.
@asaptf
asaptf merged commit 9c78286 into main Aug 13, 2026
2 of 3 checks passed
@asaptf
asaptf deleted the docs/repair-fixed-point-negative branch August 13, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant