Lattice Noise as Free Dither: Low-Scale Encrypted Training

Homomorphic encryption lets a server compute on data it cannot read. The data stays encrypted and the server never holds the key. Training under such encryption is still thousands to tens of thousands of times slower than ordinary training. A large share of that cost comes from carrying many bits of numerical precision through every encrypted operation, because more precision forces larger ciphertexts, larger polynomial rings, and more frequent "bootstrapping," the costly step that refreshes an encrypted value. This note argues that a key reason for that precision, which is protecting the tiny weight updates of gradient descent from being rounded away, has a cheap fix already built into the cryptography.

The fix comes from stochastic rounding. Stochastic rounding rounds a number up or down at random, with probabilities chosen so the rounded value equals the true value on average. In low-precision training this lets updates smaller than one unit of precision survive in expectation instead of being cut to zero. Lattice-based encryption schemes already add random noise to every ciphertext for security. When an encrypted value is rounded, that noise sits below the rounding point and randomizes it. Our claim is that this security noise can act as the random "dither" that turns ordinary rounding into stochastic rounding. If so, encrypted training can run at much smaller scale factors than current systems use, and where the noise is too narrow, a cheap encrypted dither can be added explicitly. We will make this claim precise, show when it holds and when it fails, and turn it into a rule for setting encryption parameters that shrinks ciphertexts and bootstrapping counts.

Core Claim

In CKKS, the standard scheme for approximate real-number arithmetic under encryption, every multiplication is followed by a rescaling step. Rescaling divides by a large prime and rounds, much like dropping low-order bits in fixed-point arithmetic. The scale factor $\Delta$ sets the size of one unit in the last place. Systems such as HETAL, which fine-tunes classification heads under CKKS, choose $\Delta$ large enough that rounding error is negligible. They implicitly treat rescaling as round-to-nearest, which would erase any update below $1/\Delta$.

The rounded quantity is not the clean message, though. It is the message plus encryption noise $e$. Suppose that noise is roughly Gaussian with standard deviation $\sigma$, measured in units of the last place. A Fourier expansion of the rounding sawtooth gives the expected rounding error as

$$ \mathbb{E}[\mathrm{round}(x+e)] - x \;=\; \frac{1}{\pi}\sum_{k\ge 1}\frac{(-1)^{k}}{k}\, e^{-2\pi^2 k^2 \sigma^2}\,\sin(2\pi k x), $$

where $x$ is the true value in the same units. The bias falls off as $e^{-2\pi^2\sigma^2}$. At $\sigma = 0.5$ it is already about $0.002$ of a unit. Uniform noise one unit wide makes the bias exactly zero, which is precisely stochastic rounding.

So whenever ciphertext noise is at least about half a unit wide at the point of rounding, CKKS rescaling behaves as an unbiased stochastic quantizer, and no random number generator is needed. That generator is the hardware cost that limits stochastic rounding in ordinary low-precision training. Once rounding is unbiased, the theory from A Statistical Framework for Low-bitwidth Training of Deep Neural Networks applies. That framework treats quantized training as an unbiased but noisier estimate of full-precision training. It tells us that the remaining cost of a small $\Delta$ is variance, and variance is tolerable while it stays small relative to minibatch gradient noise.

That yields a concrete scale rule. Choose the smallest $\Delta$ at each multiplicative level such that the added variance from rounding and encryption noise, scaled by the learning rate and summed over the steps between bootstraps, stays below a fixed fraction of the minibatch gradient variance. A smaller $\Delta$ means fewer modulus bits per level. That means a smaller total modulus, and under the Homomorphic Encryption Standard security tables it can allow halving the ring dimension or fitting more levels before each bootstrap.

How This Differs From Existing Work

