Privacy-Preserving Inference for Quantized BERT Models

Tianpei Lu, Bingsheng Zhang, Lekun Peng, Bowen Zheng, Lichun Li, Kui RenarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) like BERT are increasingly deployed for sensitive tasks involving private data. However, standard inference requires data to be sent to a server, posing significant privacy risks. Secure Multi-Party Computation (MPC) offers a solution by allowing parties to compute functions without revealing private inputs. Despite its potential, MPC is traditionally hindered by high computational and communication overheads, primarily due to floating-point arithmetic, the "truncation bottleneck" in fixed-point math, and the difficulty of securely computing non-linear functions like Softmax and LayerNorm.

Proposed Framework

This paper introduces a highly efficient framework for private BERT inference that addresses these bottlenecks through aggressive quantization and a novel lookup table (LUT) protocol.

Architecture and Quantization

The framework utilizes a specialized pipeline that bridges the gap between ultra-low-bit quantization and secure computation. The model architecture, shown in Figure 1, consists of 12 Transformer blocks optimized for MPC.

Architecture of the quantized BERT model optimized for secure inference.

The system employs BitNet-style quantization, reducing weights to 1 bit (binary) and activations to 4 bits. This reduction drastically lowers the number of operations required during inference. To recover accuracy lost during quantization, a full-precision "teacher" BERT model guides the training of the quantized "student" model via knowledge distillation.

Technical Innovations

  1. Multi-Input Lookup Tables (LUTs): Instead of calculating complex non-linear functions mathematically, the framework uses a novel multi-input LUT protocol. This allows two secret-shared values to serve as indices simultaneously, facilitating efficient computation of operations like Softmax.
  2. Truncation-Free Conversion: To bypass the costly truncation step typical of MPC fixed-point math, the authors use LUTs for "ring size extension" and precision conversion. By discarding lower bits and mapping the result back to the correct scale via a LUT, they eliminate truncation errors and overhead.
  3. Hybrid Secret Sharing: The system optimizes performance by switching between 3-party Replicated Secret Sharing (RSS) for matrix multiplications and 2-party Additive Secret Sharing for LUT operations.

Experimental Evaluation

The framework was evaluated on the GLUE benchmark suite, comparing the quantized private model against a full-precision BERT-base model.

Key Insights: The Quantization Trade-off

A critical finding of this work is the "sweet spot" for activation quantization. While 1-bit weights significantly reduce computation, 4-bit activations are the minimum required to maintain acceptable accuracy for BERT tasks, as illustrated in Figure 2.

Model accuracy vs. activation bit-width, showing the performance drop below 4 bits.

Performance Results

The proposed method achieves substantial improvements over existing state-of-the-art (SOTA) privacy-preserving platforms:

  • Speedup: The framework is 8× faster than Lu et al. (NDSS '25), 9× faster than Sigma (PETS '24), and 22× faster than CrypTen (NeurIPS '21).
  • Communication Efficiency: Online communication is reduced by up to 1778× compared to CrypTen for certain sequence lengths.
  • Accuracy: The average GLUE score dropped from 87.2 (full precision) to 82.9 (quantized), demonstrating high performance despite aggressive quantization.
  • Latency: In LAN conditions, BERT inference for a 128-token sequence completes in under 4 seconds.

Conclusion and Future Work

By combining 1-bit/4-bit quantization with a truncation-free LUT-based protocol, this framework significantly advances the practicality of private LLM inference. While a ~4.3% accuracy gap remains compared to full-precision models, the massive gains in speed and communication efficiency are transformative. Future work includes extending this approach to multi-billion parameter models and enhancing security against malicious adversaries.

Summary updated

BibTeX
@misc{lu2025privacy,
  author = {Tianpei Lu and Bingsheng Zhang and Lekun Peng and Bowen Zheng and Lichun Li and Kui Ren},
  title = {{Privacy-Preserving Inference for Quantized BERT Models}},
  year = {2025},
  eprint = {2508.01636},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.01636},
}
Figure