TruncFormer: Private LLM Inference Using Only Truncations

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Yubeaton, Patrick, Mo, Jianqiao Cambridge, Garimella, Karthik, Jha, Nandan Kumar, Reagen, Brandon, Hegde, Chinmay, Garg, Siddharth
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866913593437454336
author Yubeaton, Patrick
Mo, Jianqiao Cambridge
Garimella, Karthik
Jha, Nandan Kumar
Reagen, Brandon
Hegde, Chinmay
Garg, Siddharth
author_facet Yubeaton, Patrick
Mo, Jianqiao Cambridge
Garimella, Karthik
Jha, Nandan Kumar
Reagen, Brandon
Hegde, Chinmay
Garg, Siddharth
contents Private inference (PI) serves an important role in guaranteeing the privacy of user data when interfacing with proprietary machine learning models such as LLMs. However, PI remains practically intractable due to the massive latency costs associated with nonlinear functions present in LLMs. Existing works have focused on improving latency of specific LLM nonlinearities (such as the Softmax, or the GeLU) via approximations. However, new types of nonlinearities are regularly introduced with new LLM architectures, and this has led to a constant game of catch-up where PI researchers attempt to optimize the newest nonlinear function. We introduce TruncFormer, a framework for taking any LLM and transforming it into a plaintext emulation of PI. Our framework leverages the fact that nonlinearities in LLMs are differentiable and can be accurately approximated with a sequence of additions, multiplications, and truncations. Further, we decouple the add/multiply and truncation operations, and statically determine where truncations should be inserted based on a given field size and input representation size. This leads to latency improvements over existing cryptographic protocols that enforce truncation after every multiplication operation. We open source our code for community use.
format Preprint
id arxiv_https___arxiv_org_abs_2412_01042
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle TruncFormer: Private LLM Inference Using Only Truncations
Yubeaton, Patrick
Mo, Jianqiao Cambridge
Garimella, Karthik
Jha, Nandan Kumar
Reagen, Brandon
Hegde, Chinmay
Garg, Siddharth
Cryptography and Security
Machine Learning
Private inference (PI) serves an important role in guaranteeing the privacy of user data when interfacing with proprietary machine learning models such as LLMs. However, PI remains practically intractable due to the massive latency costs associated with nonlinear functions present in LLMs. Existing works have focused on improving latency of specific LLM nonlinearities (such as the Softmax, or the GeLU) via approximations. However, new types of nonlinearities are regularly introduced with new LLM architectures, and this has led to a constant game of catch-up where PI researchers attempt to optimize the newest nonlinear function. We introduce TruncFormer, a framework for taking any LLM and transforming it into a plaintext emulation of PI. Our framework leverages the fact that nonlinearities in LLMs are differentiable and can be accurately approximated with a sequence of additions, multiplications, and truncations. Further, we decouple the add/multiply and truncation operations, and statically determine where truncations should be inserted based on a given field size and input representation size. This leads to latency improvements over existing cryptographic protocols that enforce truncation after every multiplication operation. We open source our code for community use.
title TruncFormer: Private LLM Inference Using Only Truncations
topic Cryptography and Security
Machine Learning
url https://arxiv.org/abs/2412.01042