Skip to content

v0.71.9 — Knowledge edit & unlearn (live)

Choose a tag to compare

@MakazhanAlpamys MakazhanAlpamys released this 03 Jun 12:30
· 41 commits to main since this release

What's New — Knowledge Edit & Unlearn (live wiring)

The v0.61.0 / v0.62.0 schema-only stubs are now live, validated end-to-end on SmolLM2-135M (RTX 3050 4 GB).

  • soup edit set — ROME / MEMIT / AlphaEdit (live, #194). Covariance-free rank-1 weight-edit kernels: ROME (single-layer W += δ·kᵀ/‖k‖²), MEMIT (residual distributed across a layer band), AlphaEdit (ROME update projected orthogonal to the down-proj's top singular direction). On a tiny model a ROME edit moved P("Lyon" | "The capital of France is") from 0.0016 → 0.96. New --output, --device, --governor/--no-governor, --registry-id flags.
  • soup edit diff live before/after generation (#194). --before-model + --after-model (+ --probes) generates through both models and surfaces the probes whose output changed.
  • EditGovernor SQLite persistence + cross-process locking (#196). New EditGovernorStore persists per-base-model edit-count + verdict across separate soup edit set runs (env override SOUP_EDIT_GOVERNOR_DB).
  • apply_edit consults the governor automatically (#197). check_can_edit() runs BEFORE the model load (refusing on norm-blowup / edit cap); record_edit() runs AFTER with the measured Frobenius delta.
  • Live GRACE codebook (#203). Epsilon-ball nearest-key lookup, residual-key capture + value optimisation, atomic codebook sidecar, decode-time install_grace_hook. New edited_model / grace_codebook Registry artifact kinds.
  • soup train --task unlearn — NPO / SimNPO / RMU (live, #193). New unlearn_kernels.py + a self-contained UnlearnTrainerWrapper (LoRA policy + frozen reference + forget/retain JSONL). Warns when run without a retain set.

Install / Upgrade

pip install --upgrade soup-cli

Security

  • _save_edited_model / UnlearnTrainerWrapper output dirs + save_codebook / load_codebook + _load_unlearn_rows enforce cwd-containment, raw-path symlink rejection (TOCTOU), null-byte rejection, and file-size / per-line caps.
  • EditGovernorStore mirrors namespace_pin.NamespacePinStore: $HOME/$CWD/$TMPDIR containment, TOCTOU symlink rejection, WAL + busy_timeout, fcntl/msvcrt sidecar lock, POSIX 0600.
  • apply_grace_edit honours the governor for direct callers.

Known Limitations

  1. ROME-family kernels are covariance-free (C=I) — a tractable simplification of full ROME/EasyEdit; edits change the target fact + are localised, but neighbourhood preservation is looser than covariance-preconditioned ROME.
  2. Llama-family only_locate_decoder_layers resolves model.model.layers[L].mlp.down_proj; GPT-2-style transformer.h is rejected.
  3. Norm-delta thresholds tuned for larger models — on a 135M model a single ROME edit produces a large Frobenius delta (~25), so the default NormBlowupPolicy(blowup_threshold=5.0) classifies it BLOWUP. Thresholds are operator-configurable.
  4. RMU convergence noisy on few steps — NPO/SimNPO show clean decreasing forget loss; RMU's representation-steering objective needs more steps / tuning to converge on a tiny model.
  5. EditGovernor read-modify-write is best-effort under concurrency — the cross-process lock serialises each write, but two truly-concurrent soup edit set runs on the same base can both read edit_count=N and both write N+1 (one increment lost); sequential workflows unaffected.
  6. GRACE applies at decode via install_grace_hook, not by modifying weightstarget_prob_after equals target_prob_before for grace edits (the codebook is a sidecar).
  7. MEMIT distributes the residual so its per-fact edit is weaker than ROME/AlphaEdit (smoke 0.25 vs 0.96); use ROME for a one-shot fact.

Full changelog: https://github.com/MakazhanAlpamys/Soup/blob/main/CHANGELOG.md