Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

In-Context Learning Creates Task Vectors

About

In-context learning (ICL) in Large Language Models (LLMs) has emerged as a powerful new learning paradigm. However, its underlying mechanism is still not well understood. In particular, it is challenging to map it to the "standard" machine learning framework, where one uses a training set $S$ to find a best-fitting function $f(x)$ in some hypothesis class. Here we make progress on this problem by showing that the functions learned by ICL often have a very simple structure: they correspond to the transformer LLM whose only inputs are the query $x$ and a single "task vector" calculated from the training set. Thus, ICL can be seen as compressing $S$ into a single task vector $\boldsymbol{\theta}(S)$ and then using this task vector to modulate the transformer to produce the output. We support the above claim via comprehensive experiments across a range of models and tasks.

Roee Hendel, Mor Geva, Amir Globerson• 2023

Related benchmarks

TaskDatasetResultRank
Text ClassificationAG-News
Accuracy57.9
248
Topic ClassificationAG-News
Accuracy58.9
225
Multitask Language UnderstandingMMLU-Pro
Accuracy31.6
118
Commonsense Question AnsweringCommonsenseQA
Accuracy22
83
Natural Language InferenceaNLI
Accuracy33.17
65
Semantic Antonym PredictionAntonym
Accuracy65.7
44
Machine TranslationEnglish-French
Accuracy73.8
42
ReasoningBig-Bench Hard (BBH)
Accuracy42.01
33
Sentiment ClassificationSentiment classification
Acc77.1
32
Knowledge Retrieval / Relation PredictionPerson-Instrument
Accuracy0.706
30
Showing 10 of 32 rows

Other info

Follow for update