Few-Medoids: An Embarrassingly Simple Coreset Selection Method for Few-Shot Knowledge Distillation


Abstract

Coreset selection aims to identify a small and highly representative subset of a massive dataset for efficient model training. The problem remains challenging even in the few-shot knowledge distillation (KD) setup, where a full-scale pre-trained teacher informs the student network. Typical sample selection strategies often struggle to surpass the random selection baseline. In this paper, we showcase few-medoids, an embarrassingly simple coreset selection strategy that chooses the samples closest to the centroid (average image) of each class. We present extensive KD experiments on four datasets, covering a wide range of image classification problems, and three teacher-student model pairs, comprising both convolutional and transformer networks. Although the proposed method is embarrassingly simple, our empirical results indicate that few-medoids is able to consistently surpass the random selection baseline, as well as the other coreset selection strategies. We therefore consider that few-medoids can be used as a drop-in replacement for commonly-used baselines (e.g. herding or k-center Greedy), in future research on coreset selection. To reproduce the reported results, we publicly release our code at https://github.com/CemilAndreiDilmac/Few-Shot-KD-Coreset.

coreset selection; few-shot learning; knowledge distillation; object class recognition; image classification

1 Introduction↩︎

The advancements in modern deep learning have revolutionized various domains, from computer vision [1][5] to natural language processing [6][8]. However, this success is often obtained by a paradigm that prioritizes performance metrics over computational efficiency. State-of-the-art models increasingly rely on massive and potentially redundant datasets, as well as over-parameterized architectures that lead to extremely high memory and computational costs during both training and deployment phases. As the environmental and economic impacts of these computational demands become more pronounced [9][11], developing sustainable and resource-efficient practices has emerged as an important requirement for the deep learning community [11].

To address the severe inefficiencies associated with model training, two equivalent effective solutions that researchers have explored are coreset selection and data pruning [12][16]. These methodologies seek to transform a massive dataset into a minimal, highly representative subset that preserves the statistical and structural distribution of the original data. Usually, coreset selection methods [13][15], [17], [18] leverage statistical properties to identify and discard uninformative or redundant examples, while retaining only the most critical samples. Consequently, coreset selection allows models to be trained on highly compact datasets, reducing computational overhead and facilitating effective few-shot model training with reduced performance impact.

Complementary to the training optimizations offered by coreset selection, knowledge distillation (KD) [17], [19][21] targets resource efficiency at the inference stage. This technique works by compressing the predictive capabilities and learned feature representations of a large teacher model into a much smaller and more resource-efficient student network. The main goal is to ensure low latency and to reduce memory usage during real-world deployment. KD has been extensively explored, as deploying heavy models on resource-constrained edge devices remains a critical industry bottleneck [22], [23]. Although coreset selection and knowledge distillation share the objective of resource optimization, they have largely been treated as isolated domains. The former is applied exclusively for training optimization, while the latter is reserved for inference optimization. Consequently, there is a notable absence of literature investigating the intersection of these two methodologies. Specifically, to the best of our knowledge, there are only a few recent works [17], [24] that investigated the application of coreset selection to knowledge distillation, showcasing that the random selection baseline often outperforms several other specialized methods. Overall, utilizing a coreset for distillation is underexplored, despite the benefits that are brought by this setup. Specifically, it could simultaneously reduce the computational burden of training the student model, while ensuring the student still learns effectively from the teacher’s representations.

In this work, we address the identified research gap and expand the exploration of coreset selection in conjunction with KD. Moreover, we introduce a novel, simple, yet powerful baseline called few-medoids, designed to optimally identify representative samples for distillation by leveraging the latent space of the teacher. Specifically, few-medoids analyzes the per-class feature representations extracted from the teacher. Rather than relying on complex heuristics, it determines the most informative samples within a given class by calculating their centrality. Specifically, we select the data points that exhibit the least average distance to all other samples in the same class. Through comprehensive empirical validation of various convolutional and transformer architectures on four image datasets, we demonstrate that by capturing these geometric cluster centers, few-medoids can consistently outperform previously established baselines across a diverse range of experimental setups.

In summary, our contribution is three-fold:

  • We explore the effectiveness of adapting several existing baseline coreset methods to the distillation pipeline.

  • We introduce few-medoids, a simple and powerful coreset selection method that leverages the latent space of the teacher model.

  • We evaluate our proposed method against established baselines across four datasets and multiple model architectures.

2 Related Work↩︎

Recent advances in deep learning have been largely driven by scale, with improved performance often achieved by training continuously growing models on increasingly larger datasets [2][8], [25][27]. However, this trend comes at a substantial computational cost, as state-of-the-art performance typically requires significant training resources [11]. Moreover, supervised learning relies on large amounts of annotated data, and acquiring such labels is often expensive, time-consuming, and, in many domains, requires expert knowledge. These limitations have motivated research directions that seek to reduce either the amount of training data or the labeling burden, while maintaining competitive performance [12][16], [22].

One important line of research is active learning [28][32], which aims to reduce annotation cost by selecting the most informative samples from an unlabeled pool for labeling. Coreset selection [12], [14][16], [33][35] and data pruning [13], [17], [18], [36][39] are closely related, as they also seek to identify a compact yet informative subset of examples. Coreset selection has its origins in computational geometry, where early work [12] studied small subsets that approximate the original set with respect to a given objective. The three paradigms are connected by their shared objective of selecting samples that are especially useful for learning, often according to criteria such as informativeness, representativeness, or diversity [13][15], [17], [18], [32], [34], [37]. The main distinction lies in the learning setting: active learning operates on unlabeled data and focuses on which samples should be annotated, whereas coreset selection and data pruning typically assumes that labels are already available, and instead, aims to construct a smaller subset that can effectively approximate the full labeled training set.

