Randomized smoothing is a probabilistic certification technique that constructs a provably robust classifier from any base model by adding Gaussian noise to inputs and taking a majority vote over a large number of noisy samples. It provides a mathematical guarantee that a prediction will remain constant within a certified L2-radius around the input.
Glossary
Randomized Smoothing

What is Randomized Smoothing?
Randomized smoothing is a technique for constructing provably robust classifiers by adding noise to inputs and aggregating predictions.
Unlike empirical defenses like adversarial training, randomized smoothing offers a formal robustness certification that is agnostic to the underlying architecture. The certified radius is derived from the statistical margin of the majority class, making it a scalable, model-agnostic approach to achieving provable adversarial robustness.
Key Features of Randomized Smoothing
The core mechanisms that make randomized smoothing a scalable, attack-agnostic, and provably robust defense against adversarial examples.
The Gaussian Noise Mechanism
The foundational operation of randomized smoothing involves adding isotropic Gaussian noise to the input before classification. For a base classifier f and an input x, the smoothed classifier g is defined as:
g(x) = argmax_c P(f(x + ε) = c) where ε ~ N(0, σ²I)
- The noise level σ is a critical hyperparameter controlling the robustness-accuracy trade-off
- Larger σ provides stronger certification radii but degrades clean accuracy
- The noise creates a Lipschitz-continuous decision boundary, smoothing out adversarial pockets
The Neyman-Pearson Certification Guarantee
The robustness certificate is derived from the Neyman-Pearson lemma, which provides the optimal hypothesis test between two Gaussian distributions. This yields a closed-form certified radius R:
R = σ/2 * (Φ⁻¹(p_A) - Φ⁻¹(p_B))
- p_A is the lower confidence bound of the top class probability
- Φ⁻¹ is the inverse standard Gaussian CDF
- The guarantee is probabilistic: it holds with confidence 1-α, where α is the significance level
- This is a sound certificate—if the condition holds, no adversarial example exists within the radius
Monte Carlo Sampling for Prediction
At inference time, the smoothed classifier's prediction is estimated via Monte Carlo sampling rather than computed analytically:
- Draw n samples of Gaussian noise:
ε₁, ε₂, ..., εₙ ~ N(0, σ²I) - Compute the base classifier's prediction for each noisy copy:
f(x + εᵢ) - Take a majority vote across the n predictions
- Typical n ranges from 10,000 to 100,000 samples for certification
- A Binomial confidence interval (Clopper-Pearson) is used to bound the true top-class probability
- The process is embarrassingly parallel and can be batched on GPUs
Prediction vs. Certification Modes
Randomized smoothing operates in two distinct modes with different computational budgets:
- Prediction Mode: Uses a small number of samples (e.g., n=100) to make a fast, robust prediction without computing a radius. The majority class is returned immediately
- Certification Mode: Uses a large number of samples (e.g., n=100,000) and a hypothesis test to output both a predicted class and a guaranteed ℓ₂ radius within which the prediction is provably constant
This separation allows the technique to be deployed in latency-sensitive applications while still providing formal guarantees when needed
Attack-Agnostic Defense
Unlike adversarial training, randomized smoothing provides a provable guarantee that does not depend on the specific attack algorithm used:
- The certificate holds against any perturbation within the ℓ₂-ball, regardless of how it was generated
- This includes unknown, future, or adaptive attacks that specifically target the smoothing mechanism
- The only assumption is that the attacker is constrained to an ℓ₂-norm budget
- Extensions exist for ℓ₁, ℓ∞, and other norms using different noise distributions (Laplace, Uniform)
- This property makes it a gold standard for safety-critical applications where worst-case guarantees are required
Denoised Smoothing Extension
Standard randomized smoothing degrades significantly on high-resolution images because Gaussian noise destroys fine details. Denoised smoothing addresses this by prepending a denoiser to the base classifier:
g(x) = argmax_c P(f(denoise(x + ε)) = c)
- The denoiser is typically a pre-trained diffusion model or a custom DnCNN
- It removes the Gaussian noise before classification, preserving image fidelity
- This dramatically improves clean accuracy while maintaining the same certification guarantees
- The denoiser itself does not need to be robust—the smoothing framework handles certification independently
Randomized Smoothing vs. Other Defenses
A feature-level comparison of Randomized Smoothing against Adversarial Training and Defensive Distillation for achieving certified and empirical robustness.
| Feature | Randomized Smoothing | Adversarial Training | Defensive Distillation |
|---|---|---|---|
Guarantee Type | Probabilistic certification (L2 norm) | Empirical robustness only | Empirical robustness only |
Requires Model Retraining | |||
Scalability to Large Datasets (ImageNet) | |||
Architecture Agnostic | |||
Natural Accuracy Impact | Minimal to moderate drop | Significant drop | Minimal drop |
Defense Against Black-box Attacks | |||
Certified Radius (L2, CIFAR-10) | ~0.5 to 1.0 | Not applicable | Not applicable |
Inference Time Overhead | High (requires 10k+ samples) | Low (single forward pass) | Low (single forward pass) |
Frequently Asked Questions
Clear, technically precise answers to the most common questions about provable adversarial robustness via randomized smoothing.
Randomized smoothing is a probabilistic certification technique that transforms any base classifier into a provably robust, smoothed classifier. It works by adding isotropic Gaussian noise to the input and taking a majority vote over a large number of noisy samples. The core mechanism relies on the Neyman-Pearson lemma to compute a certified radius within which the prediction is guaranteed to remain constant. Specifically, if the smoothed classifier predicts class cA with probability pA under noise, and the runner-up class cB has probability pB, the certified L2-radius is calculated as (σ/2) * (Φ⁻¹(pA) - Φ⁻¹(pB)), where Φ⁻¹ is the inverse Gaussian CDF and σ is the noise level. This provides a mathematical guarantee that no adversarial perturbation within that radius can change the prediction.
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
Randomized smoothing is one of several complementary approaches to achieving certified robustness. These related concepts span attack methodologies, alternative defenses, and the formal verification frameworks that define the adversarial robustness landscape.

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