BERT Rankers are Brittle: a Study using Adversarial Document Perturbations

Yumeng Wang, Lijun Lyu, Avishek Anand
6/23/2022
cs.IRcs.AI

Official code: menauwy/brittlebert (2 stars, Python, last commit 2024-01-06).

Abstract

Contextual ranking models based on BERT are now well established for a wide range of passage and document ranking tasks. However, the robustness of BERT-based ranking models under adversarial inputs is under-explored.

Show full abstract

In this paper, we argue that BERT-rankers are not immune to adversarial attacks targeting retrieved documents given a query. Firstly, we propose algorithms for adversarial perturbation of both highly relevant and non-relevant documents using gradient-based optimization methods. The aim of our algorithms is to add/replace a small number of tokens to a highly relevant or non-relevant document to cause a large rank demotion or promotion. Our experiments show that a small number of tokens can already result in a large change in the rank of a document. Moreover, we find that BERT-rankers heavily rely on the document start/head for relevance prediction, making the initial part of the document more susceptible to adversarial attacks. More interestingly, we find a small set of recurring adversarial words that when added to documents result in successful rank demotion/promotion of any relevant/non-relevant document respectively. Finally, our adversarial tokens also show particular topic preferences within and across datasets, exposing potential biases from BERT pre-training or downstream datasets.

View on arXivView PDF

Code Implementations(1)

20Python, ShellJun 23, 20222 years ago

Similar Papers

Cite this paper

@article{wang2022bert,
  title  = {BERT Rankers are Brittle: a Study using Adversarial Document Perturbations},
  author = {Yumeng Wang and Lijun Lyu and Avishek Anand},
  year   = {2022},
  eprint = {2206.11724},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2206.11724}
}

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/2206.11724.svg)](https://codeofpaper.com/paper/2206.11724)

Discussion