Abstract
Privacy-preserving inference for Large Language Models (LLMs) typically relies on Secure Two-Party Computation (2PC), which is severely limited by the high latency of autoregressive decoding. We present POST (Public decOding and Secure verificaTion), a framework that accelerates private GPT inference by 2.1× to 6.0×. POST utilizes a public model to propose draft tokens that are verified by the private model in a single secure pass, exploiting the latency insensitivity of secure computation to batch processing without compromising privacy or accuracy.
The Privacy-Efficiency Trade-off
Deploying proprietary LLMs requires balancing model IP protection with user data privacy. While cryptographic tools like 2PC and Homomorphic Encryption (HE) enable secure inference, they are notoriously slow for standard autoregressive decoding. In these settings, generating a single token requires hundreds of communication rounds. The resulting "one-way delay" (network latency) and cryptographic overhead make real-time private interaction nearly impossible.
The POST Framework
The authors introduce POST to adapt speculative decoding for privacy-preserving contexts. The process is divided into two main stages:
- Public Proposing: The client uses a smaller, public GPT model to generate a sequence of "draft" tokens locally. This offloads the linguistic "guessing" to the client.
- Secure Verification: The private model, hosted on the server, checks the entire batch of draft tokens in a single secure computation step.
- Model Alignment: Through knowledge distillation in an offline stage, the public model is fine-tuned to mimic the private model's output distribution, increasing the likelihood that its "guesses" are accepted.
Exploiting Latency Insensitivity
The core insight of POST is the "latency insensitivity" of secure 2PC/HE environments. Because fixed costs—such as network round-trips and the initialization of cryptographic "slots" in SIMD (Single Instruction, Multiple Data) operations—dominate the total execution time, the marginal cost of processing additional tokens is negligible. As shown in the experimental data, the time required to process a sequence of 16 tokens is nearly identical to that of a single token. POST effectively gets "fifteen tokens for the price of one."
Key Results and Performance
The researchers evaluated POST across diverse tasks including Text-to-SQL (Spider), math problems (GSM8K), and code generation. Key findings include:
- Significant Speedups: End-to-end inference speed improved by 2.1× to 6.0× compared to standard secure decoding.
- Optimized Sampling: A specialized Private Sampling Protocol using multiplication and Oblivious Transfer (OT) proved 10× faster than naive cryptographic implementations of speculative sampling.
- Zero Accuracy Loss: Final outputs remain mathematically identical to the private model's standalone output because the private model must verify every token.
- Alignment Gains: Fine-tuning the public model increased acceptance rates significantly (e.g., from 10% to 40% in some configurations), directly reducing the number of required decoding steps.
Conclusion and Future Work
POST demonstrates that secure LLM inference does not have to be strictly autoregressive. By treating the private model as a verifier rather than a generator, the framework significantly reduces the impact of network latency. Future work may involve developing "pre-aligned" public models to further simplify deployment for specialized domains like medicine or law.
Summary updated