Polynomial approximation is the process of replacing non-linear activation functions—such as ReLU, sigmoid, or tanh—with low-degree polynomial equivalents to enable their computation on encrypted data. Because homomorphic encryption schemes like CKKS and BFV only support addition and multiplication natively, any non-polynomial operation must be approximated to execute within the encrypted domain without decryption.
Glossary
Polynomial Approximation

What is Polynomial Approximation?
The mathematical technique of substituting non-linear functions with low-degree polynomials to enable their evaluation within homomorphic encryption schemes that natively support only addition and multiplication.
The accuracy of the approximation is governed by the polynomial's degree: higher-degree polynomials yield tighter fits to the original function but consume more of the ciphertext's noise budget and multiplicative depth. Common techniques include Chebyshev approximation and minimax approximation, which minimize the maximum error over a specified input interval, balancing computational cost against inference fidelity in encrypted inference pipelines.
Key Characteristics of Polynomial Approximation
Polynomial approximation is the critical bridge that enables complex machine learning functions to operate within the constraints of homomorphic encryption schemes, which natively support only addition and multiplication.
The Fundamental Constraint
Homomorphic encryption (HE) schemes like CKKS and BFV are algebraically restricted to addition and multiplication operations on ciphertexts. Non-linear functions—such as ReLU, sigmoid, tanh, and max pooling—cannot be evaluated directly. Polynomial approximation replaces these functions with polynomials that can be computed using only the allowed operations.
- Core Insight: Any continuous function on a closed interval can be uniformly approximated by a polynomial (Weierstrass approximation theorem).
- Practical Impact: This transforms an incompatible neural network into a circuit evaluable under encryption.
Approximation Methodologies
Several mathematical techniques are employed to find the optimal polynomial representation, each with distinct trade-offs in accuracy and computational depth.
- Minimax Approximation: Finds the polynomial that minimizes the maximum absolute error over the target interval. The Remez algorithm is the standard tool, producing the optimal polynomial for a given degree.
- Least Squares Fitting: Minimizes the average squared error, often using Chebyshev nodes to avoid Runge's phenomenon at interval boundaries.
- Taylor Series: A simple local approximation around a single point, but error grows rapidly away from the expansion point, making it unsuitable for wide intervals.
- Interpolation: Forces the polynomial to match the target function exactly at specific points, but can oscillate wildly between them if not carefully designed.
The Depth-Accuracy Trade-off
The choice of polynomial degree directly impacts both the approximation error and the computational cost under encryption.
- Higher Degree = Better Accuracy: A degree-7 polynomial can approximate ReLU with near-perfect fidelity on a bounded interval, while a degree-3 polynomial introduces noticeable smoothing.
- Higher Degree = Greater Depth: Each polynomial evaluation consumes the noise budget and requires a specific multiplicative depth. A degree-7 polynomial requires a circuit depth of 3 (using Horner's method or Estrin's scheme), while degree-3 requires depth 2.
- Bootstrapping Cost: If the required depth exceeds the scheme's native capacity, a computationally expensive bootstrapping operation is needed to refresh the ciphertext, often dominating inference latency.
Interval Management and Domain Extension
Polynomial approximations are only accurate within a predefined bounded interval. Inputs outside this range cause catastrophic error divergence.
- Input Normalization: Neural network activations must be statistically bounded. Techniques like batch normalization and fixed scaling ensure inputs stay within the approximation's valid domain.
- Piecewise Polynomials: For functions with complex behavior, the domain is split into sub-intervals, each with its own low-degree polynomial. Under HE, selecting the correct sub-interval requires a multiplexer implemented via encrypted comparisons.
- Composition: Functions like softmax are decomposed into a sequence of approximable primitives: exponential approximation, summation, and reciprocal approximation.
Standard ML Replacements
Common neural network activation functions have well-studied polynomial substitutes optimized for HE evaluation.
- ReLU → Square or Low-Degree Polynomial: The standard ReLU,
max(0, x), is replaced byx²or a degree-4 minimax polynomial that closely tracks the ReLU shape on[-1, 1]. - Sigmoid / Tanh → Low-Degree Minimax: These smooth functions are well-approximated by degree-3 or degree-5 polynomials on a bounded interval like
[-8, 8]. - Max Pooling → Scaled Mean or Polynomial Softmax: The non-differentiable max operation is replaced by a smooth approximation like the LogSumExp function, which itself is built from exponentials and logarithms, each requiring polynomial approximation.
- Division → Reciprocal Approximation: For operations like batch normalization, division is implemented by approximating
1/xwith a polynomial and multiplying.
Precision and Application Suitability
The inherent approximation error must be evaluated against the application's tolerance for numerical imprecision.
- CKKS and Approximate Arithmetic: The CKKS scheme is designed for approximate fixed-point arithmetic, making it the natural pairing for polynomial approximation. It treats least-significant-bit errors as noise, aligning with the approximation error.
- Inference vs. Training: Encrypted inference is highly practical with polynomial approximations, as a pre-trained model's weights are fixed and the approximation error can be validated offline. Encrypted training is significantly harder because gradients must also be approximated, compounding errors.
- Accuracy Validation: The final encrypted model's accuracy must be benchmarked against the original plaintext model on a held-out test set to ensure the approximation error does not degrade predictive performance below acceptable thresholds.
Frequently Asked Questions
Clear answers to common questions about replacing non-linear functions with polynomials for homomorphic encryption.
Polynomial approximation is the mathematical technique of replacing non-linear functions—such as the sigmoid, ReLU, or softmax—with low-degree polynomials, enabling their evaluation within homomorphic encryption (HE) schemes that natively support only addition and multiplication. Since HE ciphertexts cannot directly compute division, comparison, or transcendental operations, a function like max(0, x) must be approximated by a polynomial P(x) that closely mimics its behavior over a defined input interval. The approximation is typically derived using methods like minimax approximation, Chebyshev interpolation, or Taylor series expansion, with the goal of minimizing the maximum absolute error while keeping the polynomial degree as low as possible to manage the noise budget and computational latency.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Mastering polynomial approximation requires understanding the cryptographic schemes it enables and the noise management techniques that make it viable.
Noise Budget Management
Every homomorphic multiplication consumes a finite noise budget, growing the inherent cryptographic error embedded in the ciphertext. Polynomial approximations must balance degree against noise consumption:
- Higher-degree polynomials achieve better accuracy but consume more budget
- Rescaling in CKKS truncates noise after each multiplication
- Bootstrapping resets the budget when exhausted, enabling deep polynomial evaluations Efficient approximation minimizes the multiplicative depth required.
SIMD Packing
Single Instruction, Multiple Data encoding leverages the Chinese Remainder Theorem to pack thousands of plaintext values into a single ciphertext. Polynomial approximations are evaluated in parallel across all packed slots, amortizing computational cost. This is critical for ML inference where a single polynomial evaluation simultaneously processes:
- All neurons in a layer
- All samples in a batch
- All channels in a convolution
Remez Algorithm
The Remez exchange algorithm is the gold standard for finding optimal polynomial approximations over a bounded interval. It minimizes the maximum absolute error (minimax approximation) between the target function and the polynomial. For FHE applications, Remez-optimized polynomials achieve the same accuracy as Taylor or Chebyshev expansions with lower degree, directly reducing multiplicative depth and noise consumption. This is critical for approximating sigmoid and Gaussian functions.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us