Why Simple Filters Do Not Secure Retrieval
The retrieval-based LLM is now known to have two linked exposure points: an external item must first reach context, and the model or application must then allow that item to influence an answer or action. This chapter diagnoses why three intuitive retrieval-stage defenses—query paraphrasing, perplexity filtering, and token masking—do not provide a durable guarantee against an adaptive attacker. It then maps a stronger response across the corpus, context, model, and action boundaries so a retrieval failure is detected or contained rather than handed directly to the model’s authority.
The diagnosis matters because a defense can appear effective while testing only a fixed version of the threat. If a transformation makes one trigger less similar, or a detector identifies one unusually unnatural document, the result may look like prevention. But an attacker who can observe the retrieval outcome can change the item to fit the new condition. The relevant question is not whether a control works against one sample. It is whether the control changes the system’s security properties or merely changes the surface that the attacker optimizes.
Why the obvious detectors break
Query paraphrasing is an attractive first response. If a user’s query is rewritten before retrieval, a trigger tuned to the original wording may no longer align with the text the retriever sees. The application can perform the rewrite without changing the user experience, and the approach does not require access to the attacker’s construction process. As a static disruption, it is sensible: it changes one input to the ranking contest.
The paper’s results show why that disruption is limited. Paraphrasing causes a small initial degradation—less than a 10% drop in Recall@5 for most of the evaluated datasets. But the attacker can optimize against several possible paraphrases rather than one exact query. Once the trigger is selected for the distribution of rewritten queries, retrieval performance is restored and can even exceed the original baseline. The defense changed the wording, not the underlying fact that the retriever still ranks by a manipulable similarity signal.
This does not make paraphrasing useless. It may reduce the success of a trigger that was built for one unchanging query, and it can be useful for ordinary retrieval quality or robustness testing. It does mean the result must be described as friction or a narrow signal, not as prevention. A control that depends on the attacker not adapting is fragile by design when the attacker can query, observe, and repeat.
Perplexity filtering relies on a different intuition. Perplexity is a measure related to how surprising a sequence of words is to a language model. Artificially assembled malicious text may look statistically unusual, so a system can flag documents with high perplexity before sending them to the retriever or the LLM. In the initial comparison, the paper confirms that the malicious text has higher perplexity than clean content.
The problem is that the signal belongs to the initial presentation, not necessarily to the underlying objective. The study reports that repeating the malicious text can lower its perplexity while preserving attack effectiveness. In some cases, repetition drives the score below that of the clean documents, making the item appear more natural to the detector.