Search papers, labs, and topics across Lattice.
This paper introduces PACMS, a novel framework for context selection in conversational and tool-using LLM agents that utilizes submodular optimization to prioritize relevant information from a diverse pool of context sources. By addressing the limitations of recency truncation and existing context-compression methods, PACMS ensures that the most pertinent information is retained, even as the context window fills. The key finding demonstrates that this approach significantly improves the relevance of retained context, enhancing the agent's performance in long-term interactions.
Submodular context selection can dramatically enhance LLM agents' ability to retain relevant information over extended conversations, outperforming traditional methods like recency truncation.
Conversational and tool-using LLM agents operate over a context window that fills from several directions simultaneously. As a session proceeds, the agent accumulates user and assistant turns, entries drawn from a persistent memory store, and often largest of all, the verbatim outputs of tool calls such as file reads, search results, and API responses. Once the cumulative context exceeds the model's token budget, the framework must decide what to keep. The prevailing mechanism is recency truncation, sometimes paired with periodic summarization. This is topic-blind: a fact established early in a session is discarded simply because it is old, even when the current user query is about exactly that fact; conversely, verbose but irrelevant recent material is retained. Agents that must recall information across many turns, the defining case for memory, are precisely where recency truncation fails. Existing alternatives sit outside the agent's assembly step. Retrieval augmented generation fetches external documents into the prompt but does not arbitrate the agent's \emph{already-present} pooled context. Context-compression methods reduce token count by rewriting or pruning text, but operate query-blind and lossily. Neither treats memory entries, conversation turns, and tool outputs as a single candidate pool to be selected from by relevance at the moment the prompt is assembled.