Cloud concept · Updated

Reranking - Reranking is a second-stage search process that reorders retrieved candidates using additional relevance signals before results are presented or supplied to a foundation model.

In short

An initial retriever efficiently finds potentially relevant documents, and a reranker evaluates that smaller candidate set more closely against the query. In retrieval-augmented generation, this helps place stronger evidence into a limited context window, but it adds processing cost and cannot recover documents that retrieval missed.

Cloud Concepts Hub →

6 key aspects of Reranking

Effective reranking improves the ordering of an authorized candidate set while balancing evidence quality, context limits, inference cost, and operational latency.

01
Two-stage relevance assessment

Use an efficient retriever to identify candidates, then apply a more detailed relevance assessment to that bounded set. This avoids running an expensive ranking model across the entire corpus for every query.

02
Candidate recall sets the ceiling

A reranker cannot promote evidence that was never retrieved. Improve embedding quality, keyword coverage, hybrid retrieval, filtering, or candidate depth when relevant documents are missing.

03
Query-aware scoring

Neural rerankers commonly evaluate queries and candidate passages together, capturing relationships that vector similarity alone may miss. Reranker scores should not be treated as calibrated probabilities that a passage is correct.

04
Context-budget optimization

Select the strongest evidence before assembling the generation prompt. Tune the final result count and passage lengths to reduce irrelevant context without discarding information needed for a complete answer.

05
Latency and deployment trade-offs

Candidate volume, input length, and model size affect inference latency and cost. Establish timeouts, capacity limits, monitoring, and a fallback policy appropriate to the application's availability requirements.

06
Measured quality and secure handling

Evaluate candidate recall, ranking metrics, and downstream answer quality using representative workloads. Enforce access controls before model processing and preserve source metadata for citations and troubleshooting.

Cloud services for Reranking

A typical implementation uses Amazon OpenSearch Service to retrieve candidates through keyword, vector, or hybrid search, then passes authorized passages to an Amazon Bedrock reranker. The application selects the highest-ranked evidence and supplies it to a generation model while retaining source identifiers for citations. Where custom model behavior or deployment control is required, a reranker hosted on Amazon SageMaker AI can perform the second stage instead. Tune retrieval depth and final context size independently, and monitor retrieval recall, ranking quality, answer quality, latency, and inference cost across the complete workflow.

Amazon Bedrock

Amazon Bedrock provides managed reranker models through its Rerank API and supports reranking configurations in Knowledge Bases retrieval workflows. Applications can use these capabilities to reorder retrieved passages before selecting context for generation.

Amazon OpenSearch ServiceAmazon OpenSearch Service

Amazon OpenSearch Service supports keyword, vector, and hybrid retrieval to build the candidate set. Supported OpenSearch versions and configurations also provide reranking through search pipelines; alternatively, an application can send retrieved candidates to an external reranker.

Amazon SageMakerAmazon SageMaker

Amazon SageMaker AI can host a custom reranking model on an inference endpoint when teams need control over model selection, tuning, or deployment. Engineers must size compute, configure scaling, and measure latency and cost for the expected candidate volume.

Reranking exam questions

Real practice exam questions on Reranking, with the correct answer and its explanation. Answer them with every option in the exam simulator.

MLA-C02 (beta)

A company uses Amazon Bedrock to generate answers for a RAG application. For each query, the application retrieves 200 candidate passages, sends all 200 passages to the Amazon Bedrock Rerank API, and supplies the six highest-ranked passages to the generation model. Monitoring shows that scoring the candidate passages is the main source of request latency and processing cost.

An evaluation on representative queries shows that sending only the first 40 retrieved candidates to the same scoring model produces the same six selected passages as sending all 200. Using only the first six retrieved candidates fails the answer-quality target. The company wants to reduce candidate-scoring work by at least 75% while preserving the evaluated answer quality and the six-passage generation context.

Which configuration change meets these requirements?

Show answerCORRECT ANSWER

Send the first 40 retrieved candidates to the Rerank API and supply its six highest-ranked results to the generation model.

Reducing the scoring input from 200 candidates to 40 reduces the number of query-passage evaluations by 80%. The evaluation establishes that this smaller candidate pool preserves the same six selected passages, meeting both the quality and context requirements.

AIP-C01

