Skip to content

ROSETTA: An Efficient and Accurate Privacy-Preserving LLM Decoding Framework Based on Hybrid CKKS/TFHEROSETTA: Efficient and Accurate Privacy-Preserving LLM Decoding via Hybrid CKKS/TFHE Evaluation

arXiv: Alignment, Deception & Oversight· arXiv:2609.16915· Jiangrui Yu, Baosheng Zhang, Liang Kong, Lin Ding, Yi Chen, Ye Yu, Mingzhe Zhang, Meng Li·Indexed by this site · 2026-10-01· Originally publishedDefenses

Quick read

Other

Based on the paper PDF (AI-generated); refer to the original

ROSETTA uses an adaptive segmented LUT and per-operator CKKS/TFHE selection for privacy-preserving LLM decoding; relative to CacheMir, up to 4.8× for Softmax and 1.5–2.1× end-to-end.

Questions
In autoregressive decoding of generative LLMs, non-linear operators are expensive under FHE and can account for over 70% of decode-stage latency. Pure CKKS has high precision but high cost, while a single PBS in pure TFHE has about 11 bits of precision, which is insufficient for wide dynamic ranges.
Methods
ROSETTA mixes CKKS and TFHE by operator. The adaptive segmented LUT divides the input domain into non-uniform segments according to function variation, uses linear interpolation within segments, and uses plaintext-ciphertext multiplication plus PBS to select the result. Scheme-aware selection formulates the scheme assignment of non-arithmetic primitives together with CKKS levels as a shortest-path problem on an augmented DAG.
Experiments and results
The authors report that relative to pure-CKKS CacheMir, ROSETTA achieves up to 4.8× for Softmax and 1.5–2.1× end-to-end; relative to PEGASUS, 3–4× end-to-end, with average PPL degradation reduced from +116% to +1.4%. In Figure 2, at n=1024, full CKKS is 44.1s, full TFHE is 57.9s, and putting only 1/x into TFHE is 22.2s.
Limitations and future work
The follow-up space given in the main text mainly comes from two challenges: insufficient PBS precision on wide-range operators, and the need to jointly optimize conversion overhead and CKKS level count when switching schemes per operator. The tested models in Figure 1 are GPT-2 Base, TinyLlama-1.1B, and LLaMA-3-8B, with comparison frameworks CacheMir and PEGASUS.
Experimental setupGPT-2 Base、TinyLlama-1.1B et al. · decode-stage Softmax、end-to-end LLM decoding et al. · latency、speedup et al.
Evaluated models
GPT-2 BaseTinyLlama-1.1BLLaMA-3-8B
Benchmarks
decode-stage Softmaxend-to-end LLM decodingWikiText-2 PPL
Metrics
latencyspeedupPPL degradation
AI summaryROSETTA is a hybrid CKKS/TFHE framework that addresses the excessive overhead of non-linear operations in fully homomorphic encryption (FHE) privacy-preserving inference. It proposes a TFHE-based adaptive segmented lookup table protocol and designs an operator selection framework that automatically assigns each non-linear operator to CKKS or TFHE to minimize end-to-end decoding latency. Compared to the SOTA framework CacheMir, ROSETTA achieves up to 4.8× Softmax speedup and 1.5–2.1× end-to-end speedup; the paper has been accepted by ACM CCS 2026.

