Shallow Encrypted Model Reduction for In-Transit Simulation Streams

Large scientific simulations produce data faster than disks can store it. One common fix is "in-transit" processing: simulation nodes stream their state over the fast interconnect to separate analysis nodes, which compress, monitor, or learn from it before anything reaches storage. Every system built this way assumes the analysis nodes are trusted. That assumption breaks when an industrial user runs a proprietary design on rented or shared machines and wants to use a model it does not own, for example a vendor's reduced-order model of a combustor. The user will not reveal the fields, and the vendor will not ship its model. Homomorphic encryption is the standard answer to this two-sided secrecy. It is a form of encryption that lets a server add and multiply encrypted numbers without decrypting them. It is also notoriously expensive, and its costs grow with the number of successive multiplications a computation needs.

This note proposes to design the in-transit computation around that multiplication budget. Our claim is that a quadratic manifold model, which compresses a field with a linear projection and corrects it with a quadratic term, is unusually well suited to encryption. It needs only three or four sequential multiplications, no nonlinear activations, and no "bootstrapping" (the costly procedure that refreshes accumulated encryption noise). Because the multiplication depth also fixes the ciphertext size, a shallow model is cheap on the network as well as on the processor. We will build and measure an encrypted in-transit service in which the vendor's analysis nodes compute three outputs from encrypted streamed snapshots: reduced coordinates, a quantity of interest, and a "does this state lie off the model" residual score. The simulation owner decrypts only these small outputs and uses them to steer its ensemble.

Core Claim

In encrypted in-transit analysis, multiplicative depth is the quantity to design around. Depth determines three things: the ciphertext modulus, the amount of data added to the interconnect, and whether bootstrapping is needed. The expansion follows directly from how the CKKS scheme stores numbers. A ciphertext is two polynomials of degree $N$ with coefficients modulo $Q$ and holds $N/2$ real values, so each value costs about

$$ b_{\text{ct}} \approx 4\log_2 Q \ \text{bits}, \qquad \text{expansion over float64} \approx \frac{\log_2 Q}{16}, $$

where $\log_2 Q$ grows roughly linearly with the number of multiplication levels the circuit consumes.

A depth-3 or depth-4 quadratic reduced model therefore travels the wire at a small multiple of plaintext size. A deep polynomial network needs a large $Q$ or repeated bootstrapping. We further claim that the packing layout for streaming is a latency knob. Packing spatial blocks of one snapshot into slots gives immediate processing but requires slot rotations to sum inner products. Packing the same grid point across $t$ consecutive time steps removes most rotations but buffers $t$ snapshots. A mixed space–time layout traces a measurable latency-versus-throughput curve that no prior work has characterized for simulation data.

Positioning Against Prior Work

The in-transit side supplies the setting and the reference numbers. LowFive and Wilkins redirect HDF5 writes into network streams without touching solver code. Melissa and MelissaDL (High Throughput Training of Deep Surrogates from Large Ensemble Runs) stream ensemble members into an in-memory "Reservoir" buffer to train surrogates. MelissaDL x Breed uses per-sample loss to steer solvers toward poorly modeled parameters. All of these move plaintext over a trusted fabric. We reuse their interception and buffering design but put ciphertexts on the wire. We also replace Breed's server-side ranking of losses with owner-side ranking of decrypted scores. That substitution sidesteps the encrypted-comparison problem entirely, because comparisons happen after decryption on a handful of scalars.

The model form comes from Online learning of quadratic manifolds from streaming data. That paper builds quadratic manifolds from petabyte streams using incremental SVD, cutting a 1.07 PB Kelvin-Helmholtz stream to about 54 GB. The research file correctly notes that incremental SVD, with its square roots, divisions and sorting, does not map onto encrypted arithmetic. We do not attempt to run it encrypted. The vendor trains the manifold in plaintext on its own data. Only evaluating the trained manifold, which is linear followed by quadratic, happens under encryption.

