Visualizing the Relationship Between Encoded Linguistic Information and Task Performance (2022)

Abstract: Probing is popular to analyze whether linguistic information can be captured by a well-trained deep neural model, but it is hard to answer how the change of the encoded linguistic information will affect task performance. To this end, we study the dynamic relationship between the encoded linguistic information and task performance from the viewpoint of Pareto Optimality. Its key idea is to obtain a set of models which are Pareto-optimal in terms of both objectives. From this viewpoint, we propose a method to optimize the Pareto-optimal models by formalizing it as a multi-objective optimization problem. We conduct experiments on two popular NLP tasks, i.e., machine translation and language modeling, and investigate the relationship between several kinds of linguistic information and task performances. Experimental results demonstrate that the proposed method is better than a baseline method. Our empirical findings suggest that some syntactic information is helpful for NLP tasks whereas encoding more syntactic information does not necessarily lead to better performance, because the model architecture is also an important factor.

## introduction recent years have witnessed great success of deep neural networks for natural language processing tasks, such as language modeling @xcite and neural machine translation @xcite . the excellent task performance they achieved spiked the interest in interpreting their underlying mechanism. since linguistic knowledge is crucial in natural languages, an emerging body of literature uses probes @xcite @xcite to investigate whether a standard model trained * equal contribution. work done while j. xiang was an intern at tencent ai lab. however, the above probing only extracts linguistic information from a fixed standard model, which helps little to understand the relationship between the task performance and linguistic information encoded by the model. for example, under their methodology, it is difficult to answer the following two questions. first, would adding linguistic information be beneficial for an nlp model; second, is it harmful when this linguistic information is reduced. therefore, it is still an open and intriguing question to reveal how task performance changes with respect to different amounts of linguistic information. to this end, this paper proposes a novel viewpoint to study the relationship between task performance and the amount of linguistic information, inspired by the criterion of pareto optimality which is widely used in economics @xcite . our main idea is to obtain pareto-optimal models on a test set in terms of both linguistic information and task performance and then visualize their relationship along with these optimal models. by comparing a standard model with these optimal models, it is clear to answer the question that whether adding the encoded information is helpful to improve the task performance over the standard model , as illustrated in figure 1 , where the points on the line are pareto-optimal and the red triangle denotes the standard model with best performance. nevertheless, it is typically intractable to obtain the pareto-optimal models according to both dimensions on test data. to address the challenge, we propose a principled method to approximately optimize the pareto-optimal models on the training data which can be expected to generalise well on test sets according to statistical learning theory @xcite . formally, the approach can be regarded as a multi-objective optimization problem: during the learning procedure, it optimizes two objectives, i.e., the task performance and extracted linguistic information. in addition, we develop a computationally efficient algorithm to address the optimization problem. by inspecting the trend of those pareto-optimal points, the relationship between task performance and linguistic information can be clearly illustrated. back to our questions, we also consider two instances within the proposed methodology: one aims to maximize the amount of linguistic information (i.e., adding) while the other tries to minimize it (i.e., reducing). we conduct experiments on two popular nlp tasks, i.e., machine translation and language modeling, and choose three different linguistic properties, including two syntactic properties (part-of-speech and dependency labels) and one phonetic property. we investigate the relationship between nmt performance and each syntactic information, and the relationship between lm performance and phonetic information. for machine translation, we use lstm, i.e., rnn-search @xcite , and transformer @xcite as the main model architectures, and conduct our experiments on en ⇒ de and zh ⇒ en tasks. for language modeling, we employ the lstm model and conduct experiments on the penn treebank dataset. the experimental results show that: i) syntactic information encoded by nmt models is important for mt task and reducing it leads to sharply decreased performance; ii) the standard nmt model obtained by maximum likelihood estimation (mle) is paretooptimal for transformer but it is not the case for lstm based nmt; iii) reducing the phonetic in-formation encoded by lm models only makes task performance drop slightly. in summary, our contributions are three-fold: 1. we make an initial attempt to study the relationship between encoded linguistic information and task performance, i.e., how the change of linguistic information affects the performance of models. ## related work probe with the impressive performance of neural network models for nlp tasks @xcite @xcite @xcite , people are becoming interested in understanding neural models @xcite @xcite . one popular interpretation method is probe @xcite , also known as auxiliary prediction @xcite and diagnostic classification @xcite , which aims to understand how neural models work and what information they have encoded and used. from the perspective of information theory, @xcite and @xcite show that probes can be used to estimate the amount of linguistic information captured by a model. however, recent research studies point out that probes fail to demonstrate whether the information is used by models. for example, @xcite show that the probe can also achieve high accuracy in predicting randomly generated tags, which is useless for the task. @xcite present that the representations encode the linguistic properties even if they are invariant and not required for the task. instead of studying the encoded linguistic information by training a probe for fixed representations, in this work we study how the amount change of linguistic information affects the performance of nlp tasks. information removal information removal is crucial in the area of transfer learning @xcite @xcite and fairness learning @xcite , where people want to remove domain information or bias from learned representations. one popular method is adversarial learning @xcite , which trains a classifier to predict the properties of representations, e.g., domain information or gender bias, while the feature extractor tries to fool the classifier. in this work, when using our method to reduce the linguistic information in the representations, we find that our multi-objective loss function is the same form as adversarial learning, which provides the theoretical guarantee for using adversarial learning to find the pareto-optimal solutions to a multi-objective problem. recently, @xcite also propose to study the role of linguistic properties with the idea of information removal @xcite . however, the representations got by their method may not be pareto-optimal, because it only minimizes the mutual information, but ignores the objective of task performance. on the contrary, our proposed method optimizes towards both objectives, thus our results can be used to visualize the relationship between linguistic properties and task performance. pareto optimality the idea of pareto optimality @xcite is an important criterion in economics, where the goal is to characterize situations where no variable can be better off without making at least one variable worse off. it has been also widely used in the area of sociology and game theory @xcite . in addition, in artificial intelligence @xcite use pareto optimality to solve group fairness problem @xcite proposed to optimize an mt system on multiple metrics based on the theory of pareto optimality. in particular, @xcite propose a variant of probing on the hidden representation of deep models and they consider pareto optimality in terms of both objectives similar to our work. comparing with their work, one difference is the choice of objectives. another significant difference is that they optimize probing model in a conventional fashion, and thus are unable to study the relationship between linguistic information and task performance. ## visualizing relationship via pareto optimality we consider the relationship between linguistic information and task performance for two popular tasks in nlp, i.e., machine translation and language modeling. let @xmath0, x 2 , ..., x n } be a sentence and @xmath1, s 2 , ..., s n } be the labels of the linguistic property of x, where s i is the label for x i , e.g., pos tag. on both tasks, a deep model typically encodes x into a hidden representation h with a sub-network e parameterized by θ e : @xmath2, and then uses another sub-network d parameterized by θ d to map h into an output. ## experiment results in the following experiments, "model + property", e.g., "transformer+pos", which is corresponding to eq. 4 and studies how adding the linguistic properties information affects the task performance. instead, "model -property", e.g., "transformer-pos", which is corresponding to eq. 5 and studies how removing the linguistic properties information affects the task performance. it is worth noting that merging the two frontiers of + property and -property together would lead to trivial results, because pareto optimal points of the + property are more likely to dominate. however, we think the frontier of -property is helpful for answering the question that whether reducing the encoded linguistic information would affect the model performance. therefore, we plot the pareto frontiers for the two objectives independently. ## conclusion this paper aims to study the relationship between linguistic information and the task performance and proposes a new viewpoint inspired by the criterion of pareto optimality. we formulate this goal as a multi-objective problem and present an effective method to address the problem by leveraging the theory of pareto optimality. we conduct experiments on both mt and lm tasks and study their performance with respect to linguistic information sources. experimental results show that the presented approach is more plausible than a baseline method in the sense that it explores better models in terms of both encoded linguistic information and task performance. in addition, we obtain some valuable findings as follows: i) syntactic information encoded by nmt models is important for mt task and reducing it leads to sharply decreased performance; ii) the standard nmt model obtained by minimizing mle loss is pareto-optimal for transformer but it is not the case for lstm based nmt; iii) reducing the phonetic information encoded by lm models only leads to slight performance drop.