Towards Anytime Fine-tuning: Continually Pre-trained Language Models with Hypernetwork Prompt

Gangwei Jiang, Caigao Jiang, Siqiao Xue, James Y. Zhang, Jun Zhou +2 more
10/19/2023
cs.CLcs.AIcs.LG

No official code found. Best implementation: gangwJiang/HPrompt-CPT (5 stars, last commit 2023-10-12).

Abstract

Continual pre-training has been urgent for adapting a pre-trained model to a multitude of domains and tasks in the fast-evolving world. In practice, a continually pre-trained model is expected to demonstrate not only greater capacity when fine-tuned on pre-trained domains but also a non-decreasing performance on unseen ones. In this work, we first investigate such anytime fine-tuning effectiveness of existing continual pre-training approaches, concluding with unanimously decreased performance on unseen domains. To this end, we propose a prompt-guided continual pre-training method, where we train a hypernetwork to generate domain-specific prompts by both agreement and disagreement losses. The agreement loss maximally preserves the generalization of a pre-trained model to new domains, and the disagreement one guards the exclusiveness of the generated hidden states for each domain. Remarkably, prompts by the hypernetwork alleviate the domain identity when fine-tuning and promote knowledge transfer across domains. Our method achieved improvements of 3.57% and 3.4% on two real-world datasets (including domain shift and temporal shift), respectively, demonstrating its efficacy.

View on arXivView PDF

Code Implementations(1)

An official implement of "Towards Anytime Fine-tuning: Continually Pre-trained Language Models with Hypernetwork Prompts“"

50Oct 12, 20233 years ago

Similar Papers

Cite this paper

@article{jiang2023towards,
  title  = {Towards Anytime Fine-tuning: Continually Pre-trained Language Models with Hypernetwork Prompt},
  author = {Gangwei Jiang and Caigao Jiang and Siqiao Xue and James Y. Zhang and Jun Zhou and Defu Lian and Ying Wei},
  year   = {2023},
  eprint = {2310.13024},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.13024v1}
}

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/2310.13024.svg)](https://codeofpaper.com/paper/2310.13024)

Discussion