LLM Inference Encryption for Cloud Data Privacy

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The use of large language models on cloud services exposes user data to privacy risks through plaintext interactions, including transmission risks, operator theft, tenant snooping, and memory privacy leakage, with existing solutions like homomorphic cryptography being slow and limited to small models, and differential privacy only protecting unidirectional data flow.

Innovation Solution

An inference method and apparatus for large language models that perform encryption on input text to generate ciphertext, use an encrypted model for inference, and decrypt the result ciphertext back to plaintext, ensuring bidirectional data protection through transverse and longitudinal jitter encryption techniques.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If homomorphic cryptography is used to protect data privacy, then data security is improved, but inference speed deteriorates and model size is limited

Engineering Contradiction:
Improvedata securityVSAvoidinference speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the encryption approach into two parts: homomorphic encryption is applied selectively only to the input data, while the model parameters and computation process use conventional methods. This segmentation allows maintaining data security for inputs without suffering from the full performance penalty of homomorphic encryption throughout the entire inference process.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary approach by using homomorphic encryption only for the input data layer, acting as a mediator between complete encryption (secure but slow) and no encryption (fast but insecure). This partial application of homomorphic encryption provides security where needed while maintaining overall system performance.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If homomorphic cryptography is used to protect data privacy, then data security is improved, but applicable model size deteriorates (limited to small models only)

Engineering Contradiction:
Improvedata securityVSAvoidmodel size applicability
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent segments the encryption scope to apply homomorphic encryption only to input data rather than the entire model, enabling the approach to work with large-scale models that would be incompatible with full homomorphic encryption solutions.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the parameter of encryption application from 'all model components' to 'input data only', transforming the computational burden from intractable for large models to manageable, thus extending applicability to large-scale language models.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If differential privacy is used to protect data communication, then unidirectional data protection (client to server) is improved, but bidirectional protection deteriorates

Engineering Contradiction:
Improveunidirectional data protectionVSAvoidbidirectional protection capability
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent inverts the conventional differential privacy approach by applying encryption to the input data before it reaches the server, rather than adding noise to protect outputs. This inversion enables protection of both input and output data, achieving bidirectional security.

Inventive Principle:
Principle #13The other way round (Inversion)

Solution Approach 2:

The patent uses homomorphic encryption as an intermediary mechanism that enables bidirectional protection: it protects input data during transmission to the server and also protects the output results during return to the client, overcoming the unidirectional limitation of differential privacy.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Ease of operation

If plaintext interaction is used for cloud service, then ease of operation is improved, but privacy leakage risk worsens

Engineering Contradiction:
Improveinteraction simplicityVSAvoidprivacy leakage risk
Core Design Contradiction:
Ease of operationVSObject-affected harmful factors

Solution Approach 1:

The patent applies preliminary encryption to the input data before it leaves the client device. This preliminary action ensures that sensitive data is protected before entering the cloud environment, maintaining ease of operation while eliminating privacy leakage risks associated with plaintext transmission and storage.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20250211419A1Inference method and apparatus for large language model, device, and storage medium
Publication Date: 2025.06.26 BEIJING BAIDU NETCOM SCI & TECH CO LTD
  • US20250211419A1 patent drawing
  • US20250211419A1 patent drawing
  • US20250211419A1 patent drawing

AI summary

Provided are an inference method and apparatus for a large language model, a device, and a storage medium. The inference method for the large language model includes: performing encryption on a target input text to obtain a target input ciphertext; sending the target input ciphertext to a server so that an encrypted model is used for performing inference on the target input ciphertext by the server to obtain a target result ciphertext; receiving the target result ciphertext sent by the server; and performing decryption on the target result ciphertext to obtain a target result plaintext.