Some optimization problems never finish. A controller tracks a moving target, or a grid operator re-dispatches generators as solar output drifts, and in each case the solver must follow a minimizer that moves with time. When the data are private, a natural design is to run the tracker in the cloud under CKKS. CKKS is an approximate homomorphic encryption scheme: the server computes on encrypted real numbers, and the price is a small rounding-like noise that grows with every multiplication. The field's reflex is to fight that noise with more precision. Iterated bootstrapping (the expensive operation that refreshes an encrypted number so computation can continue) can reach hundreds of bits, and larger scaling factors buy more bits again. We argue this reflex is miscalibrated for tracking. A stable tracking algorithm forgets errors injected in the past, so its steady-state error is set by how fast the target moves and how often the algorithm samples it, plus a noise floor. Extra precision below the drift-induced lag buys nothing. Meanwhile it costs levels, which are the budget of multiplications left before a refresh, and it costs wall-clock time, and both lengthen the effective sampling interval and so increase lag.
The proposal is to derive, validate and use a single error law for encrypted time-varying optimization. The law accounts for three quantities at once: the cryptographic precision (scaling bits and bootstrapping accuracy), the algorithm's structure (whether it predicts the target's motion and how many correction steps it takes per sample), and the latency these choices impose. From the law we compute a precision allocation rule that says how many bits to use and where to spend multiplicative depth. We then test the claim that this rule beats "maximize precision" configurations on standard tracking benchmarks.
Core Claim
Consider a tracker sampled every $h$ seconds that runs $m$ contracting correction steps per sample. Each step shrinks error by a factor $\rho<1$. We write $\delta$ for the CKKS scaling bits and $p$ for the order of the drift compensation, with $p=1$ for correction-only "running gradient" and $p=2$ for gradient prediction-correction. Standard perturbed-contraction arguments then give a steady-state bound of the form
$$\limsup_{k\to\infty}\|x_k - x^*(t_k)\| \;\lesssim\; \frac{C_p\, h^{p} + C_\epsilon\, 2^{-\delta}}{1-\rho^{m}},$$
where $x_k$ is the encrypted iterate at sample $k$, $x^*(t_k)$ the true minimizer, $C_p$ depends on the drift speed and curvature, and $C_\epsilon$ collects the growth of CKKS noise through one sample's circuit. The first term is the prediction-correction result of Prediction-correction methods for time-varying convex optimization, which gives $O(h)$ lag for running gradient and $O(h^2)$ for gradient trajectory tracking. The contraction view of Time-Varying Convex Optimization: A Contraction and Equilibrium Tracking Approach is what lets injected noise enter only through the same $1/(1-\rho^m)$ amplification instead of accumulating.
The coupling that makes this more than an additive sum is that $h$ is not free. It must cover the encrypted computation time, $h \ge \tau(m, p, \delta, \text{refresh})$. For a fixed total ciphertext modulus, raising $\delta$ reduces the number of levels, roughly as $\log Q/\delta$. That forces more frequent bootstrapping, and bootstrapping dominates $\tau$. Because the bound is convex in $\delta$ once this latency is included, there is a finite optimal precision. We predict that this optimum sits well below the default parameters used in encrypted-optimization work. We also predict that the high-precision regime of META-BTS: Bootstrapping Precision Beyond the Limit, whose runtime grows linearly in its folding factor $k$, is strictly harmful for tracking unless drift is extremely slow.
Research Program
The first component is analytical. We prove the bound above for strongly convex, smooth objectives, treating CKKS noise as a bounded perturbation with a magnitude derived from the circuit. We also derive the closed-form optimal $(\delta, m, p)$ under a latency model fitted to measured OpenFHE operation costs. The analysis covers two refresh modes, because which mode applies depends on who may decrypt. In client refresh, the party that receives $x_k$ decrypts and re-encrypts it every sample. In server bootstrapping, no single party may see the iterate, as in multi-party dispatch in the style of Privacy Preserving Distributed Optimization Using Homomorphic Encryption. The same law governs both modes; only the latency function changes.
The second component makes prediction affordable. For quadratic tracking with $f(x,t)=\tfrac12 x^\top Q x + q(t)^\top x$, the prediction step is $-hQ^{-1}\dot q$. We estimate $\dot q$ by an encrypted finite difference, which costs no multiplications. When $Q$ is fixed and known to the data owner, $Q^{-1}$ can be pre-encrypted; when $Q$ drifts, it is approximated by a truncated Neumann series whose degree becomes a further depth-allocation variable.
A cheaper design can avoid finite differences altogether. The prediction step then collapses to $-Q^{-1}(q_k-q_{k-1})$, computed in a single homomorphic matrix-vector product. The law predicts where this pays off: prediction helps only while $\|q_k-q_{k-1}\|$ exceeds the per-sample noise floor, because below that point the extrapolation is mostly noise.
The third component revisits a conflict between two results in the file. In the static encrypted setting, Homomorphically Encrypted Gradient Descent Algorithms for Quadratic Programming found that Nesterov acceleration beats plain gradient descent for condition number $\kappa>5$ at fixed depth. In unencrypted drifting problems, On the Provable Suboptimality of Momentum SGD in Nonstationary Stochastic Optimization proved that momentum amplifies drift lag. Our law adds depth cost per step to that analysis, and predicts that under encryption and drift the crossover $\kappa$ moves far upward or disappears.
Baselines
The naive reference is encrypted running gradient: correction steps only, no prediction, default CKKS parameters. This is the direct encrypted analogue of re-solving from a warm start. We run it at the same parameters and wall-clock budget as every other method, and it establishes the $O(h)$ lag floor.
The strongest existing competitor is a combination nobody has built, so we build it. It is encrypted gradient trajectory tracking with conventional "maximize precision" parameters: the largest scaling factor the modulus chain allows, and standard bootstrapping whenever levels run out. It pairs the best tracking algorithm from Prediction-correction methods for time-varying convex optimization with the engineering stance of existing encrypted solvers. There is no reported result on Lacuna for encrypted time-varying tracking error. The only anchor is plaintext: on the scalar tracking problem, the same paper reports asymptotic error of roughly $10^{-2}$ for running gradient, $10^{-5}$ for gradient tracking and near $10^{-10}$ for Newton tracking. We replicate that plaintext benchmark first to calibrate our implementation. Beating the competitor means lower steady-state tracking error at equal wall-clock per sample, or equal error at lower latency, across at least three drift speeds.
We also run a high-precision variant that uses Meta-BTS(2) refreshes. This tests the claim that precision beyond the drift floor is wasted.
For the momentum question we use encrypted Nesterov tracking, configured as in Homomorphically Encrypted Gradient Descent Algorithms for Quadratic Programming with its depth-saving matrix product. In plaintext drifting quadratics, On the Provable Suboptimality of Momentum SGD in Nonstationary Stochastic Optimization reports Heavy-Ball error of about 0.34 at $\beta=0.5$, rising to 401.37 at $\beta=0.99$, against about 1.04 for SGD. In ill-conditioned regression with $\kappa=1000$ it reports 0.168 for SGD and 0.898 for momentum. We reproduce those settings in plaintext before encrypting them.
The ablation that isolates our key ingredient holds algorithm and refresh mode fixed and varies only $\delta$ and the depth split chosen by the allocation rule. If the gains appear here, they come from precision allocation rather than from the choice of algorithm.
Why not just…?
Why not just have the client decrypt and re-encrypt every sample? In a single-client control loop where the client receives $x_k$ anyway, this is a real threat. Client refresh removes bootstrapping entirely, and we expect it to win on latency in that setting. Our response is to treat it as one of the two refresh modes rather than as a competitor. The error law still decides the right scaling bits and whether prediction pays, since per-sample depth still sets the noise floor and round-trip time sets $h$. Where the iterate must stay hidden from every party, or where the client is intermittently offline, client refresh does not apply. The measured round-trip sensitivity in Cloud-Based MPC with Encrypted Data was 91–170 seconds per step with interaction. We report both modes and state plainly which mode wins in which regime.
Why not just use maximum precision, since more bits cannot hurt accuracy? The bits themselves do not hurt accuracy; the latency they add does. Fewer levels per modulus mean more bootstraps, a larger $h$, and more lag. The high-precision baseline and the $\delta$-sweep ablation measure this directly. The claim fails if error decreases monotonically in $\delta$ at fixed wall-clock budget.
Why not tune parameters with a learned controller, as HERL does? HERL: Tiered Federated Learning with Adaptive Homomorphic Encryption using Reinforcement Learning selects polynomial degree and moduli by Q-learning for static federated training. It reports 15–24% faster convergence, but it has no model linking noise to optimization error. We run a Q-learning tuner over the same $(\delta, m, p)$ grid with equal search budget. If it matches the closed-form rule, the analytical contribution is explanatory rather than practical, and we will say so. We expect the rule to transfer across drift speeds without retraining, and we test exactly that transfer.
Why not drop prediction and just take more correction steps? Each correction step costs a level, while the difference-based prediction costs one matrix-vector product. The plaintext gap of $10^{-2}$ against $10^{-5}$ above suggests prediction is worth its depth. The law, however, predicts that the advantage vanishes when drift per sample falls below the noise floor, and the drift-speed sweep locates that point.
Proposed Experiments
All encrypted runs use OpenFHE RNS-CKKS on one CPU, with wall-clock time per sample as the shared budget. We use four benchmarks. The first is the scalar tracking problem from Prediction-correction methods for time-varying convex optimization. The second is the drifting strongly convex quadratics and $\kappa=1000$ regression of On the Provable Suboptimality of Momentum SGD in Nonstationary Stochastic Optimization. The third is the synthetic QPs across condition numbers of Homomorphically Encrypted Gradient Descent Algorithms for Quadratic Programming, made time-varying by a random-walk linear term. The fourth is a realistic workload: an economic-dispatch QP on the IEEE-33 bus network, driven by the wind and photovoltaic time series in A Large-Scale Dataset of Distributed Renewable Energy Scenarios on the IEEE-33 Bus Network. Its lag-1 autocorrelation above 0.93 makes difference-based prediction plausible. Metrics are steady-state and worst-case tracking error, latency per sample, and bootstraps per hundred samples.
Three checks decide the proposal. First, the predicted interior optimum in $\delta$ must appear, and it must lie within a few bits of the rule's prediction. If error is monotone in $\delta$, the core claim is wrong. Second, the rule-allocated tracker must beat the maximum-precision gradient-tracking baseline at equal wall-clock on at least the dispatch and drifting-quadratic benchmarks. Third, the encrypted crossover $\kappa$ at which Nesterov overtakes gradient descent must shift upward relative to the static value of 5, by an amount the law predicts to within a factor of two. Failing the third check would not sink the allocation result, but it would show that depth-aware momentum analysis needs more than an added latency term.
References
- Prediction-correction methods for time-varying convex optimization
- Time-Varying Convex Optimization: A Contraction and Equilibrium Tracking Approach
- META-BTS: Bootstrapping Precision Beyond the Limit
- Privacy preserving distributed optimization using homomorphic encryption
- Homomorphically Encrypted Gradient Descent Algorithms for Quadratic Programming
- On the Provable Suboptimality of Momentum SGD in Nonstationary Stochastic Optimization
- Cloud-Based MPC with Encrypted Data
- HERL: Tiered Federated Learning with Adaptive Homomorphic Encryption using Reinforcement Learning
- A Large-Scale Dataset of Distributed Renewable Energy Scenarios on the IEEE-33 Bus Network