Paying Only for the Gap: Encrypted Time-Series Forecasting Above a Free Local Baseline

Homomorphic encryption lets a server compute on data it cannot read. A hospital, a utility, or a factory could send an encrypted sensor history to a cloud model and get back an encrypted forecast. The cost is steep. Running even small networks this way takes seconds to minutes per prediction and multiplies data size many times over. Meanwhile, forecasting research keeps finding that deep models often fail to beat trivial rules such as "tomorrow equals today" or "repeat the last cycle." Put together, these two facts point to a simple test that nobody has applied. The data owner can always compute such a rule on its own machine, in the clear, at zero cost. An encrypted service is only worth paying for to the extent that it beats that free local forecast.

We propose to make this test the organizing principle of encrypted forecasting. The client computes a cheap baseline forecast locally. The server, under encryption, predicts only the correction to that baseline, using a shallow model that needs a single multiplication. The encryption parameters are then sized to the forecast error the model actually achieves, rather than to generic precision targets. Because the correction is small in magnitude and the model's own error already sets a noise floor, this should permit much smaller ciphertexts than a general-purpose deployment. We measure everything as accuracy gained over the free local forecast, divided by cryptographic cost. That accounting also tells us when the encrypted service should not be used at all.

Core Claim

The claim has two parts. First, the right baseline for any encrypted forecaster is the best forecast the client can produce locally for free. That means persistence, Historical Inertia, and a linear model the client fits on its own history. Accuracy and cost should be reported relative to that baseline. Second, a residual design (client computes the baseline in plaintext, server predicts the correction with a depth-one linear map) captures nearly all of the value any encrypted model adds. The design also allows CKKS parameters (CKKS is the encryption scheme that supports approximate real-number arithmetic) to be chosen from an explicit error budget. We expect these parameters to be substantially smaller than those needed to encrypt a deeper model. If the claim holds, the large engineering effort spent approximating attention and nonlinearities under encryption is mostly wasted for continuous sequential data.

Why This Is Not Already Done

The evidence for the baseline gap is strong. Are Transformers Effective for Time Series Forecasting? shows that linear maps (DLinear, NLinear) beat Informer, Autoformer and FEDformer with roughly 140K versus 20.7M parameters. Two Steps Forward and One Behind finds that Informer fails to beat persistence in nearly half of multivariate cases. Historical Inertia shows that copying the trailing window cuts multivariate ETTh2 MSE from 3.242 to 0.572 at horizon 168. These papers motivate the proposal, but none considers privacy or deployment cost.

On the encryption side, three lines of work supply methods and constraints. THE-X approximates softmax and LayerNorm to run BERT-tiny under encryption, with interactive client rounds for ReLU. SAFENet and NASS search over which activations to approximate and how to set cryptographic parameters for vision networks, spending 7 to 60 GPU hours. NASS also documents that cost jumps sharply when depth or bit-width crosses modulus thresholds; this constrains our design toward staying below the first threshold. PolyNeXt removes non-polynomial activations entirely, but compounds multiplications with depth. All four take a deep model as given and ask how to encrypt it more cheaply. We ask instead how much of the model needs encrypting at all, measured against what the client already has for free.

The closest prior work on simple encrypted models, Privacy-Preserving Ridge Regression with only Linearly-Homomorphic Encryption, encrypts linear regression for estimation. It does not use packed multichannel windows, compare against local baselines, or size parameters to a forecast-error budget.

Research Program

The setting is as follows. A server holds a forecasting model trained on many pooled series. A client holds one private multivariate series. The server must learn nothing about the client's inputs. Protecting the model's weights from the client is out of scope, as in THE-X.

The client computes a local baseline $b$ over the forecast horizon, using either persistence or Historical Inertia. It normalizes its look-back window $x$ by subtracting the last observed value and encrypts the normalized window. The server applies a learned linear correction $W$ and returns the encrypted residual. The client decrypts and outputs $\hat y = b + W\tilde x$, where $\tilde x$ is the normalized window.

On the server, $W\tilde x$ costs one plaintext-ciphertext multiplication plus slot rotations, using the standard diagonal method for packed matrix-vector products. That is multiplicative depth one, with no bootstrapping (the expensive procedure that refreshes a ciphertext once noise accumulates).

The second piece is error-budgeted parameter selection. CKKS decryption returns the true value plus a small noise term, so encryption adds an independent error to the forecast. If the model's plaintext test error is $\mathrm{MSE}_0$ and encryption adds noise of variance $\sigma_{enc}^2$ per output, the encrypted error is approximately $\mathrm{MSE}_0 + \sigma_{enc}^2$. This follows because the noise is roughly zero-mean and independent of the forecast error.

We therefore choose the smallest scaling precision and modulus chain satisfying

$$\sigma_{enc}^2 \le \epsilon \cdot \mathrm{MSE}_0,$$

where $\epsilon$ is a tolerance set to 1%. The ring dimension is then the smallest one that remains secure at the resulting modulus size. Residual targets have a smaller dynamic range than raw values, which lowers the bits needed before rescaling. We will measure how much of the saving comes from the residual range and how much from the error budget.