Following the taxonomy proposed by Moser et al. [16], coreset selection methods can be broadly grouped into three categories: training-based, training-free, and label-free approaches. Training-based methods rely on model-dependent signals observed during optimization, such as gradients [40], [41], forgetting events [42], decision-boundary information [28], gradient matching [43], and bilevel optimization [44]. While often effective, these methods usually require repeated optimization, retraining, or additional scoring procedures, which introduces substantial computational overhead. In contrast, training-free methods rely on criteria that are independent of training dynamics, making them especially attractive in large-scale settings where efficiency and scalability are critical. This category includes simple strategies such as random sampling, as well as geometry-based methods, which remain competitive and serve as strong reference points not only in the coreset selection literature [15], [16], [34], [45], but also in dataset pruning [18], [32], [37], [46], [47], as both directions pursue the reduction of the training set, while preserving model performance. A third category, label-free methods, aims to estimate sample importance without using ground-truth labels, often through clustering or pre-trained models [33], [35], [48].

Our work belongs to the training-free category, and more specifically to geometry-based coreset selection [16], [34], [49][51]. Accordingly, the most relevant baselines for comparison are random selection, herding, and k-center Greedy. Random selection provides a simple baseline with negligible computational overhead, but it does not explicitly enforce representativeness or diversity, capturing dataset structure only through uniform sampling. In contrast, the two geometric baselines rely on the assumption that samples that are close in the latent space tend to share similar properties, so the geometry of that space carries meaningful information about the data distribution. Herding is designed to promote representativeness by greedily selecting samples such that the mean of the selected subset approximates the mean of the full dataset [49][51]. K-center Greedy instead emphasizes diversity by selecting samples that maximize coverage of the data space under a geometric distance criterion [32].

In the context of data pruning for knowledge distillation (KD) [19][22], recent work [17] has shown that the random sampling method is a surprisingly strong baseline. Moreover, a recent pruning study shows that the examples preferred in standard supervised subset selection are not always the most suitable for distillation. In particular, very hard examples may be suboptimal because the student cannot reliably match the teacher on them, while medium-difficulty ones provide a better trade-off between informativeness and learnability, leading to smoother decision boundaries and more stable knowledge transfer [24]. Specifically, Chen et al. [24] rank data points by prediction difficulty using the teacher’s cross-entropy loss on the ground-truth label, and select the medium-difficulty samples. Differently, few-medoids ranks samples within each class by their average Euclidean distance to all members of the same class, operating in the latent space of the teacher model, thereby favoring geometrically central points. As a result, the two methods retain different types of data.

3 Method↩︎

Problem statement. Coreset selection seeks to reduce a labeled dataset \({D}=\{(x_i, y_i)\}_{i=1}^n\) into a substantially smaller subset \({C}=\{(x_j, y_j)\}_{j=1}^p\), called coreset, such that \(C \subset D\) and \(p \ll n\). The goal is to preserve the most representative samples from each class, such that the empirical risk of a model \(h\) trained on \(C\) is as close as possible to the empirical risk of \(h\) trained on \(D\).

Few-medoids. In our KD-based approach, the coreset selection process is executed independently for each class, using the representations extracted by a teacher model. We denote this latent feature mapping of the teacher as \(f_\phi:\mathcal{X}\rightarrow \mathbb{R}^d\), where \(\mathcal{X}\) is the input space, \(\phi\) denotes the parameters of the teacher, and \(d\) represents the feature space dimension.

Let \(X_c = \{x_i \mid y_i=c\}_{i=1}^m\) denote the set of training samples belonging to a given class \(c\). Few-medoids assigns a score \(s_i\) to each sample, which is equal to its average Euclidean (\(L_2\)) distance to all other elements in the class. These values are then ranked in ascending order, so that lower scores indicate greater representativeness. The top-ranked image is therefore the class medoid, while the remaining ones can be viewed as progressively weaker medoid-like representatives under the same centrality criterion. In Algorithm 1, we summarize the proposed ranking method. In line 2, we initialize the list of importance scores \(S_{\!c}\). Subsequently, in lines 3-5, we determine these scores by calculating the distances between the latent feature vector \(f_\phi(x_i)\) of each sample and the latent feature vectors of all samples in class \(c\). Lastly, we sort the samples in \(X_c\) according to \(S_{\!c}\) and store the top \(k\) elements in \(C_c\). Then, the final corset \(C\) is given by: \[C = \bigcup_{j=1}^l C_j,\] where \(l\) is the number of classes.

Figure 1: Few-medoids

Knowledge distillation. For our knowledge distillation framework, we adopt the soft-label objective introduced by Hinton et al. [20]. For a given input batch \(X\), let \(z_\theta(X)\) and \(z_\phi(X)\) denote the output logits produced by the student and teacher models, respectively. We define the distillation loss, as follows: \[\label{eq95L95KD} \mathcal{L}_{\text{KD}}(X,\phi, \theta) = \tau^2 \cdot D_{\text{KL}}\left(p_\phi(X) \,\|\, p_\theta(X)\right),\tag{1}\] where \(\tau\) is a temperature parameter, \(D_\mathrm{KL}\) is the Kullback–Leibler (KL) divergence, and \(p_\phi\) and \(p_\theta\) are soft probability distributions given by: \[p_\phi(X) = \text{softmax}\left(\frac{z_\phi(X)}{\tau}\right), \qquad p_\theta(X) = \text{softmax}\left(\frac{z_\theta(X)}{\tau}\right).\]

