Meta-Sel: Efficient Demonstration Selection for In-Context Learning via Supervised Meta-Learning

Xubin Wang, Weijia JiaarXiv 2026

TL;DR

Meta-Sel is a lightweight, supervised meta-learning approach that efficiently selects the best few-shot demonstrations for In-Context Learning (ICL). By training a simple, calibrated logistic regressor on basic text features offline, it eliminates the need for expensive online exploration or extra LLM calls while dramatically boosting the performance of smaller language models.

What Problem Does This Paper Address?

In-Context Learning (ICL) allows Large Language Models (LLMs) to adapt to new tasks simply by appending a few examples (demonstrations) to the prompt. However, ICL is notoriously sensitive: picking the wrong examples can tank a model's accuracy.

To solve this, researchers have developed various demonstration selection methods. Unfortunately, practitioners face a frustrating trade-off: simple heuristic methods (like choosing semantically similar examples) often select misleading prompts due to spurious correlations, while advanced methods (like Reinforcement Learning or LLM-in-the-loop reweighting) are computationally expensive, slow, and non-deterministic.

Figure 1: Motivation of Meta-Sel. Given a user query (𝑥) and a candidate pool (Dtrain), standard similarity-based selectors (semantically similar) often retrieve examples that share spurious correlations or incorrect labels (visualized as red documents), leading to noisy prompts and incorrect LLM predictions (Top Path). In contrast, Meta-Sel (Bottom Path) leverages a learned scoring function to approximate 𝑃(𝑦|𝑥,𝑐), effectively filtering out noise and selecting helpful demonstrations that act as robust reasoning anchors, ensuring correct model outputs.

The authors address this gap by asking: Can we build a demonstration selector that is highly accurate, computationally cheap, deterministic, and fully auditable?

Methods

The authors introduce Meta-Sel, which frames example selection as a simple binary classification problem at the meta-level. Instead of training the LLM itself, Meta-Sel trains a tiny, lightweight selector offline.

  1. Meta-Dataset Construction: Meta-Sel pairs queries and candidate examples from the training data. It assigns a positive meta-label ($1$) if the candidate and the query share the same ground-truth class, and a negative label ($0$) if they do not.
  2. Lightweight Feature Engineering: To keep things fast, Meta-Sel extracts just two inexpensive features per pair:
  3. TF-IDF Cosine Similarity: To capture lexical overlap.
  4. Length-Compatibility Ratio: To discourage picking examples that are disproportionately longer than the query, saving prompt budget.
  5. Classifier Training: A standard logistic regression model is trained on these features using balanced class weights.
  6. Inference (Test-Time Selection): When a new user query arrives, Meta-Sel performs a single, vectorized scoring pass across the entire candidate pool and returns the top-$k$ highest-scoring demonstrations.
Figure 2: Meta-Sel Framework Overview. 1○Offline Meta-Training (top): We sample (query, candidate) pairs from labeled training data and assign meta-labels based on class agreement (ℓ= 1[𝑦𝑞=𝑦𝑐]). Two lightweight meta-features—TF-IDF cosine similarity and length ratio—are extracted per pair, and a logistic regression classifier ℎ𝜃is trained to predict label match. 2○Test-Time Selection (bottom): For a new query 𝑥𝑞, we score every candidate in the pool using the learned ℎ𝜃in a single vectorized pass, rank by predicted match probability, and return the top-𝑘demonstrations. The entire selection is deterministic, interpretable, and requires no additional LLM calls.

Because it relies on a simple linear model over text-only statistics, the entire selection process requires zero online exploration, zero model fine-tuning, and zero additional LLM calls.

Datasets

The approach was evaluated on four popular English-language intent classification benchmarks:

  • BANKING77: 77 fine-grained intents in the banking domain.
  • CLINC150: 150 intents spanning 10 diverse domains.
  • HWU64: 64 intents across 21 domains.
  • LIU54: 54 intents across 21 domains.

To ensure a rigorous evaluation, the authors used precision-margin sampling to curate a challenging subset of 1,000 test queries per dataset that lie close to class decision boundaries.

Key Insights and Ideas

  • Label Agreement as a Proxy: In intent classification, the primary role of a demonstration is to map an utterance to a discrete label. Meta-Sel proves that maximizing the probability of class agreement between the query and the demonstration is an excellent proxy for downstream LLM accuracy.
  • Selection Matters Most for Small Models: Advanced selection techniques provide massive benefits to smaller models (4B–7B parameters), helping them bridge the accuracy gap with much larger models. For instance, pairing a compact model with Meta-Sel can achieve accuracy close to a 20B model at a fraction of the inference cost.
  • The Risk of Over-Retrieval: On highly complex datasets with fine-grained label spaces (like CLINC150), pure similarity-based selectors can actually introduce label confusion by picking semantically similar phrases that actually belong to different intents (e.g., "set a reminder" vs. "set a timer").

Key Results

The authors conducted a massive benchmark comparing 12 selection methods across 5 open-source LLMs (ranging from 4B to 20B parameters).

  • Top-Tier Performance: Meta-Sel ranked 1st on all four dataset averages, achieving top-3 performance in 19 out of 20 model-dataset combinations.
  • Massive Gains on Smaller Models: On the Llama2-7B model using the BANKING77 dataset, Meta-Sel achieved 81.1% accuracy, compared to a dismal 2.1% for random selection.
  • Efficiency Wins: Meta-Sel matched or outperformed state-of-the-art Reinforcement Learning methods (like RDES) in 16 out of 20 settings, but without the massive overhead of online policy updates. The entire offline meta-training pipeline completes in under 5 seconds on a single CPU core.

Limitations and Future Work

While highly effective for classification, Meta-Sel has a few limitations that open up interesting avenues for future research:

  • Lexical vs. Semantic Features: Relying on TF-IDF means Meta-Sel can miss deeper semantic nuances. The authors suggest exploring dense embeddings from sentence transformers in future iterations.
  • Task Scope: The label-agreement proxy is highly tailored to classification tasks. Extending Meta-Sel to open-ended generation, summarization, or multi-step reasoning will require designing richer meta-labels and continuous usefulness signals (like ROUGE scores).
  • Static Selection: Meta-Sel scores candidates independently, meaning it doesn't explicitly optimize for diversity or redundancy within the final set of $k$ demonstrations.

Summary updated

BibTeX
@misc{wang2026meta,
  author = {Xubin Wang and Weijia Jia},
  title = {{Meta-Sel: Efficient Demonstration Selection for In-Context Learning via Supervised Meta-Learning}},
  year = {2026},
  eprint = {2602.12123},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.12123},
}
Figure