DISCERN : Decoding Systematic Errors in Natural Language for Text Classifiers (2024)

Abstract: Despite their high predictive accuracies, current machine learning systems often exhibit systematic biases stemming from annotation artifacts or insufficient support for certain classes in the dataset. Recent work proposes automatic methods for identifying and explaining systematic biases using keywords. We introduce DISCERN, a framework for interpreting systematic biases in text classifiers using language explanations. DISCERN iteratively generates precise natural language descriptions of systematic errors by employing an interactive loop between two large language models. Finally, we use the descriptions to improve classifiers by augmenting classifier training sets with synthetically generated instances or annotated examples via active learning. On three text-classification datasets, we demonstrate that language explanations from our framework induce consistent performance improvements that go beyond what is achievable with exemplars of systematic bias. Finally, in human evaluations, we show that users can interpret systematic biases more effectively (by over 25% relative) and efficiently when described through language explanations as opposed to cluster exemplars.

## introduction a broader adoption and trust in machine learning systems would require a confluence of high predictive performance and human interpretability. despite their high predictive accuracies, current machine learning systems often exhibit systematic biases @xcite @xcite stemming from annotation artifacts @xcite or insufficient support for certain classes in the dataset @xcite . such biases impede the deployment of systems for real-world applications. hence, identifying data sub-populations where systems underperform is crucial for a comprehensive understanding of its limitations, thereby guiding future refinement strategies. in line with this objective, to identify semantically meaningful sub-populations whose examples have similar characteristics because of a shared underlying structure, previous work proposes to cluster examples and qualitatively examine clusters where the system performs poorly @xcite . in efforts to alleviate the necessity for manual analysis, recent works propose automatic methods to identify and explain underperforming clusters by associating keywords with underperforming clusters @xcite @xcite . however, identifying relevant keywords requires domain expertise and even then, they may not capture all error types. building on recent advancements in large language models (llms, @xcite @xcite , we aim to bridge this gap with open-ended natural language descriptions of error types. such descriptions can offer two major advantages: (1) language descriptions can help structure the generations or acquisitions of new labeled examples, and (2) articulation can allow developers to audit and intervene in the debugging process. with this premise, we introduce discern, an iterative approach to improve text-classfiers using precise natural language descriptions of their systematic errors (see figure 1 ). discern utilizes off-the-shelf large language models for distinct roles. an explainer llm is used to generate predicate-style descriptions foot_1 for underperforming clusters of training examples. to enhance precision, discern refines the predicates identified by the explainer through an interaction loop. in this loop, an evaluator llm assesses clustering validation set examples to identify data sub-populations where the classifier makes most errors, (2) cluster description generation using an explainer llm, (3) refining cluster descriptions through interaction between the explainer and evaluator for higher precision, and (4) model refinement through dataset aggregation. in experiments, on a set of three different text-classification tasks, we demonstrate the utility of descriptions generated by our framework in identifying meaningful systematic biases in classifiers. on the agnews dataset, by augmenting the training set with synthetically generated instances, we are able to achieve statistically significant improvements over baseline approaches that generate instances from examples of biased instances alone (section 5). in other data sets, discern can reduce misclassification rates in biased clusters by at least 10%. importantly, we show that language explanations of systematic biases are more helpful for users, and they are 25% more effective in identifying new biased instances ( ## related work automatic failure discovery. to identify failure modes in model predictions, early works employ manual inspection of model prediction errors @xcite or hypothesis testing @xcite , or adversarial testing @xcite . however, manual inspection requires extensive domain expertise and can be labor intensive. more recent efforts propose automatic frameworks that approach this problem through the lens of slice discovery @xcite , where a slice represents a portion of the dataset where the model more frequently makes errors in inference. closer to our work, @xcite propose seal, an interactive visualization tool to describe examples that exhibit high errors using natural language. different from the objective of this work, we propose to use natural language descriptions as an interpretable medium to refine text-based classifiers. ## method in this section, we first formally define our problem setup ( §3.1). next, we provide detailed descriptions of the key stages in discern ( §3.2). ## experiments in this section, we outline our experimental procedures to evaluate discern. datasets. we use three multiclass textclassification datasets: (1) trec @xcite -a six-class classification task comprising of questions labeled according to the type of the question, (2) ag news @xcite -a collection of news articles labeled according to the category of the article, and (3) covid tweets (tattle, 2020) -a sentiment-classification task that classifies tweets related to covid. classifiers. our framework is designed for developers who need to provide low-latency, high-throughput ml solutions with minimal bias. for our experiments, we hence use distilbert-base-uncased and roberta-large, as they are sufficient to handle complex tasks while being light enough for mobile deployment. this ensures that our approach is practical and effective for real-world applications, enabling users to benefit from advanced ml capabilities on mobile devices offline, without compromising performance or fairness. hence, we assume only the developer has access to the llms while the user at test-time does not have access to a model as complex. these classifiers are initially trained on a subset of the complete training set to simulate realistic learning scenarios with limited data. validation sets are subsampled to match these subsets, and the remaining training data is used as an unlabeled pool for active learning experiments. metric. we assess the utility of precise and semantically meaningful natural language explanations from discern by evaluating the performance of classifiers trained with augmented data on the validation set. we report the average performance and standard deviation across five random seeds, unless otherwise noted. baselines. for the dataset augmentation experiments, we use two baselines to compare with dis-cern. the first baseline is a naive augmentation (or no descriptions) baseline (no desc.), where we generate additional instances that adhere to the style and semantic content of the cluster exemplars. this baseline helps us to evaluate the role of natural language as a bottleneck for successful model debugging. to establish the value of refinement, our second baseline uses the explanations generated without iterative refinement to augment the training dataset. we refer to this baseline as discern-f foot_5 . it is worth noting that this baseline, while sharing similarities with the visualization approach proposed in @xcite , is distinct in its application for classifier improvement. 7 experimental setup. we utilize gpt-3.5-turbo-0125 as our explainer llm and data generator llm. as our evaluator llm, we use mixtral-8x7b-instruct @xcite , a recent open source instruction-tuned large language model. 8 choosing the evaluator llm to be different from the explainer llm, allows us to be leverage the diverse perspectives from different models and avoid confirmation bias @xcite . this strategic choice also serves as a safeguard against the potential pitfalls of confirmation bias, thus ensuring the quality and accuracy of cluster characterizations. we set the refinement threshold as recognizing more than 80% of examples within a target cluster and less than 20% of the examples outside the cluster and the maximum number of refinement iterations to five. for fair comparison across methods, we only perform dataset augmentation for those clusters that have passed the refinement threshold. additionally, we do not alter training hyperparameters between pre-debugging and post-debugging stages. a full list of hyperparameters used in our experiments can be found in appendix §a. ## results and analyses generating synthetic examples using discern descriptions leads to significant classifier improvement. we evaluate the accuracy of the distilbert classifier, fine-tuned with examples generated by various methods. in figure 2 presents descriptions generated by dis-cern-f and discern for the agnews datasets (examples for other datasets in figure 5 in the appendix). from the descriptions, we can observe the ability of discern to capture the nuances that enable targeted improvement. in particular, dis-cern descriptions provide a more precise observation of "debate" in the corresponding news articles, as opposed to discern-f. put together, these findings underscore the potential of discern to improve classifiers by addressing systematic errors. mentation and discern-f baselines using an independent samples t-test (@xmath3.05). ## ablations impact of embeddings used during clustering. we examine the impact of different embeddings on the initial stage of the discern framework, specifically focusing on clustering datapoints in the validation set. we compare the openai embeddings ada and v3 here for the trec dataset. as shown in ## conclusion in this work, we propose a framework discern, to address systematic biases and improve the performance of text classifiers. using large language models to generate precise natural language descriptions of errors, discern surpasses examplebased augmentation techniques to identify and rectify systematic biases in multiple classifiers across diverse datasets. through extensive experimentation, we have demonstrated the capability of discern in reducing misclassification rates and improving classifier accuracy, consistently outperforming alternative approaches. further, our human evaluations indicates user preference for understanding bias using natural language descriptions. overall, our findings underscore the potential of discern as a powerful tool to improve the performance of text classifiers, thus enabling the design of more reliable and equitable machine learning systems in various domains. building on our results, future research directions can explore ways to enhance other applications using the refinement approach used in our work, integrate discern into informing training recipes (such as, large language model training), and investigate biases transferred between different classifiers.