通过标签分布差异优化示范选择,提升大模型文本分类效果
Learn to Select: Exploring Label Distribution Divergence for In-Context Demonstration Selection in Text Classification
- 用小模型预测标签分布,选与测试样本分布一致的示范
- 在7个数据集上均优于传统语义相似度方法
- 适合追求高精度少样本分类的开发者使用
在大语言模型(LLM)的上下文学习中,使用少量输入-标签示范描述任务已展现出优异性能。然而,示范选择对模型表现有关键影响。现有方法多关注测试输入与示范的语义相似度,忽视了标签分布的一致性。为此,我们提出两阶段示范选择方法:TopK + 标签分布差异(L2D),利用微调的BERT类小语言模型(SLM)生成标签分布,并计算测试输入与候选示范间的分布差异。该方法可选出不仅语义相近,且标签分布匹配的示范。在七个文本分类基准上的实验表明,本方法持续优于现有策略。进一步分析显示,LLM性能与用于标签分布估计的小模型准确性呈正相关。
原文摘要 · Abstract (English)
In-context learning (ICL) for text classification, which uses a few input-label demonstrations to describe a task, has demonstrated impressive performance on large language models (LLMs). However, the selection of in-context demonstrations plays a crucial role and can significantly affect LLMs' performance. Most existing demonstration selection methods primarily focus on semantic similarity between test inputs and demonstrations, often overlooking the importance of label distribution alignment. To address this limitation, we propose a two-stage demonstration selection method, TopK + Label Distribution Divergence (L2D), which leverages a fine-tuned BERT-like small language model (SLM) to generate label distributions and calculate their divergence for both test inputs and candidate demonstrations. This enables the selection of demonstrations that are not only semantically similar but also aligned in label distribution with the test input. Extensive experiments across seven text classification benchmarks show that our method consistently outperforms previous demonstration selection strategies. Further analysis reveals a positive correlation between the performance of LLMs and the accuracy of the underlying SLMs used for label distribution estimation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。