Prior work joining low precision and encryption falls into three groups. The first group lowers precision only for inference with fixed weights. HEQuant packs several low-bit integers into one ciphertext coefficient and drops low output bits deterministically. Efficient Quantization and Data Access for Accelerating Homomorphic Encrypted CNNs uses deterministic powers-of-two weights under BFV, a scheme for exact integer arithmetic. Cheetah accepts a 1-bit truncation error in two-party inference. These papers motivate our work, since they show that precision cuts are where the cost savings lie. They also constrain it: all of them round deterministically, which is harmless in a single forward pass but untested over thousands of training updates.

The second group uses randomness as an encoding or as a source of tolerated faults. Homomorphically Encrypted Computation using Stochastic Encodings represents numbers as encrypted random bitstreams. That keeps circuits shallow but needs bitstreams of length $2^n$ for $n$ bits of precision, so it loses above 8 bits. Circa tolerates random sign faults and deterministically truncates bits before the sign test. We use neither idea. We keep the standard CKKS encoding, and the randomness we exploit is the noise that is already present.

The third group trains under encryption at high precision. Towards Deep Neural Network Training on Encrypted Data reports about 40 minutes per 60-sample minibatch for a tiny network. HETAL makes encrypted fine-tuning of classification heads practical but never lowers the scale. HETAL supplies our method: its matrix-multiplication algorithms and its softmax approximation over $[-128,128]$. Our change is the precision schedule and the dithering analysis.

Research Program

The work has three parts.

The first part is measurement. We will instrument a CKKS implementation to record, at every rescale in a HETAL-style training step, the empirical width of the noise in units of the last place. That noise can be read from decryptions against plaintext ground truth. The forward pass, the gradient products, and the learning-rate multiply in the weight update are separate sites and will be recorded separately. We expect the noise to be wide after ciphertext-by-ciphertext multiplications. We expect it to be narrow at operations involving freshly encoded plaintext constants and possibly right after bootstrapping, because there the rounding acts on a nearly clean value.

The second part covers sites where the measured width falls below about half a unit. There we add an explicit dither: an encrypted uniform random vector one unit wide, added just before rescaling. The client can supply it ahead of time as a few encrypted vectors that the server reuses with slot rotations. The cost is one ciphertext addition per site. On Stochastic Rounding with Few Random Bits suggests a handful of random bits suffices, so the dither vectors can be coarse.

The third part derives and validates the variance-based scale rule above. We will then re-select the full encryption parameter set (modulus chain, ring dimension, bootstrapping placement) from the security tables for each candidate scale.

The softmax approximation and bootstrapping may need more precision than the weight updates do. The rule therefore allocates scale per level rather than globally. If those components end up dictating the modulus anyway, the gains from this work will be small, and we will report that outcome as a finding.

Baselines

The naive reference point runs HETAL's encrypted fine-tuning at its default high scale, with parameters unchanged. It represents current practice. It will be run on the same five benchmarks HETAL uses (MNIST, CIFAR-10, Face Mask, DermaMNIST, SNIPS), with the same pretrained ViT and MPNet feature extractors, optimizer, epochs, and hardware. HETAL reports end-to-end encrypted fine-tuning times of 567 to 3442 seconds across these benchmarks and a maximum accuracy loss of 0.51% versus unencrypted training. We will reproduce these numbers on our hardware before comparing anything. Beating this baseline means at least a 1.5x wall-clock reduction per training run, from smaller rings or fewer bootstraps, while keeping accuracy loss within that same 0.51% envelope.

The strongest competitor is "just lower the scale and change nothing else." This means running CKKS at reduced $\Delta$ with standard rescaling and no dither or scale rule. If our claim holds in its strongest form, this baseline already works at most sites. That is why it is the real test of what the proposal adds. It will use exactly the same reduced parameter sets as our method, so the only difference is explicit dither at the narrow-noise sites plus per-level allocation. Our method beats it if, at the smallest scale where it still converges, our version either reaches lower final loss and smaller bias, or converges at a strictly smaller modulus. Concretely, we would want one fewer bootstrap per epoch or a halved ring dimension at equal accuracy.

