PrivCirNet: Efficient Private Inference via Block Circulant Transformation

Homomorphic encryption (HE)-based deep neural network (DNN) inference protects data and model privacy but suffers from significant computation overhead. We observe transforming the DNN weights into circulant matrices converts general matrix-vector multiplications into HE-friendly 1-dimensional convolutions, drastically reducing the HE computation cost. Hence, in this paper, we propose \method, a protocol/network co-optimization framework based on block circulant transformation. At the protocol level, PrivCirNet customizes the HE encoding algorithm that is fully compatible with the block circulant transformation and reduces the computation latency in proportion to the block size. At the network level, we propose a latency-aware formulation to search for the layer-wise block size assignment based on second-order information. PrivCirNet also leverages layer fusion to further reduce the inference cost. We compare PrivCirNet with the state-of-the-art HE-based framework Bolt (IEEE S\&P 2024) and the HE-friendly pruning method SpENCNN (ICML 2023). For ResNet-18 and Vision Transformer (ViT) on Tiny ImageNet, PrivCirNet reduces latency by $5.0\times$ and $1.3\times$ with iso-accuracy over Bolt, respectively, and improves accuracy by $4.1\%$ and $12\%$ over SpENCNN, respectively. For MobileNetV2 on ImageNet, PrivCirNet achieves $1.7\times$ lower latency and $4.2\%$ better accuracy over Bolt and SpENCNN, respectively. Our code and checkpoints are available on Git Hub.

Paper

Similar papers

Peer review

Reviewer mVR65/10 · confidence 4/52024-06-18

Summary

Proposing the use of cyclic blocks for matrix multiplication to accelerate privacy-preserving inference in neural networks.

Strengths

PrivCirNet features a novel encoding algorithm optimized for block circulant weight matrices, dubbed CirEncode, that reduces the HE computation in proportion to block size. PrivCirNet also co-design a latency-aware optimization formulation for layer-wise block size assignment based on second-order information.

Weaknesses

The model proposed by the authors is interactive privacy-preserving neural network reasoning, which only provides comparisons of reasoning latency with comparison objects and lacks comparative experiments with communication traffic.

Questions

1. model parameters tend to be fractional, why choose bfv over the more fractional friendly ckks? 2. why is the table layout inconsistent? For example, table 1 and table 2. 3. again in table 4, why the accuracy of MobileNetV2 is higher after 50% compression of the proposed method than uncompressed? This is inconsistent with the intuition of information loss after compression. 4. the polynomial modulus used in Figure 4 is x^16-1, but the usual BFV encryption has a polynomial modulus of x^N+1. isn't the article using the original BFV? From the appendix and the supplementary material submitted, I can find no correlation.

Rating

5

Confidence

4

Soundness

3

Presentation

2

Contribution

2

Limitations

Better to solve the limitions.

Authorsrebuttal2024-08-10

Follow-up on Rebuttal for paper 1826 - Request for Response

Dear Reviewer mVR6, We are writing to follow up on the rebuttal submission for our paper. We have carefully addressed all the concerns you raised in your initial review, providing additional data and clarifications to support our responses. Given the significant impact of your review on the final decision, we believe our rebuttal must be fully considered. We kindly request your prompt feedback on our responses, as your input is essential to ensuring a fair and balanced evaluation of our work. Please let us know if there are any additional points you would like us to address or if further clarification is required. Thank you for your attention to this matter.

Authorsrebuttal2024-08-11

Thanks for your helpful comment. Response to reviewer mVR6

We appreciate your advice on improving the clarity of our paper. In the final version, we will explain in the appendix why our encoding scheme uses $\mod x^n-1$. As for the conversion protocol, we initially omitted the details since HE+MPC is a mainstream technique in hybrid HE-based frameworks, and nearly all related works utilize the same conversion protocol. However, we will now add an explanation of the hybrid HE+MPC scheme to the appendix. Thank you again for your attention and valuable suggestions.

Reviewer wNvj6/10 · confidence 4/52024-07-12

Summary

This paper proposes an optimization for linear layers of secure inference systems. The authors propose a linear layer evaluation protocol that can efficiently compute linear layers when the model weights are circulant (diagonally repeating). They also propose optimizations to determine the optimal block size to achieve a balanced tradeoff between accuracy and latency. The authors demonstrated the linear layer efficiency with extensive evaluations.

