K now MAN : Weakly Supervised Multinomial Adversarial Networks (2021)

Abstract: The absence of labeled data for training neural models is often addressed by leveraging knowledge about the specific task, resulting in heuristic but noisy labels. The knowledge is captured in labeling functions, which detect certain regularities or patterns in the training samples and annotate corresponding labels for training. This process of weakly supervised training may result in an over-reliance on the signals captured by the labeling functions and hinder models to exploit other signals or to generalize well. We propose KnowMAN, an adversarial scheme that enables to control influence of signals associated with specific labeling functions. KnowMAN forces the network to learn representations that are invariant to those signals and to pick up other signals that are more generally associated with an output label. KnowMAN strongly improves results compared to direct weakly supervised learning with a pre-trained transformer language model and a feature-based baseline.

## introduction neural approaches rely on labeled data sets for training. for many tasks and languages, such data is either scarce or not available at all. knowledgebased weak supervision tackles this problem by employing labeling functions (lfs). lfs are manually specified properties, e.g. keywords, that trigger the automatic annotation of a specific label. however, these annotations contain noise and biases that need to be handled. a recent approach for denoising weakly supervised data is snorkel @xcite . snorkel focuses on estimating the reliability of lfs and of the resulting heuristic labels. however, snorkel does not address biases on the input side of weakly supervised data, which might lead to learned representations that overfit the characteristics of specific lfs, hindering generalization. we address the problem of overfitting to the lfs in this paper. other approaches tackle such overfitting by deleting the lf signal completely from the input side of an annotated sample: for example, @xcite strip out emoticons that were used for labeling the sentiment in tweets, and @xcite mask the entities used for distant supervision of relation extraction training data @xcite . however, as lfs are often constructed from the most prototypical and reliable signals (e.g., keywords), deleting them entirely from the feature space might -while preventing over-reliance on them -hurt prediction quality considerably. however, we find a way to blur the signals of the lfs instead of removing them. in this work we propose knowman (knowledge-based weakly supervised multinomial adversarial networks), a method for controllable soft deletion of lf signals, allowing a trade-off between reliance and generalization. inspired by adversarial learning for domain adaptation @xcite , we consider lfs as domains and aim to learn a lf-invariant feature extractor in our model. knowman is composed of three modules: a feature extractor, a classifier, and a discriminator. specifically, knowman employs a classifier that learns the actual task and an adversarial opponent, the lf-discriminator, that learns to distinguish between the different lfs. upstream of both is the shared feature extractor to which the gradient of the classifier and the reversed gradient of the discriminator are propagated. in our experiments, the feature extractor for encoding the input is a multi-layer perceptron on top of either a bag-of-words vector or a transformer architecture, but knowman is in principle usable with any differentiable feature extractor. knowman consistently outperforms our baselines by 2 to 30% depending on the dataset. by setting a hyperparameter λ that controls the influence of the adversarial part we can control the degree of discarding the information of lf-specific signals. the optimal λ value depends on the dataset and its properties. the contributions of this work are i) proposing an adversarial architecture for controlling the influence of signals associated with specific lfs, ii) consistent improvements over weakly supervised baselines, iii) release of our code 1 . to our knowledge, we are the first that apply adversarial learning to overcome the noisiness of labels in weak supervision. ## method our approach is composed of three interacting modules i) the shared feature extractor f s , ii) the classifier c and iii) the lf discriminator d. the loss function of c rewards the classifier c for predicting the correct label for the instance, and the gradient is used for optimizing the shared feature extractor and classifier modules towards that goal. at the same time, the loss function for the lf-discriminator d rewards predicting which lf was responsible for labeling an instance. however, in adversarial optimization, knowman backpropagates the reversed gradient for the lf-discriminator, hence the information indicative for distinguishing between specific lfs is weakened throughout the network. the hyperparameter λ is used to control the level 1 https://github.com/luisamaerz/knowman of weakening the signals -the higher we choose the value the more influence is assigned to the discriminator information that goes into d. the result of the interplay between classifier and lf-discriminator is a shared feature representation that is good at predicting the labels while reducing the influence of lf-specific signals, encouraging the shared feature extractor to take other information (correlated with all lfs for a class) into account. in figure 1 , the arrows illustrate the training flow of the three modules. due to the adversarial nature of the lf discriminator d, it has to be trained with a separate optimizer (red arrows), while the rest of the network is updated with the main optimizer (green arrows). when d is trained the parameters of c and f s are frozen and vice versa. to calculate the losses we utilize canonical negative log-likelihood loss (nll) and use it for both, the classifier and the lf discriminator. the classification nll can be formalized as: here the shared feature extractor has two different objectives: i) help c to achieve better classification performance and ii) make the feature distribution invariant to the signals from the lfs. this is captured by the shared objective: ## related work adversarial neural networks have been used to reduce the divergence between distributions, such as @xcite , @xcite and @xcite . the latter proposed an architecture for gradient reversal and a shared feature extractor. unlike us, they focused on a binary domain discriminator. similarly, @xcite ) use an adversarial approach in a multinomial scenario for domain adaptation. some works on adversarial learning in the context of weak supervision focus on different aspects and only share similarity in name with our approach: @xcite use virtual adversarial training @xcite for perturbing input representations, which can be viewed as a general regularization technique not specific to weakly supervised learning. @xcite use generative adversarial mechanisms for selecting negative training instances that are difficult to discriminate from heuristically annotated ones for a classifier. several approaches have focused on denoising the labels for weakly supervised learning @xcite @xcite . snorkel @xcite is one of the most general approaches in this line of work. however, snorkel only models biases and correlations of lfs, and does not consider problems of weak supervision that may stem from biases in the features and learned representations. a recent approach that focuses on denoising weakly supervised data is @xcite . knodle is a framework for comparison of different methods that improve weakly supervised learning. we use some of their datasets for our approach but denoise the signals of the lfs during training. ## conclusion we propose knowman -an adversarial neural network for training models with noisy weakly supervised data. by integrating a shared feature extractor that learns labeling function invariant features, knowman can improve results on weakly supervised data drastically across all experiments and datasets in our setup. the experiments also show that the adverse effect of labeling function-specific signals is highly dependent on the datasets and their properties. therefore, it is crucial to fine-tune the λ parameter on a validation set to find the optimal degree of blurring the labeling function signals. since the modules in the knowman architecture are easily exchangeable, knowman can be applied to any architecture and dataset labeled with heuristic labeling functions.