Repository navigation
feat(text): row-conditioned synthetic text with DP methods, PII layer and leakage audit (T14) - #45
Open
nick-developer wants to merge 6 commits into
Open
nick-developer wants to merge 6 commits into
nick-developer wants to merge 6 commits into
Conversation
… (wip) Adds relsynth.textgen: DP n-gram release, local LM with user-level DP-GD, Private Evolution, a PII pipeline with typed placeholders, the canary and duplicate audits and text metrics, and wires extended text columns into the engine while the 1.0 path stays unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSVqwJ1ZmupJ7qmQviUY7E Signed-off-by: Claude <noreply@anthropic.com>
Adds the relsynth text command (models, pii-eval, audit, metrics), the model licence register, Props. 1500-1507 with checks C1500-C1507, the text benchmark (S6, S7, BANKING77), the text-lm CI job, ADR 0010 and the guide docs/text.md. Out-of-vocabulary tokens now get a floor score in the n-gram log-likelihood so canary ranking stays informative. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSVqwJ1ZmupJ7qmQviUY7E Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSVqwJ1ZmupJ7qmQviUY7E Signed-off-by: Claude <noreply@anthropic.com>
…-9wns9e # Conflicts: # CHANGELOG.md # README.md
SQLAlchemy 2.1.8's stubs reject **dict[str, bool | None] for Column, which failed the mypy ratchet on every PR (not caused by this PR's changes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSVqwFQpRaQG7JXjqkxnbn Signed-off-by: Claude <noreply@anthropic.com>
transformers 5 keeps a checkpoint's dtype (float16 for Pythia); fine-tuning in float16 on a CPU overflowed and generation failed with NaN probabilities in the text-lm CI job. Local models are now cast to float32, non-DP fine-tuning clips gradients and skips non-finite losses, a fitted model with non-finite weights raises a clear error, and sampling drops invalid logits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSVqwJ1ZmupJ7qmQviUY7E Signed-off-by: Claude <noreply@anthropic.com>
Owner
Author
|
The f35d982 cherry-picks the ddl.py typing fix from #44 (4e3026f), which clears the Generated by Claude Code |
Owner
Author
|
The
I'll re-run the failed jobs once the rest of the run has finished. Generated by Claude Code |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Cod3r · project thread
What and why
Roadmap T14 (synthetic text, wave D). Free-text columns are now generated from their row (
condition_ontakes one or several columns) and a column can choose a method incolumns.<c>.text:ngram(default): the 1.0 model, byte-identical when none of the new keys is set.ngram+dp: a user-level DP n-gram release (Kim et al. NeurIPS 2021): per-person n-gram counts per class, discrete Gaussian noise (OpenDP), partition-selection thresholds (Prop. 903). CPU only, no weights, air-gapped.lm(+dp): a local causal LM from a folder (local_files_only, never downloaded or bundled), LoRA through peft, user-level DP-GD on full batches (exact zCDP, ρ = T/2σ²). Optional extrarelsynth[text-lm]; built-instubbyte model for offline tests.pe: Private Evolution (Lin et al. 2024, Xie et al. 2024), always DP; a public generator proposes, private texts vote through noisy histograms in a data-independent hashed + random-projection embedding.Also:
text.pii): built-in regex recognizers (IBAN mod-97, Luhn, phone, date, URL, IP, address, names after cues) plus optional Presidio, spaCy, GLiNER (relsynth[text-pii]), typed placeholders before training, format-valid surrogates after generation.relsynth text pii-evalmeasures recall with Wilson intervals.relsynth text audit: canary exposure against the DP bound, MinHash near-duplicate search with exact check, extraction attack. Metricsrelsynth text metrics: MAUVE (hashed embedding), consistency with the row, TSTR, copy rates.relsynth text models(src/relsynth/data/text_models.yaml, 19 models) andtools/check_text_models.py(compares with the hub).docs/proofs/sec_v50_text.tex), checks C1500–C1507 (tests/science/test_text_checks.py, shard 4/4), ADR 0010, guidedocs/text.md, benchmarkbenchmarks/text/run_text.py(S6, S7, PolyAI BANKING77, CC BY 4.0, added to the dataset register; aggregates only).text-lm: CPU PyTorch, downloads EleutherAI/pythia-14m (Apache-2.0) into the runner, runs the text tests and C1502 offline (HF_HUB_OFFLINE=1), the benchmark with the local model, GLiNER/Presidio recall (informational) and the licence check.DP charges go to the existing DP-mode
Accountant(no interface change). Text columns insiderelsynth run --dpstay placeholders for now: RFC-T14-01 proposes the budget share and plan changes to T07/T08 (T07b is editing those files).How it was tested
ruff check src tests tools benchmarks, bandit, SPDX check, mypy ratchet (0 new errors)tests/unit/test_textgen.py16 pass without PyTorch, 17 with itmain(tools/identity_check.py, S1–S11 and quickstart, seeds 1 and 2): 24/24 identicalBenchmark (one seed; consistency ratio = classifier accuracy on synthetic ÷ on held-out real; exposure in bits, uniform ≈ 1.44, max 10.75):
Finding: the 1.0 text guards count rows, not people; one person with 4 copies of a sentence gets it reproduced (exposure 7.9–10.4 bits).
text.dpfixes that.Statistics and privacy
docs/proofs/sec_v50_text.texand a check (the PDF is not rebuilt: no LaTeX in the sandbox)Checklist
Unreleaseddocs/text.md, theory, testing, datasets, regenerated spec/CLI/settings references and IR schemaallReport:
roadmap/reports/T14.mdin the project files.Generated by Claude Code