Randomized smoothing transforms an arbitrary base classifier into a certifiably robust smoothed classifier. For any input, it adds isotropic Gaussian noise and queries the base model multiple times. The smoothed classifier's prediction is the majority vote across these noisy samples. This process yields a provable radius within which no adversarial perturbation can alter the prediction.
Glossary
Randomized Smoothing

What is Randomized Smoothing?
Randomized smoothing is a probabilistic defense mechanism that constructs a certifiably robust classifier from any base model by adding Gaussian noise to inputs and returning the most probable prediction under that noise distribution.
The certified radius is computed using the Neyman-Pearson lemma, which guarantees that Gaussian noise yields the optimal trade-off between robustness and accuracy for L2-norm perturbations. Unlike empirical defenses, randomized smoothing provides a mathematical guarantee of robustness without requiring assumptions about the base model's architecture or training procedure.
Key Characteristics of Randomized Smoothing
Randomized smoothing is a probabilistic defense that constructs a certifiably robust classifier by adding Gaussian noise to inputs and returning the most probable prediction under that noise distribution. It provides provable guarantees against adversarial perturbations.
Probabilistic Certification Guarantee
Unlike empirical defenses, randomized smoothing provides a mathematical guarantee that a prediction will remain constant for any input within a certified L2 radius. The certification radius R is computed using the formula: R = σ/2 * (Φ⁻¹(pA) - Φ⁻¹(pB)), where σ is the noise level, pA and pB are the top two class probabilities under the smoothed distribution, and Φ⁻¹ is the inverse Gaussian CDF. This guarantee is attack-agnostic—it holds against all possible adversaries, not just gradient-based methods.
Gaussian Noise Augmentation
The core mechanism constructs a smoothed classifier g(x) that returns the most likely prediction when Gaussian noise is added to the input:
- Base classifier f: Any arbitrary model (neural network, decision tree, etc.)
- Noise distribution: Isotropic Gaussian N(0, σ²I) with standard deviation σ
- Smoothed prediction: g(x) = argmax_c P(f(x + ε) = c) where ε ~ N(0, σ²I)
The noise level σ acts as a tunable robustness-accuracy trade-off parameter. Larger σ yields larger certified radii but may degrade clean accuracy.
Monte Carlo Estimation Procedure
Certification at inference time requires estimating the prediction probabilities under noise through statistical sampling:
- Prediction phase: Draw n₀ samples of Gaussian noise, compute the majority class ĉ
- Certification phase: Draw n samples, count occurrences of ĉ to estimate lower bound pA with confidence 1-α
- Sample counts: Typically n₀ = 100 and n = 100,000 for tight certification bounds
- Clopper-Pearson confidence interval: Used to compute a rigorous lower bound on the true probability
The procedure is computationally expensive at inference time but provides rigorous statistical guarantees.
Neyman-Pearson Lemma Foundation
The theoretical foundation of randomized smoothing rests on the Neyman-Pearson lemma from statistical hypothesis testing. For binary classification with Gaussian noise, the optimal adversary is constrained by the likelihood ratio between two shifted Gaussian distributions. The worst-case classifier—one that minimizes certified radius for a given pA—is a linear classifier defined by a half-space. This connection to classical statistics provides the tightness of the L2 certification bound, making it the gold standard for provable defenses.
Architecture-Agnostic Defense
Randomized smoothing operates as a wrapper around any base classifier, making it uniquely flexible:
- No architectural constraints: Works with CNNs, ResNets, Vision Transformers, or any differentiable model
- No retraining required: Can be applied post-hoc to pre-trained models, though performance improves with noise-augmented training
- Black-box compatibility: The base model can be treated as an oracle; only query access is needed
- Composability: Can be combined with other defenses like adversarial training for enhanced empirical robustness
This agnosticism makes it immediately deployable on existing production models.
Limitations and Practical Considerations
Despite its theoretical elegance, randomized smoothing has notable constraints:
- L2 norm only: Standard formulation certifies only against L2-bounded perturbations, not L∞ or L1 attacks
- Scalability challenges: Certification requires tens of thousands of forward passes per input
- Semantic blind spot: The guarantee is purely geometric; it does not account for perceptual similarity
- Noise-level sensitivity: σ must be chosen before deployment; mismatched σ leads to loose or invalid certificates
- Variance in estimation: Finite sampling introduces statistical error, requiring careful confidence level calibration
Randomized Smoothing vs. Other Defenses
A comparison of Randomized Smoothing against other prominent adversarial defense mechanisms across key properties of robustness guarantees, computational cost, and attack resilience.
| Feature | Randomized Smoothing | Adversarial Training | Defensive Distillation | Input Gradient Regularization |
|---|---|---|---|---|
Robustness Guarantee Type | Probabilistic Certified | Empirical Only | Empirical Only | Empirical Only |
Provable Lp-Norm Radius | ||||
Attack-Agnostic Certification | ||||
Gradient Masking Risk | ||||
Black-Box Attack Resilience | High | Moderate | Low | Moderate |
Clean Accuracy Impact | Minimal | Moderate to High | Low | Minimal |
Training Overhead | Low | High | Moderate | Low |
Inference Overhead | High (Monte Carlo) | None | None | None |
Scalability to Large Datasets | ||||
Compatible with Any Architecture |
Frequently Asked Questions
Explore the core mechanisms, guarantees, and practical considerations of randomized smoothing, the leading approach for building certifiably robust classifiers against adversarial perturbations.
Randomized smoothing is a probabilistic defense that constructs a certifiably robust classifier from any base classifier by adding isotropic Gaussian noise to inputs and returning the most probable prediction under that noise distribution. The mechanism operates in two phases: during prediction, the smoothed classifier aggregates the base model's outputs over multiple noise-perturbed copies of the input and selects the majority class. During certification, it computes a lower bound on the probability of the top class and uses the Neyman-Pearson lemma to calculate a guaranteed L2-radius within which no adversarial perturbation can change the prediction. This transforms a brittle, point-wise decision boundary into a smooth, region-based one where the classifier's output is provably stable. Unlike empirical defenses that can be broken by stronger attacks, randomized smoothing provides a mathematical certificate of robustness that holds regardless of the attack algorithm used.
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
Explore the core concepts, mathematical foundations, and complementary techniques that define the landscape of certifiable robustness and probabilistic defenses.
Certified Robustness
A property of a model that provides a mathematical guarantee that its prediction will not change for any input within a specified Lp-norm radius. Unlike empirical defenses that can be broken by stronger attacks, certified methods like randomized smoothing offer provable lower bounds on the magnitude of perturbation required to flip a classification. This is crucial for safety-critical applications where worst-case guarantees are non-negotiable.
Gaussian Noise Augmentation
The core mechanism of randomized smoothing involves constructing a smoothed classifier by adding isotropic Gaussian noise to the input. The prediction becomes the argmax of the class probabilities under this noise distribution. This process effectively 'smooths out' the decision boundary, transforming a potentially sharp, brittle base classifier into a provably robust one. The standard deviation of the noise is a critical hyperparameter controlling the robustness-accuracy trade-off.
Monte Carlo Sampling
To estimate the prediction of the smoothed classifier, randomized smoothing relies on Monte Carlo sampling. The algorithm makes N noisy copies of the input and queries the base classifier on each. The final prediction is the majority vote. To provide a high-confidence guarantee, techniques like the Clopper-Pearson confidence interval or Hoeffding's inequality are used to bound the true probability of the top class from the empirical counts.
Denoised Smoothing
An extension that applies randomized smoothing to a pipeline including a denoiser (often a pre-trained neural network) before the base classifier. This allows the use of smoothing on classifiers not originally trained with heavy noise augmentation. The denoiser attempts to remove the added Gaussian noise, improving the accuracy of the base classifier on the noisy inputs and leading to a higher certified accuracy at a given radius.
Consistency Regularization
A training methodology that complements randomized smoothing by enforcing that the base classifier's predictions on different noisy versions of the same clean input are consistent. This is often achieved by minimizing a divergence metric like KL divergence between the softmax outputs. This directly optimizes the base model for the smoothing process, leading to tighter certification bounds and higher certified accuracy.

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