Manuscript Offprint

arXiv:2609.35599

Signatures of semantic search in the activations of large language models

Luke Leckie, Peter M. Todd, Jacob G. Foster

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

When recalling lists of concepts (e.g., animals) during the semantic fluency task (SFT), both humans and large language models (LLMs) organise their output into clusters of related items (e.g., sea animals) that are punctuated by strategic switches between clusters. In humans, this pattern can be explained by a semantic foraging process, whereby distinct neural and behavioural signatures accompany within-cluster production (“exploit”) and between-cluster switching (“explore”). Whether LLMs likewise represent these two search regimes within their internal states is unknown. Here, we apply a range of mechanistic interpretability techniques to provide evidence for this. In Study 1, we use the Jacobian lens (J-lens), which maps intermediate-layer residual-stream representations to token-level activations, to show that concept-level activations predict switching. First, we find that switching coincides with low next-token activations. Moreover, the probability of switching rises as the set of strongest J-lens activations (the J-space) becomes depleted of items from the category currently being produced, analogous to explore-exploit decision-making during patch foraging. We then show that middle-layer J-lens activations of abstract category-related labels (e.g., “water”) increase in anticipation of switching into that category. We confirm these representations to causally influence switching by deriving steering vectors that target category switching. In Study 2, we identify generic residual stream directions that are activated during and in anticipation of switching. By steering activations along these directions, we bias increased or decreased rates of switching. Our study extends the semantic foraging framework to artificial intelligences and provides evidence that LLMs maintain distinct representational signatures for exploration and exploitation as they verbalise conceptual information.

1 INTRODUCTION AND RELATED WORK

Searching for resources is a ubiquitous challenge faced by agents (Hills et al., 2015; Charnov, 1976; Todd et al., 2012). In search environments where resources are distributed patchily over space, agents must balance the local exploitation of known but depleting resources against global exploration for novel but uncertain resources (Charnov, 1976). This type of search problem is typified by animal patch foraging behaviours. During patch foraging, animals typically decide when to leave a depleting patch and explore for a new one based on the value of continued exploitation relative to expected opportunities available elsewhere (Charnov, 1976). Alternation between local exploitation and global exploration has been described across a wide diversity of organisms and contexts; it may constitute a general solution to efficient search in structured environments (Marques et al., 2020; Nicolau Jr et al., 2009; Hogeveen et al., 2022; Todd et al., 2012; Buatois & Lihoreau, 2016).

Mounting evidence from human concept-list recollection studies suggests that the retrieval of semantic information from internal meaning spaces also operates according to a foraging process that balances local exploitation against global exploration (Hills et al., 2012; Lundin et al., 2023; Nour et al., 2023). Research has focused on the Semantic Fluency Task (SFT), in which individuals are tasked with naming as many concepts (e.g., animals) as they can within a short period of time. Concept recollection during the SFT is typically arranged into bouts of exploitative “clustering”, in which individuals name closely semantically related items (e.g., listing farm animals); these bouts are separated by strategic exploratory “switches” between clusters (e.g., farm animals → sea animals) (Troyer et al., 1997; Lundin et al., 2020). The semantic foraging framework is supported by studies showing that clustering and switching regimes are coupled to distinct behavioural and neural signatures. For instance, when switching, inter-item response latency increases (Hills et al., 2012) and both the posterior cerebellum and hippocampus experience heightened activation, with characteristic “ripple bursts” of activity travelling through the hippocampus (Lundin et al., 2023; Nour et al., 2023). Moreover, the activity of these two regions progressively increases (“ramping”) with the time spent naming items within a given cluster (Lundin et al., 2023). Finally, evidence for patch-like semantic representations comes from work showing that priming individuals with high-level category-related concepts (e.g., “river”) facilitates the retrieval of exemplar items (e.g., “crocodile”), suggesting that item-level retrieval depends on the activation of category-level semantic representations (Neely, 1977; Dirani & Pylkkänen, 2023; Rissman & Lupyan, 2024). While SFT-performing Large Language Models (LLMs) similarly produce concept lists arranged into clusters and switches (Lacosse et al., 2026b) it is not presently known if this is related to a semantic foraging-like process—with distinct activation signatures for clustering and switching—or only bears superficial resemblances to human-produced text.

