Year: 2020

Abstract:
Motivated by the human’s ability to continually learn and gain knowledge over time, several research efforts have been pushing the limits of machines to constantly learn while alleviating catastrophic forgetting (Kirkpatrick et al., 2017b). Most of the existing methods have been focusing on continual learning of label prediction tasks, which have fixed input and output sizes. In this paper, we propose a new scenario of continual learning which handles sequence-to-sequence tasks common in language learning. We further propose an approach to use label prediction continual learning algorithm for sequence-to-sequence continual learning by leveraging compositionality (Chomsky, 1957). Experimental results show that the proposed method has significant improvement over state-of-the-art methods. It enables knowledge transfer and prevents catastrophic forgetting, resulting in more than 85% accuracy up to 100 stages, compared with less than 50% accuracy for baselines in instruction learning task. It also shows significant improvement in machine translation task. This is the first work to combine continual learning and compositionality for language learning, and we hope this work will make machines more helpful in various tasks. The code is available at: https://github.com/yli1/CLCL.

heading: 1 INTRODUCTION
text: Continual Learning is a key element of human intelligence that enables us to accumulate knowledge from a never ending stream of data. From machine learning perspective, there is no guarantee that information accessed at a current task to be revisited later in future tasks. This leads to what is known as Catastrophic Forgetting (McCloskey & Cohen, 1989; McClelland et al., 1995); significant drop in previously obtained knowledge of an AI system as it learns new information and gets less/no exposure to old information. Several approaches have been proposed to bridge the gap between machine and human continual learning skills with catastrophic forgetting being the central problem. Existing continual learning methods have focused mostly on classification tasks (e.g. (Rebuffi et al., 2017; Lopez-Paz & Ranzato, 2017; Shin et al., 2017; Li & Hoiem, 2016; Shmelkov et al., 2017; Triki et al., 2017; Li & Hoiem, 2016; Triki et al., 2017; Rusu et al., 2016; Lee et al., 2017; Elhoseiny et al., 2018; Kirkpatrick et al., 2017c; Zenke et al., 2017; Chaudhry et al., 2018)).
In this paper, we propose a new scenario of continual learning which handles sequence-to-sequence tasks common in language learning. Continual language learning is an open question which has not been studied extensively in machine learning and NLP domains. It may facilitate a variety of applications in NLP systems. For example, it enables a robot to keep on learning new tasks via natural language instruction, a conversational agent to adapt to new conversation topics quickly, and a neural machine translation system to expand its vocabulary continually.
Humans learn language by leveraging systematic compositionality, the algebraic capacity to understand and produce large amount of novel combinations from known components (Chomsky, 1957; Montague, 1970). Compositional generalization is critical in human cognition (Minsky, 1986; Lake et al., 2017). It also helps humans acquire language from a small amount of data, and expand vocabulary sequentially (Biemiller, 2001). In contrast to humans’ such ability, state-of-the-art continual learning approaches do not achieve the expected generalization. Table 1 and Figure 3 show the performance of state-of-the-art approaches (Kirkpatrick et al., 2017a; Aljundi et al., 2018) when tested
∗Corresponding author: yuanpeng16@gmail.com †Work partially done while visiting Baidu Research
in instruction learning and machine translation tasks. This highlights the lack of generalization of these approaches, designed after classification tasks, on sequence generation language tasks and the importance of studying the design of continual learning methods for language learning.
Modeling continual language learning with improved compositional understanding is at the heart of this paper. More concretely, we address the challenge of open and growing vocabulary problem with continual learning. It requires optimizing over two objectives. First, previously learned knowledge should be transferred and combined with new knowledge. Second, the learned model should resist catastrophic forgetting (Kirkpatrick et al., 2017b), where a model adapted to a new distribution no longer works on the original one. To achieve these objectives, we use compositionality to separate semantics and syntax of an input sentence, so that we can convert label prediction algorithm to sequence to sequence algorithm for continual learning.
The contributions of this paper can be summarized as follows.
• We propose a new scenario of continual learning which handles sequence-to-sequence tasks common in language learning.
• We propose an approach to use label prediction continual learning algorithm for sequenceto-sequence continual learning by leveraging compositionality. To our knowledge, this is the first work for applying compositionality to continual learning of sequence-to-sequence tasks, targeting at both knowledge transfer to later stages and catastrophic forgetting prevention on previous stages.
• Experiments show that the proposed method has significant improvement over multiple state-of-the-art baselines in both knowledge transfer and catastrophic forgetting prevention with almost 85% accuracy up to 100 stages on language instruction task. It also shows significant improvement in a machine translation task.

