Felid: A Flexible and Efficient New Design for Transformer Fine-Tuning under Fully Homomorphic Encryption

Felid optimizes Transformer fine-tuning under FHE at the ciphertext operation level, with 30x fewer rotations and 8x end-to-end speedup.
Felid is an optimization framework for Transformer fine-tuning under Fully Homomorphic Encryption (FHE). Unlike prior architecture-level approaches, it focuses on ciphertext operations through three core innovations: a flexible packing strategy supporting variable input counts for dynamic batches, dedicated matrix evaluation algorithms that greatly reduce rotations and relinearizations, and functional bootstrapping that folds element-wise activation functions into the bootstrapping step. Experiments show 30x fewer rotations, 2.5x fewer bootstrapping calls, and fine-tuning of a 2-layer BERT-style model with batch size 16 in 650 seconds—an 8x end-to-end speedup over SOTA.
Introduction
Fully Homomorphic Encryption (FHE) allows computations to be performed directly on ciphertext, offering a non-interactive, privacy-preserving path for transformer fine-tuning. However, the inherent massive overhead of ciphertext operations severely constrains practical performance. Existing work mostly optimizes efficiency at the architectural level, yet struggles to break through the bottlenecks at the ciphertext operation level. The recently proposed Felid framework takes a different approach, starting from the ciphertext operation level. Through innovative packing strategies and targeted matrix evaluation algorithms, it significantly reduces the number of rotations, relinearizations, and bootstrapping operations, thereby achieving substantial acceleration of Transformer fine-tuning.

