Research / Repairing frozen models

CertiPatch: Specification Repair for Frozen Language Models with Replayable Empirical Certificates

Introduces CertiPatch, a train–certify–verify protocol that repairs frozen language models against deterministic specifications with gated low-rank patches and replayable empirical certificates, reaching zero failures on three enumerable specs.

Published
9 February 2026
Author
Ali Uyar
DOI
10.5281/zenodo.18541322
Code
github.com/aliuyar1234/certipatch

Abstract

We study specification repair for frozen language models: given a deterministic prompt family and a computable Yes/No labeler, learn an inference-time patch that enforces the specification within a certified scope while explicitly measuring collateral change. We present CertiPatch, a train–certify–verify protocol that (i) learns a gated low-rank hookpoint patch under a constraint-first objective (minimize collateral subject to zero in-scope violations), and (ii) emits a replayable empirical certificate with fail-closed verification semantics. In a reduced-compute, single-seed study on EleutherAI/pythia-410m-deduped, CertiPatch attains zero failures on three fully enumerable specs (COMPARE-2D: 0/10,000, PARITY-4D: 0/10,000, BALANCE-PAREN-14: 0/32,767) and achieves 86.22% pass rate (68,974/80,000) on a large-domain, coverage-bounded specification (COMPARE-6D-STRAT). Where baseline cells are available (PARITY-4D), CertiPatch closes the spec with substantially lower measured collateral (KL_S = 0.00168) than completed budget-matched PEFT baselines. We further provide a six-condition compositionality study showing that naive additive patch composition fails (e.g., 5,003 violations on spec B), while sequential and joint repair recover feasibility. All claims are explicitly scope-qualified: single seed, reduced compute, and incomplete baseline coverage where artifacts are missing.

Why it matters

Each repair comes with evidence that can be rerun: replaying the certificate recomputes hashes, regenerates datasets and re-evaluates metrics, and any mismatch fails verification.

Cite

@misc{uyar2026certipatch,
  title     = {CertiPatch: Specification Repair for Frozen Language Models with Replayable Empirical Certificates},
  author    = {Uyar, Ali},
  year      = {2026},
  doi       = {10.5281/zenodo.18541322},
  publisher = {Zenodo},
  url       = {https://doi.org/10.5281/zenodo.18541322}
}
AU-4
Certificate card: six recorded fieldsSealed block: Pythia-410M, 24 layers, frozenPatch: rank-4 taps at layers 6, 12, 18, 23 (32,768 weights)Counterexample found, or a replay check failedSweep clean, or a replay check matchedCertiPatch repairs a frozen language model against a programmatic specification. It learns rank-4 corrections at four layers of Pythia-410M (32,768 weights), sweeps the specification's whole domain for counterexamples (prompts whose answer margin is below τ = 1.0), and adds the hardest to the next round. On COMPARE-2D ("Is 37 greater than 52?", all 10,000 pairs) the base model fails 5,050 prompts and the patched model none after 7 rounds, with every margin at least 1.00. The certificate records the model fingerprint, manifest and patch hashes, domain hash and metrics; replay recomputes each one and fails closed on any mismatch, such as a perturbed patch.