FEnc$^2$: Unifying Data Packing for Efficient Private Inference via Convolution and Architecture-Aware Fragment Encoding

📄 arXiv: 2606.16359v1 📥 PDF

作者: Ran Ran, Zhaoting Gong, Nuo Xu, Yuanchao Xu, Fan Yao, Wujie Wen

分类: cs.CR, cs.LG

发布日期: 2026-06-15

备注: 15 pages, 9 figures. To appear in ISCA 2026


💡 一句话要点

提出FEnc²以解决同态加密推理中的数据打包效率问题

🎯 匹配领域: 支柱五:交互与反应 (Interaction & Reaction)

关键词: 同态加密 隐私保护 卷积神经网络 数据打包 性能优化

📋 核心要点

  1. 现有同态加密方法在数据打包上效率低下,导致计算和内存开销过大。
  2. FEnc²通过卷积感知编码和架构感知密文压缩,优化密文的槽利用率和旋转复杂度。
  3. 在MNIST和ImageNet数据集上,FEnc²在GPU和CPU上分别实现了高达228.83倍和226.06倍的速度提升。

📝 摘要(中文)

完全同态加密(FHE)使得隐私保护的机器学习成为可能,但其计算和内存开销极大。这些开销不仅源于低级原语的高成本,如数论变换(NTT)、旋转和密钥切换,还来自于应用层的密文打包效率低下。现有的打包策略通常只保留相邻数据元素或特征分组,导致密文槽浪费、旋转过多和密文数量膨胀。本文提出FEnc²,一个统一的基于片段的编码框架,旨在优化CKKS基础上的私有卷积神经网络推理。FEnc²通过卷积感知编码和架构感知密文压缩两个组件,优化槽利用率、旋转复杂度和密文密度,显著减少同态操作的数量。实验结果表明,FEnc²在最大批量大小下,GPU和CPU上的延迟速度提升分别达到228.83倍和226.06倍,展示了其在加密推理中的应用潜力。

🔬 方法详解

问题定义:本文旨在解决同态加密推理中数据打包效率低下的问题。现有方法在密文槽利用率和旋转复杂度上存在明显不足,导致计算资源浪费和性能下降。

核心思路:FEnc²通过分析卷积操作的特性,设计了一种统一的片段编码框架,旨在优化密文的结构,减少同态操作的数量。通过合理选择片段大小,解耦空间依赖关系,降低内外层旋转的复杂度。

技术框架:FEnc²主要由两个模块组成:卷积感知编码(Conv-aware Encoding)和架构感知密文压缩(Arch-aware Ct Compression)。前者优化片段大小,后者在特征或通道减少层后恢复密文密度。

关键创新:FEnc²的主要创新在于其统一的片段编码框架,能够同时优化密文的槽利用率和旋转复杂度,这与现有方法的单一优化策略形成鲜明对比。

关键设计:在设计中,FEnc²通过分析卷积层的特性,选择最优的片段大小,并在特征或通道减少后进行密文压缩,以确保最大化利用内存容量。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

FEnc²在MNIST数据集上实现了GPU和CPU的延迟速度提升,分别达到228.83倍和226.06倍;在ImageNet数据集上,GPU和CPU的速度提升分别为4.55倍和9.43倍,显示出其在加密推理中的显著性能优势。

🎯 应用场景

FEnc²的研究成果在隐私保护机器学习、医疗数据分析和金融数据处理等领域具有广泛的应用潜力。通过提高同态加密推理的效率,FEnc²能够支持更复杂的模型和更大规模的数据集,为未来的隐私保护技术奠定基础。

📄 摘要(原文)

Fully Homomorphic Encryption (FHE) enables privacy-preserving machine learning but incurs extreme computational and memory overhead. These costs come not only from expensive low-level primitives, including Number Theoretic Transform (NTT), rotation, and key-switching, but also from inefficient ciphertext packing at the application level. Existing packing strategies typically preserve either neighboring data elements or feature grouping, but not both, leading to wasted ciphertext slots, excessive rotations, and inflated ciphertext counts. We propose FEnc2, a unified and principled fragment-based encoding framework for CKKS-based private convolutional neural network inference. FEnc2 optimizes slot utilization, rotation complexity, and ciphertext density through two components: 1)Conv-aware Encoding, which analytically selects an optimal fragment size to decouple spatial dependencies and jointly minimize inner-outer rotations across layers, and 2)Arch-aware Ct Compression, which restores ciphertext density after feature- or channel-reduction layers. Together, these transformations reshape encrypted workload structure and reduce homomorphic operations by one to two orders of magnitude. With full memory capacity utilized, i.e., at maximum batch size, FEnc2 achieves end-to-end latency speedups over the state-of-the-art Orion of up to 228.83x on GPU and 226.06x on CPU for LeNet on MNIST, and up to 4.55x on GPU and 9.43x on CPU for MobileNet on ImageNet. FEnc2 is hardware-agnostic yet architecturally transformative: by optimizing encrypted tensor layout before execution, it reduces ciphertext count and workload pressure on hardware, complementing primitive-level optimizations such as NTT and keyswitch accelerators. These results show that application-level data layout is a first-order architectural design dimension for encrypted inference and an important enabler for next-generation FHE systems.