In-Context Learning Dynamics with Random Binary Sequences
Eric J. Bigelow, Ekdeep Singh Lubana, Robert P. Dick, Hidenori Tanaka, Tomer D. Ullman
TL;DR
This work treats in-context learning (ICL) as Bayesian model selection over a discrete latent concept space, using random binary sequences to probe how context activates competing algorithms without updating model weights. By framing $p(y|x)=\\int p(y|h) p(h|x) \\mathrm{d}h$ (or its discrete form) and analyzing sharp, S-shaped transitions as context length $|x|$ grows, the authors show that large LLMs can switch between latent concepts, including subjectively random generation and simple formal language induction. Empirical results with GPT-3.5+ reveal controllable generation of random-like sequences and abrupt formal-language learning, with open-source models displaying similar but varied dynamics; these findings support a view of ICL as model selection over latent concepts rather than gradual parameter-like updates. The study highlights non-linear, context-driven emergence of capabilities and points to implications for AI safety and interpretability, while offering a cognitive-science-inspired framework to connect high-level ICL behavior with discrete hypothesis search.
Abstract
Large language models (LLMs) trained on huge corpora of text datasets demonstrate intriguing capabilities, achieving state-of-the-art performance on tasks they were not explicitly trained for. The precise nature of LLM capabilities is often mysterious, and different prompts can elicit different capabilities through in-context learning. We propose a framework that enables us to analyze in-context learning dynamics to understand latent concepts underlying LLMs' behavioral patterns. This provides a more nuanced understanding than success-or-failure evaluation benchmarks, but does not require observing internal activations as a mechanistic interpretation of circuits would. Inspired by the cognitive science of human randomness perception, we use random binary sequences as context and study dynamics of in-context learning by manipulating properties of context data, such as sequence length. In the latest GPT-3.5+ models, we find emergent abilities to generate seemingly random numbers and learn basic formal languages, with striking in-context learning dynamics where model outputs transition sharply from seemingly random behaviors to deterministic repetition.
