EXPLORA: Efficient Exemplar Subset Selection for Complex Reasoning

Kiran Purohit, Venktesh V, Raghuram Devalla, Krishna Yerragorla, Sourangshu Bhattacharya, Avishek Anand

Introduction

In-Context Learning (ICL) has emerged as a powerful paradigm for enabling Large Language Models (LLMs) to solve complex reasoning tasks by providing a few demonstration examples, or "exemplars," within the prompt. For tasks requiring multi-step logic, these exemplars typically include Chain-of-Thought (CoT) rationales. However, LLM performance is notoriously sensitive to the specific choice and ordering of these exemplars.

Current selection strategies generally fall into two categories:

  1. Dynamic Selection: Tailoring exemplar sets for each query (e.g., using K-Nearest Neighbors). While accurate, this approach incurs significant computational overhead at inference time.
  2. Static Selection: Identifying a single "golden set" of exemplars for an entire task. This is efficient for deployment but presents a challenging "needle in a haystack" optimization problem.

Existing static methods often fail to account for the complex interactions between exemplars in a prompt and are frequently "LLM-hungry," requiring thousands of expensive API calls for evaluation. EXPLORA addresses these challenges by treating subset selection as a bandit-based exploration problem, identifying high-performing static subsets with unprecedented efficiency.

Methodology: The EXPLORA Framework

EXPLORA is a sampling-based bandit algorithm designed for optimal "top-$l$" exemplar subset selection. Unlike previous methods that treat exemplars in isolation, EXPLORA optimizes for the collective performance of the subset.

The EXPLORA workflow: from exemplar clustering to bandit-based subset refinement.

The framework consists of several key technical innovations:

  • Linear Scoring Function: To avoid exhaustive LLM evaluations, EXPLORA utilizes a proxy model. It leverages BERT embeddings to calculate similarity between candidate exemplars and a validation set, learning a weight vector ($\alpha$) that correlates with minimized task loss.
  • Bandit-Style Exploration: Drawing inspiration from the Lower-Upper Confidence Bound (LUCB) algorithm, EXPLORA iteratively refines its "low-loss" subset pool. It identifies promising candidates from an unexplored pool and compares them against the lowest-performing members of the current top set, using targeted LLM evaluations to guide swaps.
  • Frugal Evaluation and Caching: By focusing evaluations on the most promising subsets and implementing a robust caching mechanism, EXPLORA significantly reduces the total number of LLM calls.
  • Small-to-Large Transferability: A critical efficiency gain is achieved by performing the selection process on smaller, open-source models (e.g., Mistral-7B) and transferring the optimized exemplar sets to larger models like GPT-3.5-turbo.

Experimental Setup

The effectiveness of EXPLORA was evaluated across five diverse reasoning benchmarks: GSM8K (math), AquaRat (algebra), TabMWP (tabular reasoning), FinQA (financial analysis), and StrategyQA (multi-step logic).

Results and Analysis

EXPLORA demonstrates significant improvements in both accuracy and computational efficiency compared to state-of-the-art baselines like LENS.

Performance comparison of EXPLORA against dynamic and static baselines across five benchmarks.

Accuracy Gains

As shown in the results table, EXPLORA consistently outperforms existing static selection methods. Notably, it achieved a 12.24% improvement over LENS on the GSM8K dataset. When combined with Self-Consistency (SC) techniques, EXPLORA establishes new competitive baselines for static prompting in complex reasoning.

Efficiency and Transferability

Beyond accuracy, EXPLORA is remarkably efficient. It requires approximately 90% fewer LLM calls than LENS, reducing the time required for exemplar selection from roughly 40 hours to under 10 hours in several instances. Furthermore, the study confirms that exemplars optimized on smaller 7B-parameter models transfer effectively to much larger models, allowing for cost-effective prompt optimization on local hardware before API deployment.

Conclusion

EXPLORA offers a robust and efficient solution to the exemplar selection problem in ICL. By modeling subset selection as a bandit problem and leveraging the transferability of prompts across model scales, it enables high-performance reasoning without the prohibitive costs of traditional selection methods.

Summary updated

BibTeX
@inproceedings{purohit2024explora,
  author = {Kiran Purohit and Venktesh V and Raghuram Devalla and Krishna Yerragorla and Sourangshu Bhattacharya and Avishek Anand},
  title = {{EXPLORA: Efficient Exemplar Subset Selection for Complex Reasoning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.307},
}
Figure