Analyzing Curriculum Learning for Sentiment Analysis along Task Difficulty, Pacing and Visualization Axes (2021)

Abstract: While Curriculum Learning (CL) has recently gained traction in Natural language Processing Tasks, it is still not adequately analyzed. Previous works only show their effectiveness but fail short to explain and interpret the internal workings fully. In this paper, we analyze curriculum learning in sentiment analysis along multiple axes. Some of these axes have been proposed by earlier works that need more in-depth study. Such analysis requires understanding where curriculum learning works and where it does not. Our axes of analysis include Task difficulty on CL, comparing CL pacing techniques, and qualitative analysis by visualizing the movement of attention scores in the model as curriculum phases progress. We find that curriculum learning works best for difficult tasks and may even lead to a decrement in performance for tasks with higher performance without curriculum learning. We see that One-Pass curriculum strategies suffer from catastrophic forgetting and attention movement visualization within curriculum pacing. This shows that curriculum learning breaks down the challenging main task into easier sub-tasks solved sequentially.

## introduction learning in humans has always been a systematic approach of handling the fundamentals first and then learning incrementally harder concepts. cognitive science has established that this leads to a clearer, robust understanding and the most efficient learning @xcite . indeed, something similar can be applied while training neural networks. @xcite show that curriculum learning (cl) -sampling data based on increasing order of difficulty leads to quicker generalization. @xcite the authors contributed equally to the work. @xcite also demonstrate that cl increases the rate of convergence at the beginning of training. their cl strategy involved sorting the training data based on transfer learning from another network trained on a larger dataset. the idea of reordering samples has been explored in various approaches. in this paper, we evaluate the "easiness" with a network and train the samples on another network. hence, even in our case, we shall pick easier points regarding a target hypothesis then train another network that optimizes its current hypothesis. this idea has been suggested by previous works as well. @xcite . @xcite proposed baby steps and one pass curriculum techniques using sentence length as a curriculum strategy for training lstm @xcite on sentiment analysis. a tree-structured curriculum ordering based on semantic similarity is proposed by @xcite . @xcite propose an auxiliary network that is first trained on the dataset and used to calculate difficulty scores for the curriculum order. cl is also used in nlp within tasks such as question answering @xcite and nlg for answer generation @xcite . for sentiment analysis, @xcite propose a strategy derived from sentence length, where smaller sentences are considered easier and are provided first. @xcite provide a tree-structured curriculum based on semantic similarity between new samples and samples already trained. @xcite suggest a curriculum based on handcrafted semantic, linguistic, syntactic features for word representation learning. some of these works @xcite @xcite have suggested that baby steps performs better than one pass. we perform experiments using both techniques. while the idea of curriculum remains the same across these works, the strategy itself to decide sample ordering is often diverse. ## axis i: curriculum learning: one pass and baby steps while curriculum learning as defined by @xcite is not constrained by a strict description, later related works @xcite @xcite make distinctions between baby steps curriculum and one-pass curriculum. most of these previous works have also shown the dominance of baby steps over one-pass. baby steps and one pass curriculum can be defined as follows. for every sentence s @xmath0, its sentiment is described as y @xmath1, 1, 2, 3, 4}, where @xmath2, 2...n} for n data points in d. for a model f w , its prediction based on s i will be f w (s i ). loss l is defined on the model prediction and actual output as l(y i , f w (s i )) and cost defining the task as c(d, f w here, curriculum strategy s(s i ) defines an "easiness"/"difficulty" quotient of sample s i . furthermore, one pass makes distinct, mutually exclusive sets of the training data and trains on each one of these sets one by one. this makes it faster as compared to baby steps, where data cumulatively increases in each pass. this implies that the model is trained on previous data and the additional harder data. to analyze the two methods for executing cl we choose two curriculum strategies (difficulty scoring function). furthermore, we also experiment with an individual setting explained in following sections. ## axis iii: attention movement visualization visualization of attention @xcite is an important and popular visualization method for interpreting the prediction in these models. previous works such as @xcite have visualized attentions to identify where does bert look. @xcite also show in attention visualization that various heads of the transformer look at various linguistic details. in this section we use attention visualization to qualitatively analyze and explain how the model's focus on the sentence changes as the various stages (when model encounters new and harder data) of cl progresses. it is important to note that bert has n layers and h heads. within each of these n xh heads there lies a t xt self attention from each input time stamp to every other time stamp. where t is the maximum sentence length. thereby, there are a total of n xh 2d t xt attention visualizations observed in bert. ## conclusion in this paper we conduct experiments to analyze cl. we first hypothesize the failure of one pass for curriculum learning in text classification. we conduct an individual non curriculum experiment, to show that one pass heavily suffers with catastrophic forgetting. unless this forgetting is tackled, one pass will continue to under perform even no curriculum settings. then, we analyze cl along task difficulty hypothesis to establish firmly that cl only helps when coupled with difficult tasks. the scope of improvement may diminish or even be negative for tasks which are already easy. finally we propose movement visualizations to analyse cl. we observe that for hard examples, cl breaks down the task into multiple phases. these phases in a way rule out certain sections of the sentence for sentiment prediction first, such that when the model encounters harder data in later phases, it is clear on what not to focus on. furthermore, after both the experiments, we can conclude that the reason cl might be deleterious to performance in easier tasks could be because in these tasks, multiple phases are unnecessary. if the model prediction was already correct in the first couple of phases, then further phases may only move the prediction away hence leading to poor performance.