On the encryption side, CryptoNets and HTCNN show that packing many inputs into ciphertext slots buys throughput with square activations. SAFENet searches channel-wise polynomial degrees. All three target image classifiers. Towards Deep Neural Network Training on Encrypted Data shows encrypted training running 4–5 orders of magnitude slower than plaintext. That result constrains us and rules out training anything under encryption in the loop. FAMHE supplies a pattern we borrow: do cheap work in cleartext at the data owner and send only encrypted intermediates for shared computation. Its setting was static medical cohorts with synchronous rounds, not streams. Circuit Bootstrapping: Faster and Smaller makes bootstrapping cheaper. Our design aims to avoid bootstrapping altogether, so that work is a fallback rather than a component.

Research Program

The system has three parties. The owner runs the solver and holds the secret key. The vendor owns the manifold basis $V$, the quadratic correction $W$, and a quadratic quantity-of-interest map. The facility operator runs the analysis nodes and is honest-but-curious.

Snapshots are intercepted at the HDF5 write, as in LowFive, and encrypted under CKKS on the simulation node. They are streamed into an encrypted Reservoir on the analysis nodes. There the encoder $z = V^\top(x - \bar x)$ is computed as plaintext-by-ciphertext products accumulated across spatial blocks. The quadratic terms $z \otimes z$, the quantity of interest, and the residual $\lVert x - \bar x - Vz - W(z\otimes z)\rVert^2$ follow within a leveled budget of about four multiplications.

We will build three components. The first is a depth-audited compiler from trained quadratic manifolds to CKKS circuits, with parameter selection of $N$ and $Q$ driven by the audited depth. The second is the space–time packing layer, with temporal width $t$ as its control knob, implemented as a policy of the Reservoir buffer. The third is an owner-side decrypt-and-steer loop that feeds residual scores into Breed's AMIS sampler (Adaptive Multiple Importance Sampling, Breed's method for choosing which parameters to simulate next).

We will then analyze three quantities as functions of reduced dimension $r$, depth, and $t$: wire bytes per snapshot, analysis-node cycles, and end-to-end latency. We will also measure the fraction of solver time spent encrypting. The feasibility of the whole approach rests on that last quantity.

One caveat belongs up front. Encryption hides the owner's fields from both vendor and facility. It does not stop the owner from extracting a linear encoder by querying it. Returning $z$ reveals $r$ projections per snapshot. The default output mode therefore returns only the scalar quantity of interest and the residual. The $z$-returning mode is offered as an explicit disclosure trade.

Baselines

The naive reference point is plaintext in-transit processing in the MelissaDL style. The same quadratic manifold is evaluated on unencrypted streamed snapshots, on the same nodes, with the same Reservoir and interconnect. This gives the accuracy ceiling and the speed ceiling, and every encrypted configuration is reported as a slowdown factor against it. For scale, the file's plaintext reference is that MelissaDL multiplied batch throughput by 13x over offline training on HeatPDE (High Throughput Training). A plaintext run over TLS is included alongside it to separate transport encryption cost from computation cost.

The strongest existing encrypted method is HTCNN-style batched CKKS inference (HTCNN). It uses interleaved batch packing, rotation-key reuse, square activations and sum pooling. We apply it to a convolutional surrogate that predicts the same quantity of interest and residual from the same fields. It is the closest competitor because it is the only cited system tuned for encrypted throughput on dense tensor inputs.

The reported numbers apply only to images. HTCNN reaches "15.6 images/second" at "98.95%" on MNIST and processes "a batch of 227 images … in 678 seconds" at "74.19%" on CIFAR-10, using "3.3GB to 5.9GB of RAM". CryptoNets reports about 92 KB per MNIST image. We found no reported result on Lacuna for encrypted inference on PDE state fields, so this baseline must be run by us.

Fairness is enforced in four ways. Both pipelines use the same CKKS library and security level. They run on the same node count. They receive the same hyperparameter budget, set by a fixed number of architecture and degree configurations. And both are matched to within a fixed plaintext accuracy tolerance before encryption. The proposal beats this baseline if it reaches equal or lower quantity-of-interest error and conservation error at fewer wire bytes and higher snapshots per second.

