ICLR: In-Context Learning of Representations
Core Francisco Park, Andrew Lee, Ekdeep Singh Lubana, Yongyi Yang, Maya Okawa, Kento Nishi, Martin Wattenberg, Hidenori Tanaka
TL;DR
The paper investigates whether in-context exemplars can override pretrained semantic structure in large language models by presenting a graph-tracing task where tokens map to graph nodes and connectivity is defined independently of semantics. It demonstrates that, with enough in-context examples, representations reorganize to reflect the graph structure, as evidenced by PCA visualizations and a decreasing Dirichlet energy, and that this reorganization occurs despite semantic correlations. The authors propose an energy minimization framework to explain the emergence, linking the observed PCA structure to spectral embeddings of the inferred graph. The findings suggest that scaling context can unlock novel, context-specified representations and capabilities in LLMs, with potential implications for adaptive world representations and reasoning. However, the reorganization is not always dominant over pretrained priors, and the phenomenon appears to follow phase-transition-like dynamics tied to context length and graph size.
Abstract
Recent work has demonstrated that semantics specified by pretraining data influence how representations of different concepts are organized in a large language model (LLM). However, given the open-ended nature of LLMs, e.g., their ability to in-context learn, we can ask whether models alter these pretraining semantics to adopt alternative, context-specified ones. Specifically, if we provide in-context exemplars wherein a concept plays a different role than what the pretraining data suggests, do models reorganize their representations in accordance with these novel semantics? To answer this question, we take inspiration from the theory of conceptual role semantics and define a toy "graph tracing" task wherein the nodes of the graph are referenced via concepts seen during training (e.g., apple, bird, etc.) and the connectivity of the graph is defined via some predefined structure (e.g., a square grid). Given exemplars that indicate traces of random walks on the graph, we analyze intermediate representations of the model and find that as the amount of context is scaled, there is a sudden re-organization from pretrained semantic representations to in-context representations aligned with the graph structure. Further, we find that when reference concepts have correlations in their semantics (e.g., Monday, Tuesday, etc.), the context-specified graph structure is still present in the representations, but is unable to dominate the pretrained structure. To explain these results, we analogize our task to energy minimization for a predefined graph topology, providing evidence towards an implicit optimization process to infer context-specified semantics. Overall, our findings indicate scaling context-size can flexibly re-organize model representations, possibly unlocking novel capabilities.