Strengths

- Improving the efficiency of secure inference systems is an important problem. - The idea of proposing HE-friendly linear layer evaluation for circulant weights is interesting. - The proposed method is sound with decent performance.

Weaknesses

- Some of the statements are misleading and the presentation can be further improved to avoid misunderstandings. - The details of how nonlinear layers are evaluated are missing.

Questions

Overall I think this paper is interesting. I have some concerns about some statements and comparisons with the prior work BOLT (S&P'24). - In the motivation section, you mentioned that the linear layers are the bottleneck of BOLT. But from BOLT's results, the nonlinear layers seem to occupy more than 70% of the runtime in the WAN setting. I think it should be made clear that the linear layers become the bottleneck when you consider very fast network settings. - It should be made clear that the proposed method is for circulant weight matrix only instead of general matrix multiplications, the notation of GEMM is very misleading, and I think it should be replaced. - BOLT is specifically designed and optimized for transformers, I'm wondering what adaptations have you made to BOLT for the models considered in the paper? It might be not fair to compare your protocol to BOLT as it's not specifically designed for CNNs. - In BOLT, you can also make the weight matrix circulant. In this case, the multiplications between weights and ciphertext inputs should be very fast as you just need to multiply a scalar to the ciphertext. Can the authors compare this simple adaptation? Also, it should be made clear when comparing with prior methods that the prior methods are for general matrix multiplications, but your proposal is not. - I'm wondering how the nonlinear layers are evaluated. Which crypto primitive are you using for that? Does your code include the MPC part?

Rating

6

Confidence

4

Soundness

3

Presentation

2

Contribution

2

Limitations

See my concerns in the Question section.

Reviewer eLA66/10 · confidence 4/52024-07-13

Summary

The paper introduces PrivCirNet, a framework designed to enhance the efficiency of private DNN inference using homomorphic encryption (HE) and MPC schemes. The key contributions are as follows. 1. By converting DNN weights into block circulant matrices, the framework transforms general matrix-vector multiplications into HE-friendly 1-dimensional convolutions, significantly reducing computational overhead. 2. PrivCirNet customizes the HE encoding algorithm to fully leverage the block circulant transformation, reducing computation latency in proportion to the block size. 3. The framework includes a latency-aware formulation to search for optimal layer-wise block size assignments using second-order information. 4. PrivCirNet employs layer fusion techniques to further minimize inference costs. 5. The framework demonstrates substantial improvements over state-of-the-art HE-based frameworks (e.g., Bolt) and HE-friendly pruning methods (e.g., SpENCNN) in terms of both latency and accuracy across various models (ResNet-18, Vision Transformer, MobileNetV2) and datasets (CIFAR-10, CIFAR-100, Tiny ImageNet, ImageNet).

Strengths

The use of block circulant transformation for optimizing HE-based DNN inference at the HE/MPC hybrid approach is novel and innovative. The paper includes thorough evaluations and comparisons with existing methods, providing strong evidence of the proposed framework's effectiveness. The structure and presentation of the paper are clear, making the methodology and results easy to understand. Finally, the framework addresses a critical issue in privacy-preserving machine learning, offering substantial improvements in both efficiency and accuracy.

Weaknesses

This paper does not provide the actual implementation code needed to reproduce the simulation results. Additionally, while the paper offers an explanation of homomorphic encryption (HE), it does not clearly present the implementation details for multi-party computation (MPC). The results report overall latency without distinguishing between the HE part and the MPC part, making it difficult to discern the extent of performance improvement specifically attributed to HE.

Questions

In Figure 9, the comparison of latency and accuracy is conducted against the worst-case scenarios of existing work. Is this comparison fair?

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

They did adequately.

Reviewer eRSG6/10 · confidence 4/52024-07-17

Summary

The authors have proposed a co-design method for making the Homomorphic encryption (HE) evaluation faster in private inference. Specifically, they used a new HE encoding mechanism to leverage the properties of the black-circulant matrix to reduce the HE rotations and ciphertext-plaintext multiplications. The experiments are performed on various CNN models and ViT models with multiple datasets.

Strengths

1. Authors have tailored the SOTA HE algorithm, BSGS implemented in BOLT, to leverage the block-circulant matrix properties to further speed up the HE evaluation in private inference. They have implemented various crypto algorithms, which require a reasonable effort in C++. 2. Thorogh experimentation, including ViT models on ImageNet, TinyImagNet, and CIFAR-10/100 datasets. 3. The paper is well-structured and thoroughly written, making it easy to follow even for those who are not experts in this field.

Weaknesses

$\bullet$ **Limited Novelty** The idea of employing black-circulant matrices for faster convolution, both in plaintext [1] and ciphertext [2], is not new. The authors have just tailored them for the BGSG algorithm, by making the block-size variable. Moreover, the efficiency of the proposed encoding method, CirEncode, has been validated with a relatively smaller hidden size. For example, ViT with hidden dimensions 192 and 256. In contrast, the BERT-based model, used in BOLT, has a hidden dimension of 768. The efficacy of the encoding mechanism should be validated against 768 and/or 1024 hidden dimensions. $\bullet$ **Compariosn against HybReNets** Authors have shown comparison with ResNet18 baseline in Figure 9. However, recently, there have been more efficient baselines for private inference have been devised such as HybReNets (e.g., HRN-5x5x3x and HRN-2x5x3x) [3]. These privacy-friendly baseline networks have a relatively higher number of channels in deeper layers, thus, the efficacy of the encoding mechanism should be validated with the networks with a higher number of channels. $\bullet$ **Writing** The year is missing in citations 27 and 38. [1] Ding et al., CirCNN: Accelerating and Compressing Deep Neural Networks Using Block-Circulant Weight Matrices, MICRO 2017. [2] Lou et al., Falcon: Fast Spectral Inference on Encrypted Data, NeurIPS 2020. [3] Jha et al., DeepReShape: Redesigning Neural Networks for Efficient Private Inference, TMLR 2024.

Questions

1. For ViT experiments on CIFAR, did you use pre-trained ImageNet mode? 2. Why MobileNetV2 is used for benchmarking? If FLOPs efficiency is the reason, it should also be evaluated on RegNet-x [4] and ConvNeXt [5] models, and if required, by substituting complex non-linearities with privacy-friendly counterparts (LN with BN and GELU with ReLU). 3. Which Crypto-primitive is used for evaluating the nonlinear computations? 4. What is the overhead of finding the optimal block size using second-order information? That is, how much time is required to find the optimal block size for each layer? How does this timing overhead increase with the network size, particularly in wider networks (e.g., in HybReNets [3]) [4] Radosavovic et al., Designing Network Design Spaces, CVPR 2020. [5] Woo et al., ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders, CVPR 2023. *I'm open to improving the score if the key concerns are addressed in the rebuttal*

Rating

6

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

Addressed in the paper.

Authorsrebuttal2024-08-11

Thank you very much for your support. Response to reviewer eRSG.

Thank you very much for your support! We greatly appreciate the valuable advice and will incorporate all the relevant discussions and data into our final version. The varying accuracy degradation observed across different baseline networks (MobileNetV2, ResNet, HybReNet, RegNet, ConvNeXt) can be partly attributed to the differing proportions of parameters occupied by standard convolutional layers. For instance, in ConvNeXt, 98% of the parameters are derived from standard convolution, with less than 2% from depth-wise/group-wise convolution, providing significant compression potential using PrivCirNet. In contrast, standard convolution parameters account for only 64% and 78% of RegNet and MobileNetV2, respectively. As a result, RegNet and MobileNetV2 exhibit larger accuracy degradation at higher compression rates. Additionally, these networks demonstrate varying latency characteristics in nonlinear layers. Jointly optimizing linear and nonlinear layers is an interesting question, and we plan to explore this in our future work. We will include this discussion in our final version. Thank you once again for your support and insightful feedback!

Reviewer eRSG2024-08-09

Reply on the Authors' Rebuttal

Thank you for providing a thorough rebuttal to each of the queries raised in the review. I appreciate the Authors' effort in conducting the additional experiments (particularly, Table 3 in the attached pdf) in a limited time. Authors have addressed the novelty concern of employing a block circulant matrix for PI. I would suggest they include the Table, where the usage of the block circulant matrix is compared with the prior work (in rebuttal), in the paper's main text. Further, I encourage the Authors to repeat the experiments on RegNet and ConvNeXt (Table 4, in the pdf) on at least one more dataset, if possible on CIFAR-100 (accuracy on CIFAR-10 does not always tell the story), in the final version. There is one clarification needed to understand the results in Table 1: What are the matrix size triplets (e.g., (512, 768, 3072)) in Table 1, in the pdf? Is there any particular reason for selecting the order of the triplet dimensions? The FFN of transformer-based models have bottleneck architecture, for example, (768, 4*768, 768)

Authorsrebuttal2024-08-10

Thank you very much for your kind and valuable comments. Response to reviewer eRSG.

Thank you very much for your kind and valuable comments. We will include a table comparing the use of block circulant matrices with prior work in our main text. Additionally, we have conducted experiments on RegNet and ConvNeXt using CIFAR-100, with the results shown in the table below. | Method | Top-1 Acc. | Linear layers’ latency (s) | | --------------- | ---------- | ------------------------------- | | RegNet | $79.17$ | $64.2$ | | +PrivCirNet(b2) | $79.68$ | $30.1\ (2.1\times \downarrow)$ | | +PrivCirNet(b4) | $77.78$ | $22.4\ (2.9\times \downarrow)$ | | +PrivCirNet(b8) | $72.23$ | $16.7\ (3.8\times \downarrow)$ | | ConvNeXt | $76.17$ | $243.9$ | | +PrivCirNet(b2) | $77.11$ | $120.1\ (2.0\times \downarrow)$ | | +PrivCirNet(b4) | $76.58$ | $65.8\ (3.7\times \downarrow)$ | | +PrivCirNet(b8) | $76.38$ | $36.6\ (6.7\times \downarrow)$ | PrivCirNet achieves a $2.1\times$ latency reduction on RegNet and a $6.7\times$ reduction on ConvNeXt, both without accuracy loss, consistent with our findings on CIFAR-10. We are currently running experiments on Tiny ImageNet and will include all these results in the appendix of our final version. We will also release the model checkpoints upon acceptance. In Table 1 of the global rebuttal, the matrix size triplets $(d_1,d_2,d_3)$ represent matrix multiplications with dimensions $(d_1,d_2) \times (d_2,d_3)$. These dimensions correspond to those found in the BERT-base model. Specifically, $512$ represents the sequence length, $(512,768,768)$ is the dimension of the $Q$, $K$, and $V$ projections, $(512,768,3072)$ corresponds to the first fully connected layer in the FFN, and $(512,3072,768)$ corresponds to the second fully connected layer in the FFN. This experiment demonstrates the effectiveness of PrivCirNet across different dimensions in the BERT-base model. Thank you again for your valuable comments, which have strengthened and enhanced the robustness of our paper!

Reviewer eRSG2024-08-10

Response to Authors

Thanks for the data and clarification. Since the key concerns are addressed in the rebuttal, I have increased the score to 6. Authors should include all the relevant discussion and data in the final version of the draft. Also, a brief discussion on the impact of selecting different baseline networks (MobileNetV2/ResNet/HybReNets/RegNets/ConvNeXt) on the accuracy degradation with various block sizes should be included in the draft. This is crucial, as evident from the data provided in the rebuttals, going from b4 to b8 results in **$\sim$ 5%, $\sim$ 2%,** and **0.2%** accuracy degradation (CIFAR-100) when baseline networks are RegNet, HybReNets, and ConvNeXt, respectively. Nonetheless, these networks have disparate impacts on the latency of nonlinear layers, as they have different ReLU distribution and ReLU efficiency.

Reviewer wNvj2024-08-11

Thanks for the rebuttal. I don't have further comments, and I'll keep my score.

Reviewer mVR62024-08-11

To authors

Thank you for your explanation. You have solved some concerns about this paper. I have change my score. I hope my suggestions can help readers understand your paper more clearly. 1. Since your work is closely related to plaintext encoding, you should clearly explain the plaintext encoding in the BFV scheme to help readers better understand the entire scheme. 2. Since your scheme is a hybrid of HE and MPC, it would be better if you could provide a clearer explanation of the conversion between BFV and MPC. Thanks.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC