Correlation-Aware Example Selection for In-Context Learning with Nonsymmetric Determinantal Point Processes

Qing Du, Zhiliang Tian, Zhen Huang, Kailun Bian, Tianlun Liu, Zhaoning Zhang, Xinwang Liu, Bo Liu, Dongsheng Li2025

Abstract: Qiunan Du, Zhiliang Tian, Zhen Huang, Kailun Bian, Tianlun Liu, Zhaoning Zhang, Xinwang Liu, Feng Liu, Dongsheng Li. Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing. 2025.

Introduction

In-Context Learning (ICL) has become a cornerstone of Large Language Model (LLM) utility, allowing models to perform tasks by observing a few demonstration examples in the prompt. However, LLMs are notoriously sensitive to the specific examples chosen. Traditional selection methods typically focus on either relevance (similarity to the query) or diversity (avoiding redundancy).

Standard diversity-based methods often employ Determinantal Point Processes (DPP) with symmetric kernels. While effective at ensuring a diverse set of examples (negative correlation), symmetric kernels cannot model positive correlations—the "consistency" among examples that helps an LLM identify a unified task pattern. This paper addresses this gap by introducing Nonsymmetric Determinantal Point Processes (NDPP) for ICL example selection.

The NDPP Framework

The proposed framework leverages NDPP to capture both positive and negative correlations among examples. The core of the approach lies in its two-stage process: training the selector and performing inference.

Overview of the NDPP framework, illustrating the training stage with kernel decomposition and the inference stage with query-aware adaptation.

Training Stage: Pseudo-labeling and Optimization

During the training stage, the authors use LLM feedback to pseudo-label example subsets. Since ground-truth optimal subsets are unknown, the probability of an LLM correctly predicting an answer given a subset serves as a "soft label." The NDPP kernel matrix $L$ is optimized via Maximum Likelihood Estimation (MLE). To handle computational complexity, $L$ is decomposed into a symmetric matrix $S$ (modeling diversity) and a skew-symmetric matrix $A$ (modeling positive correlations). Low-rank decomposition is further applied to ensure the method scales linearly with dataset size.

Inference Stage: Query-Aware Adaptation

At inference time, the learned kernel undergoes Query-Aware Adaptation. The semantic similarity between the input query and the example pool is integrated into the kernel matrix $R$, ensuring the selected examples are not only internally consistent and diverse but also highly relevant to the specific user request. Finally, a greedy Maximum A Posteriori (MAP) inference algorithm selects the best $k$ examples.

Experimental Evaluation

The model was evaluated across five diverse benchmarks: GeoQuery (geography-related Prolog queries), NL2Bash (English to Bash commands), MTOP (multilingual semantic parsing), WebQs (question answering), and RocEnd (story generation).

Key Results

The NDPP-based retriever consistently outperformed strong baselines, including BM25 and CEIL (a state-of-the-art symmetric DPP method).

Performance comparison of the proposed NDPP method against CEIL and BM25 across four benchmarks as the number of in-context examples increases.

As shown in Figure 6, the proposed method maintains a performance lead across various datasets and example counts. Key findings include:

  • Significant Gains: On GPT-Neo (2.7B), the method achieved a 20% average improvement over random selection.
  • Cross-Model Generalization: The retriever, even when trained on smaller models, successfully transferred to high-capacity models like GPT-4 and Gemini-2.0-flash, achieving state-of-the-art results.
  • Stability: The high-quality selections reduced the LLM's sensitivity to example ordering, a common pain point in ICL, leading to more stable performance across different permutations.

Conclusion

By transitioning from symmetric to nonsymmetric kernels, this work highlights the importance of modeling positive correlations (consistency) alongside diversity in ICL. The NDPP framework provides a robust, scalable, and model-agnostic solution for optimizing prompt construction, paving the way for more reliable and efficient interactions with Large Language Models.

Summary updated

BibTeX
@misc{du2025correlation,
  author = {Qing Du and Zhiliang Tian and Zhen Huang and Kailun Bian and Tianlun Liu and Zhaoning Zhang and Xinwang Liu and Bo Liu and Dongsheng Li},
  title = {{Correlation-Aware Example Selection for In-Context Learning with Nonsymmetric Determinantal Point Processes}},
  year = {2025},
  doi = {10.18653/v1/2025.emnlp-main.1376},
}
Figure