Cloud-hosted transformer and large language model inference creates a direct confidentiality problem: user prompts may contain sensitive code, business data, personal information, or regulated documents, yet remote serving exposes intermediate state to the cloud software stack and accelerator runtime. Fully homomorphic encryption keeps accelerator-side execution ciphertext-only, but end-to-end LLM inference remains expensive because linear layers are interleaved with non-linear, cache-state, and refresh-sensitive operators. A CPU trusted execution environment can execute those operators natively, but a CPU TEE alone does not define how an untrusted accelerator should participate.

Bifrost presents a hybrid TEE-FHE serving architecture in which secrets are provisioned only to an attested CPU TEE, while the accelerator, device memory, driver/runtime stack, and host software remain outside the trusted computing base. The system uses FHE as a secure delegation mechanism for projection and feed-forward linear layers on accelerator-backed CKKS, while non-linear operators, attention-side control logic, KV-state transitions, and decrypt-then-encrypt refresh execute inside the CPU TEE.

Prefill/decode split in Bifrost+

Bifrost+ further applies a prefill/decode split: prompt-side KV state is built inside the CPU TEE, and only decode-side state enters the hybrid ciphertext path. In an estimator-style comparison matching Euston's methodology, Bifrost reduces projected latency by 9.25x on GPT-2 (1.5B) and 9.91x on LLaMA 3 (8B). In direct CKKS/FHE deployments, Bifrost+ reduces TTFT by 14.6-45.8x on GPT-2 (124M) and 15.3-53.4x on Qwen3 (0.6B). The systems lesson is selective encrypted execution: use FHE only where ciphertext-only accelerator delegation is required, and keep non-linear, refresh, and prompt-side work inside the CPU TEE.

Architecture overview

The architecture divides responsibilities between two trusted and untrusted components. The CPU TEE holds secrets and executes non-linear operations, attention control logic, KV-state transitions, and refresh procedures. The accelerator performs linear layer computation on encrypted data via CKKS, handling projection and feed-forward layers. This division means the device memory, driver/runtime stack, and host software never receive plaintext data, limiting the trusted computing base to the attested CPU TEE alone.

Performance results

The hybrid approach yields significant latency reductions. Bifrost achieves 9.25x and 9.91x projected latency reduction on GPT-2 1.5B and LLaMA 3 8B respectively. When operating in pure CKKS/FHE mode, Bifrost+ achieves 14.6-45.8x TTFT reduction on GPT-2 124M and 15.3-53.4x on Qwen3 0.6B. These results demonstrate that confining expensive encrypted execution to linear layers while keeping non-linear work on the TEE produces substantial practical improvements.