Language Models Struggle to Use Representations Learned In-Context
Michael A. Lepori, Tal Linzen, Ann Yuan, Katja Filippova
TL;DR
The paper investigates whether LLMs can flexibly deploy in-context learned representations to solve downstream tasks. It uses two metrics, Dirichlet Energy $E_G(H^l(\mathcal{T}))$ and Distance Correlation $D_C(H^l(\mathcal{T}))$, to quantify how well token representations align with a latent state-space topology, and evaluates open-weight LLMs on next-token prediction and adaptive world modeling (AWM), as well as frontier reasoning models. Across tasks, open-weight models encode in-context semantics in their latent representations but largely fail to deploy them for next-token prediction or AWM; frontier models show partial improvements, suggesting reasoning chains can partially compensate but do not fully enable flexible deployment. The findings underscore the need for targeted training regimens or architectural changes to create truly adaptable agents capable of leveraging in-context information in flexible, context-shifting ways.
Abstract
Though large language models (LLMs) have enabled great success across a wide variety of tasks, they still appear to fall short of one of the loftier goals of artificial intelligence research: creating an artificial system that can adapt its behavior to radically new contexts upon deployment. One important step towards this goal is to create systems that can induce rich representations of data that are seen in-context, and then flexibly deploy these representations to accomplish goals. Recently, Park et al. (2024) demonstrated that current LLMs are indeed capable of inducing such representation from context (i.e., in-context representation learning). The present study investigates whether LLMs can use these representations to complete simple downstream tasks. We first assess whether open-weights LLMs can use in-context representations for next-token prediction, and then probe models using a novel task, adaptive world modeling. In both tasks, we find evidence that open-weights LLMs struggle to deploy representations of novel semantics that are defined in-context, even if they encode these semantics in their latent representations. Furthermore, we assess closed-source, state-of-the-art reasoning models on the adaptive world modeling task, demonstrating that even the most performant LLMs cannot reliably leverage novel patterns presented in-context. Overall, this work seeks to inspire novel methods for encouraging models to not only encode information presented in-context, but to do so in a manner that supports flexible deployment of this information.
