Bel-0 is the world's first end-to-end encrypted LLM

Bel-0 is the world's first LLM that computes entirely on encrypted data, available for anyone to try. Data is encrypted on the user's device before it leaves and stays encrypted while the model works on it. Only the user can decrypt the final answer. FHE makes this possible by letting the model compute directly on ciphertext, so the server never sees the prompt, the model's activations, or the answer.

Bel-0 runs Llama 3.1 8B Instruct, Meta's widely used open-weight language model, with 8 billion parameters and 32 transformer layers, entirely on encrypted data. Each request passes through four steps (Figure 6).

1
Encrypt the tokens
Client Server Key
explain my blood results
explainmybloodresults
Encrypted
tokens
2
Run the transformer
Client Server Key
Llama 3.1
8B
3
Return each token
Client Server Key
New
token
One token
at a time
4
Decrypt the answer
Client Server Key
All values are normal.
Readable
only here
Never
sees the
answer
Encrypted data The key never leaves the client
Llama 3.1 tokens 4 tokens
Tokens. Pick one to find it in the figure.
Figure 6: The prompt is encrypted on the client, processed encrypted on the server and only decrypted on the client. Try it: type a prompt under the figure; it is split into real Llama 3.1 tokens in this browser. Ciphertexts shown are illustrative.
  1. The user encrypts the prompt locally. The user's client first tokenizes the prompt, splitting it into the small pieces of words that the model processes. It then encrypts these tokens with a secret key that the server never sees. The result is ciphertext, which the client sends to the server.
  2. The server runs the model on ciphertexts. Bel-0 receives only this ciphertext and runs every layer of Llama 3.1 8B directly on it, including attention, the feed-forward layers and the normalization steps. The scores for the next token, called logits, stay encrypted. The next token is sampled from them homomorphically, fed back into the transformer and returned to the user in step 3.
  3. The server returns the encrypted tokens. The sampled tokens are produced in encrypted form and sent back to the client, so the server never learns what it generated.
  4. The user decrypts the answer. The user's client decrypts the tokens with the secret key and turns them back into text. Since the key never leaves the client, no one else can read the answer.

With the data encrypted end to end, the confidentiality of a request does not depend on the cloud provider or the hardware the model runs on: even an attacker with full access to the server would see only ciphertexts.