Defense of Adversarial Ranking Attack in Text Retrieval: Benchmark and Baseline via Detection

Xuanang Chen, Ben He, Le Sun, Yingfei SunarXiv 2023

Abstract

Neural ranking models (NRMs) have undergone significant development and have become integral components of information retrieval (IR) systems. Unfortunately, recent research has unveiled the vulnerability of NRMs to adversarial document manipulations, potentially exploited by malicious search engine optimization practitioners. While progress in adversarial attack strategies aids in identifying the potential weaknesses of NRMs before their deployment, the defensive measures against such attacks, like the detection of adversarial documents, remain inadequately explored. To mitigate this gap, this paper establishes a benchmark dataset to facilitate the investigation of adversarial ranking defense and introduces two types of detection tasks for adversarial documents. A comprehensive investigation of the performance of several detection baselines is conducted, which involve examining the spamicity, perplexity, and linguistic acceptability, and utilizing supervised classifiers. Experimental results demonstrate that a supervised classifier can effectively mitigate known attacks, but it performs poorly against unseen attacks. Furthermore, such classifier should avoid using query text to prevent learning the classification on relevance, as it might lead to the inadvertent discarding of relevant documents.

Introduction

In the world of Information Retrieval (IR), Neural Ranking Models (NRMs) have become the gold standard for delivering relevant search results. However, these models have a "glass jaw": they are highly susceptible to adversarial ranking attacks. Much like "black-hat SEO," malicious actors can subtly manipulate a document—by swapping words or inserting "trigger" phrases—to force it to the top of search results, even if it’s irrelevant or nonsensical.

While the community has developed sophisticated attack methods (like PRADA or PAT), there hasn't been a systematic way to evaluate defenses. This research fills that gap by shifting the focus from how to attack to how to protect, establishing a standardized benchmark to test the detection of manipulated documents before they reach the ranker.

Methodology

The study proposes a defense strategy based on detection, framing the problem through two distinct lenses:

  1. Point-wise Detection: A binary classification task determining if a specific document is adversarial or original.
  2. List-wise Detection: A more realistic scenario where a detector filters a list of search results. The goal here is not just classification accuracy, but maintaining the quality of the final ranking, measured by metrics like Mean Reciprocal Rank (MRR).
Point-wise vs. List-wise Detection Framework

Several baseline detectors were evaluated:

  • Unsupervised: Methods targeting "red flags" such as high spamicity (OSD), low fluency/perplexity (PPL), or poor linguistic acceptability (LA).
  • Supervised: Fine-tuning transformer models like BERT and RoBERTa to distinguish between original and manipulated text. These were tested in two configurations: one seeing only the document text, and one seeing both the query and the document.

Benchmark Datasets

The authors created a synthetic benchmark dataset built on the widely-used MS MARCO passage dataset. To generate adversarial examples, three state-of-the-art attack methods were employed:

  • PRADA: Uses gradient-based word substitutions.
  • PAT: Inserts optimized "trigger tokens" at the start of documents.
  • IDEM: Uses a generative model (BART) to create "connection sentences" between the query and the document.

The resulting dataset contains approximately 144K training examples and 20K for validation and testing, providing a robust environment for future defense research.

Key Insights and Results

The Generalization Gap

Supervised models (BERT/RoBERTa) are remarkably effective at catching attacks they have encountered during training, often exceeding 95% accuracy. However, when faced with a new type of attack, their performance often plummets to near-random guessing, highlighting a significant vulnerability to unseen threats.

The "Relevance-Aware" Trap

Intuitively, a detector might perform better if it knows the user's query. However, experimental data shows this backfires in list-wise scenarios. The detector begins to learn "relevance" rather than "adversariality," leading it to accidentally discard legitimate, highly relevant documents. This is quantified by the #DR (Discarded Relevant documents) metric. As shown in the results, RoBERTa with a query discarded 0.10 to 0.15 relevant documents per query, whereas the version without the query discarded almost none (0.02).

List-wise Detection Performance and Ranking Recovery

Ranking Recovery and Robustness

In the list-wise task, the RoBERTa-Base (without query) detector was the most effective, improving the ranking quality (MRR) by 2-3 points over the attacked list. Additionally, while unsupervised methods generally underperformed, the Linguistic Acceptability (LA) detector proved surprisingly resilient. Because many attacks introduce grammatical glitches, a model trained to recognize "bad English" can catch a variety of attacks without specific training on them.

Conclusion

The study demonstrates that supervised detection is a viable first line of defense, with the best models reaching 99.4% accuracy when trained on a variety of attacks. However, the reliance on supervised learning remains a hurdle for defending against novel, more natural-looking attacks. Future work should explore adversarial training to make rankers inherently more robust and develop "universal" detectors that do not overfit to specific perturbation patterns.

Summary updated

BibTeX
@misc{chen2023defense,
  author = {Xuanang Chen and Ben He and Le Sun and Yingfei Sun},
  title = {{Defense of Adversarial Ranking Attack in Text Retrieval: Benchmark and Baseline via Detection}},
  year = {2023},
  eprint = {2307.16816},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.16816},
}
Figure