Instruction-following rerankers

Emerging · ~7 min read ·

Classic cross-encoders answer one question: “how relevant is this passage to this query?” Instruction-following rerankers (e.g. Contextual AI Rerank v2) take an extra control signal — a short instruction that defines what “relevant” means for this task.

Why plain relevance is not enough

Two documents can both “match” a query while serving opposite user goals. “Cancel subscription” might need the self-serve steps for a support bot, or the retention offer for a sales agent. A generic MS MARCO-style reranker was trained on topical relevance — not on task policy.

Instructions let you steer ranking without fine-tuning a new checkpoint for every product surface.

How instruction rerank differs

InputClassic cross-encoderInstruction reranker
QueryYesYes
PassageYesYes
Task instructionNo (or baked into query text)First-class field
Typical deploySelf-host or APISelf-host or API — open weights exist
# Conceptual API shape (vendor SDKs differ)
results = client.rerank(
    query="cancel my plan",
    documents=candidates,
    instruction="Prefer official help articles with step-by-step cancel steps; demote marketing and upsell pages.",
)  # higher score = better match to query under that instruction

Models that take an instruction today

  • Qwen3-Reranker (0.6B / 4B / 8B, Apache 2.0) — an instruction per task through sentence-transformers’ prompts; Qwen report typical gains of 1–5% from a tailored one.
  • Contextual AI Rerank v2 (1B / 2B / 6B, CC BY-NC-SA — non-commercial) — pass the instruction as prompt= to predict or rank.
  • Voyage rerank-3 (hosted) — append or prepend the instruction to the query. Voyage introduced instructions with rerank-2.5 and say the Rerank 3 series keeps them.
  • Alibaba Cloud Model Studio (hosted) — qwen3-rerank, qwen3.7-text-rerank and qwen3-vl-rerank take an instruct parameter. Without one they rank for question answering (“Given a web search query, retrieve relevant passages that answer the query.”); Alibaba suggest writing instructions in English.
  • Contextual AI Rerank API (hosted) — the commercial route to the v2 family above: ctxl-rerank-v2-instruct-multilingual and its -mini take an instruction field. Contextual tested instructions about recency, document type, source and metadata, and ask for an explicit timeframe rather than “this year”, because the model doesn’t know today’s date.
  • Mixedbread mxbai-rerank-v3.1-listwise (hosted, inside Mixedbread Search only) — a listwise model that reads the whole candidate set, so an instruction such as “later amendments supersede earlier ones” can compare documents with each other. Its weights are not published.
# Contextual AI Rerank v2, from its model card
from sentence_transformers import CrossEncoder

model = CrossEncoder("ContextualAI/ctxl-rerank-v2-instruct-multilingual-2b")
ranked = model.rank(
    "cancel my plan",
    candidates,
    prompt="Prefer official help articles with step-by-step cancel steps; demote marketing and upsell pages.",
)

You can approximate this with a classic model by prefixing the query ("[Support KB] cancel my plan"), but dedicated instruction models are trained to treat the control text as constraints rather than bag-of-words topics.

When to use it

  • Multi-surface products. Same corpus, different ranking policies (support vs sales vs compliance).
  • Hard negatives share vocabulary. Legal “termination for convenience” vs “for cause”; support “refund” vs “exchange”.
  • You lack fine-tuning budget. Steering via instructions is cheaper than training domain adapters every quarter.

Skip it when your queries are single-intent FAQ lines and a small cross-encoder (Jina tiny, mxbai xsmall, bge-base) already hits NDCG on your labels — see evaluate rerankers.

Vs classic cross-encoders

  • Classic (bge, Cohere, mxbai, Jina v1–v2): the most published BEIR-style numbers; open weights or mature hosted APIs; a good default for RAG “topical precision”.
  • Instruction rerankers (Qwen3, Contextual AI v2, Voyage rerank-3, Alibaba’s qwen3-rerank, Mixedbread’s listwise model): stronger when relevance is policy-shaped; harder to compare on public leaderboards, because the score depends on the instruction you write — our models table shows each vendor’s own numbers where they publish any.
  • Late-interaction (ColBERT): different axis entirely (token MaxSim at scale) — see late-interaction guide.

How to evaluate

Do not paste a generic BEIR number and call it done. Build 30–50 queries with the instruction you will ship, label which docs are correct under that policy, and measure NDCG@5 / MRR before vs after. Swap instruction text alone and check that rankings move in the intended direction.

If changing the instruction does not change the top-5, you are paying for a feature you are not using — fall back to a classic reranker.

See classic cross-encoder behaviour

Our in-browser demo scores topical relevance only (no instruction field). Use it to baseline what a plain reranker does, then A/B an instruction API on your labelled set.

Open the demo →

Keep reading