Table of Contents
Fetching ...

Provable Benefits of Task-Specific Prompts for In-context Learning

Xiangyu Chang, Yingcong Li, Muti Kara, Samet Oymak, Amit K. Roy-Chowdhury

TL;DR

This work considers a novel setting where the global task distribution can be partitioned into a union of conditional task distributions and examines the use of task-specific prompts and prediction heads for learning the prior information associated with the conditional task distribution using a one-layer attention model.

Abstract

The in-context learning capabilities of modern language models have motivated a deeper mathematical understanding of sequence models. A line of recent work has shown that linear attention models can emulate projected gradient descent iterations to implicitly learn the task vector from the data provided in the context window. In this work, we consider a novel setting where the global task distribution can be partitioned into a union of conditional task distributions. We then examine the use of task-specific prompts and prediction heads for learning the prior information associated with the conditional task distribution using a one-layer attention model. Our results on loss landscape show that task-specific prompts facilitate a covariance-mean decoupling where prompt-tuning explains the conditional mean of the distribution whereas the variance is learned/explained through in-context learning. Incorporating task-specific head further aids this process by entirely decoupling estimation of mean and variance components. This covariance-mean perspective similarly explains how jointly training prompt and attention weights can provably help over fine-tuning after pretraining.

Provable Benefits of Task-Specific Prompts for In-context Learning

TL;DR

This work considers a novel setting where the global task distribution can be partitioned into a union of conditional task distributions and examines the use of task-specific prompts and prediction heads for learning the prior information associated with the conditional task distribution using a one-layer attention model.

Abstract

The in-context learning capabilities of modern language models have motivated a deeper mathematical understanding of sequence models. A line of recent work has shown that linear attention models can emulate projected gradient descent iterations to implicitly learn the task vector from the data provided in the context window. In this work, we consider a novel setting where the global task distribution can be partitioned into a union of conditional task distributions. We then examine the use of task-specific prompts and prediction heads for learning the prior information associated with the conditional task distribution using a one-layer attention model. Our results on loss landscape show that task-specific prompts facilitate a covariance-mean decoupling where prompt-tuning explains the conditional mean of the distribution whereas the variance is learned/explained through in-context learning. Incorporating task-specific head further aids this process by entirely decoupling estimation of mean and variance components. This covariance-mean perspective similarly explains how jointly training prompt and attention weights can provably help over fine-tuning after pretraining.

Paper Structure

This paper contains 21 sections, 157 equations, 1 figure.

Figures (1)

  • Figure 1: Experimental results across various settings: (a) Performance of unconstrained $\bm{W}_k,\bm{W}_q,\bm{W}_v$-parameterized linear attention model and reduced model, with non-zero task mean. (b) Performance of unconstrained $\bm{W}_k,\bm{W}_q,\bm{W}_v$-parameterized linear attention model and reduced model, with zero task mean. (c) Performance of unconstrained $\bm{W}_k,\bm{W}_q,\bm{W}_v$-parameterized linear attention model and theoretical prediction, with non-zero task mean. (d) Performance of unconstrained $\bm{W}_k,\bm{W}_q,\bm{W}_v$-parameterized linear attention model, with different numbers of task-specific trainable parameters.

Theorems & Definitions (3)

  • Definition 1: Single-task ICL
  • Definition 2: Multi-task ICL
  • Definition 3: Task-specific prompts