cs.CLSep 22, 2026

ClusterFewshot: Improving Few-shot Optimization for LLMs workflow

Authors: Omri Bar HaimShahar KatzLior Wolf

Abstract

The performance of large language model (LLM) workflows often depends on selecting a small set of in-context demonstrations to guide model behavior on new tasks. Recent methods improve this process by augmenting prompts with successful reasoning paths. However, their demonstration selection relies on random sampling or metric-based rankings, overlooking the semantic structure of the task. We propose ClusterFewshot, a strategy that combines semantic structuring with utility-aware scoring to construct representative and effective few-shot demonstration sets. Evaluated within DSPy-based pipelines, ClusterFewshot substantially reduces optimization cost across multiple benchmarks, while consistently improving accuracy relative to prior bootstrap-based methods in both standalone prompt tuning and hybrid prompt-weight optimization.

Explore similar work

CardsList
  1. Context Tuning for In-Context Optimization

    Jul 6, 2025Jack Lu, Ryan Teehan, Zhenbang Yang +1Few-Shot LearningPrompt Tuning

  2. Neuron-Aware Active Few-Shot Learning for LLMs

    Jul 2, 2026Zhuowei Chen, Liwei Chen, Christian Schunn +2Few-Shot LearningActive Learning

  3. FLARE: Few-shot Learning-based Adaptive Reflective Engine

    Aug 3, 2026Dhanasekar Sundararaman, Bharat Gandhi, Aashna Garg +1Few-Shot LearningPareto Frontier