Does RoBERTa Perform Better than BERT in Continual Learning: An Attention Sink Perspective

Xueying Bai, Yifan Sun, Niranjan Balasubramanian
10/8/2024
cs.LGcs.CL

No official code found. Best implementation: StonyBrookNLP/attention-sink-cl (4 stars, last commit 2024-10-07).

Abstract

Continual learning (CL) aims to train models that can sequentially learn new tasks without forgetting previous tasks' knowledge. Although previous works observed that pre-training can benefit CL, it remains unclear whether a pre-trained model with higher downstream capacity also performs better in CL. In this paper, we observe that pre-trained models may allocate high attention scores to some 'sink' tokens, such as [SEP] tokens, which are ubiquitous across various tasks. Such attention sinks may lead to models' over-smoothing in single-task learning and interference in sequential tasks' learning, which may compromise the models' CL performance despite their high pre-trained capabilities. To reduce these effects, we propose a pre-scaling mechanism that encourages attention diversity across all tokens. Specifically, it first scales the task's attention to the non-sink tokens in a probing stage, and then fine-tunes the model with scaling. Experiments show that pre-scaling yields substantial improvements in CL without experience replay, or progressively storing parameters from previous tasks.

View on arXivView PDF

Code Implementations(1)

40Shell, PythonJul 25, 20242 years ago

Similar Papers

Cite this paper

@article{bai2024does,
  title  = {Does RoBERTa Perform Better than BERT in Continual Learning: An Attention Sink Perspective},
  author = {Xueying Bai and Yifan Sun and Niranjan Balasubramanian},
  year   = {2024},
  eprint = {2410.05648},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.05648v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.05648.svg)](https://codeofpaper.com/paper/2410.05648)

Discussion