Active Few-Shot Learning for Text Classification (2025)

Abstract: The rise of Large Language Models (LLMs) has boosted the use of Few-Shot Learning (FSL) methods in natural language processing, achieving acceptable performance even when working with limited training data. The goal of FSL is to effectively utilize a small number of annotated samples in the learning process. However, the performance of FSL suffers when unsuitable support samples are chosen. This problem arises due to the heavy reliance on a limited number of support samples, which hampers consistent performance improvement even when more support samples are added. To address this challenge, we propose an active learning-based instance selection mechanism that identifies effective support instances from the unlabeled pool and can work with different LLMs. Our experiments on five tasks show that our method frequently improves the performance of FSL. We make our implementation available on GitHub.

## introduction deep learning systems have shown great performance when given enough labeled data, yet they struggle to learn from a small amount of labeled data @xcite . however, constructing a large corpus of annotated data is costly and time-consuming, which hinders the building of supervised classifiers for new domains @xcite . few-shot learning (fsl) addresses this by seeking to grasp new concepts from limited labeled examples for broader applications @xcite . with recent advances in large language models (llm), the capabilities of fsl can be utilized much better than before and these methods can reach acceptable performance using minimal training data @xcite @xcite . there are two widely adopted approaches to addressing the fsl problem: in-context learning (icl) and fine-tuning (ft). recent autoregressive decoder-only llms have demonstrated strong performance in the realm of fsl @xcite , providing the opportunity to achieve satisfactory results with little to no labeled data without requiring any fine-tuning. on the other hand, ft is a more established strategy for text classification, which leverages a model fine-tuned on labeled support data for prediction, and can show strong results as opposed to icl @xcite , but a large amount of training data is required for model fine-tuning. interestingly, most fsl methods typically select the samples randomly. however, the quality of the samples can have a significant impact on the model's performance. in some scenarios, adding un-or less-informative samples can even decrease the accuracy or may cause a high variance in the model's performance @xcite . few studies in the field of natural language processing (nlp) have explored sample selection strategies. nevertheless, prior works are limited by their lack of advanced techniques, such as active learning @xcite , and by compromising performance to achieve efficiency @xcite . given these challenges, and following the revealed strong performance of ft approaches against icl @xcite , we propose a new ft-and active learning (al)-based few-shot (fs) sample selection method to enhance classification performance by choosing the most informative unlabeled samples, thus, minimizing annotation costs. inspired by successful al algorithms @xcite , our algorithm selects instances using entropy and clustering methods to ensure uncertainty, diversity, and representativeness in sample selection. more specifically, we propose an iterative approach to progressively choose samples for human annotation and label them to be added to the sup-port set. this process begins with generating an organized depiction of the unlabeled data based on a certain embedding method to capture the requested key features of the data. following this, a sampling method is applied to strategically select new data points based on the generated embeddings. these data points are then selected and given to a human annotator to be labeled and added to the support set. afterward, we use this augmented support set for fine-tuning llms. to evaluate our method, we conduct experiments on five classification tasks: the news topic, 5-star rating, and private states' type, polarity, and intensity classification. we use two pre-trained language models, bart and flan-t5 @xcite , as the backbone and fine-tuning models in our approach. the proposed method is compared against weak and strong baselines to support its effectiveness and efficiency. these baselines include random sampling, in-context learning with gemma 2 @xcite , llama 3.1 @xcite , and mistral v0.3 @xcite , as well as other related work utilizing more advanced sample selection strategies in fsl. our approach, especially when combining representative and uncertaintybased sampling techniques, exceeds the baselines considerably on average. our contributions can be summarized as follows: 1) we introduce an active learning-based sample selection scenario by combining uncertainty and representativeness measures for fs classification problems achieving state-of-the-art performance when paired with recent fsl algorithms. 2) we executed comprehensive experiments on a wide variety of tasks using various llms. 3) we present a thorough analysis to assess the performance of the models at different iterations, comparing them to the baselines presented in previous work. 4) we make our implementation publicly available. ## related work in previous studies, the few-shot scenario has been simulated by randomly sampling a subset from the complete training data @xcite @xcite @xcite . among different fsl methods in nlp, there are few methods that have paid attention to the sample selection strategies. however, some recent studies in the field of image processing have demonstrated the effectiveness of incorporating al strategies in the context of fsl @xcite @xcite . the study conducted by chang et al. ( 2021 ) is one of the few works that specifically addresses sample selection in nlp. their research focuses on fs training instance selection and using it in three text generation tasks with bart. their approach is motivated by the idea that few-shot training instances should exhibit diversity and representativeness. to achieve this, the authors utilized k-means clustering for choosing data points closer to the center of clusters as important (i.e., informative) samples. their results demonstrate the success of this method even with this simple noniterative clustering-based approach. in contrast, our research specifically targets classification tasks. furthermore, our active learning approach incorporates a wider range of tasks and selection strategies (i.e., uncertainty, diversity, and representativeness) compared to their study. we then extend the usage of this idea to iteratively expand the support set. the only recent study that incorporates fs and al approaches in nlp is conducted by @xcite , using a zero-shot approach for xlm-roberta-based siamese networks. they use label tuning to fine-tune the label embeddings for faster training. on the contrary, we use multiple language models (i.e., bart and flan-t5) and fine-tune the entire model on the support set in every iteration as we prioritize the fs instance selection quality and model performance, which is shown to produce significantly better performance. also, the related work does not specify how they select samples in the first iteration using an uncertainty approach while the model has never seen any related data before. in contrast, we propose using representative sampling in the first step to boost the initial performance of the model, even in uncertainty sampling methods. moreover, we introduce four new sampling methods compared to the mentioned work. importantly, our methods and implementation are open source and publicly available to be freely used by fellow researchers. to the best of our knowledge, the previous work's methods are not freely available to the public. goal is to select a small number of samples from this unlabeled pool to be labeled and used as a support set in a way that maximizes a model's performance on the test set. in different fs instance selection methods, we may have one or more iterations of sampling and model fine-tuning. we categorize experiments with a single round of this process as 'non-iterative', and those with multiple rounds as 'iterative'. figure 1 illustrates the full pipeline of a single iteration, which can be the one and only iteration in the non-iterative approaches. at each iteration, we first examine the data to determine which additional samples to include in the support set. this process begins by extracting embeddings from a certain source, specified by an embedding method, to have a structured representation of the unlabeled data. this source is derived from running inference on the fine-tuned model of the last iteration by feeding it the unlabeled training pool. subsequently, a sampling method is applied to select new samples based on the obtained embeddings, guiding the model's learning toward optimal performance. the embedding and sampling methods are explained in the following subsections in more detail. the selected samples are then removed from the unlabeled training pool and given to an oracle for labeling. following that, the newly labeled samples are added to the support set. this augmented support set is next used to fine-tune a new instance of the pre-trained model on the validation set. finally, we evaluate the latest fine-tuned model on the test set to analyze the performance of our approach at the end of each step. however, the test set is solely used for evaluation purposes and is not needed for our approach to function in the defined setup. moreover, in the initial round, the support set is an empty set, all the training data is included in the unlabeled pool, and a pre-trained model without any previous fine-tuning is used to extract embeddings. ## discussion of results to better understand the impact of different approaches, we analyze the experimental results in this section. the model names in the tables indicate the employed pre-trained model, followed by the sampling method. if an iterative approach is used, the name reflects the sampling method for the first iteration, followed by the method used in the subsequent iterations. whenever a referred sampling method can make use of both embedding methods, we specify the used method inside parentheses. ## conclusion and future work we propose a novel fine-tuning-based method for sampling data to be used in a few-shot setting with active learning, while many others tend to sample data randomly. we show how using different embedding and sampling methods helps us achieve better results in classification tasks by choosing and labeling the most informative unlabeled samples that may represent the variety of data or that the model has the most doubts about. these methods unleash their full potential when used iteratively, using the fine-tuned model from the previous iterations, surpassing in-context learning approaches and other fine-tuning-based sampling strategies in previous studies. future work will expand on new embedding and sampling methods in classification tasks as well as other types of nlp tasks, such as text generation. it will also explore the effect of semisupervised learning methods on top of our approach in a pipeline, making use of the rest of the unlabeled data to improve performance.