Efficient Decoding Methods for Language Models on Encrypted Data
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) power modern AI applications, but processing sensitive data on untrusted servers raises privacy concerns. Homomorphic encryption (HE) enables computation on encrypted data for secure inference. However, neural text generation requires decoding methods like argmax and sampling, which are non-polynomial and thus computationally expensive under encryption, creating a significant performance bottleneck. We introduce cutmax, an HE-friendly argmax algorithm that reduces ciphertext operations compared to prior methods, enabling practical greedy decoding under encryption. We also propose the first HE-compatible nucleus (top-p) sampling method, leveraging cutmax for efficient stochastic decoding with provable privacy guarantees. Both techniques are polynomial, supporting efficient inference in privacy-preserving settings. Moreover, their differentiability facilitates gradient-based sequence-level optimization as a polynomial alternative to straight-through estimators. We further provide strong theoretical guarantees for cutmax, proving its convergence via exponential amplification of the gap ratio between the maximum and runner-up elements. Evaluations on realistic LLM outputs show latency reductions of 24x-35x over baselines, advancing secure text generation.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 13 of its 40 references that are in the map. First posted on arXiv 10 Sep 2025.
Builds on
13 of 40 references.
References · 13
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2013Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computationcited by 2,079
- 2018Hierarchical Neural Story Generationcited by 1,193
- 2018A Discourse-Aware Attention Model for Abstractive Summarization of Long Documentscited by 478
- 2014A* Samplingcited by 151
- 2024On Protecting the Data Privacy of Large Language Models (LLMs): A Surveycited by 96
- 2020HeLayers: A Tile Tensors Framework for Large Neural Networks on Encrypted Datacited by 22
- 2023Converting Transformers to Polynomial Form for Secure Inference Over Homomorphic Encryptioncited by 19
- 2021A methodology for training homomorphicencryption friendly neural networkscited by 10
- 2022Private and Reliable Neural Network Inferencecited by 7
- 2020SPEED: Secure, PrivatE, and Efficient Deep learningcited by 6
1 more
Built on by
Citing papers per year: 2025: 1; 2026: 4.
5 papers.
- 2025Traveling Salesman-Based Token Ordering Improves Stability in Homomorphically Encrypted Language Modelscited by 1
- 2026HEAT: Faster Fully Homomorphic Inference via Approximations-Weights Co-Adaptationcited by 0
- 2026Static Bootstrap Placement for Encrypted Language Model Decodingcited by 0
- 2026HE-OFT: Privacy-Preserving One-Shot Federated Fine-Tuning under Homomorphic Encryptioncited by 0
- 2026A Graph-Based Analysis of Comparability, Scale, and Attribution in Private Transformer Inferencecited by 0
- 2026A Graph-Based Analysis of Comparability, Scale, and Attribution in Private Transformer Inference14 Oct 2026
- 2026HE-OFT: Privacy-Preserving One-Shot Federated Fine-Tuning under Homomorphic Encryption6 Oct 2026
- 2026Static Bootstrap Placement for Encrypted Language Model Decoding4 Oct 2026
- 2026HEAT: Faster Fully Homomorphic Inference via Approximations-Weights Co-Adaptation1 Sep 2026
- 2025Traveling Salesman-Based Token Ordering Improves Stability in Homomorphically Encrypted Language Models14 Oct 2025