TruncFormer: Privacy Inference for Large Language Models Using Only TruncationTruncFormer: Private LLM Inference Using Only Truncations
The researchers propose the TruncFormer framework, which can convert any large language model into a plaintext simulation of privacy-preserving inference (PI), used to protect data privacy when users call proprietary models. Privacy inference is difficult to make practical due to the huge latency cost brought by nonlinear functions in LLMs; existing work can only approximate specific nonlinearities such as Softmax and GeLU one by one, while new architectures continuously introduce new nonlinearities, trapping research in a continuous catch-up. TruncFormer exploits the differentiability of nonlinear functions to accurately approximate them with sequences of addition, multiplication and truncation, and decouples addition/multiplication from truncation operations, statically determining truncation insertion positions according to a given field size and input representation size, reducing latency compared with existing cryptographic protocols that force truncation after every multiplication. The authors have open-sourced the code for community use.