← All papers
First page of Curating Always-Loaded Context for LLM Agents: A Capacitated Assortment Model with Censored Feedback

Curating Always-Loaded Context for LLM Agents: A Capacitated Assortment Model with Censored Feedback

Zexuan Liu, Yuning Yang, Tiancheng Zhao

cs.AI Oct 7, 2026 · v1 cs.LG math.OC
Nearly all numbered theorems on context-file curation, except those relying on one smoothness assumption, have complete formal proofs in Lean 4, supplied as supplementary material.
At the start of every session, LLM agents load a fixed context file, such as $\texttt{AGENTS.md}$. Each loaded token in the file is charged again in every later round of the session, and these files can degrade performance as they grow in size. However, in practice, human or automated curators usually grow these files by appending. We formulate context curation as a capacitated assortment problem. Instructions consume tokens under a finite attention capacity; adding an instruction never raises the compliance of the others, while retained instructions incur a per-session setup cost. We prove an upper bound on the optimal file size, regardless of the number of available candidate instructions, and that appending every instruction with positive standalone value can be arbitrarily worse in net value than selecting an optimal subset. A token budget also limits the loss when the token price is underestimated. We then examine what can be learned from past sessions and how this information can guide decisions to add or remove instructions. Feedback is inherently censored: the benefits and harms of loaded instructions are observable, whereas missing instructions generate feedback only when their absence causes harm. In this setting, we show that deleting instructions ignored by agents can inevitably remove helpful ones. We characterize how much evidence should be collected before adding an instruction. Besides, we bound regret when human reviewers can inspect only a limited number of edits per period. Empirical experiments further show that irrelevant rules drawn from real context files reduce language-model compliance.

LLM agents load a fixed context file such as AGENTS.md every session, and curators usually grow it by appending. Each loaded token costs something in every round, and large files can lower compliance. The open questions are what the file should contain and how to learn that from censored session transcripts.

Context curation is modeled as a capacitated assortment problem. Instructions have token costs and signed gains, and compliance is diluted under a finite attention capacity. Learning from transcripts is analyzed under censored feedback, where absent instructions are observed only through gap sightings, and reviewers can approve only a limited number of edits per period. The numbered results are formally proved in Lean 4, and experiments with Claude models on ManyIFEval tasks vary file and pool sizes.

The optimal file size is bounded independently of the candidate pool size. Appending every instruction with positive standalone value can be arbitrarily worse than optimal selection. Deleting instructions that agents ignore can remove helpful ones, and the edit-limited regret bounds match up to constant factors. In experiments, large files reduced gross value, and the best tested files stayed small as the pool grew.