{ "id": "2310.00313", "version": "v1", "published": "2023-09-30T09:01:35.000Z", "updated": "2023-09-30T09:01:35.000Z", "title": "In-Context Learning in Large Language Models: A Neuroscience-inspired Analysis of Representations", "authors": [ "Safoora Yousefi", "Leo Betthauser", "Hosein Hasanbeig", "Akanksha Saran", "Raphaël Millière", "Ida Momennejad" ], "categories": [ "cs.CL" ], "abstract": "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 three tasks with a priori relationships among their conditions: reading comprehension, linear regression, and adversarial prompt injection. We formed hypotheses about expected similarities in task representations to investigate latent changes in embeddings and attention. Our analyses revealed a meaningful correlation between changes in both embeddings and attention representations with improvements in behavioral performance after ICL. This empirical framework empowers a nuanced understanding of how latent representations affect LLM behavior with and without ICL, offering valuable tools and insights for future research and practical applications.", "revisions": [ { "version": "v1", "updated": "2023-09-30T09:01:35.000Z" } ], "analyses": { "keywords": [ "large language models", "in-context learning", "neuroscience-inspired analysis", "latent representations affect llm behavior", "attention representations" ], "note": { "typesetting": "TeX", "pages": 0, "language": "en", "license": "arXiv", "status": "editable" } } }