Paper Reading AI Learner

Efficient Decoding Methods for Language Models on Encrypted Data

2025-09-10 08:23:14
Matan Avitan, Moran Baruch, Nir Drucker, Itamar Zimerman, Yoav Goldberg

Abstract

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 it converges globally to a unique two-level fixed point, independent of the input values beyond the identity of the maximizer, which explains its rapid convergence in just a few iterations. Evaluations on realistic LLM outputs show latency reductions of 24x-35x over baselines, advancing secure text generation.

Abstract (translated)

大型语言模型(LLMs)是现代人工智能应用的核心,但在不可信的服务器上处理敏感数据引发了隐私问题。同态加密(HE)可以在不解密的情况下对加密的数据进行计算,从而实现安全推理。然而,神经文本生成需要使用argmax和采样这样的解码方法,这些方法是非多项式的,并且在加密条件下运行时计算成本高昂,这成为了性能瓶颈的主要原因。 我们提出了cutmax算法,这是一种与同态加密兼容的argmax算法,相比以前的方法减少了密文操作次数,从而支持了实际情况下基于加密环境下的贪婪解码。此外,我们也提出了一种新颖的HE兼容核采样(top-p)方法,利用cutmax实现高效的随机解码,并具有可证明的隐私保证。 这两种技术都是多项式的,因此能够在保护隐私的同时高效地进行推理。它们的可微性还支持基于梯度序列级别的优化作为直通估算器的多项式替代方案。 此外,我们对cutmax算法提供了强大的理论保障,证明其能够全局收敛到一个独立于输入值(除了最大化的身份)的独特两级固定点,这解释了它只需要几次迭代就可以快速收敛的原因。在针对现实LLM输出进行评估时发现,与基准方法相比,延迟减少了24-35倍,推动了安全文本生成的发展。

URL

https://arxiv.org/abs/2509.08383

PDF

https://arxiv.org/pdf/2509.08383.pdf


Tags
3D Action Action_Localization Action_Recognition Activity Adversarial Agent Attention Autonomous Bert Boundary_Detection Caption Chat Classification CNN Compressive_Sensing Contour Contrastive_Learning Deep_Learning Denoising Detection Dialog Diffusion Drone Dynamic_Memory_Network Edge_Detection Embedding Embodied Emotion Enhancement Face Face_Detection Face_Recognition Facial_Landmark Few-Shot Gait_Recognition GAN Gaze_Estimation Gesture Gradient_Descent Handwriting Human_Parsing Image_Caption Image_Classification Image_Compression Image_Enhancement Image_Generation Image_Matting Image_Retrieval Inference Inpainting Intelligent_Chip Knowledge Knowledge_Graph Language_Model LLM Matching Medical Memory_Networks Multi_Modal Multi_Task NAS NMT Object_Detection Object_Tracking OCR Ontology Optical_Character Optical_Flow Optimization Person_Re-identification Point_Cloud Portrait_Generation Pose Pose_Estimation Prediction QA Quantitative Quantitative_Finance Quantization Re-identification Recognition Recommendation Reconstruction Regularization Reinforcement_Learning Relation Relation_Extraction Represenation Represenation_Learning Restoration Review RNN Robot Salient Scene_Classification Scene_Generation Scene_Parsing Scene_Text Segmentation Self-Supervised Semantic_Instance_Segmentation Semantic_Segmentation Semi_Global Semi_Supervised Sence_graph Sentiment Sentiment_Classification Sketch SLAM Sparse Speech Speech_Recognition Style_Transfer Summarization Super_Resolution Surveillance Survey Text_Classification Text_Generation Time_Series Tracking Transfer_Learning Transformer Unsupervised Video_Caption Video_Classification Video_Indexing Video_Prediction Video_Retrieval Visual_Relation VQA Weakly_Supervised Zero-Shot