Certified Robustness Under Bounded Levenshtein Distance
Elias Abad Rocamora, Grigorios G. Chrysos, Volkan Cevher
TL;DR
This work tackles robust textual classification under adversarial perturbations constrained by the Levenshtein distance. It introduces LipsLev, a Lipschitz-constant–based framework that uses ERP distance to bound the margin $g_{y,\hat{y}}$ of convolutional NLP models, enabling deterministic, single-pass certificates for perturbations of any length. By deriving a layer-wise Lipschitz bound and training 1-Lipschitz classifiers, LipsLev achieves non-trivial verified accuracy for $d_{\text{Lev}}\le 2$ (e.g., 38.8% at distance 1 and 13.93% at distance 2 on AG-News) and is orders of magnitude faster than brute-force or IBP baselines. This approach establishes a practical foundation for scalable, deterministic verification in NLP and opens avenues for extending Lipschitz verification to more complex architectures and tokenization schemes.
Abstract
Text classifiers suffer from small perturbations, that if chosen adversarially, can dramatically change the output of the model. Verification methods can provide robustness certificates against such adversarial perturbations, by computing a sound lower bound on the robust accuracy. Nevertheless, existing verification methods incur in prohibitive costs and cannot practically handle Levenshtein distance constraints. We propose the first method for computing the Lipschitz constant of convolutional classifiers with respect to the Levenshtein distance. We use these Lipschitz constant estimates for training 1-Lipschitz classifiers. This enables computing the certified radius of a classifier in a single forward pass. Our method, LipsLev, is able to obtain $38.80$% and $13.93$% verified accuracy at distance $1$ and $2$ respectively in the AG-News dataset, while being $4$ orders of magnitude faster than existing approaches. We believe our work can open the door to more efficient verification in the text domain.
