arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.00313cs.CL
收藏

解码上下文学习:受神经科学启发的大型语言模型表示分析

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

Microsoft(微软公司);Microsoft Research(微软研究院);Macquarie University(麦考瑞大学)

Safoora Yousefi, Leo Betthauser, Hosein Hasanbeig, Raphaël Millière, Ida Momennejad

AI总结:

本文受神经科学启发,通过表征相似性分析和参数化探测等方法分析Llama-2 70B与Vicuna 13B在上下文学习前后的嵌入与注意力变化,揭示了表征变化与行为改进之间的关联。

摘要:

大型语言模型(LLMs)通过利用输入中特定任务的示例,在上下文学习(ICL)中表现出显著的性能提升。然而,这种提升背后的机制仍不明确。在本工作中,我们研究了LLM嵌入和注意力表示在上下文学习之后如何变化,以及这些变化如何介导行为上的改进。我们采用受神经科学启发的技术,如表征相似性分析(RSA),并提出新方法,用于在Llama-2 70B和Vicuna 13B中进行参数化探测以及测量注意力在相关信息与不相关信息之间的比率。我们设计了两个条件之间具有先验关系的任务:线性回归和阅读理解。我们对任务表征中的预期相似性形成了假设,并测量了ICL前后LLM表征的假设对齐情况以及注意力的变化。我们的分析揭示了ICL后行为改进与LLM各层嵌入和注意力权重的变化之间存在有意义的关联。这一实证框架使人们能够细致地理解潜在表征如何塑造LLM行为,为未来研究和实际应用提供了有价值的工具和见解。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