Recent mechanistic interpretability research provides evidence that LLMs maintain internal representations that track and influence the structure of generated language (Pal et al., 2023; Hendel et al., 2023; Todd et al., 2024; Dong et al., 2025). For example, research using sparse autoencoders to track changes in model activations when processing pre-created stories finds that activations strongly shift across event boundaries (Lubana et al., 2025). Furthermore, research examining LLM reasoning behaviours, such as back-tracking and expressing uncertainty, has found that these behaviours are coupled to specific directions in model activation space, which can be “steered” to bias the propensity for these behaviours (Venhoff et al., 2025). Other research provides evidence that models hold and act on anticipatory internal representations of future content. Specifically, LLMs writing rhyming poetry internally represent candidate end-of-line rhyming words before composing the line; editing these representations restructures the intervening text to cohere with the edited end-of-line word (Lindsey et al., 2025). More recently, work employing the “Jacobian-lens” (J-lens), which maps intermediate-layer activations to token-level activations, has found that LLMs can represent intermediate and higher-level concepts related to their current output in their mid-layers (e.g., the token “red” may have a high activation when the LLM is answering “The fourth planet from the sun is [Mars]”) (Gurnee et al., 2026). One recent study found that LLMs processing human-generated SFT lists assign low next-token probabilities to their switch events; these LLMs also have different residual stream activations when specifically prompted to generate a semantically similar versus different item to one provided (Lacosse et al., 2026b) and can collaborate with humans performing the SFT to enhance their concept retrieval (Lacosse et al., 2026a). Together, these findings link changes in generated language to identifiable internal representations. However, research has not yet directed mechanistic interpretability tools, such as the J-lens, to study or manipulate the dynamics of LLM activations as they naturally perform semantic foraging tasks. It is, therefore, unclear if the representations of LLMs support a foraging-like process that regulates transitions between exploitation and exploration during semantic retrieval. Understanding this is critical: The same area-restricted search dynamics that govern SFT production are hypothesised to extend into naturalistic speech (Leckie et al., 2026) and could also be shared across a range of search tasks that are central to the utility of LLMs, including searching for information over the internet (Nakano et al., 2022), selecting tools (Schick et al., 2023), navigating code (Yang et al., 2024), and retrieving information from context (Liu et al., 2024). Discovering latent explore-exploit dynamics in these behaviours and modulating the balance of exploration versus exploitation could enhance the efficiency of the search processes underpinning the effectiveness of these LLM behaviours.

In this paper, we apply a range of mechanistic interpretability techniques to study this. In Study 1, we examine how concepts are represented across different layers of LLMs during the SFT and ask if these representations signify participation in switching versus clustering behaviours. To do this, we first investigate how final-layer token probabilities differ preceding switching versus clustering events. We then test whether final-layer differences in concept activation are detectable in earlier layers, by applying the J-lens to internal layers of the residual stream. We find that switch events are preceded by low next-token probabilities and that, although all items show increased activation in anticipation of their verbalisation, this effect is lower for items participating in switches, as compared to clustering. Second, we use the J-lens to identify internal conceptual patches comprising the most strongly activated concepts. We find that as these patches become depleted with items from the same category that an LLM is presently verbalising from, LLMs become increasingly likely to switch to a novel category; this effect is greater than expected by depleting the overall pool of items in a category. Third, we show that the activations of higher-level category-related labels (e.g., “Africa”) increase in anticipation of switching into the corresponding category. We then demonstrate these item- and category-level activations to influence switching behaviour by using them to derive steering vectors that induce switching towards target categories. In Study 2, we identify generic directions in LLM activation space that predict switching behaviour and ramp in anticipation of switching. By steering SFT-performing LLMs along this direction, we bias increased or decreased likelihoods of switching. This study provides evidence that LLMs hold distinct representational signatures for exploration and exploitation as they search for conceptual resources, demonstrating semantic foraging-like search behaviour as a property of LLMs.

References (54)