CipherFlow: Compiling AI Programs for Efficient Cryptographically Secure Inference
Hedong Zhang, Mengxin Zheng, Qian Lou
NeurIPS 2026
TL;DR. Hardware-aware compiler that automatically maps neural-network operators across homomorphic encryption and secure multi-party computation to minimize secure inference latency across different hardware and network settings.
Abstract. Cryptographically secure inference faces two practical challenges: making secure programming accessible to AI developers and data scientists, and achieving efficient execution across deployment environments. Developers must compose cryptographic primitives correctly, while performance depends on hardware, networks, and evolving ciphertext states. We present CIPHERFLOW, a compiler framework that takes a high-level AI computation graph, available cryptographic primitives, and a target hardware and network configuration to generate an executable, latency-optimized secure inference program. CIPHERFLOW automates cryptographic execution decisions through three techniques: MicroBench profiles deployment-specific primitive costs; state-expanded planning jointly optimizes homomorphic encryption (HE) and secure multi-party computation (MPC) placement, conversions, and ciphertext maintenance under cryptographic-state constraints; and BlockFold summarizes branched regions to scale planning to Transformer graphs. Evaluation using measured HE/MPC backend costs across CPU/GPU and network settings shows up to 16.5$\times$ speedup on BERT-base and over 22$\times$ on ViT compared with static hybrid placement baselines. CIPHERFLOW separates model programming from cryptographic execution decisions, enabling developers to express AI computations while the compiler constructs efficient secure programs.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 3 reviews · OpenReview
Updated 25 Nov 2026, 03:42 UTC.
- Decision
- Accept (poster)
Read decision
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.
Final justification
Reviewers recognized clear empirical gains, and the authors satisfactorily clarified concerns on bootstrapping, cost modeling, baselines, scalability, and related work. The final version should incorporate the promised revisions. Note: Please add the source code link for the paper in the main text in the final version. I recommend acceptance.
Read meta-review
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.
Final justification
Reviewers recognized clear empirical gains, and the authors satisfactorily clarified concerns on bootstrapping, cost modeling, baselines, scalability, and related work. The final version should incorporate the promised revisions. Note: Please add the source code link for the paper in the main text in the final version. I recommend acceptance.
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
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.
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.
Formatting concerns
N/A
4 comments
Rebuttal 2
W4 / Q4: Relation to EncFormer
Thank you for pointing us to EncFormer and we will cite and discuss it. EncFormer improves the underlying hybrid inference stack through Stage-Compatible Patterns, optimized FHE kernels, a complex CKKS–MPC conversion protocol, and communication-efficient MPC protocols for nonlinearities. Its cost analysis supports principled selection among FHE–MPC boundaries.
CipherFlow addresses a complementary graph-level optimization problem: automatically selecting operator placements, conversions, and HE-level maintenance for a specific hardware and network environment, while enforcing feasibility and cryptographic-state compatibility across branched graphs. EncFormer’s kernels, packing layouts, and conversion protocols could therefore be represented as additional profiled actions, with their shape and parameter requirements encoded by CipherFlow’s feasibility constraints.
EncFormer appeared contemporaneously with our work, so it was not included in the submitted experiments. We will add a detailed comparison in Related Work and evaluate its placement strategy or integrate its primitives where feasible in the revision.
We hope the expanded technical details and the positioning against Matchmaker/EncFormer address the reviewer's concerns, and we thank the reviewer again for pointers that materially improve the paper's placement in the literature.
Response to Rebuttal
Thanks for the responses! Assuming these are properly incorporated into the final version, I remain positive about the paper.
Thank you for your constructive comments throughout the review process and for the positive feedback.
- Rating
- 4/6
- Confidence
- 2/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
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
Final justification
Thank you for your response and clarification. I remain relatively positive about this work, and would like to maintain my current score.
Formatting concerns
none
4 comments
Rebuttal
We thank the reviewer for the thorough and constructive review.
W1: Greedy / Random per-node baselines
Thank you for this suggestion. We implemented both baselines using the same MicroBench profiles and the same deployment grid as in §4:
- Greedy: Assign each operator to the locally faster domain, then insert the conversions and bootstraps required for a valid plan.
- Random: Sample 100 uniform random per-operator assignments per deployment setting and report the best and median.
The table reports baseline latency normalized by CipherFlow latency; higher is worse.
| Model | Platform | Greedy | Random best-of-100 | Random median |
|---|---|---|---|---|
| BERT | CPU | 1.37× | 10.9× | 16.3× |
| BERT | GPU | 5.75× | 14.0× | 18.6× |
| ViT | CPU | 1.43× | 11.3× | 17.0× |
| ViT | GPU | 5.39× | 13.9× | 18.6× |
Greedy never outperforms CipherFlow and can be substantially slower when locally preferred domains alternate across adjacent operators. On GPU at 10 Mbps, it assigns 108 of 132 operators to HE and 24 to MPC, inducing 72 HE–MPC conversions. Their overhead outweighs the local operator savings, making greedy 5.75× slower than CipherFlow’s all-HE plan.
Random assignments perform even worse: across the tested models and platforms, the worst-setting best-of-100 sample is 10.9–14.0× slower, while the median is 16.3–18.6× slower. These results show why placement must jointly account for operator, conversion, and HE-level-maintenance costs. We will add these baselines to the revision.
W2: Level-Dependent HE Execution Cost
We agree that CKKS operation latency can vary with the current modulus-chain level. Our current MicroBench profile uses one HE cost per operator, measured at the level used by the corresponding operator in the NEXUS pipeline, and therefore does not capture this variation explicitly.
This limitation is straightforward to address because the planner already tracks the remaining HE level in each state. We can replace the current cost with a level-dependent cost , obtained by profiling each representative operator at every legal level. This requires no change to the planning algorithm, and the state-space and time-complexity bounds remain .
We will add level-parameterized HE profiling and report both the per-level runtime variation and whether it changes the selected plans or their predicted latency. We will also state the current single-level approximation explicitly as a limitation.
W3: Cost-model Validation vs Wall-clock
All MicroBench entries are wall-clock measurements on the target HE/MPC backends (CV: 1–5% on CPU and <1% on GPU). We additionally executed QK → Softmax → AV → LayerNorm → GeLU (, ): localhost latency was 2.3 s versus a 2.5 s prediction, corresponding to 6–9% error. The nonlinear operators were within , while the two attention matmuls were 30–37% faster than predicted.
Under different network settings, predictions remained conservative. Raw protocol rounds overestimate WAN latency because many rounds are pipelined; we will instead fit effective blocking rounds from shaped-network measurements. The largest reported speedup (16.5×, GPU/10 Mbps) uses an all-HE plan and contains no network term. We will add the predicted-versus-measured results and this refinement.
W4: Communication Volume of Selected Plans
We computed online communication across the grid; representative BERT-base results are:
| Platform / network | Ours latency (s) | Ours volume (GiB) | BumbleBee (GiB) | BOLT (GiB) | BLB (GiB) | All-MPC (GiB) |
|---|---|---|---|---|---|---|
| GPU, 10 Mbps | 472 | 0.0 | 12.3 | 10.4 | 8.5 | 10.5 |
| GPU, 3 Gbps / 80 ms | 127 | 10.2 | 12.3 | 10.4 | 8.5 | 10.5 |
| CPU, 10 Mbps / 1 ms | 7,934 | 7.9 | 8.9 | 7.0 | 5.2 | 10.5 |
| CPU, 1 Gbps / 20 ms | 486 | 10.5 | 8.9 | 7.0 | 5.2 | 10.5 |
At low bandwidth, CipherFlow chooses HE-heavy plans; at GPU/10 Mbps, all-HE has zero HE–MPC protocol communication versus 8.5–12.3 GiB for static hybrids. At high bandwidth, latency-optimal MPC-heavy plans may communicate more—for example, 10.2 versus 8.5 GiB for BLB on GPU/3 Gbps and 10.5 versus 5.2 GiB on CPU/1 Gbps. We will report this latency–volume trade-off.
Rebuttal 2
W5: Dynamic Shapes
We agree that CipherFlow currently assumes a static computation graph with fixed tensor shapes. MicroBench caches costs by operator type, tensor shape, and backend, so each previously unseen shape needs to be profiled only once, after which the result can be reused.
Autoregressive decoding is more challenging because tensor shapes and execution characteristics evolve across decoding steps. Supporting such workloads may require runtime shape prediction and precompiled plans for anticipated decoding stages. We will clarify the current fixed-shape assumption and discuss dynamic-shape decoding as future work.
Q1: Comparison with CostSphere
CostSphere formulates hybrid inference primarily as cost-driven HE/MPC assignment over an ordered operator sequence, whereas CipherFlow formulates it as deployment-specialized compilation of a stateful cryptographic program over a branched dataflow graph. The distinction is therefore not merely a different cost model or solver, but the optimization abstraction itself.
First, CostSphere's switching formulation relates adjacent sequence positions and does not explicitly model joint cryptographic-state compatibility at residual or attention joins; CipherFlow enforces join feasibility and uses BlockFold to summarize branched regions. Second, CostSphere approximates HE-state evolution using a consecutive-FHE count and threshold-triggered bootstrapping, whereas CipherFlow propagates the remaining level ℓ using per-operator deltas and optimizes execution, conversion, and maintenance as explicit state transitions. Third, CostSphere primarily adapts learned costs across network settings on a CPU platform, while CipherFlow profiles the target CPU or GPU backend and specializes the plan jointly to hardware, bandwidth, and RTT; Figure 4 shows that hardware can reverse the optimal placement. Finally, CipherFlow's state-expanded shortest-path formulation and BlockFold provide scalable, feasibility-preserving planning over branched graphs, with O(NL²) composition and approximately 3.5-second BERT-base compilation.
Thus, CipherFlow is not merely a more accurate solver of the same assignment problem. Its novelty is a unified compiler formulation for deployment-specialized cryptographic-state evolution over branched neural graphs, where placement decisions affect downstream feasibility and joins couple the states of multiple execution paths. We will add a detailed comparison to Related Work.
Q2: Empirical compile-time scaling; MoE
We additionally measured the full compilation pipeline, including MicroBench cache lookup and materialization of the five baseline plans, on CPU:
| Encoder blocks | 12 | 24 | 48 | 96 |
|---|---|---|---|---|
| Operators | 132 | 264 | 528 | 1,056 |
| Compile time | 3.0 s | 6.1 s | 13.0 s | 25.6 s |
Compile time scales approximately linearly with model depth: increasing the operator count by increases compilation time by . This is consistent with the linear dependence on in the bound when the HE level budget is fixed.
For MoE models, data-dependent expert routing violates our current static-graph assumption. Because experts within a layer often share the same structure, a possible extension is to compile reusable expert-level transfer tables (via BlockFold) and select among compatible precompiled plans at runtime. Modeling routing distributions and serving effects remains future work. We will add both the scaling results and this limitation to the revision.
Q3: Batched Inference and HE SIMD
We agree that batching may change the optimal plan. CKKS SIMD can pack multiple requests into ciphertext slots and amortize HE computation, while MPC communication generally grows with processed data. Thus, batching may shift some settings toward HE, depending on batch size and packing efficiency.
CipherFlow can support batch-aware planning by profiling batched tensor shapes and including batch size in the plan key. Jointly optimizing batching and packing (in the spirit of Coyote's vectorization search) together with HE–MPC placement remains future work. As the reviewer notes, the Discussion (Section 5) already lists batching and serving effects as an explicit limitation; we will expand that paragraph with this analysis and cite Coyote.
Thank you for your response and clarification. I remain relatively positive about this work, and would like to maintain my current score.
Thank you for your response. We appreciate your positive feedback and will incorporate the discussed changes into the final version.
- Rating
- 4/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 2/4
- Significance
- 3/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
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
-
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?
-
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?
-
Is communication cost part of the cost metric?
Limitations
yes
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.
Formatting concerns
nil
7 comments
Rebuttal
We thank the reviewer for the careful reading. The review's central technical questions (Q1, Q2, and the "FHE as baseline" concern) all trace back to one point: whether a ciphertext should be refreshed by a direct bootstrap or by an HE→MPC→HE round-trip is itself deployment-dependent — and the compiler decides it from measured costs rather than assuming either. We answer the three questions with new quantitative results.
Q1 - What happens if direct bootstrapping is removed?
We re-run CipherFlow with the bootstrap transition disabled, while retaining the other four action types and allowing ciphertext refresh through HE→MPC→HE round trips.
Removing bootstrapping degrades performance in GPU settings. At 10 Mbps, latency increases from 472 s to 1,828 s, making it 3.87× slower, because the original optimal plan uses 17 direct bootstraps to avoid costly HE→MPC→HE communication. At 100 Mbps, disabling bootstrapping increases latency by up to 1.23×.
These results show that conversion-based refresh does not universally replace direct bootstrapping. When computation is relatively cheap but communication is costly, direct bootstrapping can outperform conversion-based refresh. We will add this ablation to the appendix.
Q2 - Why profile bootstrapping if HE→MPC→HE refreshes the level?
The term “free bootstrapping” appears to have caused a misunderstanding. In Lines 135–137, we mean that an HE→MPC→HE round trip returns to HE with a fresh noise/level budget and can replace a direct bootstrap. We do not mean that this refresh has zero cost: the round trip still incurs two conversions, including computation, communication, protocol interaction, and representation alignment.
Direct bootstrapping and conversion-based refresh consume different resources. A direct bootstrap remains entirely in HE, incurs no HE–MPC communication, and is primarily compute-bound. In contrast, an HE→MPC→HE round trip is communication-dependent and requires scale, packing, and representation conversion. Therefore, neither mechanism is universally cheaper. This trade-off is evident in the measured refresh costs for a tensor of shape [1,128,768]:
| Refresh cost | 10 Mbps | 100 Mbps | 1 Gbps | 3 Gbps |
|---|---|---|---|---|
| HE→MPC→HE round-trip | 62.9 s | 6.3 s | 0.7 s | 0.2 s |
| Direct bootstrap, CPU (51.6 s) | bootstrap wins | round-trip wins | round-trip wins | round-trip wins |
| Direct bootstrap, GPU (1.7 s) | bootstrap wins | bootstrap wins | round-trip wins | round-trip wins |
The preferred mechanism changes with the deployment: direct bootstrapping is cheaper under constrained communication, whereas the conversion round trip becomes cheaper as bandwidth increases. Consequently, modeling FHE bootstrapping cost is necessary for the compiler to choose the lower-cost refresh path rather than imposing a static “never bootstrap” rule.
On "state expansion implies FHE is the baseline, switching to MPC only when too expensive"
We would like to correct this impression: the state-expanded graph is fully symmetric between the two domains. Table 3 lists five transitions — HE execution, MPC execution, HE→MPC conversion, MPC→HE conversion, and bootstrapping — and MPC execution costs (local compute + communication volume + rounds × RTT) enter the objective exactly as HE costs do. Plans may start and end in either domain; nothing anchors the search at HE.
Figure 4 provides direct empirical evidence that MPC is not treated as a fallback. MPC costs are already included in the optimization and, under many settings, lead to MPC-dominant solutions. On the CPU platform, the compiler selects pure-MPC plans, using HE for 0 of the 132 operators, at every bandwidth of at least 100 Mbps (Fig. 4, left column). Conversely, on the GPU platform at low bandwidth, it selects pure-HE plans. These results would not arise if MPC costs were excluded from the planner's objective.
Q3 — Is communication cost part of the cost metric?
Yes, as a first-class term. Appendix H, Lines 559–566, defines how communication volume and interaction rounds enter the deployment-specific cost metric. Every profiled action carries a triple (local compute c_loc, communication volume b, round count r), composed per deployment as
latency =
c_loc+ 8·b/BW +r·RTT (Appendix H)
MPC operators and HE↔MPC conversions carry non-zero b and r; HE execution and bootstrapping are pure compute (b = r = 0). This composition is how bandwidth and RTT reshape the optimal plan across Fig. 3.
Rebuttal 2
Clarity issues
- Figure 2 repeated numbers. The repetition is intentional: the numbers denote pipeline stages, not sequential steps. Two boxes sharing the same number are independent components of the same stage, and both of their outputs feed the next stage. In the revision we will clarify this stage-based semantics in the caption and mark parallel components as ②a/②b to make the convention explicit.
- Line 189 "three components". The three components are already introduced in Section 3: MicroBench at Line 189 (§3.1), State-Expanded Planning at Line 191 (§3.2), and BlockFold at Line 193 (§3.3). Figure 2 also marks each component with a dashed box. However, State-Expanded Planning (“StateExp”) is less visually prominent because its name is not emphasized in the text and its dashed region in the figure is relatively small, making it easy to overlook. We will make all three components equally explicit and visually salient.
- Appendix B (L481–482). The sentence should read "…(detailed in Table 3). The two conversion directions are measured separately…" — we will fix this in the revision. We will also complete Appendix D (StateExp) with the full transition-rule exposition and a worked example.
We hope these clarifications show that the bootstrapping question the reviewer raises is not an inconsistency in the design but the very deployment-dependence the compiler is built to exploit — the planner selects conversion-based refresh where it is optimal and direct bootstrapping where communication constraints make it preferable, with up to 3.87× latency at stake. Together with the fixed presentation issues, we would be grateful if the reviewer would consider updating their assessment.
Q1+ Q2: This is an interesting result. While I am mostly familiar with FHE, it has not occurred to me that communication cost in MPC could potentially perform worse in latency compared to FHE bootstrapping. I did not misunderstand the term "free bootstrapping". I am aware that switching to MPC and back effectively refreshes the noise, resulting in a "bootstrapped" ciphertext. This process (HE->MPC->HE), in fact, was what I leaned towards, and hence the question on removing HE bootstrapping. I feel that beyond just a simple ablation study, it would be helpful to also highlight this either in the main text or Appendix B.
Q3 + state expansion: Thank you for drawing my attention to Figure 4. May I ask how did the coefficient "8" come about in the latency cost calculation?
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Rebuttal
We thank the reviewer for the positive assessment of the ideas and benchmarks and for the very relevant pointers, which we address below.
W1 / Q1: Optimizing for objectives other than end-to-end latency
CipherFlow's planner minimizes additive per-action edge costs and is therefore not limited to latency. Each profiled action records compute time, communication volume b, round count r, and device type. These quantities can be reweighted to support objectives such as:
Throughput is different because it depends on concurrency, batching, and resource contention rather than additive single-request costs. Supporting it requires a serving-aware extension and remains future work. We will expand the Discussion and Limitations accordingly.
W2 / Q2: Technical details of the implementation
On the algorithmic side, we will provide the complete algorithmic specification in the revision, including: the full state definition (i,d,ℓ) and all five transition rules with their feasibility conditions, the join-handling rules for branched regions (operand domain/level compatibility at residual and attention merges), and the full BlockFold procedure (SESE region extraction, per-region transfer-table construction, and macro-level composition with backtracking), together with a worked example on one encoder block.
On the systems side, the main implementation challenges are:
Together, these challenges motivate stateful, feasibility-aware planning rather than independent per-operator assignment.
W3 / Q3: Relation to Matchmaker
Thank you for pointing us to Matchmaker, we will cite and discuss it. Both works are deployment-aware, but optimize different decisions.
Matchmaker operates within 2PC-MPC, combining CPU-oriented LSS and GPU-oriented FSS execution to improve batch throughput across deployment settings. Its optimization distributes requests across protocol/device configurations rather than assigning individual graph operators or tracking dataflow-dependent cryptographic state.
CipherFlow performs per-operator HE/MPC placement for single-request latency on branched transformer graphs. Placement jointly determines conversions, ciphertext-level evolution, bootstrapping, and compatibility at residual and attention joins, motivating our state-expanded formulation and BlockFold.
The approaches are complementary: a Matchmaker-style protocol suite could serve as an MPC backend profiled by MicroBench, while CipherFlow optimizes HE/MPC placement above it. We will clarify this distinction in Related Work.