CertiPatch is a reproducible research framework for specification repair of frozen language models with a deterministic
train -> certify -> verify pipeline.
Author: Ali Uyar (Independent Researcher)
Citation DOI (latest release archive): 10.5281/zenodo.18541322
Release note: Keep citing the existing archived release DOI above; metadata or manuscript edits on main do not require minting a new DOI.
This project studies reliable post-hoc repair of model behavior under explicit, machine-checkable constraints. CertiPatch learns localized inference-time patches, certifies behavior over declared evaluation scope, and verifies artifact integrity via replayable certificates with fail-closed semantics.
This repository provides:
- gated low-rank hookpoint patches (GLR-HP),
- constrained optimization (augmented Lagrangian + CEGIS),
- replayable empirical certificates with fail-closed verification semantics,
- end-to-end generation of paper artifacts (figures, tables, and LaTeX).
- Deterministic spec/domain generators for reproducible evaluation.
- Constraint-first repair objective: satisfy in-scope spec constraints while quantifying collateral drift.
- Artifact-locked certificates with explicit scope and coverage semantics.
- End-to-end workflow from training through verification to publication assets.
certipatch/: library code (specs/,models/,cegis/,eval/,artifacts/)scripts/: runnable entrypoints (scripts/reproduce_paper.py)configs/: YAML overlays merged withconfigs/default.yamlschemas/: JSON schemas for config/artifacts/certificates/metricstests/: deterministicpytestsuitepaper/latex/: manuscript, figures, tables
python -m venv .venv
.\.venv\Scripts\activate
python -m pip install -e ".[dev,torch,hf,tl,viz]"Run a toy tier:
python scripts/reproduce_paper.py --config configs/compare2d_certipatch.yaml --tier toyRun the paper profile:
python scripts/reproduce_paper.py --config configs/paper_full.yaml --tier full- Download paper PDF:
paper/latex/main.pdf - Build paper locally:
cd paper/latex
latexmk -pdf -interaction=nonstopmode -halt-on-error main.texThe reproduction workflow is fail-closed. A valid run must:
- validate config against
schemas/config_schema.json, - write artifacts to
runs/<run_id>/, - generate paper assets under
paper/latex/figures/andpaper/latex/tables/, - pass manifest and certificate verification.
If verification fails, outputs are not considered valid.
python -m pytest -q
python -m ruff format . && python -m ruff check .
python -m mypy certipatch
python scripts/update_manifest_sha256.pySee REPRODUCE.md for expected outputs and validation behavior.