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

Xiangyu Chang, Yingcong Li, Muti Kara, Samet Oymak, Amit K. Roy-Chowdhury
3/3/2025
cs.CLcs.AI

No official code found. Best implementation: xchang1121/prompt_ICL (0 stars, last commit 2025-09-06). 1 more below.

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.

View on arXivView PDF

Code Implementations(2)

code for paper "Provable Benefits of Task-Specific Prompts for In-context Learning"

00Python, Jupyter NotebookMar 5, 20251 years ago

Code for paper "Provable Benefits of Task-Specific Prompts for In-context Learning" in AISTATS 2025

00Python, Jupyter NotebookJul 17, 20251 years agoNOASSERTION

Similar Papers

Cite this paper

@article{chang2025provable,
  title  = {Provable Benefits of Task-Specific Prompts for In-context Learning},
  author = {Xiangyu Chang and Yingcong Li and Muti Kara and Samet Oymak and Amit K. Roy-Chowdhury},
  year   = {2025},
  eprint = {2503.02102},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.02102v2}
}

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

Discussion