Method and system for reduction of ciphertext matrix computation and bootstrapping in secure llm
AssigneeCornami, Inc.
InventorFa-Long LUO
Life of this patent
Estimating the term…
Abstract
The disclosure is directed toward a method and system to efficiently determine an attention function by reducing bootstrapping steps and ciphertext matrix operations. A combined key and query matrix in plaintext is pre-calculated. A ciphertext-plaintext matrix multiplication of the combined key and query matrix with a ciphertext input is performed. The output of the resulting ciphertext-plaintext matrix multiplication of the combined key and query matrix is bootstrapped. A ciphertext-plaintext matrix multiplication of the value matrix with the ciphertext input is performed. The resulting ciphertext-plaintext matrix multiplication of the value matrix is bootstrapped.
Claims15
A method to efficiently determine an attention function, the method comprising:
- pre-calculating a combined key and query matrix in plaintext;
- performing a ciphertext-plaintext matrix multiplication of the combined key and query matrix with a ciphertext input;
- bootstrapping an output of the ciphertext-plaintext matrix multiplication of the combined key and query matrix;
- performing a ciphertext-plaintext matrix multiplication of a value matrix with the ciphertext input;
- and
- bootstrapping the ciphertext-plaintext matrix multiplication of the value matrix.
A computer system comprising:
- a memory;
- an input accepting an input to an attention head function;
- a processor coupled to the input and the memory, the processor configured to:
- pre-calculate a combined key and query matrix in plaintext and storing the combined key and query matrix in the memory;
- perform a ciphertext-plaintext matrix multiplication of the combined key and query matrix with a ciphertext input;
- bootstrap an output of the ciphertext-plaintext matrix multiplication of the combined key and query matrix;
- perform a ciphertext-plaintext matrix multiplication of a value matrix with the ciphertext input;
- and
- bootstrap the ciphertext-plaintext matrix multiplication of the value matrix.
A non-transitory computer readable medium including executable instructions which, when executed in a processor, causes the processor to:
- pre-calculate a combined key and query matrix in plaintext;
- perform a ciphertext-plaintext matrix multiplication of the combined key and query matrix with a ciphertext input;
- bootstrap an output of the ciphertext-plaintext matrix multiplication of the combined key and query matrix;
- perform a ciphertext-plaintext matrix multiplication of a value matrix with the ciphertext input;
- and
- bootstrap the ciphertext-plaintext matrix multiplication of the value matrix.
Dependencies are inferred from the claim text.