Hi OpenFHE team,
I am currently exploring CKKS implementations for privacy-preserving inference of large foundation models, especially Transformer/LLM inference. I have a question about whether OpenFHE currently supports, or could potentially support, a CKKS ring-degree switching / ring-packing primitive similar to the method used in recent FHE-based LLM systems.
The specific primitive I am interested in is not CKKS-to-FHEW/TFHE scheme switching. Instead, it is a CKKS-to-CKKS ring switching operation between different cyclotomic ring degrees.
Concretely, suppose we have a CKKS/RLWE ciphertext in a large ring:
R_N = Z_Q[X] / (X^N + 1)
and we want to switch it to smaller rings:
R_N' = Z_Q[Y] / (Y^{N'} + 1), where N' divides N and Y = X^{N/N'}.
The operation I have in mind is roughly:
-
key-switch the ciphertext from a large-ring secret key
sk_Nto an embedded small-ring secret keysk_N'(X^{N/N'})insideR_N; -
decompose the large-ring ciphertext polynomials by coefficient residue classes modulo
k = N/N'; -
reinterpret the decomposed polynomial components as multiple ciphertexts over the smaller ring
R_N'.
In other words, one large-ring ciphertext would be converted into k = N/N' smaller-ring ciphertexts, each encrypting a block of coefficients from the original message. A reverse merge/repack operation would also be useful.
This type of primitive appears very useful for modern CKKS-based large model inference, because different operators may prefer different ciphertext formats and ring degrees. For example, nonlinear functions and bootstrapping may use a large ring with slot encoding, while some plaintext-ciphertext or ciphertext-ciphertext linear algebra routines could be much more efficient in smaller rings or coefficient-style layouts.
My questions are:
-
Is there currently any way to implement this CKKS ring-degree switching / ring-packing operation using the public OpenFHE API?
-
If it is not possible via the public API, are the required lower-level components already present internally in OpenFHE, such as:
-
generating key-switching material from a large-ring secret to an embedded small-ring secret,
-
manipulating DCRTPoly components across different ring dimensions,
-
constructing valid ciphertexts in a smaller CKKS CryptoContext from decomposed large-ring polynomial components,
-
preserving CKKS metadata such as scale, level, and modulus chain information?
-
-
Would the OpenFHE team consider supporting this type of CKKS ring-degree switching primitive in the library?
I believe this would be very valuable for implementing efficient CKKS inference for large foundation models (e.g., LLM), in which the work from CryptoLab (https://arxiv.org/pdf/2601.18511) has already finished.
Thank you very much!