acceptodds
Published as a conference paper at NeurIPS 2026

CipherFlow: Hardware-Aware Compiler Framework for Low-Latency Hybrid Secure Inference

Hedong Zhang, Mengxin Zheng, Qian Lou

Abstract

Secure inference enables clients to use cloud neural networks without revealing private inputs or intermediate values. Homomorphic encryption (HE) and secure multi-party computation (MPC) provide complementary cryptographic mechanisms for this goal, and recent hybrid HE-MPC secure inference systems have shown better performance than using either primitive alone. However, existing hybrid secure inference systems typically rely on fixed execution strategies that are brittle across deployments. The best hybrid plan depends on both the target execution environment and the evolving cryptographic state of the computation, making manual or static mappings insufficient. We present CipherFlow, a hardware-aware compiler for hybrid HE-MPC secure inference. Given a plaintext neural-network graph and a target deployment profile, CipherFlow automatically generates a deployment-specialized, latency-optimized secure execution program. It profiles deployment-specific primitive costs and performs state-aware graph optimization to jointly decide operator placement, cross-domain conversion, and cryptographic maintenance actions. We implement CipherFlow on real HE and MPC backends and evaluate end-to-end BERT-base and ViT inference across diverse CPU/GPU and network settings. CipherFlow achieves up to 16.5 speedup on BERT-base and over 22 on ViT over state-of-the-art static hybrid baselines. These results show that compiler support can make hybrid cryptographic inference portable across heterogeneous deployments, turning manual secure-inference engineering into an automatic deployment-specific optimization process.

Keywords:
Atlanta, Main Track

Reviews

Among:
Shape:
123456this paper, Bottom 49%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.33 over 3 reviews, above 49% of the others.
Reviewer_KSA2OpenReview ↗
Rating
5
Clarity
3
Confidence
4
Originality
2
Quality
3
Significance
3
Read review
Summary

The paper proposes a compiler framework for secure transformer inference. The main goal is to optimize end-to-end latency by dynamically assigning MPC and HE-based secure computation protocols based on available hardware/network conditions. To enable this, the framework includes a micro benchmarking tool that establishes cost parameters. The empirical evaluation demonstrates significant performance gains compared to HE/MPC protocol assignments in recent hybrid frameworks.

Strengths and weaknesses

Strengths: The high-level ideas of the paper are presented clearly and in an accessible way. The newly identified hybrid strategies show clear benefits in end-to-end latency compared to static standard assignments of recent hybrid MPC/HE frameworks (cf. Figure 3). The benchmarks are conducted using state-of-the-art MPC/HE building blocks/implementations.

Weaknesses:

The work is limited in optimizing execution/assignment only in terms of end-to-end latency. However, there are many other aspects that users would like to optimize for deployment, including monetary execution costs in cloud environments, which will significantly change assignments due to often higher costs for bandwidth and GPU compute compared to CPU compute.

The write-up significantly lacks technical details both on the algorithm design (also the pseudocode provided in the appendix is only very high level) as well as technical implementation of the inference system based on NEXUS CKKS and SHAFT MPC.

