Grad2Task: Improved Few-shot Text Classification Using Gradients for Task Representation

Jixuan Wang, Kuan-Chieh Wang, Frank Rudzicz, Michael Brudno
1/27/2022
cs.CLcs.AI

Official code: jixuan-wang/Grad2Task (14 stars, Python, Apache-2.0, last commit 2022-11-24).

Abstract

Large pretrained language models (LMs) like BERT have improved performance in many disparate natural language processing (NLP) tasks. However, fine tuning such models requires a large number of training examples for each target task.

Show full abstract

Simultaneously, many realistic NLP problems are "few shot", without a sufficiently large training set. In this work, we propose a novel conditional neural process-based approach for few-shot text classification that learns to transfer from other diverse tasks with rich annotation. Our key idea is to represent each task using gradient information from a base model and to train an adaptation network that modulates a text classifier conditioned on the task representation. While previous task-aware few-shot learners represent tasks by input encoding, our novel task representation is more powerful, as the gradient captures input-output relationships of a task. Experimental results show that our approach outperforms traditional fine-tuning, sequential transfer learning, and state-of-the-art meta learning approaches on a collection of diverse few-shot tasks. We further conducted analysis and ablations to justify our design choices.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Codes for the paper "Grad2Task: Improved Few-shot Text Classification Using Gradients for Task Representation"

141Python, ShellOct 25, 20214 years agoApache-2.0

Similar Papers

Cite this paper

@article{wang2022gradtask,
  title  = {Grad2Task: Improved Few-shot Text Classification Using Gradients for Task Representation},
  author = {Jixuan Wang and Kuan-Chieh Wang and Frank Rudzicz and Michael Brudno},
  year   = {2022},
  eprint = {2201.11576},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2201.11576}
}

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

Discussion