The third piece is the audit. For each dataset and horizon, we compute value-added: the MSE reduction over the best free local forecast. We also record latency, ciphertext bytes, and evaluation-key size for every encrypted model. We then report where the encrypted service earns its cost. The pattern should not be uniform. Historical Inertia's own results show it losing on ETTm1 at short horizons and winning at long ones.

Baselines

The naive reference point is the free local forecast. We run persistence, Historical Inertia, and their per-channel best, all computed by the client in plaintext at zero cryptographic cost. On ETTh2, the strongest reported number for this reference is Historical Inertia's multivariate MSE of 0.572 at horizon 168 and 0.635 at horizon 720, from Historical Inertia. We rerun it under our exact splits and normalization. Any encrypted model counts as useful only if its encrypted MSE beats this reference by a margin that is consistent across seeds and splits.

A tougher local reference is a ridge-regularized linear model, of the DLinear or NLinear form, that the client fits on its own history alone. This captures what a client can do without any server. The server's only advantage is having learned from other series. Our residual model must beat this reference to justify outsourcing at all.

The strongest cheap encrypted competitor is DLinear or NLinear from Are Transformers Effective for Time Series Forecasting?. We encrypt it directly, with the server performing normalization and decomposition homomorphically, under general-purpose CKKS parameters (fixed 40-bit scale, standard 128-bit-secure ring dimension). The file quotes its plaintext cost on Electricity (about 140K parameters, 0.4 ms) but no accuracy figure. No reported result was found on Lacuna for encrypted DLinear or for any encrypted time-series forecaster.

The strongest expensive competitor is a small Transformer forecaster encrypted the THE-X way, with polynomial softmax and distilled LayerNorm. We pair it with a PolyNeXt-style Hadamard-product MLP adapted to one-dimensional windows. The only encrypted reference number available is THE-X staying within 1.48% of plaintext accuracy on GLUE, which is from a different domain.

All trained models use the same pooled training series and the same look-back window. Each gets an equal hyperparameter search budget (the same number of trials per model), and all run on the same CPU. For any model that needs client round trips, latency is reported both excluding and including network round trips.

The key ablation crosses the two ingredients at fixed depth one. We compare residual targets against raw targets, and error-budgeted parameters against general-purpose ones. This separates the accuracy contribution, which overlaps with what NLinear already provides, from the ciphertext savings, which is our addition.

Why not just…?

Why not just let the client run the baseline and skip the server? This is the most serious threat, and it is built into the design as the reference point rather than argued away. The literature on the baseline gap suggests that on some datasets, Exchange-Rate in particular, where Are Transformers Effective for Time Series Forecasting? reports that repeating the last value beat Transformers, the honest answer will be "do not outsource." We will report that as a finding. The service has value only where pooled training beats the client's own local linear fit, and the audit measures exactly that.

Why not just encrypt DLinear or NLinear directly? For accuracy, this may be nearly equivalent: NLinear's subtract-last-value step is already a residual on persistence. Our residual design is not claimed to forecast better. The claim is that moving the baseline and normalization to the client, and sizing CKKS to the error budget, shrinks ciphertexts and keys at equal accuracy. If the ablation shows no size or latency reduction relative to directly encrypted DLinear under general-purpose parameters, the contribution reduces to the audit, and we will say so.

Why not just use a polynomial deep network or a client-aided Transformer, which keep nonlinear capacity? The shuffling test in Are Transformers Effective for Time Series Forecasting? suggests that attention fails on these data for structural reasons, not because of which activation it uses. PolyNeXt's depth-scaling, from Activation-Free Backbones, consumes one multiplicative level per Hadamard product, which pushes it past the first modulus threshold. Still, a degree-two correction might capture cross-channel coupling that a linear map misses, as on Electricity. We test this directly by adding one Hadamard layer, at depth two, to the residual model and asking whether its value-added justifies the extra level.

Why not just add differential privacy noise and compute in the clear? Differential privacy protects data by adding random noise to it, and that noise lands directly on the short-range autocorrelation the baselines exploit. We include a local-noise baseline calibrated to standard privacy budgets. We expect it to fall below even plain persistence. If it does not, that weakens the case for encryption here.

Proposed Experiments

We use ETTh1, ETTh2 and ETTm1, Electricity, Exchange-Rate, and Weather, with standard look-back windows and horizons of 24 to 720 steps. We also run the Venice sea-level series to test very long windows, where Two Steps Forward and One Behind reports shallow models scaling to 23,040 points while Transformers become intractable beyond 2,880. The metrics are MSE and MAE, value-added over the best local forecast, single-query latency, ciphertext and key bytes, and value-added per second of server time. Latency is reported for single queries rather than batched throughput, since forecasting serves one client stream at a time; this is the regime where CryptoNets needed 250 seconds per prediction.

Three outcomes decide the claim. First, the residual depth-one model must retain at least 95% of the value-added achieved by the best encrypted deep competitor on each dataset and horizon. Second, error-budgeted parameters must yield measurably smaller ciphertexts and lower latency than general-purpose CKKS, with no more than 1% extra MSE. Third, the audit must show a horizon-dependent region in which the server beats the client's own local linear fit. If no such region exists on these benchmarks, that also answers the question: on standard forecasting data, encrypted forecasting buys nothing over the local baseline.