Fully Homomorphic Encryption (FHE) is a cryptographic scheme that allows arbitrary computations to be performed directly on ciphertext without decryption, with security typically based on the hardness of lattice problems (such as LWE/RLWE). The core operations of FHE include: ciphertext addition and multiplication, relinearization (recompressing a ciphertext whose dimension has expanded after multiplication back into a standard ciphertext), rotation (cyclically shifting between packed ciphertext slots, a key step for implementing matrix multiplication and convolution), and bootstrapping. Bootstrapping is the most expensive operation in FHE; it "refreshes" the noise accumulated in a ciphertext through a homomorphic decryption process, enabling it to continue participating in subsequent computations without decryption failure. It is precisely the high overhead of these ciphertext operations that constitutes the main bottleneck to the practical adoption of FHE.
Ciphertext Operation Bottlenecks and Felid's Approach
Transformer fine-tuning under FHE faces two core overheads: frequent ciphertext rotation and relinearization operations, and excessive bootstrapping calls. These operations directly determine the overall computational complexity. Felid does not attempt to restructure the model architecture; instead, it focuses on optimizing the underlying ciphertext operations. Its core innovations include:
- Flexible packing strategy: supports batching a variable number of inputs, better matching the dynamic batch requirements of fine-tuning workloads.
- Operation-specific matrix evaluation algorithms: designs dedicated algorithms for different matrix operations, significantly reducing the number of rotations, relinearizations, and bootstrapping operations.
- Functional bootstrapping fused with activation functions: leverages functional bootstrapping to fold the computation of element-wise activation functions into the bootstrapping step, further reducing overall complexity.
Together, these optimizations enable Felid to achieve order-of-magnitude efficiency gains at the ciphertext operation level.
Performance Gains: 30x Fewer Rotations, 2.5x Fewer Bootstrapping Calls
According to the paper's data, compared with the latest state-of-the-art work, Felid achieves a 30x reduction in ciphertext rotations and relinearizations across all matrix operations, and a 2.5x reduction in bootstrapping calls throughout the entire computation pipeline. Even more striking is the end-to-end result: Felid completes fine-tuning of a 2-layer BERT-style model with a batch size of 16 in 650 seconds, achieving an 8x speedup over state-of-the-art work.
These figures demonstrate that optimization at the ciphertext operation level can deliver gains far beyond architectural-level adjustments. In particular, you may not have noticed that the fused design of functional bootstrapping not only reduces the number of bootstrapping calls but also hides the computational overhead of activation functions within the bootstrapping process—a clever form of computation reuse.
Why the Flexible Packing Strategy Matters
Fine-tuning tasks typically involve variable batch sizes and dynamic input lengths, whereas traditional FHE packing schemes often assume a fixed number of inputs, resulting in poor batching efficiency. Felid's packing strategy supports batching a flexible number of inputs, enabling it to adapt to fine-tuning workloads of different scales. This design may seem simple, yet it directly affects ciphertext slot utilization and overall throughput. Combined with operation-specific matrix evaluation algorithms, Felid maintains flexibility without sacrificing performance—instead achieving higher computational density.
Implications for Privacy-Preserving Machine Learning
Felid's results provide a new technical path for privacy-preserving fine-tuning of large models. In fields with extremely high data privacy requirements, such as healthcare and finance, FHE enables data to participate in model training without decryption, fundamentally avoiding the risk of data leakage. However, the speed bottleneck of FHE fine-tuning previously made it difficult to use in practice. Felid reduces the time for 2-layer BERT fine-tuning to 650 seconds. Although there is still a gap before practical deployment of large-scale models, it has already demonstrated the enormous potential of ciphertext operation-level optimization. In the future, as bootstrapping efficiency improves further and hardware acceleration matures, FHE fine-tuning is expected to be deployed in more scenarios.
Functional bootstrapping is an extended form of bootstrapping: standard bootstrapping only reduces noise, whereas functional bootstrapping, while refreshing the noise, can also apply an arbitrary function (such as activation functions like ReLU or GELU) to the plaintext encoded in the ciphertext. Its principle is to use the polynomial approximation of homomorphic decryption in the bootstrapping process to embed the target function directly into the decryption circuit. In this way, the element-wise activation function computation that would otherwise require additional ciphertext multiplications and rotations is "folded" into the bootstrapping step, eliminating the overhead of separate computation. Felid leverages this property to hide the computational cost of activation functions within the unavoidable bootstrapping process, thereby completing nonlinear transformations without increasing the number of bootstrapping calls.
Conclusion
Through innovative packing strategies, operation-specific matrix evaluation algorithms, and functional bootstrapping fusion, Felid achieves a significant efficiency breakthrough at the ciphertext operation level. The 30x reduction in rotations, 2.5x reduction in bootstrapping, and 8x end-to-end speedup demonstrate the value of low-level optimization. This work sets a new performance benchmark for transformer fine-tuning under fully homomorphic encryption, and also reminds researchers: while pursuing architectural innovation, one should not overlook the optimizable space in ciphertext operations themselves.
One-line Summary
Felid optimizes Transformer fine-tuning under FHE at the ciphertext operation level, with 30x fewer rotations and 8x end-to-end speedup.
Paragraph Summary
Felid is an optimization framework for Transformer fine-tuning under Fully Homomorphic Encryption (FHE). Unlike previous approaches that start from model architecture, Felid focuses on the ciphertext operation level, reducing overhead through three core innovations: a flexible packing strategy that supports a variable number of inputs to accommodate dynamic-batch fine-tuning workloads; dedicated evaluation algorithms designed for different matrix operations that substantially reduce ciphertext rotations and relinearizations; and the use of functional bootstrapping to fold element-wise activation functions into the bootstrapping step. Experiments show that, compared with the latest SOTA work, Felid reduces rotations and relinearizations by 30x and bootstrapping calls by 2.5x, and completes fine-tuning of a 2-layer BERT-style model with batch size 16 in 650 seconds, achieving an 8x end-to-end speedup, providing a new efficiency benchmark for privacy-preserving large model fine-tuning.
Related articles

Claude Designs Scorpion Venom-Neutralizing Proteins: With 17 Binders, How Far Are We From an Antidote?
Anthropic's Claude helped design scorpion venom-neutralizing proteins: only 17 of 211 candidates passed, multi-target coverage failed, and channel function and animal testing remain absent.

Fitting a 27B Model into 5.9GB: Ternary Bonsai 2.5 Fixes Its Agent Weaknesses
Prism ML releases Ternary Bonsai 2.5: a 27B model in just 5.9GB, with ternary quantization compressing weights to 1.76 bits. The new version focuses on fixing Agent capabilities, raising Tao3Bench Verify to 75.6 and Upworld from 51.2 to 90.5, hitting 291 tokens/s on a single A700, open-sourced under Apache 2.0.

GPT-6-Designed Proteins Validated in Lab; ERNIE 5.5 Preview Open-Sourced
GPT-6 designed proteins using reasoning and code alone, with lab binding evidence across five targets; Baidu open-sourced ERNIE 5.5 Flash Preview under Apache 2.0 with 280B parameters and 1M context.