用两阶段优化生成自然文本,可操纵大模型排序结果。
Are LLMs Reliable Rankers? Rank Manipulation via Two-Stage Token Optimization
- 分两阶段优化令牌,兼顾排序效果与语言自然度。
- 在多个大模型上使目标项排名显著提升,优于现有方法。
- 揭示大模型重排器易受攻击,适合安全与可信系统研究者。
大型语言模型(LLMs)在信息检索中越来越多地被用作重排器,但其排序行为可能被微小且自然的提示所引导。为暴露这一漏洞,我们提出 Rank Anything First(RAF),一种两阶段令牌优化方法,通过生成简洁的文本扰动,持续提升目标项在 LLM 排序中的位置,同时难以被察觉。第一阶段使用贪心坐标梯度,结合排名目标梯度与可读性评分,筛选出当前位置的候选令牌;第二阶段在精确排序和可读性损失下,利用基于熵的动态加权方案评估候选,并通过温度控制采样选择最优令牌。RAF 以双目标为导向,逐令牌生成促进排名的提示:最大化排序有效性并保持语言自然性。多模型实验表明,RAF 使用自然语言显著提升目标项排名,且在提升效果与自然性保持方面优于现有方法。这些发现揭示了关键安全问题:基于 LLM 的重排机制本质上易受对抗性操纵,对现代检索系统的可信性与鲁棒性构成新挑战。代码已公开于 https://github.com/glad-lab/RAF。
原文摘要 · Abstract (English)
Large language models (LLMs) are increasingly used as rerankers in information retrieval, yet their ranking behavior can be steered by small, natural-sounding prompts. To expose this vulnerability, we present Rank Anything First (RAF), a two-stage token optimization method that crafts concise textual perturbations to consistently promote a target item in LLM-generated rankings while remaining hard to detect. Stage 1 uses Greedy Coordinate Gradient to shortlist candidate tokens at the current position by combining the gradient of the rank-target with a readability score; Stage 2 evaluates those candidates under exact ranking and readability losses using an entropy-based dynamic weighting scheme, and selects a token via temperature-controlled sampling. RAF generates ranking-promoting prompts token-by-token, guided by dual objectives: maximizing ranking effectiveness and preserving linguistic naturalness. Experiments across multiple LLMs show that RAF significantly boosts the rank of target items using naturalistic language, with greater robustness than existing methods in both promoting target items and maintaining naturalness. These findings underscore a critical security implication: LLM-based reranking is inherently susceptible to adversarial manipulation, raising new challenges for the trustworthiness and robustness of modern retrieval systems. Our code is available at: https://github.com/glad-lab/RAF.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。