One word is enough: Minimal adversarial perturbations for neural text rankingOne Word is Enough: Minimal Adversarial Perturbations for Neural Text Ranking
The authors attack neural rankers with a single query center word; on BERT, TREC DL 2019, best_grad's SR is 90.97%.
one_word_start and one_word_sim do not access internals (black-box heuristics); one_word_best_grad uses gradients (white-box). The goal is to boost rank by changing only one query center. The victim system is NRM re-ranking of BM25 top-100. Success means a higher rank after re-ranking.
- Neural ranking models have strong retrieval performance, but the authors claim that very small adversarial changes can alter rankings without humans perceiving a semantic change. The question they ask is: can inserting or replacing just one word aligned with the query boost the target document?
- In counter-fitted embeddings, take the token closest to the query centroid as the query center. Beginning insertion and similar word replacement do not look at model internals; the gradient variant selects positions by hinge loss gradient norm, inserts at top-20, and keeps the one with the highest score.
- On BERT and TREC DL 2019, best_grad's SR is 90.97% and PP is 1.49%; in the same setting, white-box PRADA's SR is 96.69% and PP is 12.30% (Table 1). The authors claim documents around ranks 40–80 are most easily boosted.
- The authors plan to extend the gradient strategy to black-box and recent LLM rankers, and investigate multi-word but still small perturbations, as well as conversational search, question answering, and recommendation. Experiments use two NRMs and TREC DL 2019/2020; the paper does not report margin β, number of attacked documents, or number of repetitions.
- Evaluated models
- BERT-base-mdoc-BM25monoT5-base-MSMARCO
- Benchmarks
- MSMARCO v1 passage rankingTREC DL 2019TREC DL 2020
- Metrics
- SRSSPPRBSBISR
The researchers propose a query-aware minimal adversarial attack that improves the ranking of a target document in neural ranking models by inserting or replacing a single semantically aligned word. On the TREC-DL 2019/2020 datasets, against BERT and monoT5 rerankers, the single-word attack achieves a success rate of up to 91%, with an average of fewer than two token modifications per document. The authors also propose new diagnostic metrics, finding that mid-ranked documents are most vulnerable to attack. The paper claims these results reveal practical risks and motivate defense research for neural ranking.
Paper analysis
What problem does this paper attempt to solve?
Can a single word-level change aligned with the query boost a target document's rank in neural re-ranking?
Can neural rankers be boosted for a specified document by a single word-level change semantically aligned with the query?
- Scenario: The authors state that Transformer-based neural ranking models (NRMs) are mainstream in retrieval, but prior work shows that small adversarial modifications can alter rankings without perceived semantic change.
- Existing methods: The authors state that attacks like PRADA often use multi-word modifications or train substitute models, requiring many edits or query probes.
- This paper's claim: The authors state that inserting or replacing a single query-derived semantic center word (query center) is sufficient to boost the target document.
- This paper proposes: Three single-word attacks: insertion at the beginning, similar word replacement, and gradient-based position insertion, plus perturbation proportion (PP) and interval success rate (ISR). The authors state this corresponds to real-world risk and motivates more robust ranking architectures.
- Threat model:
- Goal: Perturbed document d̃ ranks higher than original d after NRM re-ranking.
- Knowledge: one_word_start and one_word_sim do not access model internals, called black-box heuristics; one_word_best_grad uses gradients of the ranker's input embeddings, white-box. The baseline PRADA also runs under the same white-box parameter access.
- Capability: Only insert or replace one query center. The gradient variant selects among the top-k positions by gradient norm; experiments use k=20.
- Victim system: NRM re-ranking of BM25 top-100 candidates. In experiments, BERT-base-mdoc-BM25 and monoT5-base-MSMARCO.
What related research exists?
Related work covers classifier text attacks, ranking attacks like PRADA, and discrete adversarial training; the baseline is white-box PRADA.
Text attacks on classifiers
- HotFlip (Ebrahimi et al., 2018) and Pruthi et al. (2019): deceive sequence classifiers with character-level or word-level perturbations. The paper states that this line of work was later connected to retrieval and re-ranking, and that neural architectures relying on subword tokenization are affected by small token changes.
Neural ranking attacks
- PRADA (Wu et al., 2023): black-box framework that trains a substitute model with pseudo-relevance feedback, then uses gradient-guided word replacements to boost target documents. The paper notes that it requires multiple perturbations per document and repeated model queries.
- Wang et al. (2022): use direct gradient analysis to examine BERT ranker sensitivity. The paper paraphrases that perturbing a few words can significantly change ranking scores.
- The paper states that references [7, 8] achieve attack success rates close to 100%, but do not emphasize minimal perturbation. Bidgeli et al.'s [1] Empra performs black-box perturbations in the embedding layer, avoiding discrete word edits. The paper states that Liu et al. [5] use reinforcement learning to combine word, phrase, and sentence-level perturbations.
Adversarial training
- Ivgi and Berant (2021): compare offline and online discrete adversarial augmentation for NRMs. The paper paraphrases their results as online adversarial sampling providing greater robustness but at high computational cost.
Baselines and benchmarks
- Baseline method: PRADA. The original method trains a substitute model; this paper changes it to white-box due to computational constraints, to have the same parameter access as gradient variants.
- Benchmarks: MSMARCO v1 passage (approximately 8.8 million passages); query sets are TREC DL 2019 (43 queries) and TREC DL 2020 (54 queries). Re-rankers are BERT-base-mdoc-BM25 and monoT5-base-MSMARCO.
The authors position this work after these: in a minimal, query-aware setting, use a query center insertion or replacement to affect ranking while maintaining semantic coherence.
How does the paper address this problem?
Take the word closest to the query centroid as the query center, then use heuristics or gradient norm to decide a single insertion or replacement.
The authors use single-word adversarial attacks to boost target documents: first determine the query center, then perform only one insertion or one replacement.
Problem setting
- Input: query q, list L after NRM re-ranking of BM25 top-100, and target document d in L. Output d̃ such that the NRM ranks d̃ higher than d.
- Constraint: Only insert or replace one word. The authors state this is to make the change semantically plausible while exposing ranker vulnerability.
Query center
- Definition: Query tokens in the vocabulary are mapped to vectors; the centroid is v(q)=1/k∑i=1k v(qi). The query center is the token in the embedding vocabulary with the highest cosine similarity to this centroid. Out-of-vocabulary query tokens do not contribute to the centroid.
- Authors' intuition: It is the word that best represents the overall semantic intent of the query.
- Vectors: Experiments use Mrkšić et al.'s publicly available counter-fitted word vectors, from 300-dimensional GloVe on Common Crawl (840B tokens), with WordNet synonym and antonym constraints. This space is only used for selecting the center word and computing similarity; gradients are computed with respect to the ranker's own input embeddings.
Three positions
- one_word_start: Insert the query center at the beginning of the document. The authors' rationale is that prior work shows BERT rankers are more sensitive to perturbations in early positions. Does not access model internals.
- one_word_sim: In the counter-fitted space, replace the document token most similar to the query center (but not identical) with the query center. This is a replacement and also does not access model internals.
- one_word_best_grad: Insertion. The authors state it is inspired by PRADA, using gradients to select the position.
Gradient-based position selection
- Loss: Pairwise hinge loss is Lrank(q,d;L)=∑d′∈ L∖{d}max(0,β−f(q,d)+f(q,d′)), where β is the margin and f is the ranking score. The paper does not specify β. The authors state this loss represents how far the target document is from exceeding competitors by the margin.
- Importance: Compute the gradient of this loss with respect to each token's input embedding, and take the L2 norm as I(ti). The authors state that tokens with larger norms have greater impact on the ranking objective.
- Selection: Take the top-k positions by norm, insert the query center at each, compute f(q, d̃), and keep the one with the highest score improvement. The authors state k balances search cost and effectiveness; experiments use k=20. Algorithm 1 gives this procedure.
Success determination
- After replacing d with d̃, re-rank L with the same NRM; success if the rank is higher than original d. The paper describes the three methods as ranging from black-box heuristics to white-box gradient insertion, all limited to a single word-level change.
What experiments did the paper conduct?
In Table 1, on BERT and TREC DL 2019, best_grad's SR is 90.97% and PP is 1.49%.
Experimental setup
- Models tested: BERT-base-mdoc-BM25, monoT5-base-MSMARCO. BM25 first retrieves top-100, then NRM re-ranks.
- Data: MSMARCO v1 passage, approximately 8.8 million passages; TREC DL 2019 has 43 queries, TREC DL 2020 has 54 queries.
- Baseline: PRADA. The original method is black-box and trains surrogate models; this paper runs it directly in white-box due to computational constraints, to compare with gradient variants. All PRADA in the table below is this white-box setting.
- Metrics: SR is the percentage of attacks that improve ranking; SS is the cosine similarity between the original and perturbed document embeddings, from Universal Sentence Encoder, in [0, 1]; RB and SB are the average improvements in rank and NRM score, respectively; PP is the average percentage of tokens modified per document.
- ISR: Average success rate over rank intervals [11–20], [21–30] up to [99–100], excluding top-10. The authors cite PRADA, stating these documents are unlikely to be further boosted.
- Not reported: The paper does not report margin β, the document range and denominator for SR, the number of repetitions, or the number of queries. The gradient variants use k=20.
Main results
According to Table 1. SR and PP are percentages, SS is in [0, 1], RB and SB are absolute improvements. The table below lists only some cells for PRADA and one_word_best_grad.
Swipe horizontally to read the table
Setting SR SS PP RB SB BERT-base-mdoc-BM25, TREC DL 2019, PRADA 96.69% 0.87 12.30% 17.84 1.98 Same, one_word_best_grad 90.97% 0.97 1.49% 12.97 1.61 BERT-base-mdoc-BM25, TREC DL 2020, PRADA 97.74% 0.85 13.83% 20.10 2.42 Same, one_word_best_grad 87.10% 0.97 1.45% 9.47 1.16 monoT5-base-MSMARCO, TREC DL 2019, one_word_best_grad 65.18% 0.97 1.15% 11.78 1.53 monoT5-base-MSMARCO, TREC DL 2020, one_word_best_grad 59.49% 0.96 1.10% 7.95 1.00 - The authors claim best_grad achieves up to about 91% success with a single token change, with similarity around 0.98. The abstract also states an average of fewer than two tokens changed per document. Table 1's PP is the percentage of modified tokens; the paper does not convert it to token counts.
- The authors claim that in the comparable white-box setting, rank and score improvements are competitive with PRADA, but with far fewer edits. For monoT5 and PRADA not listed in the table: TREC DL 2019 SR is 69.78%, SS is 0.89, PP is 9.70%, RB is 11.61, SB is 1.39; TREC DL 2020 SR is 59.62%, SS is 0.88, PP is 3.55%, RB is 7.42, SB is 0.94.
- The authors claim one_word_start and one_word_sim also achieve 30–60% success while maintaining high similarity. Endpoints from Table 1 not included in the table above: BERT, TREC DL 2020, one_word_sim has SR 30.90%, RB 2.06, SB 0.24; monoT5, TREC DL 2019, one_word_start has SR 57.48%.
Interval success rates
- What was tested: Figure 1 plots ISR for each attack on both re-rankers, left is BERT-base-mdoc-BM25, right is monoT5-base-MSMARCO, both with TREC DL 2019 queries. The text does not provide readings for each interval.
- Authors' interpretation: The authors claim documents around ranks 40–80 are most susceptible to perturbation, calling it the Goldilocks zone. They suggest a possible explanation: top documents have saturated relevance scores, while lower documents are often too semantically distant for a single insertion to help.
- Subsequent impact: The authors claim these shifts, though not at the top of the list, may still affect downstream processes due to more aggressive candidate pruning in multi-stage retrieval.
Other ablations and analyses
- The paper does not report numerical ablations for k, β, or query-center embeddings; k is fixed at 20 (Section 3.2).
- The authors claim RB and SB have a strong positive correlation; the paper does not report the correlation coefficient (Section 4.3).
- The conclusion states similarity to the original exceeds 97%; in Table 1, BERT, TREC DL 2019, one_word_start has SS 0.96.
- The results section states similarity around 0.98; the monoT5, TREC DL 2020 best_grad row in the table above, and BERT's best_grad 0.97, do not match this phrasing.
- In Table 1, across all four model×query set combinations, PRADA's SR is higher than best_grad; the authors do not frame this as a failure.
- best_grad's SR on monoT5 is lower than the corresponding cell on BERT; the authors do not explain this separately.
What are some points that can be further explored?
The authors plan to extend to black-box and LLM-based rankers, and study multi-word minimal perturbations and other tasks.
Limitations and future directions noted by the authors
The paper does not specifically discuss limitations. The future directions listed in Conclusion and Future Work are as follows.
- Black-box: The authors plan to extend the gradient strategy to realistic black-box settings.
- LLM rankers: The authors plan to extend to recent LLM-based rankers.
- Multi-word perturbations: The authors plan to investigate multi-word but still small perturbations to study the trade-off between stealth and attack success.
- Other tasks: The authors plan to apply such perturbations to conversational search, question answering, or recommendation to assess broader impacts on robust information access systems.
Experimental coverage
- The re-rankers tested are BERT-base-mdoc-BM25 and monoT5-base-MSMARCO; query sets are TREC DL 2019 (43 queries) and TREC DL 2020 (54 queries); the document pool is MSMARCO v1 passage, approximately 8.8 million passages (Section 4.1).
- The pipeline is BM25 top-100 followed by NRM re-ranking; ISR excludes top-10, with intervals from [11–20] to [99–100]; Figure 1 uses only TREC DL 2019 (Section 4.2, Figure 1).
- Attacks are one_word_start, one_word_sim, one_word_best_grad, with k=20; the baseline is PRADA under white-box, not the original black-box with surrogate models (Section 3.2, 4.1, Table 1).
- Query center uses counter-fitted word vectors (300-dimensional GloVe, Common Crawl 840B tokens, WordNet constraints); SS uses Universal Sentence Encoder (Section 3.1, 4.2).
- The paper does not report margin β, the document range and denominator for SR, the number of repetitions, the number of queries for gradient variants, or the ISR readings for each interval in Figure 1.
Summarize the main content of the paper
The authors claim that a single word perturbation can boost ranking, mid-document positions are most vulnerable, and it requires fewer edits than white-box PRADA.
A single word aligned with the query can alter neural re-ranking results. The goal is to modify the original text minimally while still boosting the target document's rank in the NRM list.
- Approach: In counter-fitted space, take the token closest to the query centroid, called the query center. Insertion at the beginning and similar-word replacement do not look at model internals; one_word_best_grad uses the gradient norm of a pairwise hinge loss to select positions and keeps the insertion with the largest score increase among the top-20.
- Data and baseline: TREC DL 2019 (43 queries) and 2020 (54) on MSMARCO v1; after BM25 top-100, re-rank with BERT-base-mdoc-BM25 or monoT5-base-MSMARCO. The baseline is PRADA under white-box, not the original black-box with surrogate models.
- Key numbers: In Table 1, on BERT and TREC DL 2019, best_grad's SR is 90.97%, SS is 0.97, PP is 1.49%, RB is 12.97; the same cell for PRADA has SR 96.69% and PP 12.30%. On monoT5 and TREC DL 2019, best_grad's SR is 65.18%, white-box PRADA is 69.78%. The lowest SR in Table 1 is 30.90% (BERT, TREC DL 2020, one_word_sim).
- Authors' conclusions: The authors claim that even around 50% success could pose practical risks in multi-stage retrieval, and that mid-ranked documents are most vulnerable. They plan to extend the gradient strategy to black-box and recent LLM-based rankers.