heading: 2 RELATED WORK
text: Our work is closely related to compositionality and continual learning or lifelong learning. Here, we briefly review some related work in these areas.
Compositionality Compositional generalization is critical in human cognition (Minsky (1986); Lake et al. (2017)), and it helps humans acquire language from a small amount of data, and expand vocabulary sequentially (Biemiller (2001)). Therefore, researchers have been studying how to enable human-level compositionality in neural networks for systematic behaviour (Wong & Wang, 2007; Brakel & Frank, 2009), counting ability (Rodriguez & Wiles, 1998; Weiss et al., 2018) and sensitivity to hierarchical structure (Linzen et al., 2016). Recently, people proposed multiple related tasks (Lake & Baroni, 2018; Loula et al., 2018; Lake et al., 2019) and methods (Lake & Baroni, 2018; Loula et al., 2018; Kliegl & Xu, 2018) with different kinds of RNN models and attention mechanisms. Though these methods enable generalization when the training and test sentences have small difference, it has been an open problem (Yang et al., 2019) to reach human-level compositionality generalization. More recently, Li et al. (2019) proposed an entropy regularization method that achieves high performance on several NLP tasks. In this paper, we study compositionality from continual learning angle. By leveraging the compositional learning approach, we propose the con-
tinual learning algorithm by encoding compositionality into DNN. To our knowledge, our work is the first to apply compositionality to continual learning in DNN.
Continual learning Continual learning or lifelong learning involves multiple stages. Each stage has a set of classes and corresponding data, and the training can only access the data in the current stage. Based on the way for overcoming catastrophic forgetting, continual learning work may be categorized into data-based and model-based approaches. In data-based approaches, some methods store previous data either with replay buffer (Rebuffi et al., 2017; Lopez-Paz & Ranzato, 2017) or generative model (Shin et al., 2017); other approaches (Li & Hoiem, 2016; Shmelkov et al., 2017; Triki et al., 2017), employ the new task data to estimate and preserve the model behavior on previous tasks, mostly via a knowledge distillation loss as proposed in Learning without Forgetting (Li & Hoiem, 2016). These approaches are typically applied to a sequence of tasks with different output spaces. To reduce the effect of distribution difference between tasks, (Triki et al., 2017) propose to incorporate a shallow auto-encoder to further control the changes to the learned features, while (Aljundi et al., 2017) train a model for every task (an expert) and use auto-encoders to help determine the most related expert at test time given an example input. In model-based approaches, some methods dynamically increase model size for the growing information (Rusu et al., 2016; Xu & Zhu, 2018); other methods (Fernando et al., 2017; Lee et al., 2017; Kirkpatrick et al., 2017c; Zenke et al., 2017) focus on the parameters of the network. The key idea is to define an importance weight ωk for each parameter θk in the network indicating the importance of this parameter to the previous tasks. When training a new task, network parameters with high importance are discouraged from being changed. In Elastic Weight Consolidation, (Kirkpatrick et al., 2017c) estimate the importance weights Ω based on the inverse of the Fisher Information matrix. (Zenke et al., 2017) propose Synaptic Intelligence, an online continual model where Ω is defined by the contribution of each parameter to the change in the loss, and weights are accumulated for each parameter during training. Memory Aware Synapses (Aljundi et al., 2018) measures Ω by the effect of a change in the parameter to the function learned by the network, rather than to the loss. This allows to estimate the importance weights not only in an online fashion but also without the need for labels. Finally, Incremental Moment Matching (Lee et al., 2017) is a scheme to merge models trained for different tasks. Modelbased methods seem particularly well suited for our setup, given that we work with an embedding instead of disjoint output spaces. In this paper, we propose a method with minimal increase of model structure in each stage, and we leverage compositionality with explainable mechanisms that align with human learning.

heading: 3 CONTINUAL LEARNING WITH COMPOSITIONALITY

