Tree-based Lookup Table on Batched Encrypted Queries using Homomorphic Encryption

Jung Hee Cheon, Hyeongmin Choe, Jai Hyun ParkIACR ePrint 2024

Abstract

Evaluating non-linear functions and lookup tables (LUTs) remains a significant challenge in privacy-preserving computation. While Ring Learning-With-Errors (RLWE) schemes like CKKS offer high throughput for arithmetic operations, they have historically struggled with non-arithmetic tasks. This paper introduces tree-based algorithms that enable efficient LUT evaluation on batched encrypted data. By optimizing the search process through table folding and hybrid indicator techniques, the proposed methods achieve a 2.4–6.0x throughput improvement over state-of-the-art LWE-based implementations.

Introduction

Homomorphic Encryption (HE) is a cornerstone of privacy-preserving machine learning, allowing servers to process data without decryption. However, the ecosystem is currently bifurcated. LWE-based schemes (e.g., TFHE) excel at discrete lookups but lack arithmetic efficiency. Conversely, RLWE-based schemes (e.g., CKKS) are optimized for large-scale vector arithmetic but are inefficient for non-linear activations like ReLU or Sigmoid, which are typically implemented via LUTs. This work addresses this gap by making LUT evaluations efficient within the high-throughput RLWE framework.

Proposed Methodology

The authors propose three primary algorithms to perform "homomorphic binary search" over encrypted data, leveraging the SIMD (Single Instruction, Multiple Data) capabilities of RLWE.

Algorithm 1: Table Folding

This approach treats the LUT as a search tree. In each step, a homomorphic comparison determines which half of the table contains the target value. The table is then "folded" by selecting the relevant half-block through a linear combination: $(1 - \beta)X_1 + \beta X_2$.

Visual representation of the Table Folding approach (Algorithm 1).

Algorithm 2: One-hot Indicator

Instead of reducing the table, this method iteratively subdivides a "one-hot" indicator vector. This vector, containing a single '1' at the target index and '0's elsewhere, is eventually used in an inner product with the original table to extract the desired value.

Algorithm 3: The Hybrid Approach

The core innovation is a hybrid strategy designed for public LUTs. The authors observed that table folding is computationally expensive when the table is large (early steps), while one-hot expansion becomes costly as the indicator vector grows (later steps). The hybrid method uses the one-hot approach for the first $\log \sqrt{n}$ steps and switches to folding for the remainder, optimizing the balance between ciphertext-ciphertext and ciphertext-plaintext multiplications.

Comparison between the One-hot Indicator (Approach 1) and Table Folding (Approach 2) strategies.

Implementation and Error Management

The algorithms are implemented using the CKKS scheme. To mitigate the "approximate" nature of CKKS arithmetic, the authors employ rigorous error analysis. They use Chebyshev polynomials to approximate the comparison function and a heuristic method to "spread" table keys, ensuring that homomorphic comparisons remain accurate even with limited precision.

Experimental Results

Performance was evaluated using synthetic LUTs on an Intel Xeon Silver 4114 CPU:

  • High Throughput: The RLWE-based tree algorithms achieved 2.4–6.0x higher throughput than state-of-the-art LWE schemes.
  • Amortized Efficiency: For an encrypted LUT with 512 entries, the amortized processing time per query was 0.041 seconds.
  • Scalability: For public LUTs of size 8192, the Hybrid algorithm (Algorithm 3) processed queries in approximately 70 milliseconds (amortized).
  • Memory Footprint: Algorithm 3 requires only $O(\sqrt{n})$ additional memory, offering better scalability than simpler $O(n)$ alternatives.

Conclusion and Future Work

This research demonstrates that tree-based search algorithms can bridge the performance gap for non-arithmetic operations in RLWE schemes. While the current implementation is constrained by the precision of the CKKS comparison function and requires sorted keys, it provides a high-throughput foundation for privacy-preserving machine learning. Future work includes integrating these LUTs into end-to-end encrypted neural networks and exploring GPU acceleration to further leverage the SIMD nature of the algorithms.

Summary updated

BibTeX
@article{cheon2024tree,
  author = {Jung Hee Cheon and Hyeongmin Choe and Jai Hyun Park},
  title = {{Tree-based Lookup Table on Batched Encrypted Queries using Homomorphic Encryption}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2024},
}
Figure