attacklm-dataset v0.4.1 — Audit-harness bug fixes
attacklm-dataset v0.4.1 — Audit-harness bug fixes
A paper-vs-code audit (memory 2094e7cf) found 5 bugs in scripts/inversion/. All 5 fixed in this release.
What changed
- Bug #1 (correctness, MUST FIX):
scoring.py:162score_recordwas using_extract_full_text()which leaked the prompt into the NLL and biased all--mia-method referencescores by prompt length. Switched to_extract_assistant_turn()per MUSE 2023 default. - Bug #2 (crash + wrong metadata, MUST FIX):
lira.py:305save_shadow_paramshardcodedlira_k=0in the JSON and crashed withNameErroron empty params. Added explicitlira_kparameter;shadow_train.pynow passeslira_k=len(shadow_losses). - Bug #3 (evidence chain, MUST FIX):
probe.pyProbeResultdidn't includeprompt_textorbest_reconstruction, so memorization findings couldn't be recovered from the audit artifact without re-running the probe. Added the two fields; the audit artifact (inversion_results.jsonl,chmod 0600) is now self-contained. - Bug #4 (performance):
probe.py:144generate_completionswas doing K sequentialmodel.generate()calls. Switched to singlegenerate()withnum_return_sequences. ~20× speedup on typical 14B + 256-token setups. - Bug #5 (code smell):
lira.pyLiRAScorehad a deadalphafield "reserved for future use". Removed the field and thealphaparameter fromscore_lira. Cleaner contract.
Data
The data tarball is unchanged from v0.4.0. Only the audit-harness code in scripts/inversion/ changed.
Tests
14 new tests in tests/test_audit_bugfixes.py. 443 → 457 passing.
Audit code status
Production-ready for a real defensive run. The three MUST-FIX bugs are all fixed. The audit code is safe to use.
Install
git clone https://github.com/Veedubin/attacklm-dataset.git
cd attacklm-dataset
git checkout v0.4.1
pip install -e ".[inversion]"Or upgrade an existing v0.4.0 install:
cd attacklm-dataset
git fetch origin
git checkout v0.4.1
pip install -e ".[inversion]"Audit usage
python scripts/inversion_audit.py \
--model /path/to/model \
--dataset-root /path/to/data/datasets/buckets/sources \
--attack all \
--mia-method per_tokenFor LiRA:
python scripts/inversion_audit.py \
--model /path/to/model \
--dataset-root /path/to/data/datasets/buckets/sources \
--attack mia \
--mia-method lira \
--lira-params shadow_params.json