Decoding In-Context Learning: Neuroscience-inspired Analysis of Representations in Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yousefi, Safoora, Betthauser, Leo, Hasanbeig, Hosein, Millière, Raphaël, Momennejad, Ida
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909115619475456
author Yousefi, Safoora
Betthauser, Leo
Hasanbeig, Hosein
Millière, Raphaël
Momennejad, Ida
author_facet Yousefi, Safoora
Betthauser, Leo
Hasanbeig, Hosein
Millière, Raphaël
Momennejad, Ida
contents Large language models (LLMs) exhibit remarkable performance improvement through in-context learning (ICL) by leveraging task-specific examples in the input. However, the mechanisms behind this improvement remain elusive. In this work, we investigate how LLM embeddings and attention representations change following in-context-learning, and how these changes mediate improvement in behavior. We employ neuroscience-inspired techniques such as representational similarity analysis (RSA) and propose novel methods for parameterized probing and measuring ratio of attention to relevant vs. irrelevant information in Llama-2 70B and Vicuna 13B. We designed two tasks with a priori relationships among their conditions: linear regression and reading comprehension. We formed hypotheses about expected similarities in task representations and measured hypothesis alignment of LLM representations before and after ICL as well as changes in attention. Our analyses revealed a meaningful correlation between improvements in behavior after ICL and changes in both embeddings and attention weights across LLM layers. This empirical framework empowers a nuanced understanding of how latent representations shape LLM behavior, offering valuable tools and insights for future research and practical applications.
format Preprint
id arxiv_https___arxiv_org_abs_2310_00313
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Decoding In-Context Learning: Neuroscience-inspired Analysis of Representations in Large Language Models
Yousefi, Safoora
Betthauser, Leo
Hasanbeig, Hosein
Millière, Raphaël
Momennejad, Ida
Computation and Language
Large language models (LLMs) exhibit remarkable performance improvement through in-context learning (ICL) by leveraging task-specific examples in the input. However, the mechanisms behind this improvement remain elusive. In this work, we investigate how LLM embeddings and attention representations change following in-context-learning, and how these changes mediate improvement in behavior. We employ neuroscience-inspired techniques such as representational similarity analysis (RSA) and propose novel methods for parameterized probing and measuring ratio of attention to relevant vs. irrelevant information in Llama-2 70B and Vicuna 13B. We designed two tasks with a priori relationships among their conditions: linear regression and reading comprehension. We formed hypotheses about expected similarities in task representations and measured hypothesis alignment of LLM representations before and after ICL as well as changes in attention. Our analyses revealed a meaningful correlation between improvements in behavior after ICL and changes in both embeddings and attention weights across LLM layers. This empirical framework empowers a nuanced understanding of how latent representations shape LLM behavior, offering valuable tools and insights for future research and practical applications.
title Decoding In-Context Learning: Neuroscience-inspired Analysis of Representations in Large Language Models
topic Computation and Language
url https://arxiv.org/abs/2310.00313