Inferensys

Glossary

Randomized Smoothing

A technique that constructs a certifiably robust classifier by adding random noise to inputs and returning the most probable prediction under that noise distribution.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
CERTIFIED ROBUSTNESS

What is Randomized Smoothing?

A technique that constructs a certifiably robust classifier by adding random noise to inputs and returning the most probable prediction under that noise distribution.

Randomized smoothing is a defense technique that transforms any base classifier into a certifiably robust smoothed classifier. The method adds isotropic Gaussian noise to the input and aggregates predictions, providing a formal guarantee that the output will remain constant within a mathematically verified L2-radius.

This approach provides a probabilistic certified robustness guarantee without requiring modifications to the underlying model architecture. The certified radius is derived analytically from the noise level and the margin of the majority prediction, making it a scalable defense against evasion attacks in high-dimensional signal spaces.

CERTIFIED DEFENSE MECHANISM

Key Features of Randomized Smoothing

Randomized smoothing constructs a provably robust classifier by adding isotropic Gaussian noise to inputs and returning the most probable prediction under that noise distribution. This technique provides a certified radius within which no adversarial perturbation can alter the prediction.

01

Certified Radius Guarantee

The core output of randomized smoothing is a certified L2-radius around an input point. Within this mathematically verified bound, the smoothed classifier's prediction is provably invariant to any adversarial perturbation. The radius is computed using the Neyman-Pearson lemma and depends on the margin of the majority class probability under the noise distribution. A higher probability for the top class yields a larger certified radius, providing a direct trade-off between accuracy and robustness.

L2-norm
Perturbation Metric
02

Monte Carlo Prediction Procedure

At inference time, the smoothed classifier does not operate on a single input. Instead, it generates n copies of the input corrupted with independent Gaussian noise and runs the base classifier on each. The final prediction is the majority vote across these n noisy samples. A larger sample size n provides a tighter statistical estimate of the true underlying probability, enabling more precise certification. Typical values range from 10,000 to 100,000 samples for certification.

10k-100k
Typical Sample Count
03

Clopper-Pearson Confidence Bounds

To convert the Monte Carlo vote counts into a rigorous guarantee, randomized smoothing employs the Clopper-Pearson binomial confidence interval. This statistical method provides a lower bound on the true probability of the top class with a user-specified confidence level α (typically 0.001). The certified radius is then derived from this lower probability bound, ensuring that the guarantee holds with probability at least 1-α over the randomness of the sampling procedure.

α = 0.001
Standard Confidence Level
04

Model-Agnostic Defense

Unlike adversarial training or gradient masking, randomized smoothing is a wrapper method that does not require modifying the base classifier's architecture or training procedure. It treats the underlying model as a black box, making it compatible with any differentiable or non-differentiable classifier. This property enables robustness certification for complex architectures including ensembles, decision trees, and proprietary models where internal access is unavailable.

Black-box
Base Model Access
05

Noise Level Trade-off

The standard deviation σ of the added Gaussian noise is a critical hyperparameter controlling the robustness-accuracy trade-off:

  • Larger σ: Increases the certified radius but degrades the base classifier's accuracy on clean inputs
  • Smaller σ: Preserves clean accuracy but provides weaker robustness guarantees Optimal σ selection often involves cross-validation on a held-out set, balancing the desired certification level against acceptable performance on unperturbed data.
σ
Noise Hyperparameter
06

Limitations and Extensions

Standard randomized smoothing certifies only L2-norm bounded perturbations and can produce loose bounds when the base classifier is not robust to Gaussian noise. Extensions address these limitations:

  • SmoothAdv: Combines smoothing with adversarial training for tighter bounds
  • MACER: Optimizes the certified radius directly during training
  • Denoised Smoothing: Prepends a denoiser to improve clean accuracy
  • L1 and L∞ variants: Extend certification to other perturbation norms
RANDOMIZED SMOOTHING EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about constructing certifiably robust classifiers using randomized smoothing.

Randomized smoothing is a technique that constructs a certifiably robust classifier from an arbitrary base classifier by adding random noise to inputs and returning the most probable prediction under that noise distribution. The process works by creating a smoothed classifier g(x) that outputs the class which the base classifier f is most likely to return when Gaussian noise is added to the input x. Formally, g(x) = argmax_c P(f(x + ε) = c) where ε ~ N(0, σ²I). This transforms the discrete decision boundary of f into a soft, probabilistic boundary, providing a provable guarantee that the prediction will not change for any perturbation within a certified radius. The key insight is that if the top class probability is sufficiently high, the decision is stable under bounded input perturbations.

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.