heading: 3.1 PROBLEM DEFINITION
text: Conventional continual learning algorithms are designed after fixed size input and label classification output. However in many tasks, such as language, both input and output are sequences and bridging this gap between continual learning and sequence-to-sequence models is at the heart of our work. We facilitate more accurate continual sequence-to-sequence artificial learner by proposing an approach that can leverage Label Prediction Continual Learning (LP-CL) compositionally into Sequence-toSequence Continual Learning (S2S-CL) .
LP-CL: Label Prediction Continual Learning In LP-CL, we consider a word to label mapping problem, with input word x and corresponding output label y. In initial learning stage, y takes one of K classes: y ∈ Vinit = {c1, c2, . . . , cK}. In continual learning stage, y takes a new class: y ∈ Vcont = {cK+1}. In test, y takes all previous classes: y ∈ Vinit ∪ Vcont. For example, in language instruction task, input x is a primitive word, and output Y is the corresponding action symbol; in word-level machine translation, input x is an English content word, and output Y is the corresponding French word. In initial training stage, we have multiple input word and output symbol pairs. In continual learning stage, we have a new input and output word pair. We train a model in initial training stage, and do not use the initial training data any longer in the rest of training stages. We then switch to the data in continual learning stage, and continually update the model. In test stage, we evaluate whether model can predict labels from both initial and continual learning stages. We denote label prediction continual learning model (LP-CL) as P (y|x; θ) .
S2S-CL: Sequence to Sequence Continual Learning For sequence to sequence continual learning (S2S-CL), we consider sequential input X = x1, x2, . . . , xn and output Y = y1, y2, . . . , ym. Each output label yi, i ∈ {1, . . . ,m} is from the corresponding label set in label prediction problem. We want to make a model P (Y |X) for sequence to sequence continual learning. Our goal is to facilitate better Sequence to Sequence Continual Learning (S2S-CL) capability quantified as P (Y |X) by leveraging access and joint-learning with Label Prediction Continual Learning (LP-CL) model, P (y|x; θ).

heading: 3.2 USE LP-CL ALGORITHM FOR S2S-CL WITH COMPOSITIONALITY
text: The core idea of this work is to use compositionality to separate semantics and syntax, so that we can convert label prediction algorithm to sequence to sequence algorithm for continual learning. In Kirkpatrick et al. (2017a), continual learning can be probabilistically defined as follows.
logP (ψ|D) = logP (DT |ψ) + logP (ψ|D1···T−1)− logP (DT )
Here, logP (DT |ψ) is the negative of loss function in task T , and logP (ψ|D1···T−1) is regularization related to parameters learned during tasks 1 · · ·T −1. In this work, we have two parts of parameters ψ = θ, φ for semantics θ and syntax φ processing. With compositionality (Li et al., 2019), we make θ and φ conditionally independent given D1···T−1.
logP (ψ|D) = logP (DT |ψ) + logP (θ, φ|D1···T−1)− logP (DT ) = logP (DT |ψ) + logP (θ|D1···T−1) + logP (φ|D1···T−1)− logP (DT )
We assume syntax φ does not change after the initial stage, so we realize regularization logP (φ|D1···T−1) by freezing φ during learning in task T . We use label prediction continual learning algorithm for regularization logP (θ|D1···T−1). Please see Figure 1 for illustration.
We derive the proposed approach based on the above ideas. To use label prediction algorithm in sequence to sequence problem, we need to extract label prediction problem from sequence to sequence problem. Language is generally composed of semantics p and syntax f , so that we decompose an input sequence to them with compositionality.
In language instruction task, for example, input X is a word sequence, and output Y is a label sequence. We consider X has two types of information: which labels are present (Xp), and how the labels should be ordered (Xf ). Y is constructed by the output label types (Y p), and output label order (Y f ) (Eq. 1). We then use chain rule (Eq. 2). With compositionality, Y f functionally depends only on Xf , and given Y f , Y p depends only on Xp (Eq. 3). For intuitive example, in language instruction, order of output actions depends only on input function words (syntax), and given the order, each output action (semantics) depends only on the corresponding input primitive. In machine translation, output order depends only on input part-of-speech information (syntax), and given the order, each output word label (semantics) depends only on the corresponding input word.
P (Y |X) = P (Y f , Y p|Xf , Xp) (1) = P (Y f |Xf , Xp)P (Y p|Y f , Xf , Xp) (2) = P (Y f |Xf )P (Y p|Y f , Xp) (3)
We use LP continual learning for S2S continual learning (our goal) by decomposing output sequence to labels. We assume that the labels yp1 , . . . , y p m are conditionally independent given output syntax Y f and input semantic information Xp (Eq. 4) (we design model in this way). We then use total probability (Eq. 5). We further design that xpi depends only on y f j and X
p (attention mechanism), and with label prediction component, ypj depends only on x p i (Eq. 6).
P (Y |X) = P (Y f |Xf ) m∏ j=1 P (ypj |Y f , Xp) (4)
= P (Y f |Xf ) m∏ j=1 n∑ i=1 P (xpi |Y f , Xp)P (ypj |x p i , Y f , Xp) (5)
= P (Y f |Xf ) m∏ j=1 n∑ i=1 P (xpi |y f j , X p)P (ypj |x p i ) (6)
P (xpi |y f j , X p) is an operation to apply attention map yfj on a sequence of value vectors X p, so that it does not have parameters. Let θ be the parameter for label prediction module P (ypj |x p i ; θ), and φ be the parameter for attention map generator P (Y f |Xf ;φ).
P (Y |X) = P (Y f |Xf ;φ) m∏ j=1 n∑ i=1 Patt(x p i |y f j , X p)P (ypj |x p i ; θ)
Since we assume continual learning stage does not contain new syntax patterns, we can freeze φ during continual learning stage. θ is the parameter for label prediction module. Therefore, we can use label prediction continual learning model (LP-CL) to enable compositional sequence to sequence continual learning (S2S-CL) as we detail in the next subsection.