ROSETTA is a hybrid CKKS/TFHE framework that addresses the excessive overhead of non-linear operations in fully homomorphic encryption (FHE) privacy-preserving inference. It proposes a TFHE-based adaptive segmented lookup table protocol and designs an operator selection framework that automatically assigns each non-linear operator to CKKS or TFHE to minimize end-to-end decoding latency. Compared to the SOTA framework CacheMir, ROSETTA achieves up to 4.8× Softmax speedup and 1.5–2.1× end-to-end speedup; the paper has been accepted by ACM CCS 2026.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Nonlinear operators in LLM decoding under FHE are slow and hard to keep precise; ROSETTA mixes CKKS and TFHE per operator.

    Under FHE, non-linear operators in autoregressive decoding have high latency, and no single scheme can simultaneously achieve both precision and efficiency.

    • Scenario: Generative LLMs are often deployed in the cloud, and prompts may contain sensitive information. The authors state that FHE schemes are more communication-efficient and place a lower burden on the client: the client uploads encrypted input, the server computes on ciphertexts, and only returns encrypted output (Figure 1(a)).
    • Limitations of existing work: prefill suits CKKS's SIMD; decode processes only one token at a time, and some operators have low parallelism. The authors state that after CacheMir optimizes the linear parts, non-linear operators still account for over 70% of decode time (Figure 1(b): GPT-2 Base, TinyLlama-1.1B, LLaMA-3-8B, non-linear about 76.8%). PEGASUS assigns all non-linear layers to TFHE, and LOHEN offloads only the first k layers; the authors state these heuristics are not optimal.
    • Observation: In decode, non-linear operators differ in element count and input dynamic range. Taking softmax as an example, exp processes n bounded elements, while the 1/x after summation is a single scalar with a wider range. Under full CKKS, the Goldschmidt iteration for 1/x has a total latency of 44.1s; under full TFHE, exp cannot be batched and there are two conversions, totaling 57.9s, with a single PBS of about 11 bits; the authors state that relative to the plaintext baseline, softmax perplexity can increase by more than 100% (Table 8).
    • Threat model: Standard two-party privacy-preserving inference. The server holds confidential model weights, and the client holds sensitive input; the architecture is public to both parties. Honest-but-curious: both parties follow the protocol but may try to learn more information. The guarantee is that the client obtains correct output, and both weights and input remain confidential.
    • Proposed method: ROSETTA, a hybrid CKKS/TFHE framework. First, a TFHE-based adaptive segmented lookup table (segmented LUT) for high-precision non-linear evaluation over wide ranges; second, scheme-aware operator selection that assigns each non-linear operator to CKKS or TFHE while simultaneously allocating CKKS multiplication levels, to reduce end-to-end decoding latency.
  2. What related research exists?

    Related work is divided into pure CKKS, hybrid CKKS/TFHE, and MPC/hybrid protocols; baselines are CacheMir and PEGASUS.

    The introduction categorizes privacy inference into three types, and Table 1 further compares four classes of FHE frameworks by nonlinear evaluation.

    • Pure CKKS: CKKS [11, 12] packs multiple plaintexts into one RLWE ciphertext, suitable for SIMD in prefill. Pure-CKKS frameworks [38, 41, 59, 60] and CacheMir [55] use polynomial approximations for nonlinearities; CacheMir also uses shortest paths for CKKS layer assignment. The authors state that these require multiple iterations and frequent bootstrapping for a wide range of 1/x, with high precision but high cost, and are limited by wide SIMD.

    • Hybrid CKKS/TFHE: TFHE [13] uses programmable bootstrapping (PBS) for element-wise table lookup. PEGASUS [27] moves all nonlinear layers to TFHE with a single LUT. LOHEN [63] offloads only the first k layers, also with a single LUT. The authors state that single PBS has low precision (about 11 bits), and coarse-grained heuristics ignore conversion overhead and the number of surrounding CKKS layers.

    • MPC and hybrid FHE/MPC: MPC [2, 18, 23, 30, 34, 56–58] and hybrid FHE/MPC [24–26, 29, 37, 39, 47, 48, 50, 51, 54, 62, 64]. The authors state that relative to these designs, pure FHE has less communication and less client computation. Scheme conversion uses Ring Switch [4, 20], LWE Extract / RLWE Repack [8, 13], and RLWE Trace [8]; high-precision comparison uses HomComp [5]. The max-free softmax follows the normalize-and-square approach of [38, 55, 59].

    • Baselines and benchmarks: the authors compare ROSETTA against pure-CKKS CacheMir [55] and hybrid PEGASUS [27]; latency breakdown is based on CacheMir, with models GPT-2 Base, TinyLlama-1.1B, and LLaMA-3-8B. Metrics include Softmax and end-to-end latency, plus perplexity (PPL) degradation relative to plaintext.

    The authors position this work as: segmented LUT plus polynomials, with precision higher than single PBS; the selection strategy is per-operator and jointly optimized with CKKS layer assignment, rather than all-CKKS, all-TFHE, or first-k-layers.

  3. How does the paper address this problem?

    The segmented LUT improves wide-range precision, and the augmented DAG shortest path simultaneously determines the scheme and CKKS levels.

    ROSETTA offloads only the non-arithmetic primitives suitable for TFHE and uses segmented LUTs to compensate for the precision limit of a single PBS; the scheme allocation and CKKS level count are solved together as a shortest path on the same DAG.

    Problem Setting

    • Computation scope: only decoding. A Transformer block contains self-attention and SwiGLU FFN (Figure 4). Hidden dimension d_model (e.g., 4096), number of heads h (e.g., 32), per-head dimension d, FFN intermediate dimension d_ffn (e.g., 11008), context length n.
    • Attention: a single token input goes through Q/K/V projections, K and V are appended to the KV-cache, then scaled dot-product softmax and output projection are performed per Equation (6).
    • FFN: Equation (7), SiLU(x W_up) is multiplied element-wise with the gating branch, then down-projected. Standard max subtraction is expensive in FHE, so normalize-and-square is used: starting from y_i = e^{z_i/2^k} on a small range, the identity Softmax(2x) is applied k times to recover Softmax(z).

    Adaptive Segmented LUT

    • Single-table problem: example f(x)=1/x, domain [0.1, 2.0], N_br=4 (Figure 5). With equal intervals and midpoint constant approximation, x=0.22 gives 2.963, exact value 4.545, relative error 34.8% at that point, maximum error 70.4% over the domain.
    • Construction: the domain is split into N_seg segments, with boundaries denser where the function varies locally (1/x is denser near 0). In the example N_seg=2, segments [0.1, 0.5] and [0.5, 2.0], the authors claim the maximum error drops to 33.3%. Within a segment, linear approximation f(x)≈a_si·x+b_si; the same example gives 4.571, relative error 0.57%, maximum error 5.9%. Quadratic approximation is more accurate (Figure 5(e)), but the authors use linear, claiming sufficient accuracy and lower cost.
    • Online three steps: 1) compare with each segment boundary and sum to get segment number S; 2) linear mapping within the segment to get interval number I; 3) take (a_SI, b_SI) for linear evaluation. Plaintext example x=0.22 falls into S=0, I=1.

    Ciphertext Lookup Protocol

    • Obstacle: S and I are also ciphertexts, so coefficients cannot be directly fetched. First use PBS to extract coefficients, then LWE ciphertext-ciphertext multiplication, requiring high-precision fixed-point arithmetic not natively supported by TFHE.
    • Strategy: online-construct-then-select (Figure 6). First use RLWE plaintext-ciphertext multiplication to put all candidates a_si·x+b_si into a test polynomial, then use PBS to select the correct item by encrypted index. Inputs prepare both JxK_RLWE (constant term encoding) and JxK_LWE.
    • Step 1: each x≥τ_j uses HomComp [5] (internally multi-step PBS), then homomorphic addition, total N_seg−1 comparisons. In the example, one comparison gives S=0.
    • Steps 2–3: interval number and linear evaluation both go through "construct all candidates first, then PBS select". The protocol only uses RLWE plaintext-ciphertext multiplication and PBS; the authors claim 12–19 bits over a wide range, 6–10 bits higher than the ~11 bits of a single PBS, and 8–9× faster than CKKS iteration (§3).

    Scheme-Aware Operator Selection

    • Search reduction: within a layer, only non-arithmetic primitives (e.g., exp, 1/x) are considered for TFHE; arithmetic operations stay in CKKS.
    • Joint optimization: each CKKS–TFHE conversion is recorded as an edge weight on the CacheMir layer allocation DAG; a level-0 TFHE node is inserted next to each non-arithmetic primitive. The shortest path simultaneously gives which primitives to offload and the CKKS level count per layer. The authors claim this avoids the suboptimal heuristic of first comparing single-operator latency and then tuning levels separately (§4).
    • Conversion primitives: Ring Switch splits/merges between large and small rings; LWE Extract / RLWE Repack converts between packed RLWE and scalar LWE; RLWE Trace extracts the constant term. These primitives are used before and after nonlinear evaluation to connect back to subsequent linear layers.
  4. What experiments did the paper conduct?

    Relative to CacheMir, Softmax up to 4.8×, end-to-end 1.5–2.1×; relative to PEGASUS, PPL degradation from +116% to +1.4%.

    Experimental setup

    • Models: Latency decomposition covers GPT-2 Base, TinyLlama-1.1B, and LLaMA-3-8B (Figure 1(b)). The architecture example gives d_model=4096, h=32, d_ffn=11008, corresponding to the LLaMA block example in the text; the paper does not list all hyperparameters per model in the read main text.
    • Baselines: CacheMir [55] (pure CKKS, which the authors call SOTA), and PEGASUS [27] (hybrid CKKS/TFHE). LOHEN [63] appears in the feature comparison in Table 1; the numerical comparisons in the abstract are against CacheMir and PEGASUS.
    • Operator microbenchmark: softmax, n=1024. Figure 2(b) gives the latencies of exp and Inv under CKKS, TFHE, and conversions; exp input range is [-3, 3], Inv input range is [1, 403].
    • Metrics: Module and end-to-end latency (seconds or hours), speedup ratios, and PPL degradation relative to the plaintext baseline. Precision is described in bits and relative error for the segmented LUT.
    • Review method: The paper does not state which model is used to compute PPL, nor does it report the number of repetitions. Table 8 is cited as showing that a single PBS increases softmax perplexity by more than 100% relative to plaintext, but the table body is not included in the read main text.

    Main results

    SettingLatency or precisionSource
    Full CKKS softmax, n=102444.1s (Inv 42.7s + exp 1.4s)Figure 2(c)
    Full TFHE softmax, n=102457.9sFigure 2(d)
    Hybrid: exp in CKKS, 1/x in TFHE22.2sFigure 2(e)
    ROSETTA vs CacheMirSoftmax up to 4.8×; end-to-end 1.5–2.1×Abstract, §1.1
    ROSETTA vs PEGASUSEnd-to-end 3–4×; average PPL degradation +116% → +1.4%§1.1
    • Authors' interpretation: In Figure 2(b), exp is 1.4s in CKKS and 17.1s in TFHE; Inv is 42.7s in CKKS and 0.8s in TFHE, with conversions at 20.0s. The authors state that assigning only 1/x to TFHE combines the strengths of both, bringing total latency to 22.2s.
    • End-to-end: The authors report 1.5–2.1× end-to-end relative to CacheMir and 3–4× relative to PEGASUS, while reducing average PPL degradation from +116% to +1.4%. The read main text has no per-model end-to-end table.
    • Precision: The segmented LUT is reported by the authors as 12–19 bits, exceeding the single-PBS ceiling of about 11 bits by 6–10 bits, and is 8–9× faster than CKKS iteration (§3). At the illustrative point in Figure 5, the constant LUT has a relative error of 34.8% (maximum 70.4%), and after linear segmentation that point is 0.57% (maximum 5.9%).

    Operator-level latency decomposition

    • What was measured: Module latency of the same softmax (n=1024) under three assignments: full CKKS, full TFHE, and hybrid (Figure 2).
    • Results: The dominant cost in full CKKS is Inv at 42.7s; in full TFHE, the dominant costs are exp at 17.1s plus two conversions (Lat.=20 appears multiple times in the figure), totaling 57.9s; on the hybrid path, TFHE Inv is 0.8s and CKKS exp is 1.4s, totaling 22.2s.
    • Authors' interpretation: exp, with many elements and a bounded range, suits CKKS's low-degree polynomials and SIMD; scalar, wide-range 1/x suits TFHE. Comparing only each operator's own latency is insufficient because conversions and the number of adjacent CKKS layers change the total cost.

    Decode-stage share

    • What was measured: Latency decomposition of GPT-2 Base, TinyLlama-1.1B, and LLaMA-3-8B based on CacheMir (Figure 1(b)), with the horizontal axis as Latency (hours), ranging approximately from 0 to 5.
    • Results: The non-linear block is marked 76.8% in the figure. The authors state that non-linear operators account for over 70% of total decode runtime.
    • Authors' interpretation: After CacheMir optimizes the linear parts, the main decode overhead lies in non-linear operators, so hybrid offloading has room for gains.

    Other ablations and analyses

    • Single-segment equally spaced constant LUT, domain [0.1, 2.0], N_br=4: relative error 34.8% at x=0.22, maximum error 70.4% over the domain (Figure 5(a)(b), §3.1).
    • Two segments but constant approximation: the authors state the maximum error drops to 33.3% (§3.1.1).
    • Two segments with linear: relative error 0.57% at that point, maximum error 5.9% (Figure 5(d)(f)).
    • Quadratic approximation: given in Figure 5(e); the authors state it can further improve precision, but linear is adopted.
    • Segmented LUT vs single PBS: precision 12–19 bits vs about 11 bits, 6–10 bits higher; 8–9× faster than CKKS iteration (§1.1, §3).
    • Table 1 is a feature comparison (polynomial / single LUT / segmented LUT+polynomial, full CKKS / full TFHE / first k layers / per-operator), with no additional numbers.
  5. What are some points that can be further explored?

    The read main text frames the coupling between the precision ceiling and scheme assignment as two challenges that must be solved first.

    Limitations and future directions noted by the authors

    The read main text has no separate Limitations or Future Work section. In the introduction, the authors frame two things as challenges that must be solved before a hybrid scheme can be deployed, rather than as plans beyond the completed work.

    • Wide-range precision: The TFHE side still inherits PBS's precision limitation for wide-range operators (e.g., 1/x); a single PBS encodes only a small LUT (e.g., 2048 entries), with a precision ceiling of about 11 bits, which the authors state is insufficient for wide dynamic ranges (§1). The segmented LUT is a design targeting this challenge.
    • Assignment itself is non-trivial: Assigning an operator to TFHE changes that operator's latency and introduces scheme conversions, and the levels of surrounding CKKS layers must also be set accordingly; comparing only each operator's own latency under the two schemes is insufficient (§1). The shortest-path formulation is a design targeting this challenge.
    • A single scheme is insufficient: The authors state that CKKS has high precision but is expensive and limited by wide SIMD; TFHE suits element-wise operations but cannot provide high precision (§1). This is motivation, not a separately listed unfinished item.

    Experimental coverage

    • The models for latency decomposition are GPT-2 Base, TinyLlama-1.1B, and LLaMA-3-8B, based on CacheMir (Figure 1(b)).
    • The softmax microbenchmark uses n=1024, comparing full CKKS, full TFHE, and "exp in CKKS, 1/x in TFHE" (Figure 2).
    • The frameworks for numerical comparison are CacheMir and PEGASUS; LOHEN appears only in the strategy comparison in Table 1 (first k layers, single LUT, low precision).
    • Precision evidence includes the illustrative 1/x error in Figure 5, as well as the authors' reported 12–19 bits and PPL degradation from +116% to +1.4% (average relative to PEGASUS).
    • The threat model is honest-but-curious two-party with public architecture; the paper does not report experiments under a malicious adversary, communication byte counts, or numbers of repetitions in the read main text.
  6. Summarize the main content of the paper

    ROSETTA uses a segmented LUT and DAG shortest path to combine CKKS and TFHE per operator in LLM decoding.

    ROSETTA is a hybrid CKKS/TFHE privacy-preserving inference framework for LLM decoding, aiming to let the server complete decoding on ciphertexts while protecting both weights and user input under the honest-but-curious two-party setting.

    • Problem: Decoding generates one token at a time, and non-linear operators account for over 70% of the CacheMir decomposition (Figure 1(b) marks 76.8%). Full CKKS requires multiple iterations for wide-range 1/x (softmax 44.1s at n=1024); full TFHE cannot batch exp and incurs conversions, totaling 57.9s, with a single PBS of about 11 bits.
    • Method: The adaptive segmented LUT divides the domain into non-uniform segments by function curvature, with linear interpolation within segments; on the ciphertext side, plaintext-ciphertext multiplications are first performed for all candidates, then PBS selects the result, avoiding ciphertext-ciphertext fixed-point operations unsupported by TFHE. Scheme selection is applied only to non-arithmetic primitives such as exp and 1/x, with conversion costs written into a layer-assignment DAG, and a single shortest-path computation decides both the offloading targets and CKKS levels.
    • Results: The hybrid assignment in Figure 2(e) reduces softmax to 22.2s. The authors report up to 4.8× for Softmax and 1.5–2.1× end-to-end relative to CacheMir; relative to PEGASUS, 3–4× end-to-end, with average PPL degradation reduced from +116% to +1.4%. The segmented LUT is reported by the authors as 12–19 bits, 6–10 bits higher than a single PBS, and 8–9× faster than CKKS iteration. In the illustrative example, linear segmentation reduces the relative error of 1/x at x=0.22 from 34.8% to 0.57%.
    • Authors' conclusion: Non-linear operator load is uneven, so scheme selection should be per-operator rather than per-layer; the segmented LUT compensates for the precision ceiling of PBS, and the joint shortest path accounts for conversions and layer counts, thereby achieving both efficiency and precision.
Read originalarxiv.org