In the N-way K-shot episodic training paradigm, the query set constitutes the evaluation batch for a single task. It consists of unlabeled samples drawn from the same N novel classes defined by the support set. The model must infer the correct class label for each query sample by comparing it against the K labeled examples per class provided in the support set, typically using a learned embedding space and a distance metric like cosine similarity.
Glossary
Query Set

What is Query Set?
The query set is the collection of unlabeled examples in a few-shot learning episode that the model must classify by leveraging knowledge derived exclusively from the corresponding support set.
The performance on the query set defines the meta-learning loss, which is backpropagated to optimize the model's ability to generalize rapidly. Unlike standard supervised learning, the model never sees labels for the query set during inference. Advanced techniques like transductive inference can utilize the entire batch of query samples to refine class boundaries, leveraging the unlabeled data's marginal distribution to improve classification accuracy for rare or emerging signal types.
Key Characteristics of a Query Set
The query set defines the evaluation context in a few-shot episode. It consists of unlabeled examples the model must classify by leveraging patterns learned exclusively from the support set.
Unlabeled Evaluation Samples
The query set contains unlabeled examples that the model has never seen during meta-training. These samples simulate real-world deployment where novel signal types must be classified without prior exposure.
- Each query sample belongs to one of the N classes defined in the support set
- No ground-truth labels are available to the model during inference
- Classification accuracy on the query set is the primary performance metric
Episodic Task Construction
In an N-way K-shot episode, the query set is sampled alongside the support set to form a complete classification task. A typical split uses 15 query examples per class.
- For a 5-way 1-shot task: 5 support samples, 75 query samples
- Query samples are drawn from the same classes as the support set
- The model must generalize from K examples to classify many more query points
Transductive Batch Inference
Unlike inductive inference that classifies each query independently, transductive inference processes the entire query set as a batch. The model leverages the marginal distribution of unlabeled queries to refine decision boundaries.
- Mutual information between query samples improves accuracy
- Particularly effective when the support set is extremely small (1-shot)
- Requires access to all query samples simultaneously during inference
Distance-Based Classification
In metric-based meta-learners like Prototypical Networks, each query sample is classified by computing its distance to class prototypes derived from the support set. The query embedding is compared using a fixed similarity function.
- Common metrics: Euclidean distance, cosine similarity
- The query is assigned to the class of the nearest prototype
- Embedding space quality directly determines query classification accuracy
Gradient-Based Adaptation
In optimization-based methods like MAML, the query set serves as the target for computing the outer-loop loss. The model takes a few gradient steps on the support set, then its performance is evaluated on the query set.
- Query loss drives meta-parameter updates during training
- The model learns initial weights that enable rapid adaptation
- Query set difficulty directly shapes the learned initialization
Confidence Calibration Benchmark
The query set provides the ground truth for measuring not just accuracy but calibration quality. Well-calibrated models produce confidence scores that match empirical accuracy on query samples.
- Expected Calibration Error (ECE) is computed on query predictions
- Critical for open-set rejection of unknown modulation types
- Bayesian meta-learners explicitly model query prediction uncertainty
Frequently Asked Questions
Clear, technical answers to the most common questions about the role and mechanics of the query set in few-shot modulation learning.
A query set is the collection of unlabeled examples in a few-shot learning episode that the model must classify by leveraging knowledge derived exclusively from the corresponding support set. In an N-way K-shot task, the query set typically contains multiple samples per class that the model has never seen before. The model's performance is measured solely on its ability to correctly predict the labels of these query samples. Unlike traditional supervised learning, the model does not have access to the query labels during its forward pass; it must infer them by comparing each query sample against the K labeled examples in the support set using a learned similarity metric or adaptation algorithm.
Query Set vs. Support Set
Structural and functional comparison of the two complementary data partitions that define a single few-shot learning task or episode.
| Feature | Support Set | Query Set |
|---|---|---|
Primary Role | Provides the definition of novel classes | Evaluates generalization performance |
Label Status | Labeled | Unlabeled during inference |
Gradient Computation | Used to compute task-specific adaptation | Used to compute the meta-loss and update meta-parameters |
Analogy | A student's study guide or textbook | The final exam questions |
Size per Class | K examples (the 'shot') | Typically larger than K; often 5-15 examples |
Data Leakage Risk | Must never contain query samples | Must never be used for adaptation |
Transductive Setting | Used to build class prototypes | Classified jointly, leveraging batch statistics |
Episodic Variability | Fixed per episode | Fixed per episode |
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.
Query Set Applications in RF Machine Learning
The query set is the unlabeled collection of signal samples that a meta-trained model must classify during a few-shot episode. Its composition and statistical properties directly determine the measured performance of modulation recognition systems in the field.
Transductive Batch Classification
In transductive inference, the entire query set is processed as a single batch rather than as isolated samples. The model leverages the marginal distribution of all unlabeled queries to refine decision boundaries.
- Exploits cluster assumptions: unlabeled samples often form distinct groups in the embedding space
- Improves accuracy by 5-15% over inductive methods when query sets contain balanced class distributions
- Particularly effective for signal constellation analysis where geometric structure emerges across multiple samples
- Requires careful handling of class imbalance within the query batch to avoid biased prototypes
Query Set Size and Confidence Calibration
The number of samples in the query set directly impacts both classification accuracy and the reliability of confidence estimates. Larger query sets provide more robust statistical evidence for evaluating model performance.
- Standard few-shot benchmarks use 15-25 query samples per class
- Insufficient query sizes lead to high-variance accuracy estimates and unreliable benchmarking
- Bayesian meta-learning methods produce well-calibrated uncertainties that improve with query set size
- In operational SIGINT systems, query set size reflects the dwell time available for signal collection
Prototypical Network Classification
In prototypical networks, each query sample is classified by computing its distance to class prototypes derived exclusively from the support set. The query set never influences prototype computation during inductive inference.
- Prototype = mean of embedded support samples for each class
- Distance metric: typically Euclidean or cosine similarity in the learned embedding space
- Query samples are classified independently; no information flows between queries
- Softmax over distances produces a distribution over N classes for each query
- The embedding function must be trained episodically to generalize to novel modulation types
Query Set Construction for Realistic Evaluation
The composition of query sets in evaluation must reflect operational signal environments to provide meaningful performance estimates. Synthetic or curated query sets often overestimate real-world accuracy.
- Include channel impairments: fading, noise, frequency offset, and phase rotation
- Vary signal-to-noise ratio (SNR) across query samples to test robustness
- Introduce class imbalance to simulate real spectrum occupancy patterns
- Include out-of-distribution samples to measure false classification rates
- Cross-domain query sets (synthetic training, over-the-air testing) reveal true generalization capability
Relation Network Scoring
Relation networks replace fixed distance functions with a learned deep nonlinear comparator. Each query-support pair is concatenated and passed through a relation module that outputs a scalar similarity score.
- The relation module learns to compare IQ sample embeddings adaptively
- Query set size scales quadratically: N classes × K support × M queries = N×K×M comparisons
- Eliminates the need to choose between Euclidean or cosine distance
- Particularly effective when modulation classes have hierarchical similarities (e.g., QAM variants)
- Computationally more expensive than prototypical networks for large query sets
Confidence Thresholding and Rejection
Query samples with low maximum softmax probability can be rejected as unknown rather than forced into a known class. This is critical for open-set spectrum monitoring where novel signals appear regularly.
- Set a confidence threshold τ on the predicted class probability
- Samples below τ are labeled as unknown modulation for analyst review
- Threshold calibration requires a held-out validation query set with known unknowns
- Balances the trade-off between coverage (samples classified) and precision (correct classifications)
- Essential for electronic warfare support where missing a novel threat signal is unacceptable

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