privacy extra first:
Write a private draft
Passprivacy when writing the draft:
The privacy horizon is the run’s total local steps,
rounds x local_steps, and sampling switches to Poisson. Real private runs use randomness="secure", which needs the pinned secure random-number dependency. Use "reproducible_public_benchmark" only for seeded research on public data.
Give each node a ledger
Each private dataset needs a durable ledger that records every privacy reservation, including those of failed runs. Create it once, then reopen it for every later run:Never delete or recreate a ledger to restart a run. The ledger is the record of privacy already spent on that dataset.
research_seed; reproducible public benchmarks require one. Secure private runs can’t resume after a crash: a failed step leaves the whole horizon’s reservation spent.
Register an optimizer
Optimizer.sgd, Optimizer.adam and Optimizer.adamw cover most runs, private or not. For any other PyTorch optimizer, pass an OptimizerRegistration as the task’s optimizer. Every node supplies the same trusted implementation. The RMSprop reference is a complete registration to copy and adapt.
A registration supplies:
optimizer_type: the exact PyTorch optimizer class, including custom subclasses.implementation_hash: SHA-256 identifying the optimizer implementation, factory and state-validator contract, including relevant dependencies.create(model): builds fresh optimizer state on the actual model parameters.validate_state(state, parameters, logical_steps): rejects wrong state fields, tensor shapes, dtypes, counters and initial values.
torch.optim.Optimizer implementations that update from the sanitized .grad, the model weights, public options and their own state, with a step() that takes no closure. Optimizers that rely on closures, raw per-sample gradients, secondary backward passes, sparse gradients or custom zeroing need a different, audited contract.
What stays private
- Group formation shares model weights, never optimizer state, sampler state or private data.
- Raw private losses aren’t reported. Public evaluation must use a declared, fixed public holdout.
- Local checkpoints contain optimizer, sampler and accountant state. Don’t publish them; publish model-only exports.
- A per-sequence guarantee on token data doesn’t automatically protect a whole document or person. Repeated or overlapping chunks need composition.