heading: 3.3 DISENTANGLE SEMANTIC AND SYNTACTIC REPRESENTATIONS
text: Our S2S-CL approach is inspired by the idea of decomposing syntactic and semantic representations with compositionality (Li et al., 2019). Note that it is not a continual learning approach but shows how compositionality can be encoded in sequence-to-sequence models. The method disentangles syntactic and semantic1 representations by using two representations. One generates attention maps, and the other maps attended word to action. It reduces entropy of the representations.
Suppose there are input x and output y. x contains a sequence of words, where each input word is from an input vocabulary of size U . y contains a sequence of output symbols, where each output symbol is from an output vocabulary of size V . Both vocabularies contain an end-of-sentence symbol which appears at the end of x and y, respectively. The model output ŷ is a prediction for y. Suppose both input words x1, . . . , xn and output symbols y1, . . . , ym are in one-hot representation.
x = [x1, . . . , xn], y = [y1, . . . , ym]
To disentangle information, an input sentence x is converted to semantic representation p and syntactic representation f . Specifically, each word is encoded with two embeddings.
pi = Embp(xi) ∈ Rkp , fi = Embf (xi) ∈ Rkf
Then, they are concatenated to form two representations for the entire input sequence, i.e.,
p = [p1, . . . , pn] ∈ Rkp×n, f = [f1, . . . , fn] ∈ Rkf×n
Entropy regularization is introduced to achieve disentanglement by regularizing the L2 norm of the representations Lregularize = L2(p) + L2(f), and then adding noise to the representations.
p′ = p+ α p ∈ Rkp×n, p ∼ N (0, I), f ′ = f + α f ∈ Rkf×n, f ∼ N (0, I) f ′ is fed to a sequence-to-sequence module for decoding. At each step j, the decoder generates bj ∈ Rn, and attention map aj is obtained with Softmax. With the attention map, weighted average
1We make a loose usage of syntactic and semantic. In natural instruction learning, syntactic refers to functional and semantic refers to primitive.
vj on noised semantic representations p′ is computed. Then it is fed to a fully connected one-layer network fpredict to get score lj , and a Softmax is used to compute the output distribution ŷj . The decoding ends if argmax ŷj is an end-of-sentence symbol.
aj = Softmax(bj), vj = p′aj ∈ Rkp , lj = fpredict(vj) ∈ RV , ŷj = Softmax(lj)
The cross entropy of y and ŷ is used as prediction loss Lpredict, and the final loss L is the combination of prediction loss and entropy regularization loss. λ is regularization weight.
Lpredict = m∑ j=1 CrossEntropy(yj , ŷj), L = Lpredict + λLregularize

