Inferensys

Glossary

Relinearization

A key-switching procedure that reduces the size of a ciphertext after multiplication back to two ring elements, preventing quadratic growth in ciphertext dimension.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
CIPHERTEXT SIZE MANAGEMENT

What is Relinearization?

Relinearization is a key-switching procedure that reduces the size of a ciphertext after multiplication back to two ring elements, preventing quadratic growth in ciphertext dimension.

Relinearization is a noise management and size-reduction operation in lattice-based homomorphic encryption. When two ciphertexts—each represented by two polynomials—are multiplied, the result is a ciphertext with three ring elements. Without intervention, subsequent multiplications would cause exponential growth, making computation and storage impractical. Relinearization applies a key-switching procedure using a public evaluation key to collapse the three-element product back into a standard two-element ciphertext, maintaining a constant size for further operations.

The procedure relies on a relinearization key, a public key derived from the secret key that enables the transformation without decryption. During the operation, the quadratic term of the multiplied ciphertext is decomposed and re-encrypted under the original secret key, effectively eliminating the extra polynomial. This introduces a small additive noise growth penalty, which must be tracked against the ciphertext's noise budget. In schemes like CKKS and BFV, relinearization is essential after every multiplication to enable deep circuit evaluation without ciphertext dimension explosion.

CIPHERTEXT SIZE MANAGEMENT

Key Characteristics of Relinearization

Relinearization is a critical key-switching procedure that prevents the exponential growth of ciphertext dimension following homomorphic multiplication, constraining the result back to two ring elements for practical storage and continued computation.

01

The Quadratic Growth Problem

Homomorphic multiplication of two ciphertexts (each with 2 polynomials) naturally produces a result with 3 polynomials. Without intervention, subsequent multiplications cause the ciphertext size to grow to 4, then 5, then more polynomials, making storage and further computation exponentially more expensive. Relinearization eliminates this quadratic growth in ciphertext dimension by reducing the product back to a standard 2-element ciphertext.

02

Key-Switching Mechanism

Relinearization is a specific application of the key-switching primitive. It transforms a degree-2 ciphertext (encrypted under a 'squared' secret key s²) back into a degree-1 ciphertext (encrypted under the original secret key s). This is achieved using a public relinearization key (relin key), which is a masked version of s² encrypted under s, allowing the evaluator to homomorphically convert the ciphertext without accessing the secret key.

03

Noise Budget Cost

Relinearization is not free. The key-switching operation introduces additional noise into the ciphertext, consuming a portion of the finite noise budget. The magnitude of this added noise is proportional to the decomposition base used in the key-switching algorithm. A larger decomposition base reduces computational cost but adds more noise, creating a direct security-efficiency trade-off that must be managed for deep circuits.

04

Role in Packed Computation

In schemes like CKKS and BFV that support ciphertext packing, relinearization is essential for maintaining SIMD parallelism. After multiplying two packed ciphertexts, the 3-element result cannot be used for further packed operations until it is relinearized. Without it, the slot structure becomes corrupted, and subsequent rotations or multiplications would produce meaningless results.

05

Relinearization vs. Rescaling

These are distinct but complementary operations in CKKS:

  • Relinearization: Reduces ciphertext size (number of polynomials) after multiplication
  • Rescaling: Reduces ciphertext scale and modulus to manage precision and noise Both are typically applied after each multiplication: first relinearization to restore size, then rescaling to manage the scale factor. Skipping relinearization while rescaling is possible but leaves a larger ciphertext that costs more to store and operate on.
06

Computational Overhead

Relinearization is one of the most expensive operations in HE, often dominating multiplication latency. It requires:

  • NTT (Number Theoretic Transform) conversions on the extended ciphertext
  • Modular polynomial multiplications with the relin key components
  • Digit decomposition of the ciphertext polynomials Hardware acceleration via GPU or FPGA implementations often focuses on optimizing this specific operation to reduce end-to-end encrypted inference time.
RELINEARIZATION EXPLAINED

Frequently Asked Questions

Clear answers to common questions about the key-switching procedure that prevents ciphertext size explosion in homomorphic encryption schemes.

Relinearization is a key-switching procedure that reduces a ciphertext's size back to two ring elements after a homomorphic multiplication. Without relinearization, each multiplication would increase the ciphertext dimension—multiplying two ciphertexts of size 2 produces a ciphertext of size 3, and subsequent multiplications cause quadratic growth. This dimensional explosion renders computation impractical, as both storage and subsequent operation costs scale with ciphertext size. Relinearization applies a public evaluation key to transform the extended ciphertext into a canonical two-element form encrypting the same plaintext, enabling an unbounded chain of multiplications without dimensional blowup. The operation is essential in all major lattice-based schemes including BFV, BGV, and CKKS.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.