The soft-target loss in Eq. 1 is combined with the standard cross-entropy loss, denoted by \(\mathcal{L}_{\text{CE}}\), computed using the ground-truth hard labels \(Y\). The total loss optimized by the student network is thus defined as: \[\mathcal{L}_{\text{total}} = \lambda_{1}\cdot\mathcal{L}_{\text{KD}}(X,\phi, \theta) + \lambda_2 \cdot \mathcal{L}_{\text{CE}}(X, Y, \theta),\] where \(\lambda_{1}\) and \(\lambda_{2}\) are hyperparameters weighting the two objectives.

4 Experiments↩︎

Datasets. We conduct experiments on four benchmark datasets: CIFAR-10 [52], CIFAR-100 [52], Oxford Flowers 102 [53], and Food-101 [54]. For CIFAR-10, CIFAR-100, and Food-101, the validation set was created from the official training split using a stratified 80/20 split to preserve class balance, whereas for Oxford Flowers 102, we used the official split. CIFAR-10 and CIFAR-100 have a fixed image resolution of \(32 \times 32\) pixels, while Oxford Flowers 102 and Food-101 contain images with variable resolutions. The classes in CIFAR-10 represent general object categories, primarily animals and vehicles. CIFAR-100 spans a broader range of categories, including animals, plants, household objects, people, and vehicles. In Oxford Flowers 102, the classes correspond to flower species, while in Food-101, they represent types of food dishes. Detailed statistics for all datasets are presented in Table 1.

Table 1: Statistics across object class recognition datasets. We report the number of classes, as well as the number of images and the number of images per class for each split: training, validation and test.
Total images Images per class
3-5 (lr)6-8 Dataset Classes Train Val Test Train Val Test
CIFAR-10 10 40,000 10,000 10,000 4,000 1,000 1,000
CIFAR-100 100 40,000 10,000 10,000 400 100 100
Oxford Flowers 102 102 1,020 1,020 6,149 10 10 20-238
Food-101 101 60,600 15,150 25,250 600 150 250

Underlying neural models. We evaluate several teacher-student combinations, including pairs based on the same model family, as well as a cross-architecture setting. The former pairs include ResNet-34\(\rightarrow\)ResNet-18 [3] and ViT-B/16\(\rightarrow\)ViT-Small [2], while the latter is represented by ViT-B/16\(\rightarrow\)ResNet-50. In all cases, the teacher is initialized with ImageNet-1K pre-trained weights and then fine-tuned on the target dataset. The teacher is used both to provide the distillation signal and to extract features during the sample selection stage.

Each student is also trained independently on the full training set using standard supervised learning, providing a reference for the upper performance bound, outside the few-shot distillation framework. In this setting, ResNet-18 and ResNet-50 are trained from scratch, whereas ViT-Small is initialized from pre-trained weights. These models serve as supervised baselines. In the proposed framework, KD is performed only on the subsets selected by coreset selection methods, enabling a direct comparison between supervised training on the full training set and distillation on the selected subsets. The ViT-B/16\(\rightarrow\)ViT-Small pair also allows evaluation in a pre-trained teacher-student setting.

Hyperparameters. All architectures are trained for 100 epochs using a Cosine Annealing learning rate scheduler. ResNet-based models are optimized via SGD with momentum \(0.9\), while vision transformers are optimized via AdamW. A batch size of \(128\) is used for teacher training, while student models are trained with a batch size of \(32\). The learning rate varies between \(5\cdot 10^{-2}\) and \(10^{-4}\). Students trained via KD on the selected subsets use the same optimization settings, training schedule, and data augmentation pipeline as the corresponding architectures trained on the full training set. The distillation temperature is set to \(\tau = 4\). The loss weights are set to \(\lambda_1=0.6\) and \(\lambda_2=0.4\).

Table 2: Test accuracy rates (%) of the five architectures trained on the full training set of each dataset. The report accuracy rates serve as empirical upper bounds for the few-shot KD experiments.
Model CIFAR-10 CIFAR-100 Oxford Flowers 102 Food-101
ResNet-18 94.03 74.88 49.58 81.32
ResNet-34 96.94 83.16 90.82 84.47
ResNet-50 92.27 72.98 37.92 80.12
ViT-Small 97.09 85.72 98.04 88.40
ViT-B/16 97.31 85.85 93.15 86.78

Baselines. To benchmark the performance of few-medoids, we compare it against four baseline selection strategies. For a fair comparison, we applied these baselines in the latent space of the teacher. The first is random selection, where we uniformly sample \(k\) instances per class without replacement. The second is herding [51], which ensures that the running mean of the selected subset progressively approximates the true class centroid. The third is k-center Greedy [32], an algorithm that iteratively selects samples to maximize diversity in the feature space. Lastly, we introduce a custom baseline, PCA-guided matching, which leverages Principal Component Analysis (PCA) applied to the transposed feature matrix of the class samples. This transposition yields principal components that represent linear combinations of the data samples rather than the features. We select the original samples closest to these principal components to obtain distinct data samples that explain independent variations and promote subset diversity.

Evaluation protocol. We perform few-shot KD experiments for \(k \in \{1,2,4,8,16,32,64,128\}\) samples per class. For Oxford Flowers 102, the evaluation is limited to \(k \in \{1,2,4,8\}\), since each class only contains 10 training samples. For each selection strategy and each value of \(k\), five independent selections are generated using different seeds. Each resulting subset is used for a separate training run. For a given run, the checkpoint retained for final evaluation is the one that achieves the highest validation accuracy during training. When multiple checkpoints reach the same validation accuracy, the one with the lowest validation loss is selected. This checkpoint is then evaluated on the official held-out test set to obtain the final test accuracy. The reported accuracy rates represent average values over five runs.

