In this article
The Opacus DPDataLoader documentation describes selecting each dataset element for the next batch with the configured sample_rate.
A synthetic-data project may train a generator with differential privacy and later publish generated records. Before interpreting its reported privacy budget, inspect how training examples were sampled. Replacing the private loader with a convenient fixed-size loader can change the mechanism behind the accountant while the same reporting call still returns a number. The synthetic label does not repair that mismatch.
The generation interface
The Opacus DPDataLoader documentation describes selecting each dataset element for the next batch with the configured sample_rate. This Poisson sampling can produce variable-sized and empty batches. PrivacyEngine’s poisson_sampling option normally installs the required sampling behavior. Its documentation explicitly warns that disabling that option leaves the supplied loader unchanged and does not fit the accounting mechanism’s assumptions. Treat that warning as a mechanism boundary, not a cosmetic data-loading preference.
Implementation details
Preserve sampler configuration, dataset population, clipping policy, noise settings, accountant identity and training-step history together. Use the wrapped training objects returned by the privacy integration rather than quietly returning to original objects. Empty batches require an explicit supported handling path; retrying until a non-empty batch appears changes the realized selection procedure. Do not infer that preserving average batch size preserves the sampling law or validates a previously reported privacy value after the loader was replaced.
A constructed validation case
Construct a harmless training fixture with identifiable records and record batch membership without using private production data. Compare the configured private loader with a fixed-size replacement and an explicitly disabled sampling branch. Observe variable and empty membership outcomes where they occur, then inspect which objects actually perform updates. The acceptance question is whether the executed mechanism matches its declared accounting assumptions, not whether both branches finish training or print the same-shaped budget report. No numerical privacy guarantee is established by this proposed fixture.
Interpretation limits
This loader check is only one component of a differential-privacy implementation review. It does not establish that every surrounding operation is covered, that generated records contain no sensitive information or that a numerical budget is valid under arbitrary pipeline changes. Keep content inspection and model-extraction evaluation separate from construction of the training mechanism. Report any approximation explicitly and obtain an appropriate analysis before treating a changed sampling process as equivalent to the documented mechanism.
Primary references
Opacus DPDataLoader sampling contract; Opacus PrivacyEngine sampling and accounting.
This is a proposed interface validation, not an executed Retrivium experiment. Keep implementation versions and unresolved outcomes with any later measurements.
Related reading
Generated fine-tuning data: separate extraction and membership evidence; Golden inference API fixtures: test the contract rather than prose.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.