On Sensitivity of Learning with Limited Labelled Data to the Effects of Randomness: Impact of Interactions and Systematic Choices (2024)

Abstract: While learning with limited labelled data can effectively deal with a lack of labels, it is also sensitive to the effects of uncontrolled randomness introduced by so-called randomness factors (i.e., non-deterministic decisions such as choice or order of samples). We propose and formalise a method to systematically investigate the effects of individual randomness factors while taking the interactions (dependence) between them into consideration. To this end, our method mitigates the effects of other factors while observing how the performance varies across multiple runs. Applying our method to multiple randomness factors across in-context learning and fine-tuning approaches on 7 representative text classification tasks and meta-learning on 3 tasks, we show that: 1) disregarding interactions between randomness factors in existing works led to inconsistent findings due to incorrect attribution of the effects of randomness factors, such as disproving the consistent sensitivity of in-context learning to sample order even with random sample selection; and 2) besides mutual interactions, the effects of randomness factors, especially sample order, are also dependent on more systematic choices unexplored in existing works, such as number of classes, samples per class or choice of prompt format.

## introduction learning with limited labelled data, such as incontext learning, fine-tuning or meta-learning, is an umbrella term for approaches designed to work when enough labels are lacking. although such approaches can effectively deal with limited labels, they were observed to be notably sensitive to the effects of uncontrolled randomness. such randomness is introduced by the randomness factors, which represent the non-deterministic decisions in the training process, such as order of samples, the model initialisation or sample choice @xcite @xcite . the randomness in the training process can have massive impact, leading to large deviation in the performance over multiple training runs. in-context learning was found to be sensitive to the order of samples, where changing only order of samples leads from state-of-the-art predictions to random guessing @xcite . similarly, repeating fine-tuning and evaluation multiple times with different random seeds can result in smaller language models outperforming their larger counterparts @xcite . if the randomness is not properly addressed, it can have nonnegligible negative consequences even with enough labelled samples @xcite . it was identified as a major obstacle to reproducibility @xcite that can prohibit objective comparison and cause a method to be incorrectly denoted as state-of-the-art only based on more favourable chance @xcite . the uncontrolled randomness can also unintentionally (but, unfortunately, also intentionally by cherry-picking) create an imaginary perception of research progress. a lot of focus is dedicated to investigating and mitigating the effects of randomness and sensitivity of learning with limited labelled data @xcite , especially for incontext learning @xcite @xcite @xcite . however, the existing research is often limited in its extent (in terms of randomness factors, approaches or settings) and at times leads to contradictory or inconsistent results. for example, in-context learning was believed to be consistently sensitive to the order of the randomly selected samples @xcite , however, it was later observed that this sensitivity disappears when a more sophisticated sample selection strategy is used @xcite @xcite . we argue that the observed inconsistencies are caused by disregarding the interactions between randomness factors, which leads to incorrectly attributing the performance deviations to different randomness factors. such interactions are so far partially or even completely overlooked in the existing works, resulting in the misleading findings. in addition, we hypothesise that the sensitivity of incontext learning is not only affected by the interactions with other factors but also by other systematic choices, which are not thoroughly controlled and explored in the existing works, such as the number of classes, shots per class and prompt format. our main contributions are as follows 1 : ## related work the main strategy for investigating the effects of randomness factors is to repeat the training and evaluation multiple times, changing specific nondeterministic decisions of the training, such as changing what data is used and observing the change in results (i.e., random strategy) @xcite @xcite . as such investigation may be affected by the interactions with other factors, another possibility is to perform the investigation by fixing all the other factors to a specific state (i.e., fixed strategy), either chosen randomly @xcite @xcite or as a result of a mitigation strategy @xcite . another investigation strategy is to vary all the investigated factors at the same time and then decouple their effects in evaluation @xcite @xcite @xcite , which accounts for the interactions but introduces a significant increase in computation costs @xcite . majority of the focus on investigating and mitigating effects of randomness is on in-context learning, which was found to be especially sensitive to the choice of samples @xcite @xcite @xcite and their order @xcite @xcite . however, it was observed that the sensitivity to sample order disappears when using a more sophisticated sample selection strategy instead of random selection @xcite @xcite , hinting at interactions between these factors that may lead to inconsistent results. in addition, the performance of in-context learning was found to be sensitive to more systematic choices as well @xcite , such as the format of the prompt @xcite or number of shots @xcite . however, the impact of these systematic choices on the effects of randomness factors is not thoroughly investigated. besides order of in-context examples, large language models were found to be especially sensitive to the order of choices in multi-choice question answering @xcite . although the remaining approaches and randomness factors receive only limited focus, they were still found to be sensitive to the effects of randomness, such as fine-tuning being sensitive to the random seeds (that influence model initialisation and order of samples) @xcite @xcite @xcite , meta-learning being sensitive to the choice of adaptation samples or how they are split into tasks @xcite @xcite , or the overall machine learning being sensitive to factors such as the impact of framework and hardware implementation @xcite , or the data split @xcite . in majority of the cases, the effects of randomness are evaluated based on a single aggregated metric from multiple runs (e.g., mean, standard @xcite the difference between best and worst run), with the importance being determined in a binary fashion by comparing this metric to a threshold, which allows only for simple analysis @xcite @xcite ). a slightly more nuanced analysis is possible only in specific cases, where statistical approaches are used, such as grouping runs and aggregating on group level @xcite , decoupling interactions @xcite or estimating distribution from lower number of training runs @xcite . however, almost no studies analyse the importance of the effects in a way that would allow for easy comparison across different settings, such as what fraction of the overall variance the specific factor contributes. we build on the ideas from the existing works, mainly from @xcite @xcite , to explicitly take interactions into consideration and analyse the importance of the found effects. in addition, we fill the identified research gap by analysing the impact of more systematic choices on the randomness factors. ## investigation of randomness while taking interactions into consideration we propose a new method for investigating the effects of any randomness factor that takes the interactions between the effects of other factors algorithm 1 investigate randomness factor with interactions and determine its importance require: k: number of randomness factors require: rf: set of randomness factors to consider require: c 1 , c 2 , ..., c k : set of configurations for each factor 1: select randomness factor i to investigate from determine model performance r m,n by training and evaluating the model using m and n 7: determine golden model performance r g by training and evaluating the model using g 16: end for 17: calculate overall golden model standard deviation @xmath0 effects of factor i considered important 21: end if into consideration, and which is designed to measure the importance of the found effects. the steps of the method are compiled in algorithm 1, with further supplementary details included in appendix b). setup. first, a set rf (|rf| = k) is defined, which includes all the factors that will be considered in the investigation. each randomness factor is characterised by a set of its randomness factor configurations, c j , specifying all the possible states the factor can appear in. for example, the different permutations of samples represent the configurations of the data order randomness factor. for each factor i, the investigated factor configurations set ifc i , containing the configurations used for the investigation, is defined as ifc @xmath1, and the mitigated factor configurations set mfc i , containing the joint configurations of the remaining randomness factors, is defined as a cross product between all the sets of randomness factor configurations, except for the investigated randomness factor (c i ): investigating effects. at its core, the investigation of factor i is done by observing how the performance changes across the different configurations the randomness factor can appear in. in a single investigation run, the training and evaluation of a model is repeated n times (@xmath2, each time with a different configurations n of the factor i, while keeping the configurations of the remaining factors fixed to a randomly chosen configuration m from mfc i . for each repeat, the model performance (r m,n ) is determined. the standard deviation p_std m (called partial standard deviation) across these n runs (p_std @xmath3, * )) represents the effects of the investigated randomness factor that are still affected by the interactions. ## experiments datasets. the experiments are conducted on 7 text classification datasets composed of different tasks with different number of classes. we focus on 3 binary classification datasets from the glue benchmark @xcite : sst2 @xcite for sentiment classification, cola @xcite for determining the grammatical acceptability of a sentence, and mrpc @xcite for determining the semantic equivalence relationship between two sentences. in addition, we use 4 multi-class text datasets: ag news @xcite for news classification, trec @xcite for question classification, db-pedia @xcite for topic classification and snips (coucke et al., 2018) for intent classification. approaches. the main focus of the investigation is on the in-context learning using the flan- t5 (chung et al., 2022) base, llama-2 (touvron et al., 2023) 13b instruction optimised model, mistral-7b (jiang et al., 2023) and zephyr-7b (tun- @xcite . in addition, we also focus on finetuning, using the bert @xcite and roberta @xcite base models. finally, we also investigate the meta-learning approaches maml @xcite , reptile @xcite and the prototypical networks @xcite , but only on the binary datasets. ## conclusion in this work, we have proposed a novel method that explicitly takes interactions between different randomness factors into consideration by mitigating the effects of the other, non-investigated, randomness factors. in addition, our method is designed to determine the importance of the investigated randomness factor by measuring what fraction of the overall deviation of the model (represented using a golden model) it contributes over the mitigated randomness factors, allowing for in-depth analysis across experimental settings. applying our proposed method to investigate the effects of randomness factors on in-context learning, fine-tuning and meta-learning, we confirm our hypothesis that interactions between randomness factors may cause incorrect attribution of effects of one factor to another, leading to inconsistent result. contrary to the previous works, after taking interactions into consideration, we do not observe a consistent sensitivity of in-context learning approaches to the sample order even when choosing samples at random. instead, we observe that the importance of randomness factors, especially the sample order, is affected by the interactions with other factors and by the systematic choices such as the number of predicted classes, the number of samples per class and the choice of prompt format. the proposed method can be applied to other nlp tasks as well, such as question answering, with minimal modifications. only requirement is to define the randomness factors and their configurations, such as order of choices in the questions or the symbols used for the answers. extending our investigation to other tasks represents an interesting potential for future work.