Table 3: Few-shot KD test accuracy (%) on CIFAR-10, for \(k \in \{1,2,4,8,16,32,64,128\}\). Average accuracy rates and standard deviations are computed over five runs with different seeds. Bold green indicates the best result among coreset selection methods for a given \(k\) and a given neural model pair, while blue underline indicates the second-best result.
Method \(k{=}1\) \(k{=}2\) \(k{=}4\) \(k{=}8\) \(k{=}16\) \(k{=}32\) \(k{=}64\) \(k{=}128\)
ResNet-34 \(\to\) ResNet-18
Few-medoids
K-center \(16.13 \pm 1.41\) \(16.71 \pm 0.62\) \(17.91 \pm 1.42\) \(20.10 \pm 0.51\) \(22.36 \pm 0.89\) \(25.30 \pm 1.54\) \(30.20 \pm 0.25\) \(36.88 \pm 0.67\)
Herding \(43.55 \pm 0.30\) \(57.31 \pm 2.13\)
Random \(16.13 \pm 1.41\) \(18.41 \pm 1.21\) \(19.51 \pm 1.60\) \(25.16 \pm 0.33\) \(29.98 \pm 0.63\) \(36.18 \pm 1.43\)
PCA-guided matching \(15.92 \pm 0.79\) \(15.86 \pm 1.06\) \(17.40 \pm 0.89\) \(20.50 \pm 0.77\) \(23.84 \pm 0.58\) \(28.41 \pm 0.73\) \(35.61 \pm 1.61\) \(52.56 \pm 1.18\)
ViT-B/16 \(\to\) ResNet-50
Few-medoids \(14.72 \pm 3.64\)
K-center \(13.46 \pm 0.29\) \(13.41 \pm 1.14\) \(13.14 \pm 0.47\) \(12.77 \pm 1.55\) \(14.89 \pm 2.74\) \(14.79 \pm 4.10\) \(20.14 \pm 5.29\) \(28.14 \pm 5.84\)
Herding \(23.39 \pm 8.12\) \(28.62 \pm 10.18\) \(46.38 \pm 6.85\)
Random \(13.46 \pm 0.29\) \(14.41 \pm 1.67\) \(12.45 \pm 1.52\) \(18.13 \pm 3.23\)
PCA-guided matching \(12.84 \pm 0.94\) \(11.82 \pm 1.16\) \(11.70 \pm 0.75\) \(14.01 \pm 1.24\) \(19.28 \pm 2.91\) \(21.17 \pm 3.43\) \(28.32 \pm 2.86\) \(35.31 \pm 4.34\)
ViT-B/16 \(\to\) ViT-Small
Few-medoids \(82.87 \pm 1.43\) \(84.32 \pm 0.44\) \(85.87 \pm 0.44\) \(86.94 \pm 1.27\) \(87.90 \pm 1.38\)
K-center \(47.96 \pm 4.33\) \(49.99 \pm 3.95\) \(58.94 \pm 5.31\) \(69.69 \pm 4.23\) \(78.42 \pm 5.77\) \(87.48 \pm 1.67\) \(92.12 \pm 0.64\) \(93.21 \pm 0.29\)
Herding
Random \(47.96 \pm 4.33\) \(58.39 \pm 2.91\) \(71.04 \pm 4.79\)
PCA-guided matching \(31.03 \pm 3.45\) \(44.40 \pm 3.46\) \(62.74 \pm 2.91\) \(71.16 \pm 2.73\) \(80.88 \pm 3.24\) \(87.04 \pm 0.91\) \(89.38 \pm 0.85\) \(90.90 \pm 0.66\)
Table 4: Few-shot KD test accuracy (%) on CIFAR-100, for \(k \in \{1,2,4,8,16,32,64,128\}\). Average accuracy rates and standard deviations are computed over five runs with different seeds. Bold green indicates the best result among coreset selection methods for a given \(k\) and a given neural model pair, while blue underline indicates the second-best result.
Method \(k{=}1\) \(k{=}2\) \(k{=}4\) \(k{=}8\) \(k{=}16\) \(k{=}32\) \(k{=}64\) \(k{=}128\)
ResNet-34 \(\to\) ResNet-18
Few-medoids \(55.09 \pm 0.49\) \(63.83 \pm 0.20\)
K-center \(4.31 \pm 0.40\) \(5.29 \pm 0.61\) \(6.41 \pm 0.45\) \(8.82 \pm 0.63\) \(13.39 \pm 0.15\) \(25.82 \pm 0.75\) \(45.57 \pm 0.89\) \(63.23 \pm 0.43\)
Herding
Random \(4.31 \pm 0.40\) \(7.17 \pm 0.43\) \(10.28 \pm 0.31\) \(15.13 \pm 0.81\) \(24.66 \pm 0.40\) \(40.27 \pm 1.42\)
PCA-guided matching \(3.47 \pm 0.18\) \(6.03 \pm 0.16\) \(8.18 \pm 0.19\) \(13.15 \pm 0.35\) \(23.65 \pm 0.68\) \(39.75 \pm 0.43\) \(55.08 \pm 0.32\) \(66.08 \pm 0.28\)
ViT-B/16 \(\to\) ResNet-50
Few-medoids \(46.49 \pm 0.82\) \(59.08 \pm 0.46\)
K-center \(1.59 \pm 0.30\) \(2.38 \pm 0.45\) \(3.52 \pm 0.33\) \(6.70 \pm 0.67\) \(11.54 \pm 0.52\) \(20.01 \pm 0.42\) \(36.04 \pm 2.18\) \(55.17 \pm 1.42\)
Herding
Random \(1.59 \pm 0.30\) \(2.17 \pm 0.95\) \(5.22 \pm 1.38\) \(9.62 \pm 1.75\) \(18.21 \pm 1.37\) \(32.52 \pm 1.54\)
PCA-guided matching \(1.42 \pm 0.20\) \(2.40 \pm 0.53\) \(3.78 \pm 0.58\) \(7.49 \pm 0.66\) \(14.68 \pm 1.32\) \(25.49 \pm 0.70\) \(40.50 \pm 1.09\) \(57.87 \pm 1.31\)
ViT-B/16 \(\to\) ViT-Small
Few-medoids \(66.06 \pm 1.70\) \(71.73 \pm 2.83\) \(74.02 \pm 0.80\) \(75.10 \pm 1.15\) \(77.57 \pm 0.35\)
K-center \(23.50 \pm 3.44\) \(30.29 \pm 3.26\) \(39.31 \pm 3.97\) \(57.55 \pm 1.60\) \(72.67 \pm 2.30\) \(78.36 \pm 0.58\) \(81.27 \pm 0.32\)
Herding
Random \(23.50 \pm 3.44\) \(37.63 \pm 4.67\) \(54.62 \pm 4.28\) \(83.48 \pm 0.19\)
PCA-guided matching \(16.73 \pm 1.35\) \(26.65 \pm 3.65\) \(39.75 \pm 3.55\) \(54.05 \pm 3.65\) \(68.80 \pm 2.96\) \(74.54 \pm 0.62\) \(78.09 \pm 0.47\) \(81.93 \pm 0.25\)

