In few-shot learning, the query set is the collection of unlabeled data points used to test a model's ability to generalize after it has been conditioned on a small support set. During an episode, the model must classify or predict the labels for these query examples, and the resulting loss is computed to update the meta-learning parameters.
Glossary
Query Set

What is Query Set?
The query set is the batch of unlabeled examples used to evaluate a model's performance during a few-shot learning episode, distinct from the labeled support set used for conditioning.
The query set is structurally identical to the support set but serves a distinct role: it measures generalization error rather than providing class definitions. In an N-way K-shot task, the query set typically contains multiple samples per class, and performance is measured by comparing the model's predictions against the held-out ground truth labels.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about the role and mechanics of the query set in few-shot learning and meta-learning evaluation.
A query set is the batch of unlabeled examples used to evaluate a model's performance on a specific task after it has been conditioned on the support set. In an N-way K-shot classification episode, the query set typically contains multiple samples per class that the model must classify based solely on the patterns learned from the K labeled examples in the support set. The model's loss is computed exclusively on the query set, and backpropagation uses this loss to optimize the model's ability to generalize from limited data. The query set simulates the novel, unseen instances a deployed model would encounter after rapid enrollment.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding the query set requires familiarity with the core building blocks of few-shot learning and metric-based evaluation.
Support Set
The small set of labeled examples provided to the model during a few-shot task. It serves as the model's only reference for defining new classes. In an N-way K-shot task, the support set contains K examples for each of the N classes. The model conditions its understanding on this set before making predictions on the query set.
Episode-Based Training
A meta-learning training strategy where each training iteration simulates a complete few-shot task. An episode consists of sampling a support set and a query set from the overall dataset. The model learns to generalize across thousands of these simulated tasks, developing the ability to rapidly adapt to new classes at inference time.
Prototypical Networks
A metric-based few-shot learning architecture that computes a prototype for each class by averaging the embeddings of its support set examples. Query samples are then classified by finding the nearest prototype in embedding space. The query set loss is computed as the negative log-probability of the correct class via softmax over distances.
Cosine Similarity
A measure of similarity between two non-zero vectors calculated as the cosine of the angle between them. In few-shot learning, cosine similarity is often used to compare query embeddings against support set prototypes. It ranges from -1 (completely dissimilar) to 1 (identical), and is particularly effective when the magnitude of embeddings is less informative than their direction.
Confidence Score
A probability value indicating the model's certainty in its prediction for a query sample. In prototypical networks, this is typically derived from the softmax over distances to all class prototypes. Low confidence scores on query set examples can signal out-of-distribution samples or ambiguous cases that require human review.
Open Set Recognition
A classification paradigm where the model must correctly classify known classes while also identifying and rejecting unknown classes not present in the support set. Query set examples from unseen emitter types should trigger rejection rather than forced misclassification into a known class, a critical capability for spectrum surveillance applications.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us