Exploring Continual Learning of Compositional Generalization in NLI (2024)

Abstract: Compositional Natural Language Inference (NLI) has been explored to assess the true abilities of neural models to perform NLI. Yet, current evaluations assume models to have full access to all primitive inferences in advance, in contrast to humans that continuously acquire inference knowledge. In this paper, we introduce the Continual Compositional Generalization in Inference (C2Gen NLI) challenge, where a model continuously acquires knowledge of constituting primitive inference tasks as a basis for compositional inferences. We explore how continual learning affects compositional generalization in NLI, by designing a continual learning setup for compositional NLI inference tasks. Our experiments demonstrate that models fail to compositionally generalize in a continual scenario. To address this problem, we first benchmark various continual learning algorithms and verify their efficacy. We then further analyze C2Gen, focusing on how to order primitives and compositional inference types, and examining correlations between subtasks. Our analyses show that by learning subtasks continuously while observing their dependencies and increasing degrees of difficulty, continual learning can enhance composition generalization ability.1

## introduction natural language inference (nli) determines the inferential relation between pairs of sentences, by classifying the hypothesis as being true (entailment), undecided (neutral), or false (contradiction) given the premise @xcite @xcite . the task has been researched for decades and has been shown to facilitate downstream nlu tasks such as text summarization @xcite , 1 data and code can be found in https://github .com/heidelberg-nlp/c2gen . recently, large pre-trained models (plms) have achieved results on par with human performance by fitting nli training data @xcite @xcite . despite the success of state-of-the-art plms, it remains unclear to what extent neural models have the ability to generalize when performing nli. to better assess the true abilities of plms to perform nli, compositional generalization @xcite evaluation has been proposed for nli @xcite @xcite . this novel task aims to evaluate whether models are able to predict unseen compositional inferences if they have seen their constituting primitive inferences in training. the left part of to better align with the compositional generalization ability in real-world situations, and to prepare applying compositional nli to dynamically compositional generalization for nli (cgen) continual compositional generalization for nli (c 2 gen) train a man fails to make a snowball a man plays with a ball s 1 a girl tries to do a stunt a girl performs a bicycle trick a girl tries to do a stunt a girl performs a bicycle trick a man manages to do a stunt a man performs a bicycle trick a man fails to catch his @xmath1: nli train and test instances for compositional generalization in a non-continual (cgen) and continual learning (c 2 gen) setting. test instances are unseen compositions, while veridical and nli inferences have been seen as primitives during training for compositional inference. c 2 gen simulates human learning via a continual learning stream, where one primitive task (s 1 ) is learned before the other (s 2 ). in contrast, cgen assumes that all data is accessible in advance and randomly shuffled for training. we simulate a continuous learning process by manipulating the order in which specific primitive nli inferences are encountered during training. the right part of to solve the unseen compositional inference test sample, a model needs to learn, in the first place, the primitive inference try to s s (s 1 ), and then catch his @xmath2. the c 2 gen nli task challenges models in two ways: it tests i) their ability to perform compositional generalization, by combining learned primitive inferences to solve unseen compositional inferences, and ii) doing this in a continual learning scenario that requires models to memorize and re-use primitive inferential knowledge they continually acquired. unlike the existing cgen nli task, c 2 gen nli allows us to evaluate whether models can learn primitive inferences continuously and efficiently. to facilitate research on c 2 gen nli, we establish an evaluation setup and task dataset for systematic analysis of the effect that continual learning has on the compositional generalization capabilities of models to perform nli. we design two sub-tasks to perform fine-grained compositional generalization analysis: i) compositional inference (task ci ) to explore how well a model performs compositional inference; and ii) primitive recognition (task p ), to evaluate a model's ability to resolve constituting primitive inferences. with our evaluation datasets and tasks, we conduct experiments in cgen and c 2 gen nli settings using a multi-task model for the different inference tasks. initial results show that with continual learning, models show inferior performance in compositional nli inference, which we show to be due to forgetting. to combat the forgetting issue, we benchmark a set of continual learning algorithms targeted at memorization. our results validate their effectiveness, but also show that memorization alone cannot solve the compositional inference task. to gain deeper understanding of the challenges involved in a continual scenario, we investigate the effect of learning primitive inferences in different orders, analyze correlations between primitive and compositional nli tasks, and the impact of ordering compositional inference types by difficulty. our findings highlight the importance of ordering inference types in continual learning according to dependencies and intrinsic difficulty. our main contributions are as follows: to better assess their inference abilities, research has started to explore to what extent they perform generalization when performing nli. this includes cross-genre @xcite and cross-lingual @xcite generalization or investigating the impact of heuristics @xcite . in this work, we evaluate the generalization ability in nli focusing on compositional generalization. that is, we test a model's capability of predicting unseen compositional inferences if constituting primitive inferences have been learned. early work evaluates compositional generalization for nli targeting novel compositions involving specific linguistic phenomena, e.g., composing predicate replacements and embedding quantifiers @xcite , focusing on lexical entailment and negation @xcite . recently, @xcite and @xcite extended the scope of compositional generalization evaluation to composition of veridical inference with customary nli, finding that plms are limited in compositionality. despite promising findings of the above studies, they all assume that models have full access to all training data in advance. this is in contrast with humans acquiring knowledge in a continuous fashion. to simulate human learning processes, continual learning has been proposed @xcite , enabling models to learn from a continuous data stream over time. @xcite and @xcite identified catastrophic forgetting being the main challenge in continual learning. to address this issue, various continual learning strategies have been proposed. among others, data-based algorithms @xcite are well-known. they use small memories to store seen training data, to be reused in later training steps. using such strategies, later work designed elaborate models to enhance the performance of tasks such as relation extraction @xcite , multilingual learning @xcite , or dialogue @xcite . by contrast, we use such continual strategies to analyze the impact of continual learning on compositional generalization ability in nli. both compositional and continual learning are pivotal aspects for evaluating the genuine capabilities of large plms. existing work @xcite @xcite indicates that although llms are pre-trained on large amounts of data, they still struggle in novel tasks and situations. thus, llms are expected to learn compositionally and continuously. some recent work aims to combine continual learning and compositionality. @xcite focus on continual learning in a sequence-to-sequence task. they propose to represent syntactic and semantic knowledge separately which allows to leverage compositionality for knowledge transfer. @xcite introduce a challenging benchmark that aims at continual learning of compositional semantics from visually grounded text. unlike them, we introduce a new task that focuses on continual learning of compositional generalization in nli. with this task, we i) analyze the challenge of compositional generalization in nli in a continual learning setup; ii) identify the effect of ordering primitive and compositional inference types according to their dependencies and difficulty; and iii) finally, in §9 we showcase the relevance of continual learning in nli in a concrete application, namely, persona dialogue. our finding ii), which highlights the impact of ordering primitive and compositional inference types based on their difficulty, is close to another machine learning paradigm, known as curriculum learning @xcite @xcite . this learning paradigm is inspired by the human classroom, and refers to training a model with a curriculum of increasing difficulty. existing work first focuses on assessing the difficulty of training samples. according to their difficulty, they further weight data samples and bias the model towards them @xcite , or organize data into subgroups and commence learning from the easiest batch @xcite @xcite . curriculum learning differs from continual learning in two respects: foot_0 i) learning schema. curriculum learning remains an offline learning method. it focuses on structuring the learning process to facilitate faster and more robust learning, instead, continual learning aims to adapt to new data over time while preserving past knowledge. ii) training atoms. curriculum learning concentrates on data points, instead, continual learning focuses on tasks or knowledge levels. despite these distinctions, curriculum learning and continual learning interact, such as adopting the ordering principle from curriculum learning to enhance continual learning. our findings, derived from the analysis of learning sequences in continual learning, could serve as empirical evidence supporting the principles of curriculum learning. ## controlling model size & data leakage plms @xcite have demonstrated impressive performance on many nlp tasks through pre-training on extensive data. recent advancements in large plms @xcite have achieved even more substantial improvements by further scaling models and data. however, this raises concerns regarding the reliability of generalization ## potential applications our work introduces the new c 2 gen nli task as a first step to explore the compositional generalization ability of models performing nli in a continual learning setup. similar to existing continual nlp-based tasks @xcite @xcite , the continual learning setup inspires models to learn new inference knowledge continuously, to avoid costs for model retraining. given such capabilities, the c 2 gen nli task setting can benefit future applications that require the understanding and induction of compositional inferences relative to dynamically updated knowledge stores. we use the widely researched task personalized dialogue agent (pda) @xcite as an example to show how the c 2 gen nli task could apply in a dynamic setting. pda proposes chitchat models that are conditioned on information provided in a given personality profile. figure 4 shows an illustration. existing approaches suffer from consistency issues when a chit-chat model generates utterances that contradict their personality profile. for example, i dislike rock'n roll contradicts i always listen to elvis songs. to solve this issue, some studies @xcite proposed to use nli to evaluate and improve consistency. we can achieve this by evaluating whether the persona information entails or contradicts a dialogue utterance. in dialogue, utterances show semantic composition effects when combining primitive information to form new and meaningful sentences. for example, i have a blue ipod composes information from i have an ipod and my favorite color is blue. this scenario aligns with the cgen nli setup. but the persona profile of a chit-chat is dynamic and gets updated over time. for example, fig. 4 shows persona information that is updated with a fact on a new product computer. the new primitive can be composed with previously learned primitives to generate novel compositional facts, e.g., i have a blue computer from i bought a computer and my favorite color is blue. here, re-training the model to update the profile's information state is expensive and time-consuming. by contrast, enabling the model to perform continual learning is a more viable and economic solution. the model is then deemed to evaluate compositional inferences relative to the updated information state, aligning with our new task c 2 gen nli. ## conclusions and future work we propose c 2 gen, a new challenge task for compositional generalization in nli, grounded in a continual learning scenario. our new task targets nlp applications that rely on composing information from continuously updated sources. by conducting rich analyses for this novel task, on our new benchmark, we show that in continual learning, neural models fail to generalize to unseen compositional inferences due to forgetting. with known continual learning strategies we can combat forgetting, but our analyses show that memorization alone cannot solve the compositional inference challenge. our in-depth analyses of c 2 gen show that the model benefits from learning primitive before compositional inference, and learning easy before hard inference subtasks. our findings highlight the importance of observing differences of primitive and compositional inference types, and establishing the relative difficulties of diverse primitive and compositional inference types. with this, we establish recipes that can improve continual learning to approach non-continual learning. new methods can determine optimal learning orders for diverse inference types, while ensuring sufficient diversity in the data stream. our insights could also benefit other compositional generalization methods, e.g., by ordering demonstrations in in-context learning along principles we established to improve compositional generalization in continual learning.