Results. In Table 3, few-medoids demonstrates strong CIFAR-10 performance across two KD model pairs. For ResNet-34\(\to\)ResNet-18, it achieves top accuracy for five out of eight few-shot scenarios, outperforming herding and random selection by over \(5\%\) in some cases. Herding marginally leads at \(k=2\) and \(k=4\), while random selection leads at \(k=128\). For ViT-B/16\(\to\)ResNet-50, herding attains the best score for \(k \leq 8\), but few-medoids dominates for \(k \geq 16\), outperforming the other baselines by margins of up to \(11\%\). In Table 4, we show results on CIFAR-100, where we observe a clear \(k\)-dependent trend across both the ResNet-34\(\to\)ResNet-18 and ViT-B/16\(\to\)ResNet-50 settings. Few-medoids dominates the low- and mid-\(k\) regimes (\(k \le 16\) and \(k \le 32\)), outperforming herding and random selection by up to \(4\%\). However, at larger coreset dimensions (\(k \ge 64\)), both herding and random selection overtake few-medoids. As per Table 5, the rankings seem unstable on Oxford Flowers 102, since the top performance alternates among few-medoids, herding, random selection, and PCA-guided matching. This sensitivity is likely due to the limited number of training images in the dataset (10 per class) and the highly imbalanced test set. In contrast, the results reported in Table 6 demonstrate that few-medoids dominates on Food-101, where it achieves the highest accuracy across all coreset dimensions for the first two KD model pairs. In the ResNet-34\(\to\)ResNet-18 case, it outperforms herding by up to \(8\%\), and random selection by up to \(10\%\), at \(k=16\). This advantage extends to ViT-B/16\(\to\)ResNet-50, where few-medoids surpasses herding and random selection by up to \(10\%\) and \(11\%\) when \(k=16\), respectively.

