Leveraging Multiple Teachers for Test-Time Adaptation of Language-Guided Classifiers (2023)

Abstract: Recent approaches have explored language- guided classifiers capable of classifying examples from novel tasks when provided with task-specific natural language explanations, instructions or prompts (Sanh et al., 2022; R. Menon et al., 2022). While these classifiers can generalize in zero-shot settings, their task performance often varies substantially between different language explanations in unpredictable ways (Lu et al., 2022; Gonen et al., 2022). Also, current approaches fail to leverage unlabeled examples that may be available in many scenarios. Here, we introduce TALC, a framework that uses data programming to adapt a language-guided classifier for a new task during inference when provided with explanations from multiple teachers and unlabeled test examples. Our results show that TALC consistently outperforms a competitive baseline from prior work by an impressive 9.3% (relative improvement). Further, we demonstrate the robustness of TALC to variations in the quality and quantity of provided explanations, highlighting its potential in scenarios where learning from multiple teachers or a crowd is involved. Our code is available at: https://github.com/WeiKangda/TALC.git.

## introduction inductive learning from examples has underpinned many successful machine learning applications. however, classifiers trained solely from labeled examples often struggle to generalize in scenarios with limited labeled data. in contrast, humans can learn new concepts through natural language conversations @xcite . inspired by this phenomenon, recent approaches use natural language explanations, instructions, and prompts to train language-guided classifiers @xcite @xcite @xcite . while these classifiers can perform zero-shot classification, they have several limitations. firstly, they more people that travel abroad have taken travel insurance. travelers who are 29 and older take traveler insurance. most college graduate have taken travel insurance. ## talc in this section, we present the details of our framework, talc. talc leverages data programming to adapt a base natural language explanation-guided classifier on a novel task during inference. problem setup. we assume a language-guided classifier, m lc , which can take an explanation e from a teacher and example x to predict a label m lc (x, e) . a language-guided classifier refers to a classifier that utilizes one or more natural language explanations to make predictions. our objective is to make predictions for a batch of test samples, represented as {x test , y test } 1:n , where y test represents the unobserved ground-truth labels corresponding to the samples in x test , and n denotes the number of samples. during test-time adaptation, our aim is to effectively adapt the classifier to the specific task at hand and infer the true labels for x test . existing methods for test-time adaptation typically assume an online setting, where examples are processed one at a time @xcite . in contrast, we assume a priori access to the entire test set of the task. this assumption allows us to leverage the empirical distribution of the unlabeled data for semi-supervised learning. our setting aligns with real-world scenarios, such as developing a product-category classifier for an e-commerce platform, where the complete database of products (including the test set) is known in advance. for situations where test samples are observed one at a time, it is still possible to utilize talc for adapting a base classifier. this involves a "warm-up" phase, where the base classifier is used off-the-shelf for a few samples, followed by adaptation using talc. while this usage scenario is not the primary focus of our work, we provide a description of how talc can be employed in such cases in appendix §a for brevity. overview. as depicted in figure 1 , for a new task t new , we are provided with m natural language explanations @xmath0, e 2 , . . . , e m }, and a set of examples {x @xmath1. to generate the classifier outputs, we iterate through each explanation e j for every example x i , and compute m ij := m lc (x i , e j ). this yields a labeling matrix m with a shape of n × m. next, we introduce a test-time adaptation procedure: talc, to compute the final labels ỹ utilizing the m . this procedure essentially implements a function f : @xmath2, which we describe in the rest of this section. test-time adaptation. the objective of talc is to adapt the language-guided classifier, m lc , on a novel task, t new during inference. we illustrate the adaptation procedure in algorithm 1. first, we split the test set into two disjoint sets -the adaptation algorithm 1 talc inputs: language-guided classifier m lc , test set x test , task explanations e, adaptation ratio α 1: n adapt ← α × |x test | 2: x adapt test ← x test [: n adapt ] 3: x held-out test ← x test [n adapt :] 4: train the label aggregator l agg w on x adapt test ŵ ← argmax w p w (x, e; m lc (using em) 5: infer ỹt alc for x test using the learned ŵ. ỹt alc := argmax y p ŵ(y |x test , e, m lc ) return ỹt alc set and the held-out test. the adaptation set is utilized by talc to adapt m lc . the proportion of the test set that forms the adaptation set is defined by an adaptation ratio, α ∈ [0, 1], defined as α = |adaptation set| |test set| we also partition the labeling matrix m into m adapt and m held-out by choosing the rows corresponding to samples in the adaptation set and held-out set, respectively. to model the dependence between the (latent) inferred labels and m adapt , we use data programming techniques @xcite to train a label aggregator, l agg w , with task-specific parameters w. we use the learned parameters (which correspond to weights learned for each explanation) to aggregate predictions in m (both m adapt and m held-out ) and infer the labels, ỹt alc . label aggregator. the label aggregator is a graphical model that defines the joint probability of explanations e, examples x and latent (true) labels y for a given language-guided classifier as: ## experiment and analysis in this section, we evaluate the zero-shot adaptation performance of talc on classification tasks, followed by a detailed analysis of talc's robustness. ## discussion & conclusion in this paper, we introduce talc, a framework for test-time adaptation of language-guided classifiers that leverages multiple sources of supervision. one conceptual advantage of talc is its agnosticism towards the choice of language-guided classifier, leaving room for future exploration with different models. talc is flexible in terms of what aspects of explanations, teachers and unlabeled examples are used to train the label aggregator. while our approach here trains a label-aggregator for every new task (since our features for the label aggregator include identities of individual explanations), in principle it should be possible to train a unified label aggregator across tasks based on featurized representations of tasks and explanations. scaling up talc to new datasets with a larger number of tasks would provide valuable insights into its generalizability. our experiments reveal talc's susceptibility to malicious attacks and bad-faith actors, which future works can improve on. despite these challenges, talc suggests exciting opportunities for harnessing the collective wisdom of teachers in real-world applications.