heading: 3.4 LABEL PREDICTION ALGORITHM FOR CONTINUAL LANGUAGE LEARNING
text: For language problems, it is natural to use non-parametric algorithm as label prediction continual learning algorithm, because input words and output actions are usually associated with embeddings. In each stage, since the original method uses two embeddings Er ∈ Rkr (r ∈ {p, f}) for a word and one embedding W for an action, we append the new semantic ep, syntactic ef and action w embeddings (Figure 2). We freeze the old embedding parameters and only learn the newly added ones in the stage.

heading: 4 EXPERIMENTS
text: We evaluate the proposed method in a continual learning task with multiple stages. The first stage is a standard process in which we train a model with combinations of multiple words in various sentence structures. In each continual stage, we add a new input word and corresponding new output symbol. The training dataset contains only one sample, whose input is a sentence with the new word, and output is a sequence with the new symbol. For each stage, we can only use the data in that stage, and have no access to data in previous or future stages.
We have two objectives in continual learning. We want previously learned knowledge to be transferred and combined with new knowledge (transfer learning), and an updated model to work on previous data (catastrophic forgetting prevention). We evaluate transfer learning by testing whether the model works on data where the new word appears with old ones (Transfer). We evaluate catastrophic forgetting prevention by testing whether the model works on data that only contain words up to the last stage (Forget). We are also interested in preventing long-term catastrophic forgetting, because it is more difficult than preventing short-term one. Thus, we test whether the new model works on the evaluation dataset in the initial stage (Long-forget).
Baselines. We designed baseline methods for compositionality Sequence-to-Sequence continual learning to validate our approach since, to our knowledge, this is the first work for continual learning of natural language instructions and machine translation. We applied standard sequenceto-sequence model (Standard) to our continual setting, and also the compositional generalization
method (Compositional) (Li et al., 2019). We also compare with state-of-the-art continual learning baselines. To fit in the experimental setting, we focus on those that do not use replay buffer, and require minimum model structure extension, so that we added EWC (Kirkpatrick et al., 2017a) and MAS (Aljundi et al., 2018) as comparable baselines due to their popularity and competitive performance in label prediction setting. The detailed implementation of the baseline and proposed methods can be found in Appendix B.
Metric. We use accuracy as metric for both instruction learning and machine translation experiments. A prediction is correct if and only if it is completely identical to the ground truth. We run all experiments for five times with different random seeds.
Instruction Learning We first experiment on instruction learning task using SCAN dataset (Lake & Baroni, 2017). The task is summarized in Table 2 in Appendix. The details of dataset generation is in Appendix A. The results are in Figure 3 (left) and Table 1 (more details in Table 3 in Ap-
pendix). The proposed method has significantly better results than the baselines. It maintains high accuracy up to 100 stages for both transferring knowledge from previous stages to future stages, and catastrophic forgetting prevention. On the other hand, baseline methods drop performance over time. Methods without compositionality (EWC, MAS) reduces quickly, maybe because they are not designed for transferring knowledge, and since the representations are entangled, all parameters are quickly changed, causing catastrophic forgetting. Compositional method is better, but still drops, maybe because the parameters for syntax are changed over time. This experiment shows the advantage of the proposed method over baselines.
Machine Translation We also investigated whether the proposed approach works for other continual language learning problems. As an example, we conduct a proof-of-concept experiment for machine translation. We modified the English-French translation task in (Lake & Baroni, 2018). In each continual learning stage, we add an additional English-French word pair, in the format (“I am ENGLISH”, “je suis FRENCH”). Neither English word nor French word appears in previous stages. This pair is used as training data in the stage, but test data contains other patterns. Appendix A provides more details on dataset and model configuration. The result is shown in Figure 3 (right) and Table 4 in Appendix. It shows that the proposed approach has stable and significantly higher performance than baselines. For Transfer and Forget evaluation, the baseline methods drop quickly. However, for Long-forget evaluation, they keep positive accuracy over time. This means the baseline methods have the ability to learn knowledge and remember for long time, but they are not as strong as the proposed method. This experiment shows that the proposed approach has promise to be applied to real-world tasks.

heading: 5 DISCUSSIONS

heading: 5.1 ATTENTION MAP VISUALIZATION
text: We hope to use compositionality for continual learning, so we want to find whether the model works in the expected mechanism. We visualize activations of attention maps on the evaluation data in the first continual stage (Figure 4).
The visualization shows that, for each output action, the attention is on the corresponding input word. Also, for the output end-of-sentence symbol, it is on the input end-of-sentence symbol. It is consistent with the original work, and the way humans apply compositionality. This indicates that the proposed method may be applicable to other tasks where humans use compositionality.

