0
0
Prompt Engineering / GenAIml~20 mins

Multi-query retrieval in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Multi-query Retrieval Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the main advantage of using multi-query retrieval in search systems?

Imagine you want to find information on a complex topic that has several aspects. Why would a multi-query retrieval system be better than a single-query system?

AIt simplifies the search by ignoring less important parts of the topic.
BIt reduces the number of queries needed by combining all keywords into one long query.
CIt guarantees faster retrieval by only using one query at a time.
DIt allows searching multiple aspects simultaneously, improving recall and relevance.
Attempts:
2 left
💡 Hint

Think about how covering different angles of a topic can help find more useful results.

Predict Output
intermediate
2:00remaining
Output of multi-query retrieval scoring aggregation

Given the following Python code that simulates scores from multiple queries for documents, what is the final aggregated score for document 'doc2'?

Prompt Engineering / GenAI
query_scores = {
    'query1': {'doc1': 0.8, 'doc2': 0.5, 'doc3': 0.3},
    'query2': {'doc1': 0.4, 'doc2': 0.7, 'doc3': 0.6},
    'query3': {'doc1': 0.3, 'doc2': 0.2, 'doc3': 0.9}
}

# Aggregate scores by summing scores from all queries per document
aggregated_scores = {}
for q_scores in query_scores.values():
    for doc, score in q_scores.items():
        aggregated_scores[doc] = aggregated_scores.get(doc, 0) + score

final_score_doc2 = aggregated_scores['doc2']
print(final_score_doc2)
A0.9
B1.4
C1.2
D1.0
Attempts:
2 left
💡 Hint

Sum the scores for 'doc2' from each query.

Model Choice
advanced
2:00remaining
Best model architecture for multi-query retrieval embeddings

You want to build a system that generates embeddings for multiple queries to retrieve documents effectively. Which model architecture is best suited for encoding multiple queries independently but efficiently?

AA recurrent neural network that concatenates all queries into one sequence before encoding.
BA convolutional neural network that treats all queries as one long image input.
CA single shared transformer encoder that processes each query separately to produce embeddings.
DA decision tree model that classifies queries into categories before retrieval.
Attempts:
2 left
💡 Hint

Think about models that can handle sequences independently and produce vector representations.

Hyperparameter
advanced
2:00remaining
Choosing the best aggregation method hyperparameter for multi-query retrieval

In multi-query retrieval, you combine scores from multiple queries to rank documents. Which hyperparameter choice affects how you weight each query's contribution?

AThe query weight vector that assigns importance to each query's score before aggregation.
BThe dropout rate applied in the neural network layers.
CThe batch size used during model training.
DThe learning rate used to train the embedding model.
Attempts:
2 left
💡 Hint

Focus on parameters that control score combination rather than model training.

Metrics
expert
2:00remaining
Evaluating multi-query retrieval with combined metrics

You have retrieval results from multiple queries combined to rank documents. Which evaluation metric best captures both the relevance and ranking quality across all queries?

AMean Reciprocal Rank (MRR) averaged over all queries.
BAccuracy of classifying documents as relevant or not.
CMean Squared Error (MSE) between predicted and true scores.
DConfusion matrix counts aggregated over all queries.
Attempts:
2 left
💡 Hint

Think about metrics designed for ranking quality in retrieval tasks.