Table 5: Few-shot KD test accuracy (%) on Oxford Flowers 102, for \(k \in \{1,2,4,8\}\). Average accuracy rates and standard deviations are computed over five runs with different seeds. Bold green indicates the best result among coreset selection methods for a given \(k\) and a given neural model pair, while blue underline indicates the second-best result.
Method \(k{=}1\) \(k{=}2\) \(k{=}4\) \(k{=}8\)
ResNet-34 \(\to\) ResNet-18
Few-medoids \(51.44 \pm 0.59\)
K-center \(12.86 \pm 0.60\) \(20.87 \pm 0.67\) \(33.34 \pm 0.89\) \(51.16 \pm 1.19\)
Herding \(50.90 \pm 1.57\)
Random \(12.86 \pm 0.60\) \(22.52 \pm 1.85\) \(35.73 \pm 0.69\)
PCA-guided matching \(11.71 \pm 0.74\) \(22.23 \pm 1.01\) \(36.10 \pm 0.40\)
ViT-B/16 \(\to\) ResNet-50
Few-medoids \(9.53 \pm 3.70\)
K-center \(1.57 \pm 0.65\) \(8.28 \pm 4.92\) \(22.01 \pm 2.56\) \(37.00 \pm 3.46\)
Herding \(22.00 \pm 4.56\) \(35.50 \pm 3.68\)
Random \(1.57 \pm 0.65\) \(10.47 \pm 3.32\) \(35.15 \pm 5.34\)
PCA-guided matching \(1.88 \pm 0.64\) \(19.82 \pm 2.28\)
ViT-B/16 \(\to\) ViT-Small
Few-medoids \(80.56 \pm 3.03\) \(89.54 \pm 1.82\) \(95.54 \pm 0.70\)
K-center \(66.49 \pm 2.34\) \(96.62 \pm 2.41\)
Herding
Random \(66.49 \pm 2.34\) \(77.62 \pm 9.99\) \(92.15 \pm 2.68\)
PCA-guided matching \(66.87 \pm 3.34\) \(75.51 \pm 14.31\) \(91.24 \pm 3.75\) \(96.58 \pm 1.20\)
Table 6: Few-shot KD test accuracy (%) on Food-101, for \(k \in \{1,2,4,8,16,32,64,128\}\). Average accuracy rates and standard deviations are computed over five runs with different seeds. Bold green indicates the best result among coreset selection methods for a given \(k\) and a given neural model pair, while blue underline indicates the second-best result.
Method \(k{=}1\) \(k{=}2\) \(k{=}4\) \(k{=}8\) \(k{=}16\) \(k{=}32\) \(k{=}64\) \(k{=}128\)
ResNet-34 \(\to\) ResNet-18
Few-medoids
K-center \(2.54 \pm 0.64\) \(2.43 \pm 0.21\) \(2.81 \pm 0.20\) \(3.72 \pm 0.16\) \(5.87 \pm 0.40\) \(12.59 \pm 0.50\) \(30.74 \pm 1.26\) \(58.37 \pm 0.18\)
Herding \(2.78 \pm 0.29\) \(11.48 \pm 0.13\) \(20.23 \pm 0.20\) \(35.33 \pm 0.32\) \(56.17 \pm 0.33\) \(69.64 \pm 0.18\)
Random \(2.54 \pm 0.64\) \(4.09 \pm 0.45\) \(6.50 \pm 0.64\) \(10.37 \pm 0.67\) \(18.19 \pm 0.60\) \(33.42 \pm 0.97\) \(55.06 \pm 0.70\) \(69.09 \pm 0.19\)
PCA-guided matching \(4.65 \pm 0.10\) \(7.39 \pm 0.15\)
ViT-B/16 \(\to\) ResNet-50
Few-medoids
K-center \(1.18 \pm 0.19\) \(1.66 \pm 0.25\) \(1.80 \pm 0.26\) \(2.41 \pm 0.28\) \(4.03 \pm 0.74\) \(8.56 \pm 0.54\) \(20.84 \pm 0.65\) \(47.19 \pm 2.73\)
Herding
Random \(1.18 \pm 0.19\) \(2.13 \pm 0.15\) \(2.84 \pm 0.50\) \(4.83 \pm 0.85\) \(11.18 \pm 1.39\) \(24.45 \pm 1.32\) \(42.91 \pm 1.25\) \(63.36 \pm 1.95\)
PCA-guided matching \(1.02 \pm 0.06\) \(1.76 \pm 0.33\) \(1.96 \pm 0.27\) \(3.02 \pm 0.58\) \(7.33 \pm 0.88\) \(15.27 \pm 0.86\) \(33.69 \pm 1.45\) \(56.01 \pm 1.73\)
ViT-B/16 \(\to\) ViT-Small
Few-medoids \(74.92 \pm 0.57\) \(78.10 \pm 0.36\) \(80.73 \pm 0.18\) \(83.82 \pm 0.09\)
K-center \(21.63 \pm 1.80\) \(25.72 \pm 5.11\) \(29.30 \pm 7.88\) \(44.77 \pm 9.35\) \(64.97 \pm 0.93\) \(74.81 \pm 0.73\) \(81.44 \pm 0.45\) \(85.47 \pm 0.16\)
Herding
Random \(21.64 \pm 1.79\) \(36.06 \pm 1.25\) \(51.67 \pm 3.67\) \(68.11 \pm 1.55\)
PCA-guided matching \(13.50 \pm 0.82\) \(22.40 \pm 2.84\) \(36.36 \pm 2.00\) \(54.62 \pm 2.00\) \(69.09 \pm 0.89\) \(76.89 \pm 0.39\) \(81.52 \pm 0.26\) \(85.10 \pm 0.15\)

In Figure 2, we illustrate the performance of ResNet-18 students for each of the studied coreset selection methods. We include these graphs as they allow a better visualization of the performance trends as a function of the coreset size, \(k\). Overall, we observe that few-medoids frequently achieves the best performance, and it shows better stability across datasets compared with the other baselines.

In summary, few-medoids consistently outperforms coreset selection baselines on the first two KD model pairs (ResNet-34\(\to\)ResNet-18 and ViT-B/16\(\to\)ResNet-50) across most datasets. The main exception is the ViT-B/16\(\to\)ViT-Small transfer, where herding generally prevails as \(k\) increases. This indicates that few-medoids excels when the student model is trained from scratch, and its initial latent space is not semantically organized a priori. For pre-trained student setups, herding seems to be more effective for \(k \ge 4\), while few-medoids remains competitive for \(k \le 2\).

a
b
c
d

Figure 2: Quantitative comparison for the ResNet-34\(\to\)ResNet-18 model pair across CIFAR-10, CIFAR-100, Oxford Flowers 102, and Food-101. Each point indicates the average accuracy over five runs. Best viewed in color.. a — Few-shot KD results on CIFAR-10., b — Few-shot KD results on CIFAR-100., c — Few-shot KD results on Oxford Flowers 102., d — Few-shot KD results on Food-101.

a
b

Figure 3: t-SNE visualization of ResNet-18 embeddings (\(k{=}32\)) for randomly chosen test samples from 20 randomly selected classes from Food-101. Different colors represent different food categories. Few-medoids (right) generates a more discriminative latent space than random coreset selection (left). Best viewed in color.. a — Random selection., b — Few-medoids.

Latent space analysis. In Figure 3, we compare the latent space representations of ResNet-18 student models trained with few-medoids versus the random selection baseline. We can observe that few-medoids yields more well-defined class clusters than random coreset selection. Moreover, even classes that are distinguishable in both cases form tighter clusters under few-medoids, for example the dark blue cluster. This indicates that few-medoids learns more discriminative features, and is expected to perform better in terms of generalization capacity.

5 Conclusion↩︎