The key ingredient, shallow depth, is isolated with a depth ablation. It compares a linear-only encoder (depth 1), the full quadratic manifold (depth 3–4), and a deliberately deepened polynomial model that needs bootstrapping. A packing ablation compares space-only packing ($t=1$) with time-only packing ($t$ equal to the slot count) and the mixed layouts in between.

Why not just…?

Why not just encrypt the wire with TLS and decrypt on the analysis node? This protects against eavesdroppers on the network but places plaintext fields in the memory of an operator we have assumed is untrusted. It also forces the vendor's model to sit next to the owner's data in the clear. The TLS run in our baselines measures its cost, which will be far lower than ours. We treat it as a lower bound on overhead, not as a solution to this threat model, and we make no claim that encryption is needed when all parties are trusted.

Why not just use a hardware enclave or confidential GPU? This is the most serious practical competitor, and we say so. An enclave could run the vendor model near plaintext speed. The file contains no measured comparison between enclave paging and homomorphic encryption throughput at simulation scale. The argument for encryption rests on not trusting hardware against side-channel attacks, and no experiment of ours can settle that. What we can do is report our slowdown against the plaintext ceiling, which upper-bounds any enclave's speed. Readers can then see exactly what price mathematical rather than hardware trust carries. If that price is prohibitive at useful $r$, we will say the enclave wins.

Why not just have the vendor disclose the basis, so the owner projects in situ and encrypts only the tiny reduced coordinates? This hybrid is a real threat. It cuts wire traffic from $n$ values to $r$ values per snapshot and leaves only the quadratic stage encrypted. We do not dismiss it; we include it as a design point. Its costs are twofold. It exposes $V$, the vendor's dominant modes, to the owner. It also adds $O(nr)$ projection work to the solver nodes, which is exactly the in-situ contention that in-transit processing exists to avoid. The experiments will measure solver slowdown under the hybrid against solver slowdown from encryption alone. If in-situ projection costs less than encryption for realistic $r$, the hybrid dominates whenever the vendor accepts disclosing $V$. Our contribution then narrows to the case where the vendor refuses.

Why not just add differential privacy noise and stream in plaintext? FAMHE reports a severe privacy–utility trade-off for noise-based protection in high-dimensional data (FAMHE). Noise added directly to fields also violates conservation and boundary invariants, which PDEBench's cRMSE and bRMSE metrics detect (PDEBench). Differential privacy also does nothing to protect the vendor's model. We will include one noise-perturbed run at a moderate privacy level to show the effect on these metrics.

Proposed Experiments and Decisive Checks

Data come from four sources. We use PDEBench 2D Navier–Stokes and shallow-water datasets, which are public and have conservation, boundary and Fourier error metrics. We use the HeatPDE ensemble from MelissaDL, with five temperature parameters between 100K and 500K, an 800-simulation training budget and 200 Halton validation runs, following Breed. We also regenerate reduced-scale versions of the Kelvin-Helmholtz and turbulent channel-flow runs from the quadratic manifold paper. The vendor's manifold is trained on one parameter range and the owner's stream comes from a shifted range, so the residual score has real out-of-model states to detect.

The first check is fidelity. Encrypted quantities of interest and residuals must match plaintext to within CKKS precision, and conservation, boundary and Fourier errors must be unchanged. The second check tests the expansion model: measured bytes per value should track $4\log_2 Q$ across audited depths. If a depth-4 circuit's stream saturates the interconnect at production rates, the claim fails. The third check is the latency–throughput curve over $t$, which we expect to show a useful middle regime where rotations drop sharply with modest buffering. The fourth check compares against the HTCNN-style surrogate at matched plaintext accuracy.

The fifth check is steering. Breed with decrypted residual scores should reach the same validation loss within the 800-run budget as Breed with plaintext losses. The sixth check, and the one that decides the whole approach, is whether encryption on the simulation node costs less of the solver step than in-situ projection would. If encryption costs more, the in-transit design is not justified and the hybrid wins.