There exist several related works that are relevant yet not considered. Most prominently, the Matchmaker system by Jawalkar et al. that optimizes CPU/GPU assignment for FSS-based MPC to maximize throughput. There are also more recent works in MPC/HE hybrid secure transformer inference (e.g., EncFormer, TDSC'26) that could be considered in the performance evaluation.

Questions
  • Would it be possible to adapt the optimization approach for other goals than end-to-end latency? (cloud execution cost, throughput, etc.)
  • Can you describe some of the technical challenges in implementing both the compiler framework and secure inference based on NEXUS and SHAFT?
  • How do your ideas relate to the optimization approach in Matchmaker?
  • Have you considered the approach and assignment of EncFormer in your evaluation?
Limitations

The paper in its very last paragraph discusses some limitations and ideas for future work. However, this discussion could be significantly expanded, considering some of the limitations/weaknesses discussed above.

Paper formatting concerns

N/A

Final justification

The authors in their rebuttal provided robust discussions of open questions posed in my review. Assuming these will be incoporated in the final version, I increade my overall rating to recommend acceptance.

Reviewer_XPAgOpenReview ↗
Rating
4
Clarity
3
Confidence
2
Originality
3
Quality
3
Significance
3
Read review
Summary

HE and MPC are both cryptographic methods that allows trusted and confidential delegation of DNN computation. Prior works have observed that mixing these two schemes could provide better performance than employing any one approach alone.

This work presents CipherFlow, a hardware-aware compiler that automatically assigns each operator in the network to either HE or MPC. The challenge is that the best assignment depends on both the model structure and the deployment environment, such as the hardware and network conditions, so a strategy that works well in one setting may not transfer to another. CipherFlow profiles the real cost of each operator under both schemes to build a cost model, and searches for the placement (along with the necessary scheme conversions and HE level maintenance) that minimizes end-to-end latency. To keep this search tractable, it tracks the HE level as part of the planning state, and exploits the repeated block structure of transformers (BlockFold) to avoid an exponential search space.

Using the approach above, the authors show that CipherFlow is able to find plans that outperform fixed hybrid strategies across a range of hardware and network settings.

Strengths and weaknesses

Strengths

  • Formulates hybrid HE-MPC secure inference as a deployment-specific latency-minimization problem rather than a fixed operator-to-domain rule, jointly capturing operator placement, scheme conversions, and HE level maintenance under measured hardware and network costs.
  • Introduces a profiling-based cost model (MicroBench) together with state-expanded planning and BlockFold, which folds the repeated block structure of transformers into compact state transitions and reduces the planning from exponential to quadratic size, making the search tractable on transformer-scale graphs.

Weaknesses

  • The baselines are static hybrid strategies (BumbleBee, BOLT, BLB) and ablations of the compiler. Since the central claim is that joint, state-aware planning beats local choices, a random or greedy per-node baseline (selecting MPC or HE per operator, whichever is locally faster) would be a natural point of comparison.
  • The cost model appears to treat HE execution cost as independent of the operator's level, though in CKKS the runtime can depend on it, since operations on a longer modulus chain are more expensive. This could misestimate costs for deep graphs where operators run at very different levels.
  • The reported end-to-end latencies appear to be composed from the same per-operator costs the planner optimizes against, so they isolate the benefit of placement but do not validate the cost model against true wallclock. It would be nice to see perhaps a plot that shows the correlation between the cost model and measured runtime.
  • Communication volume is in the cost model, but only latency is optimized and reported. Since the selected plans swing between all-MPC (high volume) and all-HE (zero volume), it would be informative to compare their volume against the baselines, as optimizing for latency alone may carry a substantial volume cost.
  • The evaluation covers fixed-shape encoders (BERT-base, ViT-B/16). Since the plan comes from a one-time profiling pass over a static graph, dynamic-shape workloads such as decoding might require re-profiling and re-planning, though this is not discussed.
Questions
  • How does this work compare to the prior work CostSphere: A Cost Model-Driven Privacy-Preserving Machine Learning Framework with Network Context Adaptation (Yuntian Chen et al.)? That work appears to cover many of the same ideas, and reports a similar level of acceleration over the baseline. The paper positions itself against COSTCO, but not against CostSphere.
  • The asymptotic planning complexity is characterized (O(NL^2) with BlockFold), but compile time is reported for only a single model (BERT-base). How would the compile time scale empirically with larger models or deeper graphs? And would the approach extend to different block types such as MoE, where data-dependent expert routing breaks the static-graph assumption?
  • How would the plans change under batched inference, with multiple concurrent requests in flight, given HE's ability to perform vector (SIMD) operations (see Coyote, ASPLOS 2023)? The Discussion acknowledges that serving effects such as concurrency and batching are not modeled, so it would be useful to understand how much the plans would shift.
Limitations

yes

Paper formatting concerns

none

Final justification

Thank you for your response and clarification. I remain relatively positive about this work, and would like to maintain my current score.

Reviewer_5iPuOpenReview ↗
Rating
4
Clarity
2
Confidence
4
Originality
2
Quality
3
Significance
3
Read review
Summary

Given a model to be executed in a hybrid HE-MPC fashion, this work proposes a hardware-aware compiler that optimizes for end-to-end latency instead of relying on specific protocol deployment strategies. This work offers a benchmark module that determines the latency of the HE/MPC operators and constructs a corresponding graph to evaluate the model.

Strengths and weaknesses

Quality

  • MicroBench takes into account FHE bootstrapping, which is an expensive process. I am interested in knowing under what circumstances bootstrapping with FHE would be preferred. Based on my understanding, it would make sense to avoid bootstrapping in any implementation. However, in Appendix B, MicroBench monitors the resources needed for bootstrapping and uses it as part of the optimization process. See question 1 and 2.
  • Augmenting a cryptographic state to nodes and determining the shortest path is an interesting idea, However, it does seem like such a notion implicitly implies that FHE is the "baseline" and "switch to MPC if too expensive". Would there be a different path if MPC costs are included? See question 3.
  • BlockFold reduces the cost of searching for the shortest path.

Clarity

  • In Figure 2, there are repeated numbers, and as a result, I had some difficulty in understanding the diagram.
  • Line 189 claims three components but I seem to only count two: MicroBench and BlockFold. I am not sure what is the third.
  • I think there is a typo in Appendix B, line 481 to 482.

Significance

  • This work considers a different paradigm towards hybrid model inference by choosing between fundamental computation components instead of a linear/non-linear split as per existing works.
Questions
  1. If bootstrapping is ignored and the optimization flow is made based on the remaining 4 operations, would there be a difference in the latency improvement?

  2. As mentioned in Section 2.1, there is a "free bootstrapping" when converting between FHE ciphertext and MPC shares. Is there a need to monitor the cost of FHE bootstrapping?

  3. Is communication cost part of the cost metric?

Limitations

yes

Paper formatting concerns

nil

Final justification

I am raising my score to 4, with adjustments in quality and significance from 2 to 3.

In my rebuttal with the authors, they have, in my opinion, shown that FHE bootstrapping is actually preferred under some scenarios which is contrary to my original belief. I feel that "MicroBench"+"State-Expanded Planning"+"BlockFold" does indeed contribute to secure inference with hybrid FHE+MPC frameworks via a cost-optimization model in dynamic settings.

Comments on the paper

1 comment
Meta-review

This paper presents CipherFlow, a hardware-aware compiler designed to optimize end-to-end latency for hybrid HE-MPC secure transformer inference. By combining profiling-based cost estimation with state-expanded path search and block folding, the framework dynamically assigns cryptographic operators based on deployment environments.

Reviewers highlight the paper's key strengths: a practical latency-minimization formulation, solid hardware/network-aware profiling, and effective search space reduction for transformer models, yielding clear empirical gains over static hybrid baselines.

However, reviewers raised critical weaknesses regarding clarity, methodology, and evaluation:

--Reviewer 5iPu points out confusing figures, ambiguous component counting (Line 189), and possible typos in Appendix B.

--Reviewer XPAg notes potential misestimations in HE levels, unvalidated cost-model predictions versus real wall-clock runtime, and missing discussions on communication volume and dynamic shapes. Reviewer KSA2 emphasizes the lack of technical implementation details and optimization beyond latency.

--Reviewers request missing comparisons with local greedy/random baselines, relevant prior works (e.g., CostSphere, Matchmaker, EncFormer), and empirical compiler scaling.

Authors should address Reviewer 5iPu's concerns regarding FHE bootstrapping necessities, and clarify issues raised by Reviewers XPAg and KSA2 regarding cost-model validation, baselines, and implementation details.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.