Inferensys

Glossary

Query Set

The unlabeled examples in a few-shot episode that the model must classify by leveraging the knowledge derived exclusively from the corresponding support set.
Developer working on RAG retrieval system, document chunks visible on screen, technical workspace with code editor.
FEW-SHOT EPISODE COMPONENT

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.

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.

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.

FEW-SHOT LEARNING

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.

01

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
02

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
03

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
04

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
05

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
06

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
QUERY SET ESSENTIALS

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.

FEW-SHOT EPISODE COMPONENTS

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.

FeatureSupport SetQuery 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

FEW-SHOT INFERENCE

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.

01

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
5-15%
Accuracy Gain vs Inductive
02

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
15-25
Standard Query Samples/Class
03

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
04

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
SNR Range
-10dB to +30dB Typical
05

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
06

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
τ = 0.7-0.9
Typical Rejection Threshold
Prasad Kumkar

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.