---
title: "Continual Learning for Text Classification with Information"
description: "IDBR helps a text classifier learn tasks in sequence by preserving shared features, adapting task-specific features, and replaying a small…"
canonical: "https://research.elamur.ai/free/en/papers/huang-2021-continual-learning-text-classification-information/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/huang-2021-continual-learning-text-classification-information/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/) / Continual Learning for Text Classification with Information Disentanglement Based Regularization

# Continual Learning for Text Classification with Information Disentanglement Based Regularization

Paper · 2021 · Yufan Huang, Yanzhe Zhang, Jiaao Chen et al.

**Authors:** Yufan Huang, [Yanzhe Zhang](https://md.research.elamur.ai/free/en/authors/yanzhe-zhang/), [Jiaao Chen](https://md.research.elamur.ai/free/en/authors/jiaao-chen/), [Xuezhi Wang](https://md.research.elamur.ai/free/en/authors/xuezhi-wang/) and [Diyi Yang](https://md.research.elamur.ai/free/en/authors/diyi-yang/) · **Year:** 2021 · **Venue:** Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[**70** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W3153186148|W3171057731|W6891617492) · [Cited by **40** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/huang-2021-continual-learning-text-classification-information/cited-by/) · [Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies](https://aclanthology.org/volumes/2021.naacl-main/) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2021.naacl-main.218/)
- [PDF](https://aclanthology.org/2021.naacl-main.218.pdf)
- [DOI 10.18653/v1/2021.naacl-main.218](https://doi.org/10.18653/v1/2021.naacl-main.218)
- [arXiv 2104.05489](https://arxiv.org/abs/2104.05489)
- [OpenAlex](https://openalex.org/W3171057731)

Citations: OpenAlex, 2026-10-14.

## Summary

A text classifier trained on a new task can lose much of its ability to do an earlier one. This is catastrophic forgetting. The problem arises when data arrive in stages and a system needs to remain useful on earlier tasks as it learns new ones. The authors study this problem in [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/), where each input is assigned a category such as a news topic or a sentiment label. Their question is how to preserve what earlier tasks taught the classifier while leaving enough freedom to learn distinctions that matter on the new task.

Their method, information disentanglement based regularization, or IDBR, builds two feature vectors from the output of a shared encoder. One branch is trained to recognize whether two spans of an example are presented in their original order. The authors use this exercise to encourage features that are useful across tasks. The other branch is trained to identify which dataset an example comes from, encouraging it to capture differences between tasks. The classifier uses both vectors. When the next task arrives, the system compares its new vectors with those produced by the previous version of the encoder and can penalize changes in the two branches separately. The authors expect shared features to benefit from tighter protection while allowing more movement in task-specific features. The method also keeps 1% of the training examples for replay, selecting actual examples near cluster centers so that the small buffer can represent different parts of the old data.

The authors test IDBR on sequences drawn from five datasets covering news, sentiment, Wikipedia articles and question-and-answer material. In the reduced-data experiments, ordinary sequential fine-tuning forgets heavily, a small replay buffer improves final accuracy, and adding a penalty on the encoder output helps further. IDBR improves on that regularization baseline across all 6 task orders evaluated in this setting. Joint training with access to every task’s data still scores higher. In the Full setting, IDBR outperforms MBPA++, which adapts on retrieved examples at test time. It obtains accuracy comparable to LAMOL, which generates examples for replay and receives task identifiers at inference. IDBR produces its predictions without those test-time identifiers or local adaptation.

The component tests help explain the result. The two auxiliary prediction tasks are most effective together. Penalizing changes in both feature spaces works better than protecting just one, and protecting the generic branch alone typically helps more than protecting the specific branch alone. Choosing replay examples by clustering improves the overall comparison with random selection, particularly on the harder orders examined. A separate analysis finds a noticeable drop in earlier-task performance at an intermediate stage, followed by relatively small increases in forgetting at the later stages measured. The authors release the IDBR code publicly.

## Deep dive: Continual Learning for Text Classification with Information Disentanglement Based Regularization

IDBR helps a text classifier learn tasks in sequence by preserving shared features, adapting task-specific features, and replaying a small sample of old data. · about 36 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Why training on the latest task can undo earlier learning

The paper starts from a mismatch between the way a classifier is trained and the way its work can change. A training dataset defines the categories a classifier should recognize and supplies examples of each one. In a changing environment, more data and new distinctions become available after that first round of training. The authors use the example of a classifier dealing with emerging topics on social media. A system that can be brought up to date only by repeating everything it did before has limited room to learn incrementally.

In the paper’s experiments, change arrives as a sequence of identifiable tasks. An intuitive example is a classifier that starts with news categories and later encounters review sentiment. Both tasks require the system to make sense of text, but the features that settle a decision can differ. An expression of approval may determine the label for a review while contributing little to a news topic decision. An update that makes the encoder more useful for sentiment can therefore change how it represents news, even when there is no news example in the current batch to reveal the effect. Repeating that process across tasks can produce the abrupt decline on old tasks that the paper calls catastrophic forgetting.

Continual learning asks the system to remain competent across tasks while receiving their training sets in succession. The authors are interested in positive transfer as well as retention. Positive transfer means that learning from one task helps with another. The distinction matters because simply limiting change everywhere can protect useful features and impede useful updates at the same time. A feature that captures the relation between parts of a text may be worth carrying forward. A feature that was useful mainly for the preceding label set may need more freedom to change. The challenge is to make that distinction operational during training, when the desired features are internal vectors and there is no annotation saying which coordinate represents which kind of knowledge.

The paper frames its study around a shared classifier. Earlier decisions depend on the same trainable system that the next task will change. The aim after a sequence is to perform well on the collection of tasks, including those whose full training sets are no longer in use. This is different from optimizing only for the latest target. It is also different from starting with all the training sets and shuffling examples from them throughout training.

#### What earlier approaches preserve

One established approach is replay. During training on a new task, the system revisits some examples from earlier tasks. These examples provide a direct reminder of what counted as a correct decision before the latest dataset arrived. A replayed review, for example, still has its original sentiment label. It can expose an error on that label and produce a training signal that a batch of news articles alone could never supply.

The paper describes several ways previous work used earlier examples. Some methods add them to training directly. Others use them to align representations or to constrain an optimization step. The examples can be retained from the original dataset or synthesized. The authors identify different costs for these choices. Retaining a large collection of texts increases storage requirements. Generating examples requires training a system that can produce usable samples, adding training work. The common issue is how to remind the classifier of enough earlier decisions without requiring access to all earlier training data.

Another family of approaches adds a regularizer, a loss term that makes certain changes costly. Depending on the method, the protected quantity can be a prediction, a hidden representation or a parameter inside the network. These choices constrain different things. Matching earlier predictions focuses on behavior at the output. Preserving an internal vector limits changes in the features available to a classifier, even when the top prediction remains the same. Preserving parameters acts on the quantities used to compute those features and predictions. The paper treats representation alignment in lifelong relation extraction as a close precedent. It also draws on continual relation learning with episodic memory, both for protecting representations and for choosing examples to retain. [Sentence Embedding Alignment for Lifelong Relation Extraction](https://md.research.elamur.ai/free/en/papers/wang-2019-sentence-embedding-alignment-lifelong-relation/), [Continual Relation Learning via Episodic Memory Activation and Reconsolidation](https://md.research.elamur.ai/free/en/papers/han-2020-continual-relation-learning-episodic-memory/)

The authors argue that a penalty on a whole hidden vector gives the system too little control over what to preserve. If every coordinate is subject to the same treatment, a single choice of strength has to serve both information that is expected to remain useful and information that may need substantial adjustment. The paper’s response is to create two representations before applying the penalties. That gives it a way to describe a particular compromise between preserving old behavior and adapting to the new task. Replay and regularization work together in this proposal. Replay supplies old examples and labels. Regularization specifies how much the representation of an example may move away from an earlier reference.

The paper also describes architecture-based and meta-learning approaches. Architecture-based work reduces interference by assigning different tasks to different parts of a system. The incentive is to prevent learning one task from disturbing components that another task depends on. Meta-learning approaches work on how learning proceeds across tasks. Some optimize for transfer and reduced interference, while others aim to learn representations that will hold up under later updates. These are alternatives within the paper’s broader account of continual learning. Its own design keeps a shared encoder and differentiates two outputs of that encoder. [Progressive Neural Networks](https://md.research.elamur.ai/free/en/papers/rusu-2016-progressive-neural-networks/)

#### Why separate kinds of information?

Text generation offered the authors a precedent for dividing a representation by purpose. In style transfer, a useful distinction is between the content of a text and properties such as style or polarity. A system that changes the style while preserving the content needs some way to treat those properties differently. The earlier work discussed in the paper attempts such divisions using signals such as known labels or adversarial training. Research on controlled generation and on separating syntactic and semantic representations provides related examples. IDBR takes the general idea of separate feature spaces and applies it to the different demands of successive classification tasks. [Disentangled Representation Learning for Non-Parallel Text Style Transfer](https://md.research.elamur.ai/free/en/papers/john-2019-disentangled-representation-learning-non-parallel/), [Toward Controlled Generation of Text](https://md.research.elamur.ai/free/en/papers/hu-2017-toward-controlled-generation-text/), [Generating Sentences from Disentangled Syntactic and Semantic Spaces](https://md.research.elamur.ai/free/en/papers/bao-2019-generating-sentences-disentangled-syntactic-semantic/)

The paper draws another distinction between continual learning and two familiar ways of working with multiple tasks. In joint multitask learning, all the training sets are available together. This gives the learner repeated opportunities to correct errors on any of the tasks during training. A system could approximate that arrangement as tasks arrive by saving the full data and retraining, but the authors point out the cost of doing so repeatedly. Transfer learning, as discussed in the paper, instead asks how prior training helps on a target task. The evaluation commonly centers on the target, while continual learning also asks what happened to performance on the source. These differences in access and evaluation determine which comparisons the experiments can support. [Gradient Surgery for Multi-Task Learning](https://md.research.elamur.ai/free/en/papers/yu-2020-gradient-surgery-multi-task-learning/), [Parameter-Efficient Transfer Learning for NLP](https://md.research.elamur.ai/free/en/papers/houlsby-2019-parameter-efficient-transfer-learning-nlp/), [AdapterFusion](https://md.research.elamur.ai/free/en/papers/pfeiffer-2020-adapterfusion-non-destructive-task-composition/)

### The method, step by step

#### What the learner receives and what it tries to keep

Consider the point at which a new dataset arrives. Its examples have class labels, and their task of origin is known during training. The learner also has the classifier produced at the end of the preceding task and a buffer of examples retained from earlier tasks. It can use the old classifier to record how examples are represented before any updates occur. As training proceeds, it can compare the new representations with those reference vectors. After training on the current dataset, it selects some examples from that dataset for future replay.

The paper describes the goal in terms of risk, the expected prediction loss on each task added across the sequence. A task is a collection of text and class-label pairs. The same classifier appears in every term because changes to its shared parameters can affect all the tasks.

```
R(fθ) = ∑ᵢ₌₁ⁿ E₍ₓⁱ, ᵧⁱ₎ ∼ Tᵢ [ℒ(fθ(xⁱ), yⁱ)]
```

Here `R` is the aggregate risk and `fθ` is the classifier with parameter set `θ`. The summation `∑` runs over tasks, with `i` identifying a task, `1` denoting the first task and `n` the number in the sequence. `Tᵢ` is task `i`. The text `xⁱ` and its class label `yⁱ` form a pair from that task, with the superscript indicating origin. The expectation `E` averages the loss over pairs drawn from the task, as indicated by `∼`. Inside it, `fθ(xⁱ)` gives the prediction and `ℒ` measures its loss against `yⁱ`. This equation defines the study’s goal. The losses used in any one training stage are computed on the data available then.

The memory budget in the paper’s general replay formulation is a fraction of the training set at each completed task. In its description of ordinary replay, the paper starts with random sampling. IDBR keeps the same idea of a storage fraction and changes how the examples are picked.

```
γ |Sₜ₋₁|
```

`Sₜ₋₁` is the training set from the preceding task when the incoming task is `t`. The vertical bars denote the number of examples in the set. `γ` is the storage fraction, bounded between `0` and `1` inclusive, and multiplying by the dataset size gives the number of examples to retain under that rule. The preceding task is indexed by `t − 1`, so the first opportunity to replay examples comes after the first task has been learned. The buffer `ℳ` holds selected examples for use during later training.

#### From one text to two feature vectors

The first stage converts an input text into a numerical representation. The encoder, denoted `B`, produces a vector that will feed all the later decisions. In the experiments, the encoder is initialized with pretrained BERT-base-uncased. This same encoder supplies the input to both branches and is updated as the sequence proceeds. [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/)

```
r = B(x)
```

`x` is a text example, `B` is the encoder and `r` is its hidden representation for the example. A hidden representation is an intermediate numerical description used by later parts of the network. The equality identifies the vector the two branches receive.

```
g = G(B(x))
```

`G` is the extractor for the task-generic branch. It takes the output of encoder `B` on `x` and returns the generic vector `g`. The nested parentheses indicate that `B` is applied to the text first and `G` to the resulting features.

```
s = S(B(x))
```

`S` is the extractor for the task-specific branch and `s` is its output. As in the first branch, the input is the vector produced by `B` for `x`. The letter `S` here denotes a trainable function. A subscripted `Sₜ` elsewhere denotes a training set.

Both extractors are implemented as a linear layer followed by the `Tanh` activation, a nonlinear transformation of the layer’s outputs. Each returns a vector of 128 dimensions. The prediction heads are also small. Each uses a linear layer and a softmax, which turns the output scores into probabilities over the head’s possible answers. The individual branches have the same form. They acquire different roles because different prediction targets constrain what each one needs to encode.

How IDBR trains on each task The steps in order.

The flow applies repeatedly as tasks arrive. On the first task, there is no previous stage from which to cache vectors. Once there is a reference, the preservation penalties operate alongside prediction losses. After the current task, the clustering step prepares the replay buffer for future updates.

#### Teaching the generic branch through span order

The generic branch is meant to preserve information useful across the task sequence. The authors give syntax as an example of knowledge that should remain broadly useful as the classification problem changes. To train the branch, they give it a prediction exercise whose answer can be generated from an example’s own text. The exercise is called next sentence prediction. In this paper, a “sentence” in the exercise can be a span of text rather than a complete grammatical sentence.

The authors insert a `[SEP]` separator during tokenization, the process of representing text as a sequence of tokens. The separator divides an example into spans. In their original arrangement, the pair receives the label `IsNext`. Reversing the spans creates a `NotNext` example. The negative example thus contains the same two pieces of text as the positive one, in the opposite order. Recognizing the correct arrangement gives the branch a reason to encode how one span relates to the other. The supervision can be generated for each dataset without requiring any of its topic or sentiment labels.

The prediction head for this exercise reads only the generic vector. As a result, a feature that helps determine which span came first must reach the head through that branch. The authors expect regularities that support this exercise to be useful across tasks. A classifier can still use generic features differently in different classification decisions, because the downstream head sees them alongside the specific features.

```
ℒₙₛₚ = Eₓ ∈ Sₜ ∪ ℳ [ℒ(fₙₛₚ(G(B(x))), 0) + ℒ(fₙₛₚ(G(B(x̃))), 1)]
```

`ℒₙₛₚ` is the span-order loss. `E` averages over original examples `x` in the union `∪` of the current training set `Sₜ` and replay memory `ℳ`. The subscript `t` identifies the current task. `x̃` is the example made by reversing the order of the spans in `x`. The functions `B` and `G` give the encoder features and then the generic features, and `fₙₛₚ` predicts the order from the generic vector. `ℒ` is cross-entropy, a prediction loss that penalizes assigning low probability to the correct answer. `0` denotes the `IsNext` target and `1` the `NotNext` target. The addition sign joins the two losses associated with the same original example.

There is an important difference between what the exercise supplies and what the authors hope to obtain from it. The target says which order was used. It supplies no annotation of syntax, meaning or task independence. The authors use it as an indirect training signal for properties of text that may carry over from one dataset to another. Whether the resulting vectors tend to mix examples across tasks is a separate empirical question, which they examine with a visualization.

#### Teaching the specific branch to recognize the task

The second branch receives the opposite kind of cue. Its head tries to identify the task that supplied the text. A feature that helps distinguish reviews from question-and-answer material, for example, can support this decision. The authors’ motivation is that predictors also benefit from features whose usefulness depends on the task. Words that express approval or disapproval can be especially informative for sentiment, while another dataset may require different distinctions.

Task identity and class identity serve different purposes. The task identifier says which source generated an example. The class label says what answer the classifier should give for that example. A positive review still has a sentiment label even after its origin is known. Conversely, reviews assigned different sentiment labels can have the same task identifier. This makes origin prediction an additional exercise rather than a substitute for classification.

```
ℒₜₐₛₖ = E₍ₓ, ₓᶻ₎ ∈ Sₜ ∪ ℳ [ℒ(fₜₐₛₖ(S(B(x))), xᶻ)]
```

In this display, `xᶻ` denotes the task identifier attached to example `x`, which the authors write as `z`. `ℒₜₐₛₖ` is the task-identifier prediction loss. `E` averages over examples and their identifiers from the current training set `Sₜ` and the replay buffer `ℳ`, joined by `∪`. `B` encodes the text and `S` extracts its specific vector. The head `fₜₐₛₖ` predicts a task identifier using that vector. The cross-entropy `ℒ` compares its prediction with the known identifier.

The auxiliary target is available for the replayed data as well as the current data. This matters because examples from earlier tasks give the task predictor evidence about origins other than the one arriving now. The training setup uses the identifier as a supervisory label. At inference, IDBR uses the text to create both vectors and can classify it without being supplied the task identifier.

#### Combining both branches for the class decision

The classifier takes the generic and specific vectors side by side. This operation is concatenation. It preserves the entries of each vector and gives the class head access to each, so the head can learn a decision that depends on broadly useful text features, task cues or both. The auxiliary heads determine some of the pressures on the two branches, and the main class head provides a task-performance signal to both.

```
ℒ꜀ₗₛ = E₍ₓ, ᵧ₎ ∈ Sₜ ∪ ℳ [ℒ(f꜀ₗₛ(g ∘ s), y)]
```

`ℒ꜀ₗₛ` is the classification loss. `E` averages over texts `x` paired with class labels `y` from the current training set `Sₜ` and memory `ℳ`. The symbol `∪` joins the data sources. The vectors `g` and `s` are the generic and specific representations of `x`, and `∘` puts them side by side. `f꜀ₗₛ` denotes the class prediction head, and its cross-entropy `ℒ` uses `y` as the correct answer.

In practice, the authors also use the reversed examples for class prediction and task-identifier prediction. Only the span-order label changes. This gives each reversed input a role in the auxiliary exercise and in training the other heads. The treatment assumes that the original class remains an appropriate target for the rearranged text. For a task whose answer depends strongly on the relation between the two spans, that assumption deserves separate scrutiny.

#### Recording a reference before the encoder changes

When a new task arrives, the system can run the encoder and both extractors from the preceding stage on the incoming training examples. It also runs them on the examples already in memory. It saves the resulting generic and specific vectors before updating the trainable components. This provides a common reference point for comparisons throughout training on the new task.

An incoming example need not have been seen before to serve in this comparison. The previous encoder can still compute a vector for it. The reference then says how the system would have represented that input before being trained on its dataset. For a replay example, the reference has a complementary role. It records the more recent representation of a text whose task was already encountered. In each case, the old and updated vectors refer to the same input. The penalty measures a change in the description of that input, rather than whether unrelated examples look similar.

```
ℒᵍᵣₑ𝗀 = Eₓ ∈ Sₜ ∪ ℳₜ [‖Gᵗ⁻¹(Bᵗ⁻¹(x)) − G(B(x))‖₂]
```

`ℒᵍᵣₑ𝗀` is the generic representation penalty. The expectation `E` averages over texts `x` drawn from the current training set `Sₜ` and the memory available at this stage, `ℳₜ`. The symbol `∪` joins those collections. `Bᵗ⁻¹` and `Gᵗ⁻¹` are the encoder and generic extractor after training on the previous task, indexed by `t − 1`. The unmarked `B` and `G` are the versions being updated. The minus sign subtracts the current vector from its reference. The double bars with subscript `2` denote the Euclidean norm, which gives the length of that difference vector.

```
ℒˢᵣₑ𝗀 = Eₓ ∈ Sₜ ∪ ℳₜ [‖Sᵗ⁻¹(Bᵗ⁻¹(x)) − S(B(x))‖₂]
```

`ℒˢᵣₑ𝗀` is the corresponding penalty for the specific branch. The expectation again uses examples `x` from the current set `Sₜ` and current memory `ℳₜ`, with `∪` indicating their union. `Bᵗ⁻¹` is the previous encoder and `Sᵗ⁻¹` the previous specific extractor. The functions `B` and `S` without superscripts are the current versions. The difference inside `‖ ‖₂` compares old and current specific vectors by Euclidean distance. In both penalties, the formula uses the norm itself.

Because the encoder is shared, a change to its parameters can affect both distances. The architecture gives the two branches separate penalties without treating their training as independent. It also gives the class predictor access to both. When a useful update increases one distance and reduces classification loss, the objective weighs these effects against each other. A larger penalty coefficient makes such movement more expensive. A smaller one leaves the system more freedom while still charging for departures from the reference.

#### Selecting the examples that will be replayed

The paper’s memory design starts with a practical observation. If two examples are nearly interchangeable for rehearsal, saving both uses space that could preserve a different kind of example. The authors use K-Means to select a spread of examples in the feature space of the encoder. The selection takes place after the system finishes training on a task, so the features used for clustering come from an encoder already trained on that task.

The authors compute the encoder output for each text in the current training set. K-Means groups those vectors and assigns a center, or centroid, to each group. The system keeps the original text whose vector lies closest to each centroid. It can then replay an actual labeled example from that part of the dataset. The stored item is the example selected via the center, rather than the numerical centroid itself.

```
γ |Sₜ|
```

This expression specifies the number of clusters for the current dataset. `γ` is the storage fraction, `Sₜ` is the training set for task `t`, and `|Sₜ|` is its size. Since the method selects an example for each cluster, this expression also sets the replay quota for that task. In the experiments `γ` is `0.01`, corresponding to `1%` of seen examples.

Selection uses the encoder representation `B(x)` that precedes the generic and specific extractors. It therefore relies on the geometry of the shared features at the end of the task. The procedure seeks coverage across clusters of examples. It has no explicit rule to retain an example for each class or to give priority to previously misclassified cases. The resulting memory depends on how well proximity in the encoder space reflects the kinds of variation that matter for replay.

The experimental presentation describes current and memory data together in the losses and specifies a cadence for memory updates. Replay has frequency `β = 10`, with `β` denoting the interval in training steps. A replay update occurs once every ten steps. The coefficients of the movement penalties also depend on whether the batch comes from the current dataset or memory, so the procedure can make preservation matter more on examples that actually rehearse an earlier task.

#### Putting the losses together

The full objective combines classification, span-order prediction, task-origin prediction and the two distance penalties. The three prediction losses have unit weights. The authors tune the strengths of the two regularizers, leaving the auxiliary prediction weights fixed.

```
ℒ = ℒ꜀ₗₛ + ℒₙₛₚ + ℒₜₐₛₖ + λᵍ ℒᵍᵣₑ𝗀 + λˢ ℒˢᵣₑ𝗀
```

On the left, `ℒ` is the total training objective. On the right, `ℒ꜀ₗₛ` measures classification error through cross-entropy, `ℒₙₛₚ` measures the span-order prediction loss and `ℒₜₐₛₖ` measures the task-identifier loss. `ℒᵍᵣₑ𝗀` and `ℒˢᵣₑ𝗀` are the generic and specific distance penalties. `λᵍ` multiplies the generic penalty and `λˢ` multiplies the specific penalty. Each `+` includes another source of loss in the objective. The prediction terms have implicit coefficients of `1`. The two distance terms enter training starting at the second task, when there is a previous representation to use as a reference.

For replay batches, the generic coefficient `λᵍ` is `2.5`, and the authors choose the specific coefficient `λˢ` from `1.5`, `2.0` and `2.5`. On batches from the current training set, the generic coefficient is `0.25` and the candidates for the specific coefficient are `0.15`, `0.20` and `0.25`. These choices give replay batches stronger preservation penalties. Within a batch type, the search allows the specific coefficient to match the generic one or fall below it. The architecture’s flexibility comes from separate distances and separate weights, even when a particular coefficient choice gives the branches equal numerical weights.

The authors initialize the encoder using Hugging Face’s implementation. They train with AdamW, set weight decay to `0.01`, and use a learning rate of `3e⁻⁵` for the main components and `5e⁻⁴` for the task-identifier head. The learning rate controls the size of parameter updates, and weight decay applies a separate penalty through the optimizer. The head that predicts task origin thus has its own update setting. Batches contain 8 examples. The maximum sequence length is 256 tokens, with the first 256 kept for longer inputs. The experiments run on an NVIDIA RTX 2080 Ti with 11GB of memory. [Transformers](https://md.research.elamur.ai/free/en/papers/wolf-2020-transformers-state-art-natural-language/), [Decoupled Weight Decay Regularization](https://md.research.elamur.ai/free/en/papers/loshchilov-2017-decoupled-weight-decay-regularization/)

### Experiments and results

#### Data, sequence orders and validation

The tasks come from five established classification datasets. AG News calls for a news category, and DBPedia calls for a category for a Wikipedia article. Yahoo! Answer supplies question-and-answer material for classification. Yelp and Amazon supply the sentiment tasks. The authors merge the label spaces of the two review datasets because the domains are similar, yielding 33 classes across the experiments. The review datasets still serve as separate tasks in a sequence. A task boundary here can therefore mark a switch in dataset even when some class labels carry over. [Character-level Convolutional Networks for Text Classification](https://md.research.elamur.ai/free/en/papers/zhang-2015-character-level-convolutional-networks-text/)

Most experiments use the Sampled setting. For each task in this setting, the authors randomly select 2,000 examples per class for training and another 2,000 per class for validation. They use it to tune hyper-parameters. A second setting, Full, uses the same training and test data as the published comparisons with MBPA++ and LAMOL. Those data contain 115,000 training examples and 7,600 test examples per task. The authors draw 500 examples per class from the Full training data to serve as validation. During sequential training, they evaluate on validation sets for all tasks seen by that stage. The validation check can therefore detect a change in earlier performance while work on the current task is still under way.

The Sampled comparisons include both length-3 and length-5 sequences. The shorter sequences cycle through AG News, Yelp and Yahoo! Answer, rotating which dataset comes first while keeping the same tasks in the group. The longer sequences come from the prior MBPA++ experimental design. The first 6 of the paper’s orders are used for the Sampled results and the last 4 for the Full results. The ordering matters because the learner sees the full training set of a task during its own stage and later sees only selected examples from it. An early task can be exposed to more subsequent updating than a late one. Rotating the shorter sequence also changes which dataset is current when the final test takes place.

#### What the comparisons isolate

The Finetune baseline updates BERT sequentially on each task’s training data, using the class objective. This is the simplest way to continue training. It tests what happens when the update has no replay buffer and no extra loss for retaining prior capability. In the paper’s terminology, this is ordinary [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/). The cited earlier work is [Learning and Evaluating General Linguistic Intelligence](https://md.research.elamur.ai/free/en/papers/yogatama-2019-learning-evaluating-general-linguistic-intelligence/).

Replay takes this sequential baseline and adds episodic memory, a store of examples from earlier tasks. It trains on examples from that store while learning the current task. The Regularization baseline adds an L2 penalty on the classifier’s hidden features after BERT, on top of replay. This is the most direct comparison for the paper’s proposal because it already includes both old examples and a feature preservation loss. An improvement over this baseline is evidence about IDBR as a package. The ablations are needed to examine which parts of that package account for the change.

The Full comparisons use two more elaborate alternatives. MBPA++ retains all seen examples in its episodic memory and uses replay during training. At inference it retrieves nearby examples with K-nearest neighbors and uses them for local adaptation before making a prediction. LAMOL trains a language model to answer tasks and generate pseudo-examples for replay. It presents text classification in a question-and-answer format and uses task identifiers during inference. Accordingly, the Full comparison puts methods with different memory strategies and prediction procedures on the same data. The accuracy scores need to be read with those differences in mind.

Multitask learning, abbreviated MTL, supplies a joint-training reference. It trains with all task datasets available together. This reference asks how well the system can do when no task must be represented only by a replay sample during later training. The paper calls it an upper bound in that practical sense. Its role is to indicate how much room remains between the sequential approach and the joint-training condition used in the experiment.

#### Final accuracy under sampled training

The main evaluation takes place after the last task has been learned. The authors compute accuracy on the test sets for the tasks in the sequence and report the average. Accuracy measures whether the predicted class agrees with the class label. Averaging across the test sets puts earlier tasks into the final evaluation alongside the last one. If accuracy were measured only on the latest task, a system could appear successful despite having lost much of its earlier capability. The Sampled results are averaged over 3 runs.

The pattern is progressive across the sequential baselines. Finetune exhibits pronounced forgetting. Replay with examples drawn from the 1% buffer gives much stronger final performance. Adding the undivided representation penalty improves on Replay in all 6 orders in the Sampled comparison. IDBR improves on that Regularization baseline throughout those orders. The sequence of comparisons matters because it shows that revisiting a small store of labeled texts already does substantial work. IDBR’s result shows what the proposed changes contribute on top of a baseline that also uses replay and feature retention.

The authors use paired tests to compare Regularization with IDBR. They report `0.018` for the length-3 Sampled comparison and `0.009` for the length-5 Sampled comparison, using nine paired values for each test. These are p-values for the reported final-accuracy comparisons. They describe the statistical evidence in the paired tests and have a different interpretation from the accuracy gains themselves.

IDBR versus Regularization on Sampled final test accuracy, paired test by sequence length The longer sequences yield the smaller reported p-value in the paired comparison.

**The numbers**

| System or setting | paired-test p-value |
| --- | --- |
| Length-3 sequences | 0.018 |
| Length-5 sequences (this paper) | 0.009 |

The authors report that the distance between IDBR and joint multitask training grows when they move from length-3 to length-5 sequences. This observation concerns the comparison against joint access to the training sets. It can coexist with IDBR improving on the sequential regularization baseline in both settings. The longer and shorter groups also differ in which datasets they contain. A sequence-length comparison should therefore be read in terms of these experimental groups.

#### Full training and what changes at inference

On the Full setting, IDBR has higher average final test accuracy than MBPA++. The paper emphasizes that MBPA++ uses local adaptation for test predictions, while IDBR obtains its result through the classifier trained along the sequence. The IDBR results in this setting are averaged over 2 runs. The comparison scores for the earlier methods come from their respective studies.

The authors describe IDBR’s Full accuracy as comparable to LAMOL’s. LAMOL receives task identifiers at inference. This gives it source information while it answers each test query. IDBR receives identifiers as training targets for its specific branch and computes its class prediction from the input text at inference. The results therefore show that IDBR can reach similar overall accuracy under a different prediction protocol. LAMOL’s use of generated examples also makes its replay mechanism different from the small store of real examples used by IDBR.

Accuracy, replay storage and test-time computation describe different aspects of this comparison. MBPA++ stores all seen examples and retrieves examples for local adaptation. IDBR has a stated storage fraction for replay and carries out the feature-preservation work during training. LAMOL adds a generative role to its training process. These designs explain where their work occurs. The accuracy comparison alone cannot determine the total training cost of those choices.

#### Tracking how much earlier performance was lost

Final accuracy treats all tasks at the endpoint, including the latest one. The authors add a forgetting measure to follow older tasks as the sequence proceeds. For a task that has already been seen, they compare its current accuracy with the best accuracy it had at an earlier stage. This distinguishes a task that was learned well and later declined from one whose final score is similar but whose accuracy never reached the same earlier level.

```
fʲₖ = maxₗ ∈ {1, …, k − 1} aₗ,ⱼ − aₖ,ⱼ
```

Here `fʲₖ` denotes the forgetting for earlier task `j` after training on task `k`. The index `l` runs over earlier training stages, from the first stage `1` through `k − 1`. `aₗ,ⱼ` is the accuracy on task `j` after stage `l`, and `max` selects the highest of those accuracies. `aₖ,ⱼ` is the accuracy on that same task after the current stage `k`. The minus sign gives the loss relative to the earlier maximum.

```
ℱₖ = Eⱼ ∈ {1, …, k − 1} [fʲₖ]
```

`ℱₖ` is the average forgetting after stage `k`. The expectation `E` averages over the earlier task indices `j`, from `1` through `k − 1`, and `fʲₖ` gives their individual losses of accuracy. The paper’s display uses `t` for the endpoint in the averaging index and `k` in the definition of the stage-specific score. Here `k` denotes the evaluation stage throughout. The average concerns earlier tasks because the newly learned task has no earlier performance within that stage’s comparison.

The authors calculate forgetting after successive tasks on orders 4, 5 and 6 and average the results over 3 runs. The account describes a noticeable drop after the third task, with relatively small increases in forgetting after the fourth and fifth. This shows how the behavior changed within the measured sequences. It addresses a different question from the growing gap to MTL in the final-accuracy comparison. The forgetting calculation compares each earlier task with its own prior performance. The MTL comparison uses a separately trained system with joint access to the data.

### What the ablations show

#### The auxiliary tasks work better together

An ablation changes or removes a component while retaining the rest of a method as far as the experiment allows. The authors vary the auxiliary prediction losses on order 5. They compare using task-identifier prediction alone, using span-order prediction alone, and keeping both. Each auxiliary objective contributes to final classification performance in the comparison, and the gain is larger when the two are used together. The comparison is averaged over 3 runs.

Both branches feed the classifier, which gives the system an incentive to keep any information that helps with class prediction. The branch-specific exercises introduce additional incentives. Span-order prediction makes it useful for the generic branch to encode the relation between pieces of text. Identifier prediction gives the specific branch a direct reason to encode differences among sources. If only one exercise is active, the other branch can still contribute to classification, but it lacks the separate training signal that defines its intended role. The result supports the authors’ explanation that assigning a job to each branch helps the two participate in the final decision.

The ablation measures an effect on final accuracy for this sequence. It does not directly measure which information moved into each vector. The two auxiliary tasks also add supervision to the shared encoder, so improved performance could reflect a combination of better features in the encoder and a more useful division downstream. The importance of the result is that the combined supervisory design helps in the tested condition. How cleanly it divides the information is evaluated with a different kind of evidence.

#### What the feature plots reveal

The authors use t-SNE to display generic and specific vectors from the trained classifier at the end of order 2. This technique projects high-dimensional features into a display where groups and local neighborhoods can be inspected. The question is whether texts from different tasks tend to occupy overlapping regions or whether they separate by task. The generic projection shows more mixing among tasks. The specific projection shows more visibly distinct task groups.

This pattern matches the training targets. A head that must recognize task origin benefits when examples from different sources can be distinguished. A head that predicts span order can use clues that recur across tasks. The difference between the two plots is consistent with those pressures creating different feature geometries. It is especially relevant because both branches were built from the same encoder output. The observed contrast comes from what the extractors and their training signals do with that shared input.

The projections provide qualitative evidence for a relative distinction. They cannot establish that the generic vectors have lost all information about task origin or that the specific vectors contain only origin-related information. The projection is a compressed view of the features, and both branches still answer to the class objective. The figures are best read alongside the auxiliary-loss ablation. One analysis shows which training configuration works better in a controlled comparison. The other shows what aspects of the resulting feature organization are visible for a trained system on a particular order.

#### The specific branch still needs protection

A second ablation applies the distance penalty to the generic branch alone, to the specific branch alone, or to both. Protecting both yields better performance than either single-branch condition. In most of the circumstances reported, protecting the generic branch alone produces a larger gain than protecting the specific branch alone. The comparison is averaged over 3 runs.

The generic-only result is consistent with the authors’ expectation that preserving widely useful features is especially valuable during later changes. At the same time, removing the specific penalty entirely has a cost. The reason is apparent from the lifecycle of an example. Once its task is over, the learner gets relatively few chances to revisit it. The specific features that supported its class decision can still change whenever the shared encoder is updated. The penalty gives the later learner a reason to preserve those features on the inputs it can check. A branch can benefit from greater freedom to move while still needing a constraint.

This comparison concerns the presence of a penalty on each branch. The main training procedure also tunes penalty strength and uses different strengths for current and replay batches. The single-branch ablation establishes that using both terms helps in the comparisons reported. It gives less direct evidence about a universal ordering of coefficient values. Indeed, the coefficient search includes settings in which the generic and specific weights are equal. The way the spaces are constructed and the quantities to which the penalties apply remain different in that case.

#### Selection matters when the buffer is small

The third ablation changes how examples are admitted to memory. It uses IDBR in orders 1, 2 and 3 and compares random selection with the K-Means rule, holding the memory budget fixed. Average performance is better with clustering. The authors report a larger benefit on orders where IDBR’s performance is otherwise weaker. The comparison is averaged over 3 runs.

This is a comparison between ways of using the same limited supply of memory slots. With random selection, an easier-to-sample region of the dataset can contribute several similar examples by chance. The clustering rule assigns each center one retained example, so geographically distinct regions in the encoder space have an explicit route into replay. If reaching those different regions gives the learner reminders of different class distinctions, the same number of stored examples can support more of the earlier task.

The authors interpret the stronger effect on difficult orders as a sign that better coverage helps when forgetting is more severe. The comparison establishes the advantage of the selection procedure in these runs. It does not directly measure which kinds of examples make the difference, such as unusual cases or common cases that appear in varied contexts. The clustering rule uses all the current training embeddings to choose its representatives, so representativeness and additional selection work come together in this design.

Taken together, the ablations examine different steps in the method. The auxiliary comparison asks how to train the two extractors. The penalty comparison asks how to keep their outputs useful during later updates. The memory comparison asks which examples should provide a reminder of earlier tasks. A benefit at one step does not remove the need for the others. The results support the particular design in which branch roles, branch preservation and replay selection each have an explicit mechanism.

### Limitations

#### Limits identified by the authors

Resource constraints shape the experiments. The authors use Sampled for most comparisons and for all hyper-parameter tuning. They add Full to compare against the published MBPA++ and LAMOL settings. This provides evidence at the larger data scale and leaves the more detailed analysis concentrated in the reduced-data setup. Results from a particular ablation or order in Sampled should be read under its own training conditions.

The paper calls attention to the differences between the Full comparisons. The methods share training and test data but use different ways to store or produce replay examples and to make test predictions. MBPA++ adapts locally at inference, and LAMOL obtains task identifiers then. These differences are part of what a reader may care about when comparing systems. They also mean the final-accuracy comparison is not a controlled test of what happens if one changes only the regularizer while keeping the entire surrounding procedure fixed.

The authors propose sequence generation and sequence labeling as directions for future work. Their empirical evidence is for assigning labels to whole examples. A sequence-labeling system would need to make predictions at multiple positions, and a generation system would produce a sequence as its output. Those tasks would change what it means for a representation to preserve useful behavior and how to evaluate forgetting. The authors present extension to these settings as a possibility.

#### Limits visible in the experimental design

The sequence boundaries are defined for the learner, and examples have task identifiers during training. Both pieces matter. The system needs a boundary at which to save reference vectors and cluster the completed task’s data. The identifier head needs known targets. The absence of a task identifier at inference is therefore a property of the prediction procedure. The study does not establish how the entire training method would operate on an unlabeled stream where tasks blend into each other or where a change has to be detected from the data.

The datasets give the paper a way to compare retention of distinct classification abilities. They do not isolate every source of difference between tasks. A task identifier can be predicted from wording, formatting, subject matter, or other dataset cues that separate sources. Any of those may help a classifier on the benchmarks, and their usefulness could change if source cues become weaker. The experiment with more tasks changes the set of datasets as well as the sequence length. The larger gap to joint training on the longer sequences is evidence about those sequence groups. It does not isolate a causal effect of length independent of task content and order.

The method names the two branches by their intended roles. The training losses encourage those roles without directly requiring statistical independence between the vectors. In particular, the generic branch can encode task cues while learning to recognize span order, and the specific branch can encode broadly useful features while learning to identify a source. Both possibilities follow from the objectives. A probe to recover task identity from the generic branch or a quantitative test of information overlap would address questions left open by the visualization. The paper’s t-SNE analysis gives qualitative evidence that the spaces differ in how strongly they group tasks.

The span-order exercise also permits cues that need not generalize beyond the training datasets. The objective rewards any reliable way of identifying the original order, whether the signal is a broad property of text or a recurring property of the particular source. The class loss on reversed inputs further assumes that the class label survives reversal. The auxiliary ablation demonstrates a benefit on the tested order. It does not tell which textual cues produced that benefit or whether the same construction would help on classifications sensitive to the precise order of spans.

The memory percentage gives a clear measure of retained examples. It does not account for every resource the procedure uses. IDBR evaluates the previous encoder on current and stored texts to cache reference features, trains auxiliary predictors, and clusters the current task’s embeddings before selection. Those steps consume computation, and the cached references require storage during training. A comparison of end-to-end time, total memory and inference work would require timing and resource measurements of the competing methods under comparable conditions. The paper’s explicit budget establishes how many old examples IDBR keeps and its architecture shows which extra operations it performs.

Finally, the retention diagnostic follows only the tested orders through the measured stages. Every stage uses the immediately preceding representation as its reference. A small permitted change at each transition could accumulate over a much longer sequence. The small late increases in measured forgetting describe the end of these runs. They do not determine how the method would behave over an extended stream, when the set of earlier tasks grows or when the data revisit tasks already encountered.

### What came after

Later papers cite IDBR in connection with problems that reach beyond the original classifier experiments. Their titles identify three different research questions. The citation relationship establishes that the papers engage with IDBR as prior work. The available accounts do not identify a reuse of its feature branches, its auxiliary objectives or its replay rule in any of the three.

[Time Waits for No One! Analysis and Challenges of Temporal Misalignment](https://md.research.elamur.ai/free/en/papers/luu-2022-time-waits-no-one-analysis/) (2022) studies temporal misalignment. The connection to IDBR is the challenge of keeping a system useful when the data used to train it and the data it later faces reflect different conditions. IDBR creates change by switching among known classification datasets. Temporal misalignment raises the question of change over time, including situations in which deterioration can occur even before a system is updated. That distinction separates performance lost because the environment moved from performance lost because an update interfered with an earlier task. The citation places IDBR’s work on sequential training in the background to that problem. It does not establish that the temporal study implements IDBR as a remedy.

[Investigating Forgetting in Pre-Trained Representations Through Continual Learning](https://md.research.elamur.ai/free/en/papers/luo-2023-investigating-forgetting-pre-trained-representations/) (2023) connects forgetting to the representations acquired before a continual-learning sequence. In IDBR, a pretrained encoder provides the initial features, and the regularizers compare a task stage with its immediate predecessor. The primary outcome is classification performance on the supervised tasks in the sequence. The later paper’s stated subject brings a different reference point into view: what was available in the pretrained representations and what is retained as continual learning proceeds. Its citation links that investigation to earlier work that made representation change an explicit part of the training problem. The connection does not specify that it adopts IDBR’s generic and specific split.

[Mitigating the Alignment Tax of RLHF](https://md.research.elamur.ai/free/en/papers/lin-2024-mitigating-alignment-tax-rlhf/) (2024) addresses the cost associated with reinforcement learning from human feedback. Its connection to the IDBR problem is the effect of a new training objective on capabilities acquired earlier. The objectives and outcomes differ from a sequence of classification datasets. IDBR measures earlier-task accuracy and makes changes in selected representations costly. The later work’s stated subject is mitigation of the alignment tax in its own setting. Its citation situates the preservation problem in a wider discussion of what can be lost during subsequent training, while leaving the specific role of IDBR’s method unestablished.

## Cite

Cite as Yufan Huang, Yanzhe Zhang, Jiaao Chen, Xuezhi Wang and Diyi Yang. 2021. Continual Learning for Text Classification with Information Disentanglement Based Regularization. Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2021.naacl-main.218](https://doi.org/10.18653/v1/2021.naacl-main.218) · [arXiv 2104.05489](https://arxiv.org/abs/2104.05489)

```bibtex
@inproceedings{huang2021continual,
  title = {{Continual Learning for Text Classification with Information Disentanglement Based Regularization}},
  author = {Yufan Huang, Yanzhe Zhang, Jiaao Chen, Xuezhi Wang and Diyi Yang},
  booktitle = {Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.218},
  eprint = {2104.05489},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.18653/v1/2021.naacl-main.218}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