The ablation that isolates the key ingredient removes the randomness while keeping the scale. We will run a plaintext emulation of the same low-precision pipeline with exact round-to-nearest and no noise, against the same emulation with matched-variance stochastic rounding. If the "noise as dither" mechanism is real, the round-to-nearest emulation should stall on sub-unit updates while the stochastic version and actual CKKS should not. A second ablation drops explicit dither at only one site at a time, to locate which rounding sites actually bias training.

We also compare against interactive refreshing. In that setting the client decrypts, re-encrypts, and returns a fresh ciphertext instead of the server bootstrapping. The comparison counts total communicated bytes and latency.

Why not just…?

Why not just keep the precision high, as HETAL does? This is current practice, and it works: HETAL loses at most 0.51% accuracy. The price is the modulus. Under the security standard, each extra block of modulus bits can force the ring dimension to double, which roughly quadruples transform cost and grows evaluation keys. HEQuant shows how much precision costs in the inference setting, reporting 3.5 to 23.4x communication reduction from lowering it. Whether a comparable saving exists for training is exactly what our parameter sweep measures. If HETAL's parameters turn out to be dictated by bootstrapping or softmax precision rather than by the updates, this alternative wins and we will say so.

Why not just lower the scale and rely on CKKS noise without any of this analysis? This is the most serious threat, because our own claim predicts it partly works. The answer is that "partly" is the problem. Plaintext-constant multiplications, including the learning-rate multiply in every weight update, may round nearly clean values. Our formula says bias returns sharply once noise width drops below about 0.3 units. Without per-site measurement, a practitioner cannot tell which reduced scale is safe. The site-by-site dither ablation will show either that naive lowering is safe everywhere, in which case our contribution reduces to the scale rule and its validation, or that specific sites bias training and need the fix.

Why not just use error feedback, carrying the rounding residual into momentum as ECO does? ECO removes full-precision master weights by computing $x - Q(x)$ and adding that residual to the optimizer's momentum. ECO works in plaintext, where the residual is directly visible. Inside CKKS, rescaling discards low-order coefficient bits, and recovering them as a ciphertext would require keeping a higher-precision copy. That is the master-weight cost ECO was designed to remove. We therefore do not expect error feedback to transfer cheaply. Still, a hybrid that applies error feedback only at the learning-rate multiply is cheap to test, and we include it as an extra arm.

Why not just quantize gradients stochastically before encryption, as in federated compression? Natural Compression and Integer Is Enough quantize values before they are sent or encrypted. That reduces encryption and transmission cost. It does not touch the rounding that happens inside encrypted computation, which is where the modulus and bootstrapping costs arise.

Proposed Experiments

The first decisive check is a microbenchmark of accumulation. We repeatedly add encrypted updates of magnitude $10^{-1}$ to $10^{-3}$ units to an encrypted weight over $10^4$ steps, then compare the decrypted total against the exact sum. This runs under true CKKS, plaintext round-to-nearest, plaintext stochastic rounding, and CKKS with explicit dither. The prediction is that relative drift is near zero for every arm except round-to-nearest, wherever the measured noise width exceeds half a unit. A failure of that prediction would falsify the central claim.

The second check sweeps the scale factor downward on HETAL's five benchmarks. For each scale it records final accuracy, accumulated update bias against plaintext training, modulus bits, ring dimension, bootstraps per epoch, and wall-clock time, for the naive-low-scale arm and for our arm.

The third check tests whether the scale rule predicts the empirical cliff. The rule's predicted minimal scale should fall within one bit per level of the smallest scale that keeps accuracy within HETAL's 0.51% envelope.

We will report the 40-minute minibatch figure from Towards Deep Neural Network Training on Encrypted Data only as context, since that setting differs from ours. No reported result was found on Lacuna for encrypted training at reduced CKKS scale, so the naive-low-scale arm has no prior number and will be established here.