In this paper, we addressed the computational inefficiencies of model training by exploring the intersection of coreset selection and knowledge distillation. Moreover, we introduced few-medoids, a simple yet highly effective training-free sample selection strategy designed for the few-shot distillation framework. Rather than relying on complex heuristics or prediction difficulty, few-medoids directly leverages the latent feature space of the pre-trained teacher model. By calculating the average Euclidean distance between samples of the same class, the method selects the most geometrically central and representative samples (the class medoids) to form the coreset for student training. Our results underscored that retaining examples that are semantically relevant for the teacher, which are located near the center of the latent distribution of each class, yields a superior supervision signal for the student model, in most of the cases. Therefore, we consider that few-medoids can be employed as a strong yet simple sample selection baseline in future research on coreset selection and data pruning for knowledge distillation.

Acknowledgments↩︎

This research is supported by the project “Romanian Hub for Artificial Intelligence - HRIA”, Smart Growth, Digitization and Financial Instruments Program, 2021-2027, MySMIS no. 351416.

References↩︎

[1]
F.-A. Croitoru, V. Hondru, R. T. Ionescu, and M. Shah, “Diffusion models in vision: A survey,” IEEE Tranactions on Pattern Analysis and Machine Intelligence, vol. 45, no. 9, pp. 10850–10869, 2023.
[2]
A. Dosovitskiy et al., An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale,” in Proceedings of ICLR, 2021.
[3]
K. He, X. Zhang, S. Ren, and J. Sun, Deep Residual Learning for Image Recognition,” in Proceedings of CVPR, 2016, pp. 770–778.
[4]
Z. Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows,” in Proceedings of ICCV, 2021, pp. 9992–10002.
[5]
R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer, “High-resolution image synthesis with latent diffusion models,” in Proceedings of CVPR, 2022, pp. 10684–10695.
[6]
R. Rafailov, A. Sharma, E. Mitchell, S. Ermon, C. D. Manning, and C. Finn, Direct Preference Optimization: your language model is secretly a reward model,” in Proceedings of NeurIPS, 2023, pp. 53728–53741.
[7]
H. Touvron et al., “LLaMA: Open and efficient foundation language models,” arXiv preprint arXiv 2302.13971, 2023.
[8]
A. Vaswani et al., “Attention is all you need,” in Proceedings of NeurIPS, 2017, pp. 6000–6010.
[9]
A. Faiz et al., LLMCarbon: Modeling the end-to-end carbon footprint of large language models,” in Proceedings of ICLR, 2024.
[10]
P. Li, J. Yang, M. A. Islam, and S. Ren, Making AI Less ‘Thirsty’,” Communications of the ACM, vol. 68, no. 7, pp. 54–61, 2025.
[11]
R. Schwartz, J. Dodge, N. A. Smith, and O. Etzioni, Green AI,” Communications of the ACM, vol. 63, no. 12, pp. 54–63, 2020.
[12]
P. K. Agarwal, S. Har-Peled, and K. R. Varadarajan, “Geometric approximation via coresets,” in Combinatorial and computational geometry, Cambridge University Press, 2005, pp. 1–30.
[13]
X. Dai, D. Chen, M. Liu, Y. Chen, and L. Yuan, DA-NAS: Data Adapted Pruning for Efficient Neural Architecture Search,” in Proceedings of ECCV, 2020, pp. 584–600.
[14]
C. Hao et al., FedCS: Coreset Selection for Federated Learning,” in Proceedings of CVPR, 2025, pp. 15434–15443.
[15]
H. Lee, S. Kim, J. Lee, J. Yoo, and N. Kwak, “Coreset selection for object detection,” in Proceedings of CVPRW, 2024, pp. 7682–7691.
[16]
B. B. Moser, A. S. Shanbhag, S. Frolov, F. Raue, J. Folz, and A. Dengel, “A coreset selection of coreset selection literature: Introduction and recent advances,” arXiv preprint arXiv:2505.17799, 2026.
[17]
E. B. Baruch, A. Botach, I. Kviatkovsky, M. Aggarwal, and G. Medioni, “Distilling the knowledge in data pruning,” in Proceedings of ICML, 2025, pp. 3659–3676.
[18]
M. He, S. Yang, T. Huang, and B. Zhao, “Large-scale dataset pruning with dynamic uncertainty,” in Proceedings of CVPR, 2024, pp. 7713–7722.
[19]
T. Fukuda, M. Suzuki, G. Kurata, S. Thomas, J. Cui, and B. Ramabhadran, “Efficient knowledge distillation from an ensemble of teachers,” in Proceedings of INTERSPEECH, 2017, pp. 3697–3701.
[20]
G. Hinton, O. Vinyals, and J. Dean, Distilling the Knowledge in a Neural Network,” arXiv preprint arXiv:1503.02531, 2015.
[21]
B. Zhao, Q. Cui, R. Song, Y. Qiu, and J. Liang, “Decoupled knowledge distillation,” in Proceedings of CVPR, 2022, pp. 11953–11962.
[22]
D.-N. Grigore, M.-I. Georgescu, J. A. Justo, T. Johansen, A. I. Ionescu, and R. T. Ionescu, “Weight copy and low-rank adaptation for few-shot distillation of vision transformers,” in Proceedings of WACV, 2025, pp. 7368–7378.
[23]
S. Tsuyuki et al., Efficient Few-Shot Learning for Edge AI via Knowledge Distillation on MobileViT,” arXiv preprint arXiv:2603.26145, 2026.
[24]
Y. Chen, X. Xu, F. de Hoog, J. Liu, and S. Wang, “Medium-difficulty samples constitute smoothed decision boundary for knowledge distillation on pruned datasets,” in Proceedings of ICLR, 2025.
[25]
K. Enevoldsen et al., MMTEB: Massive multilingual text embedding benchmark,” in Proceedings of ICLR, 2025.
[26]
M. Lupaşcu, A.-C. Rogoz, M. S. Stupariu, and R. T. Ionescu, “Large multimodal models for low-resource languages: A survey,” Information Fusion, vol. 131, p. 104189, 2026.
[27]
N. Muennighoff, N. Tazi, L. Magne, and N. Reimers, MTEB: Massive text embedding benchmark,” in Proceedings of ACL, 2023, pp. 2014–2037.
[28]
M. Ducoffe and F. Precioso, “Adversarial active learning for deep networks: A margin based approach,” arXiv preprint arXiv:1802.09841, 2018.
[29]
V. Hondru and R. T. Ionescu, “Towards few-call model stealing via active self-paced knowledge distillation and diffusion-based image generation,” Artificial Intelligence Review, vol. 58, no. 8, p. 254, 2025.
[30]
W.-N. Hsu and H.-T. Lin, “Active learning by learning,” in Proceedings of AAAI, 2015, pp. 2659–2665.
[31]
A. Parvaneh, E. Abbasnejad, D. Teney, G. (Reza). Haffari, A. van den Hengel, and J. Q. Shi, “Active learning by feature mixing,” in Proceedings of CVPR, 2022, pp. 12237–12246.
[32]
O. Sener and S. Savarese, “Active learning for convolutional neural networks: A core-set approach,” in Proceedings of ICLR, 2018.
[33]
B. A. Griffin, J. Marks, and J. J. Corso, “Zero-shot coreset selection via iterative subspace sampling,” in Proceedings of WACV, 2026, pp. 2114–2124.
[34]
C. Guo, B. Zhao, and Y. Bai, DeepCore: A Comprehensive Library for Coreset Selection in Deep Learning,” in Proceedings of DEXA, 2022, pp. 181–195.
[35]
H. Zheng et al., ELFS: Label-free coreset selection with proxy training dynamics,” in Proceedings of ICLR, 2025.
[36]
F. Ayed and S. Hayou, “Data pruning and neural scaling laws: Fundamental limitations of score-based algorithms,” Transactions on Machine Learning Research, 2023.
[37]
B. Sorscher, R. Geirhos, S. Shekhar, S. Ganguli, and A. S. Morcos, “Beyond neural scaling laws: Beating power law scaling via data pruning,” in Proceedings of NeurIPS, 2022, pp. 19523–19536.
[38]
A. Vysogorets, K. Ahuja, and J. Kempe, DRoP: Distributionally Robust Data Pruning,” in Proceedings of ICLR, 2025.
[39]
S. Yang, Z. Xie, H. Peng, M. Xu, M. Sun, and P. Li, Dataset Pruning: Reducing Training Data by Examining Generalization Influence,” in Proceedings of ICLR, 2023.
[40]
D. Everaert and C. Potts, GIO: Gradient Information Optimization for Training Dataset Selection,” in Proceedings of ICLR, 2024.
[41]
M. Paul, S. Ganguli, and G. K. Dziugaite, “Deep learning on a data diet: Finding important examples early in training,” in Proceedings of NeurIPS, 2021, pp. 20596–20607.
[42]
M. Toneva, A. Sordoni, R. Tachet des Combes, A. Trischler, Y. Bengio, and G. J. Gordon, “An empirical study of example forgetting during deep neural network learning,” arXiv preprint arXiv:1812.05159, 2018.
[43]
B. Mirzasoleiman, J. Bilmes, and J. Leskovec, “Coresets for data-efficient training of machine learning models,” in Proceedings of ICML, 2020, pp. 6950–6960.
[44]
K. Killamsetty, D. Sivasubramanian, G. Ramakrishnan, and R. Iyer, GLISTER: Generalization based Data Subset Selection for Efficient and Robust Learning,” in Proceedings of AAAI, 2021, pp. 8110–8118.
[45]
H. Zheng, R. Liu, F. Lai, and A. Prakash, “Coverage-centric coreset selection for high pruning rates,” in Proceedings of ICLR, 2023.
[46]
A. Maharana, P. Yadav, and M. Bansal, D2 Pruning: Message Passing for Balancing Diversity and Difficulty in Data Pruning,” in Proceedings of ICLR, 2024.
[47]
X. Xia, J. Liu, J. Yu, X. Shen, B. Han, and T. Liu, Moderate Coreset: A Universal Method of Data Selection for Real-World Data-Efficient Deep Learning,” in Proceedings of ICLR, 2023.
[48]
H. Tan, S. Wu, W. Huang, S. Zhao, and X. QI, “Data pruning by information maximization,” in Proceedings of ICLR, 2025.
[49]
Y. Chen, M. Welling, and A. Smola, “Super-samples from kernel herding,” in Proceedings of UAI, 2010, pp. 109–116.
[50]
S.-A. Rebuffi, A. Kolesnikov, G. Sperl, and C. H. Lampert, iCaRL: Incremental Classifier and Representation Learning,” in Proceedings of CVPR, 2017, pp. 5533–5542.
[51]
M. Welling, “Herding dynamical weights to learn,” in Proceedings of ICML, 2009, pp. 1121–1128.
[52]
A. Krizhevsky and G. Hinton, Learning Multiple Layers of Features from Tiny Images,” University of Toronto, Toronto, Ontario, 0, 2009. [Online]. Available: https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf.
[53]
M.-E. Nilsback and A. Zisserman, Automated Flower Classification over a Large Number of Classes,” in Proceedings of ICVGIP, 2008, pp. 722–729.
[54]
L. Bossard, M. Guillaumin, and L. Van Gool, Food-101 – Mining Discriminative Components with Random Forests,” in Proceedings of ECCV, 2014, pp. 446–461.