heading: 5.2 EMBEDDING VISUALIZATION
text: We visualize how the new embedding parameters fit in the space with predefined dimensions, and accommodate with previously learned parameters. The visualization of attention maps explains the syntactic information, and we are also interested in semantic information.
We use t-SNE (Maaten & Hinton, 2008) to project high dimensional embeddings to two dimensional space for visualization. Our analysis focuses on semantic embedding, because it reflects how new information is encoded in the model. Since action embedding shares much information with semantic embedding, and syntactic embedding is not supposed to contain new information because grammar does not change over stages, we leave them in Appendix D.
Figure 5 shows two phases in the continual learning experiment. The first phase is from the first stage to around stage 50, where the new embeddings explore outside space. The second phase is the rest of the stages, where the embeddings squeeze into the explored space, maybe because exploring becomes expensive with the dense population under regularization. This may be an explanation for the performance decrease in the later stages of instruction learning experiment.

heading: 6 CONCLUSION
text: In this paper, we propose an approach to use label prediction continual learning algorithm for sequence-to-sequence continual learning problem by leveraging compositionality. To our knowledge, this is the first work to combine continual learning and compositionality for sequence-tosequence learning. Experiments show that the proposed method has significantly better results than baseline methods, and it maintains almost more than 85% accuracy for both transfer learning and catastrophic forgetting prevention up to 100 stages. The results demonstrate that language compositionality helps continual learning of natural language instruction both efficiently and effectively. We hope this work will advance the communication between humans and machines, and make machines more helpful in various tasks.

heading: A DATASET PREPARATION
text: We extend the grammar in SCAN dataset (Lake & Baroni, 2017) to generate data. For the initial stage, we generate data with three action words (walk, look, run). We then randomly and uniformly divide the data to two disjoint sets. We use one set for initial stage training data (6,601 samples), and reserve the other set as initial dataset to evaluate catastrophic forgetting in continual stages (Forget, 6,602 samples). The reserved data is also used to evaluate long-term catastrophic forgetting (Longforget). In each continual stage, we generate data that contain a new action word (jump for the first continual stage). The data contain a one-word sentence (jump: JUMP), and we use it as training data (1 sample). We use other data in the generated data as evaluation dataset (Transfer, 7,706 samples for the first continual stage). We then add Transfer to Forget for the next stage. We set a limitation of 100,000 samples for each evaluation dataset. When it has more samples than that, we select the amount uniformly at random after generating all data once. Machine translation dataset is generated similarly from the translation dataset in SCAN dataset (Lake & Baroni, 2017). We use the original training data as the initial training data, and the original test data as the initial test data.
B IMPLEMENTATION
We use bidirectional LSTM as encoder, and unidirectional LSTM with attention as decoder for sequence to sequence architecture. The first and last states of encoder are concatenated as initial state of decoder. The state size is h = 32 for encoder, and 2h = 64 for decoder. We also use kp = 64, kf = 8, α = 0.1. For EWC (Kirkpatrick et al., 2017a) and MAS (Aljundi et al., 2018), we use 10 for parameter regularization weight. In initial stage, batch size is 512, and we run training 5,000 steps. In each continual stage, batch size is 1, as each continual stage only contains one sample, and we run training 1,000 steps. We have 100 continual stages. We implement all methods with TensorFlow (Abadi et al., 2016).

heading: C DETAILED EXPERIMENT RESULTS
text: More results and standard deviation for continual learning can be found in Table 3 for instruction learning and Table 4 for machine translation experiments.

heading: D EMBEDDING VISUALIZATION
text: Syntax embeddings in Figure 6 show that the embeddings in continual learning stages do not explore outside space, but live in the space explored in the initial stage.
Action embeddings in Figure 7 show two phases for exploration, similar with semantic embeddings. This fits expectation, because the compositionality and training encourage semantic embeddings and action embeddings to be similar.

Review summaries:
The paper proposes a continual learning algorithm for label prediction to deal with sequence-to-sequence continual learning problems. The proposed method is designed to leverage compositionality.  The key idea of the proposed method is to enable the network to represent syntactic and semantic knowledge separately. This allows the neural network to leverage compositionality for knowledge transfer while alleviating catastrophic forgetting.