An End-to-End Submodular Framework for Data-Efficient In-Context Learning

Lilly Kumari, Shengjie Wang, Arnav Das, Tianyi Zhou, Jeff A. Bilmes

Introduction

Large Language Models (LLMs) exhibit a powerful capability known as In-Context Learning (ICL), where they perform tasks based on a few examples provided in the prompt without requiring parameter updates. However, ICL faces two significant challenges: the high cost of human annotation for selecting exemplars and the extreme sensitivity of LLMs to the specific choice and ordering of these examples. Traditional retrieval methods often focus solely on similarity, leading to redundant prompts that fail to utilize the model's limited context window effectively.

The Div-S3 Framework

To address these bottlenecks, we introduce Div-S3, a framework grounded in submodular optimization. This mathematical approach is specifically designed for subset selection problems where adding similar elements yields diminishing returns—a property that mirrors how LLMs process contextual information.

The two-stage Div-S3 framework: Stage 1 selects diverse exemplars for annotation, and Stage 2 retrieves query-relevant, non-redundant examples for inference.

The framework operates in two distinct stages:

  1. Stage 1: Exemplar Annotation (Div): This query-agnostic stage uses a "Facility Location" submodular function to select a diverse subset from an unlabeled pool. By ensuring broad coverage of the data space, the system identifies the most informative examples for human labeling, maximizing the utility of a limited annotation budget.
  2. Stage 2: Exemplar Retrieval (S3): During inference, the system employs Submodular Span Summarization (S3) to retrieve a set of exemplars that are collectively relevant to the test query but individually diverse. This stage also optimizes the ordering of examples, placing more relevant ones closer to the query to align with the model's attention patterns.

Key Insights: Diversity and Submodularity

A core tenet of Div-S3 is that diversity is as critical as relevance. Standard retrieval often selects nearly identical examples, wasting tokens. By treating prompt construction as a subset selection problem, Div-S3 ensures that each example provides novel information to the model.

An example of diverse exemplar retrieval where the selected set covers multiple sentiment labels (neutral, positive, negative), providing a richer context for the LLM.

Submodular functions naturally capture this "diminishing returns" property. Once the model has seen one "positive sentiment" example, the marginal benefit of a second, similar example is low. Div-S3 mathematically enforces this variety, leading to more robust performance across different prompt orderings.

Experimental Evaluation

The framework was evaluated across seven NLP benchmarks, including sentiment analysis (SST-2, SST-5), natural language inference (RTE, HellaSwag), and classification tasks (TREC, DBpedia). Testing involved five LLMs from the GPT-J, GPT-Neo, and OPT families (1.3B to 6B parameters).

Key Results

  • Accuracy Improvements: Div-S3 achieved significant gains, such as a 3% absolute increase in accuracy on SST-5 and RTE compared to standard similarity-based retrieval.
  • Impact on Smaller Models: The framework proved particularly effective for smaller models (1.3B parameters), yielding up to 10% absolute gains in specific tasks.
  • Efficient Active Learning: The Stage 1 "Div" selection outperformed established active learning baselines like VoteK, demonstrating that submodular coverage is a superior strategy for building annotation sets.

Conclusion and Future Directions

Div-S3 provides a mathematically principled approach to making In-Context Learning more data-efficient and robust. While the current study focused on models up to 6B parameters, the principles of submodular diversity are likely to scale. Future work will explore a wider variety of submodular functions and evaluate the framework on larger-scale models like Llama-3 or GPT-4. Additionally, addressing potential biases in the unlabeled pool remains a critical area for ensuring ethical AI deployment.

Summary updated

BibTeX
@inproceedings{kumari2024end,
  author = {Lilly Kumari and Shengjie Wang and Arnav Das and Tianyi Zhou and Jeff A. Bilmes},
  title = {{An End-to-End Submodular Framework for Data-Efficient In-Context Learning}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-naacl.209},
}
Figure