A company uses a custom retrieval service to supply context to an Amazon Bedrock foundation model. For each question, the service retrieves 40 candidate passages from operational runbooks. Multiple passages can belong to the same runbook, and each passage includes an authoritative runbook_id and a stable passage ID.

Evaluation shows that the five most relevant passages often belong to one runbook, crowding out useful alternative procedures. Every candidate set contains at least five distinct runbooks. The application must supply exactly five passages from five distinct runbooks. For each selected runbook, it must choose that runbook's highest-scoring passage according to a supported Amazon Bedrock reranking model, then prefer runbooks with higher best-passage scores. Initial retrieval scores do not reliably identify the best passage within a runbook.

The application may make only one reranking request per question, and all 40 passages fit within the reranking model's request limits. Which solution meets these requirements?

Show answerCORRECT ANSWER

Submit all 40 passages to the Amazon Bedrock Rerank API and request all 40 ranked results. Associate results with their input passages using the returned indexes. Traverse the results in descending relevance order, selecting the first passage for each previously unselected runbook_id until five passages have been selected.

Scoring the entire candidate set allows selection of each runbook's highest-scoring passage. Traversing the ranked results and accepting only the first occurrence of each runbook selects five distinct runbooks in order of their best passage scores. Returned indexes preserve the association between ranked results, passage IDs, and runbook IDs.

Practice Reranking in a full exam

Questions on Reranking in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Reranking

3 min read

Reranking separates finding plausible information from deciding which information best answers a query. A first-stage retriever searches a large collection using keyword matching, vector similarity, or a hybrid of both. A second stage scores the retrieved candidates using richer relevance signals and changes their order. The application then selects the highest-ranked results for a search interface or for the context supplied to a foundation model in a retrieval-augmented generation, or RAG, workflow.

This two-stage design balances retrieval coverage with computational expense. Embedding-based retrieval typically compares a query vector against document vectors calculated during ingestion. A common neural reranker instead uses a cross-encoder that processes the query and each candidate together, allowing closer evaluation of their relationship. Cross-encoders are common implementations, not the definition of reranking: rules, learned ranking models, and other model architectures can also reorder candidates.

For example, an operations assistant receives the question, “How do I rotate production database credentials without downtime?” Hybrid search retrieves 50 passages, combining exact matches for credential terminology with semantically related rotation procedures. A reranker promotes passages describing overlapping credential validity and application connection refresh, while demoting general password policy documents. The application supplies the best five passages to its generation model, subject to its context budget. These candidate and output counts are illustrative tuning choices, not universal defaults.

In a cloud architecture, a managed search service can perform initial retrieval, while a managed reranking API or a custom model endpoint performs second-stage scoring. Apply tenant and document authorization filters before unauthorized content reaches the reranker or generation model. Preserve document identifiers and source metadata through scoring so the final answer can cite its evidence. Treat retrieved text as untrusted input; a relevance score does not establish factual accuracy, authorization, or safety.

Candidate count, passage length, model choice, and final context size affect latency, throughput, and cost. Retrieving more candidates can improve coverage, but scoring them requires additional inference work. Long passages may be truncated according to model limits, potentially removing the relevant evidence. Use bounded candidate sets, appropriate chunking, request timeouts, and an explicit fallback policy, such as using the initial ranking when reranking is unavailable. For custom endpoints, benchmark hardware utilization, batching, concurrency, and autoscaling under realistic traffic.

Evaluate retrieval and reranking separately. Recall at the candidate cutoff helps determine whether the retriever finds the required evidence; metrics such as normalized discounted cumulative gain and mean reciprocal rank measure ranking quality. Also measure answer correctness, citation support, end-to-end latency, and cost. Use representative queries, relevance judgments, and held-out evaluation data. Tune embeddings, chunk boundaries, hybrid retrieval settings, candidate counts, and reranker selection as distinct components rather than changing everything simultaneously.

Reranking is not embedding-model fine-tuning, although both can improve a retrieval pipeline. Improving embeddings can bring previously missed evidence into the candidate set; reranking can only reorder candidates already supplied to it. Hybrid score fusion combines retrieval signals, whereas reranking adds another relevance assessment after candidate retrieval. Reranking also does not guarantee hallucination-free answers: the corpus may lack the answer, the selected passages may be incomplete, or the generation model may fail to follow the evidence.

Learn Reranking in lessons

4 short lessons on Reranking in 2 certification courses.

Open the lessons