CR-UTP: Certified Robustness against Universal Text Perturbations on Large Language Models

Qian Lou, Xin Liang, Jiaqi Xue, Yancheng Zhang, Rui Xie +1 more
6/4/2024
cs.CLcs.CRcs.LG

No official code found. Best implementation: UCF-ML-Research/CR-UTP (0 stars, last commit 2024-08-11).

Abstract

It is imperative to ensure the stability of every prediction made by a language model; that is, a language's prediction should remain consistent despite minor input variations, like word substitutions. In this paper, we investigate the problem of certifying a language model's robustness against Universal Text Perturbations (UTPs), which have been widely used in universal adversarial attacks and backdoor attacks. Existing certified robustness based on random smoothing has shown considerable promise in certifying the input-specific text perturbations (ISTPs), operating under the assumption that any random alteration of a sample's clean or adversarial words would negate the impact of sample-wise perturbations. However, with UTPs, masking only the adversarial words can eliminate the attack. A naive method is to simply increase the masking ratio and the likelihood of masking attack tokens, but it leads to a significant reduction in both certified accuracy and the certified radius due to input corruption by extensive masking. To solve this challenge, we introduce a novel approach, the superior prompt search method, designed to identify a superior prompt that maintains higher certified accuracy under extensive masking. Additionally, we theoretically motivate why ensembles are a particularly suitable choice as base prompts for random smoothing. The method is denoted by superior prompt ensembling technique. We also empirically confirm this technique, obtaining state-of-the-art results in multiple settings. These methodologies, for the first time, enable high certified accuracy against both UTPs and ISTPs. The source code of CR-UTP is available at \url {https://github.com/UCFML-Research/CR-UTP}.

View on arXivView PDF

Code Implementations(1)

Official repository for ACL'24 paper: CR-UTP: Certified Robustness against Universal Text Perturbations on Large Language Models

00Shell, PythonJun 2, 20242 years ago

Similar Papers

Cite this paper

@article{lou2024crutp,
  title  = {CR-UTP: Certified Robustness against Universal Text Perturbations on Large Language Models},
  author = {Qian Lou and Xin Liang and Jiaqi Xue and Yancheng Zhang and Rui Xie and Mengxin Zheng},
  year   = {2024},
  eprint = {2406.01873},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.01873v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.01873.svg)](https://codeofpaper.com/paper/2406.01873)

Discussion