In-Context Learning Creates Task Vectors

AI-generated keywords: In-context learning

AI-generated Key Points

  • In-context learning (ICL) in Large Language Models (LLMs) is a powerful learning paradigm.
  • The functions learned by ICL have a simple structure.
  • ICL compresses the training set into a task vector and uses it to modulate the transformer for producing output.
  • Comprehensive experiments were conducted across various models and tasks, including LLaMA 7B, 13B, and 30B, GPT-J 6B, and Pythia 2.8B, 6.9B, and 12B.
  • Different layers in the transformer were investigated for implementing ICL, with all models exhibiting a performance peak at a similar intermediate layer.
  • The accuracy of hypothesis-based prediction using the (A,f) mechanism was compared to regular forward pass ICL.
  • Three procedures were evaluated: Regular ICL, Hypothesis-based ICL, and Baseline machine learning framework.
  • This study provides insights into the structure of functions learned through ICL in LLMs and highlights how they can be represented as task vectors derived from training sets.
Also access our AI generated: Comprehensive summary, Lay summary, Blog-like article; or ask questions about this paper to our AI assistant.

Authors: Roee Hendel, Mor Geva, Amir Globerson

Accepted at Findings of EMNLP 2023
License: CC BY 4.0

Abstract: 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.

Submitted to arXiv on 24 Oct. 2023

Ask questions about this paper to our AI assistant

You can also chat with multiple papers at once here.

AI assistant instructions?

Results of the summarizing process for the arXiv paper: 2310.15916v1

In-context learning (ICL) in Large Language Models (LLMs) is a powerful learning paradigm, but its underlying mechanism is not well understood. This study aims to shed light on this problem by demonstrating that the functions learned by ICL have a simple structure. Specifically, these functions correspond to the transformer LLM with inputs consisting of the query and a single "task vector" calculated from the training set. In other words, ICL compresses the training set into a task vector and uses it to modulate the transformer for producing output. To support this claim, comprehensive experiments were conducted across various models and tasks. Multiple open LLMs including LLaMA 7B, 13B, and 30B, GPT-J 6B, and Pythia 2.8B, 6.9B, and 12B were utilized in these experiments. The study also investigated the impact of choosing different layers in the transformer for implementing ICL. The accuracy on a development set was evaluated for different layer choices. Interestingly, all models exhibited a performance peak at a similar intermediate layer regardless of their parameters and layer count differences. Furthermore, the accuracy of hypothesis-based prediction using the (A,f) mechanism was compared to regular forward pass ICL. Three procedures were evaluated: Regular ICL which applies the LLM to demonstrations S and query x as usual; Hypothesis which utilizes A to generate θ using a dummy x' followed by f; Baseline which represents standard machine learning framework where one uses training set S to find best-fitting function f(x). Overall, this study provides insights into the structure of functions learned through ICL in LLMs and highlights how they can be represented as task vectors derived from training sets.
Created on 01 Nov. 2023

Assess the quality of the AI-generated content by voting

Score: 0

Why do we need votes?

Votes are used to determine whether we need to re-run our summarizing tools. If the count reaches -10, our tools can be restarted.

The previous summary was created more than a year ago and can be re-run (if necessary) by clicking on the Run button below.

Similar papers summarized with our AI tools

Navigate through even more similar papers through a

tree representation

Look for similar papers (in beta version)

By clicking on the button above, our algorithm will scan all papers in our database to find the closest based on the contents of the full papers and not just on metadata. Please note that it only works for papers that we have generated summaries for and you can rerun it from time to time to get a more accurate result while our database grows.

Disclaimer: The AI-based summarization tool and virtual assistant provided on this website may not always provide accurate and complete summaries or responses. We encourage you to carefully review and evaluate the generated content to ensure its quality and relevance to your needs.