Source-linked AI summary

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

Zexuan Liu, Yuning Yang, Tiancheng Zhao

arXiv:2610.11007v1cs.AIcs.LGmath.OC

TL;DR

Always-loaded context files can contain unsuitable rules and grow by appending even though agent attention is limited. This paper models curation and learning from session feedback, establishing a pool-independent bound on optimal file size and showing that appending every individually worthwhile instruction can be arbitrarily worse.

  • Problem

    Curators face an expanding pool of candidate instructions while attention is finite, and unsuitable rules can lead agents to make mistakes.

    Source: §1 · pp. 1–2
  • Method

    The paper models curation as token-costed subset selection with attention-diluted compliance, then analyzes learning from session feedback and limits on reviewer edits.

    Source: §2 · pp. 3–4, §7 · p. 11
  • Results

    The analysis bounds optimal file size independently of pool size and shows appending all positive-standalone-value instructions can be arbitrarily worse; tested optima remain small as pools grow.

    Source: Size sweep · p. 9, §7 · p. 11
  • Takeaways & Limitations

    Curators should not automatically append every individually worthwhile instruction, and compliance and harm observations alone do not identify gain magnitudes.

    Source: §7 · p. 11

    Value identification under weaker conditions remains open when instructions interact differently, and whether measured-gain curation improves performance under actual edit limits is untested.

    Source: §7 · p. 12

Abstract

from arXiv · show

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.

1 INTRODUCTION

Always-loaded context files can impose recurring costs, contain harmful instructions, and grow through appending even as agent attention remains limited. The paper models what to retain and how curators can learn from censored session feedback.

1 INTRODUCTION

  • Every loaded token incurs recurring session costs, and larger files may reduce instruction-following reliability, though studies of small real-file ranges find no adherence drop.Context files can raise inference cost by a fifth or more without a matching task-success gain.Source: §1 · p. 1
  • Context files commonly grow by appending, while candidate pools can expand without bound even though agent attention does not.Across 1,867 repositories, such files more than doubled over their life and deletions became rarer as they aged.Source: §1 · p. 2
  • Feedback is censored: loaded instructions reveal compliance and its effects, while missing-instruction value usually appears only when absence causes a failure.The paper frames the central questions as what the file should contain and how curators can learn that from past transcripts.Source: §1 · p. 2
  • Instructions compete for shared attention that dilutes compliance as the file grows, and each retained instruction carries a per-session setup cost.The model extends fixed-cost assortment with a capacity constraint and a growing item pool.Source: §1 · p. 2
  • The paper identifies a gap in jointly studying finite attention capacity, censored feedback, a growing candidate pool, and limited curator edits.The cited prior work treats related learning settings separately.Source: §1 · p. 2
  • The paper contributes a capacitated assortment model, an attention-independent-of-pool-size file bound, and analyses of censored feedback, evidence thresholds, and reviewer edit limits.Experiments also find that irrelevant rules drawn from real context files reduce language-model compliance.Source: §1 · p. 2

2 MODEL

The model treats context curation as choosing a token-costed subset of candidate instructions for repeated sessions. Compliance can decline as instructions share attention, while file setup costs recur each session.

2 MODEL

  • A curator selects a subset from a pool that grows after sessions, and the agent loads that file at the start of later sessions.A summarizer extracts candidate instructions from session transcripts before they join the pool.Source: §2 · p. 3
  • Each instruction has a token cost and per-session value based on its relevance probability and expected gain when followed, which may be negative.Every loaded instruction incurs a setup cost κc_i per session.Source: §2 · p. 3
  • Adding instructions cannot increase the compliance of instructions already in the file; compliance otherwise depends on the whole file.Thus an instruction may be followed less often in company than alone.Source: §2 · pp. 3–4
  • In the shared-dilution subclass, compliance depends on intrinsic followability, attention load, and a common nonincreasing dilution curve.The model requires θ_i g(a_i) < 1; a single-item file has compliance θ_i g(a_i).Source: §2 · p. 3
  • The model bounds the average number of followed instructions per session by a finite attention capacity, regardless of how many are loaded.Under shared dilution, this capacity is finite when the dilution curve satisfies the stated decay condition; the weaker bounded-average-compliance condition can also hold without uniform capacity.Source: §2 · p. 4

3 STRUCTURAL PROPERTIES

Finite attention capacity and recurring setup costs constrain valuable file size, while dilution makes appending every individually worthwhile instruction potentially costly. Without dilution, accretion is optimal when the file fits the token budget.

3 STRUCTURAL PROPERTIES

  • The setup cost of any file worth keeping is bounded by the maximum per-instruction value times the attention capacity.A numerical illustration gives a 30,000-token cost bound when the best instruction is worth 10,000 always-loaded tokens per session and average compliance capacity is 3.Source: §3 · pp. 4–5
  • Under attention capacity, every nonnegative-value file—and therefore every optimum—has a size bound independent of the candidate pool size and token budget.The stated bounds apply when capacity holds; the appendix also gives a result under bounded average compliance when capacity fails.Source: §3 · pp. 4–5
  • With shared dilution, appending all instructions with positive standalone value can be arbitrarily worse than optimal selection as the candidate pool grows.The accretion loss grows linearly beyond χḠ/ρ, at rate κc_min per additional instruction; the agent follows only about χḠ instructions while paying for every appended one.Source: §3 · p. 5
  • Without dilution, value is additive and appending all positive-standalone-value instructions is optimal whenever they fit the token budget.In that case, the optimal files are exactly the feasible files containing the accretion set.Source: §3 · p. 5
  • A token budget set at the size-bound level can limit loss when the curator underestimates the token price.Under monotone dilution, at least one optimal file can be obtained by deleting instructions from the accretion file.Source: §3 · p. 5

4 LEARNING WITH CENSORED FEEDBACK

The section studies what session transcripts reveal when feedback about absent instructions is censored, and how curators can learn under an edit cap. It shows that compliance alone cannot guide value-based deletion, gives a condition for admitting instructions, and bounds the regret due to limited edits.

4.1 Setup

  • Loaded-item compliance and harm signals identify compliance and whether an instruction ever harms, but not gain magnitude without magnitude feedback; absent-item sightings reveal rates, not values.The learning setup observes compliance and harm for loaded instructions and gap sightings for absent ones.Source: §4.1 · p. 6

4.2 Deletion

  • Compliance-only deletion cannot distinguish value: with instructions {1, 2}, it removes helpful but often ignored instruction 1 with probability tending to one.Instruction 2 is mostly followed but worth little or harmful.Source: §4.2 · p. 6

4.3 Admission

  • Under Theorem 1's stated conditions, two sightings uniquely minimize expected loss, which trades false inclusion against delay for real candidates.The loss combines the probability of falsely including a spurious candidate with the expected wait for a real one.Source: §4.3 · p. 7

4.4 Regret under an edit cap

  • Without magnitude feedback, every policy has linear regret on some instance, and the learning term of the stated bound is not claimed tight.The learning term is of order T^(2/3)(ln NT)^(1/3).Source: §4.4 · pp. 7–8
  • ETC-m explores batches and commits to the highest estimated-value feasible file; under the stated conditions, the edit-cap regret bounds match within a constant, at order (N/m)L∆.The lower bound applies to policies adding at most m instructions per epoch from an empty file.Source: §4.4 · pp. 7–8

5 EXPERIMENTS

The experiments examine how file size affects instruction compliance and value, test dilution on a published benchmark, and simulate regret under an edit cap. They find that large files can reduce value and compliance, while the simulated edit-cap term tracks the theoretical bounds.

Size sweep.

  • At N = 3200, gross value peaks at b = 200 with 5.0 followed instructions for Haiku and 23.8 for Sonnet, falling to 0.6 and 4.0 with the entire pool loaded.The final step from b = 1600 to 3200 has negative marginal relevant compliance for both models.Source: Size sweep · p. 9, Figure 1 · p. 9
  • At ρexp = 0.1, measured optima are 10, 5, and 10 for Haiku and 40, 20, and 40 for Sonnet across pools of 200, 800, and 3200; accretion loss rises as the pool grows.From N = 200 to 3200, accretion loss rises from 15.8 to 316.7 for Haiku and from 6.0 to 320.4 for Sonnet.Source: Size sweep · p. 9
  • At N = 3200, mean compliance for relevant instructions in the b = 40 file is 0.27 for Haiku and 0.91 for Sonnet, versus 0.05 for both with the entire pool loaded.The score measures instruction compliance, not overall response quality.Source: Size sweep · p. 9
  • On IFScale, compliance ranges from 0.92–1.00 at ten keyword requirements to 0.067–0.689 at 500 requirements across 24 model configurations.Source: Size sweep · p. 9

Regret under an edit cap.

  • The simulated edit-cap term has log-log slope 1.06 against N/m at each epoch length, stays below the upper bound in all 60 settings, and is within a factor of 4.1–5.4 of the lower bound when N ≥4m.The plotted lines show the lower bound and the cap term of the upper bound.Source: Regret under an edit cap · p. 10, Figure 2 · p. 10

6 RELATED WORK

The related-work section distinguishes this paper's attention-capacity model and censored-feedback learning results from existing assortment, choice, bandit, and context-memory work. Its stated novelty is the combination of shared dilution, a growing candidate pool, and a renewing per-period edit cap.

Assortment with product costs and capacity

  • Unlike costed or space-constrained assortment work focused on revenue under a fixed choice model, this work bounds optimal file size under attention capacity, signed gains, and a growing pool.Hardness and approximation are not the subject of this paper.Source: §6 · p. 10

Other choice models

  • The authors know of no choice model that takes a capacity on total choice probability as a primitive; related attention models instead constrain consideration per item.Source: §6 · pp. 10–11

Learning with censored feedback and edit budgets

  • The feedback map here depends on the file through dilution, and the per-period edit cap renews so the untried pool shrinks at a fixed rate; the edit-cap regret term is matched above and below.Source: §6 · p. 11

LLM context and memory curation

  • Existing context and memory curation methods use additive or submodular value, while this work models competition for attention, censored signals outside the file, and regret under a review cap.Source: §6 · p. 11

7 CONCLUSION

The paper studies context curation as an assortment problem with token costs, attention capacity, and censored feedback. It reports pool-independent file-size bounds, learning results under stated assumptions, and experiments on instruction files.

7 CONCLUSION

  • The optimal file size is bounded independently of the candidate pool, while appending all positive-standalone-value instructions can become arbitrarily worse than optimal selection.Under the feedback model, compliance and harm observations do not identify gain magnitudes.Source: §7 · p. 11
  • The learning analysis gives conditions for requiring two sightings within a time window before admission and bounds regret under edit limits when gains are measured and additional identification assumptions hold.The upper and lower bounds match in the edit-related regret term up to constant factors.Source: §7 · p. 11
  • Experiments with two language models show that large instruction files can reduce gross value before token penalties, while the best tested files remain small as the candidate pool grows.The published benchmark also reports lower average compliance at high instruction counts.Source: §7 · p. 11
  • The conclusion leaves open which weaker conditions permit value identification under different instruction interactions and whether measured-gain curation improves performance under actual edit limits.The simulations reproduce the predicted scaling of regret caused by edit limits within the model.Source: §7 · p. 12

A PROOFS AND FURTHER RESULTS FOR SECTION 3

  • The appendix describes further Section 3 results, including a size bound when capacity fails and a sharpened cap that limits loss from an underestimated token price.It also gives a load bound that needs neither the mass condition nor capacity.Source: A PROOFS AND FURTHER RESULTS FOR… · p. 15

A.1 Proofs for Section 3

The appendix bounds the size and cost of nonnegative-value files, then characterizes how optimal files relate to the accretion file under monotone dilution. It also identifies a condition that cannot be weakened to a singleton-compliance bound.

A.1 Proofs for Section 3

  • κC(S) ≤ w̄χḠ and |S| ≤ χḠ/ρ for every file with R(S) ≥ 0, bounding optimal file size independently of candidate count and budget.Every optimum has nonnegative value, so these bounds apply to it.Source: §A.1 · p. 15
  • A budget B ≥ w̄χḠ/κ never binds: capped and uncapped optima coincide.The bound applies for every candidate count.Source: §A.1 · p. 15
  • The candidate-pool condition is compatible with infinitely many instructions having positive standalone value.The passage gives identical candidates as an example when their standalone value exceeds setup cost.Source: §A.1 · p. 15

A.2 Optimal files lie inside the accretion closure

  • Under monotone dilution, every optimum is contained in the accretion closure, and instructions with nonpositive standalone value are excluded from at least one optimum.An instruction with negative standalone value never appears in an optimum.Source: §A.2 · p. 15
  • The result requires monotone dilution: bounding each instruction’s compliance by its singleton level is insufficient when adding a harmful instruction can raise others’ compliance.The counterexample’s unique optimum includes the harmful instruction because it raises compliance for two others.Source: §A.2 · p. 16

A.3 Size bounds without capacity

Without a finite capacity-based compliance bound, the appendix gives size bounds under bounded-average compliance and a load bound under additional conditions. It also analyzes size behavior for particular dilution curves.

A.3 Size bounds without capacity

  • Under Assumption 2, N is finite, so every nonnegative-value file and every optimum has size at most n̄, with bounds independent of candidate count and budget.The size set N is an initial segment under Assumption 1.Source: §A.3 · p. 16
  • The strict Assumption 2 threshold matters: M(n)/n may approach ρ without ever falling below it.The passage gives an example satisfying Assumption 1 where the strict condition cannot be relaxed.Source: §A.3 · p. 16
  • Under power dilution, the size bound grows like (w̄/κ)^(1/β) and, for α > ρ, diverges as β approaches zero.Source: §A.3 · p. 17
  • When the budget does not bind, optimal size maximizes M(n) − ρn; under power dilution its continuous maximizer is ((1 − β)α/ρ)^(1/β).The integer optimum is the floor or ceiling of the continuous maximizer.Source: §A.3 · p. 17
  • Under the stated load-bound assumptions, each instruction in a nonempty optimum must cover its setup cost at the file’s attention load, which is bounded when g(∞) < ρ/θ̄ ≤ 1.If ρ/θ̄ > 1, the only optimum is empty.Source: §A.3 · p. 17

A.4 Sharpened size bound and cap insurance

The appendix sharpens file-size and token-price guarantees, then gives special-case multinomial-logit results and identifies what censored transcripts reveal under specified designs. Its identification results distinguish information from compliance, harm flags, and sightings.

A.4 Sharpened size bound and cap insurance

  • For any deletion-stable file with positive gross value, μC(S) ≤ a_g; a cap B ≥ a_g/κ therefore never binds.The result also bounds every optimum under any budget, subject to the stated assumptions.Source: §A.4 · p. 18
  • At B = a_g/κ, underestimating token price by κ−κ̂ loses at most a_g(1−κ̂/κ) ≤ a_g; overestimating it leaves the cap slack.Without a cap, the stated loss bound for underestimation can be unbounded in the Appendix B model as κ̂ approaches zero.Source: §A.4 · p. 19

B THE MULTINOMIAL LOGIT CASE

  • In the multinomial-logit case, compliance is shared dilution with g(x)=1/(1+x), and the agent follows at most one instruction per session on average.Here the capacity is Q̄=1, the single-choice case of the size-bound result.Source: B THE MULTINOMIAL LOGIT CASE · pp. 19–20

C.1 Formal assumptions

  • Under tied loads, identification requires G(x)=xg(x) to be injective over the batch-load range; otherwise distinct loads can produce the same batch compliances.For g(x)=e^−βx, G peaks at 1/β, so a range extending beyond that point can contain two indistinguishable loads.Source: §C.1 · p. 21

C.2 Identification

  • Compliance identifies values only on played item-file pairs and carries no information about value; harm flags identify whether an item ever harms, but gain sign only in the typed case.Gain magnitude is not identified without magnitude feedback.Source: §C.2 · p. 21
  • For an item never played, sightings identify only the product δ_i p_i; a common sighting rate and a bridge item played and omitted can identify δ and every p_i.The bridge item must have positive relevance.Source: §C.2 · p. 21

C.3 Deletion and the need for magnitudes

Deletion based on observed compliance can preserve a worse file, and without magnitude feedback even a one-item problem can force regret linear in the horizon.

C.3 Deletion and the need for magnitudes

  • With r₂=−0.05, both non-compliance deletion rules converge to keeping instruction 2, whose value −0.023 is below the empty file’s value 0.The example has R({1})=0.249, while R({2}) is 0.021 or −0.023 depending on r₂; the policies delete instruction 1 and keep instruction 2 with probability tending to one.Source: §C.3 · pp. 22–23
  • Even with one candidate, identical observation laws can hide opposite optimal files, forcing every policy to incur regret at least T min(∆,∆′)/2 in one instance.The proposition assumes positive probability of relevance and compliance, positive cost, and a budget that can accommodate the item.Source: §C.3 · p. 23

C.4 Admission

The admission analysis balances false inclusion against waiting for corroborating sightings. Under the stated conditions, requiring two sightings minimizes the specified loss.

C.4 Admission

  • For spurious candidates, PFI(1)=1−(1−ε)^T, while for k≥1 the bound uses a sighting plus at least k−1 additional sightings within the preceding W−1 sessions.For k=2, expected delay is 1/π(1+1/ψ_W), where ψ_W=1−(1−π)^(W−1); any k has delay at least k/π.Source: §C.4 · p. 23
  • k=2 is the unique minimizer of the stated admission loss when its loss bound is below both the k=1 bound and the lower bound for k≥3.The supplied band of conditions implies these comparisons.Source: §C.4 · p. 24
  • When Wπ ≫ k, the delay is about k/π; for rare false sightings, the stated upper bound on false inclusion is about T W x^k/(k−1)!.Counting only disjoint windows gives a lower bound smaller by a factor k.Source: §C.4 · p. 24

C.5 Regret under an edit cap

The section bounds learning regret when edits are capped, using batched exploration and an estimated-value commit step. It also reports the implementation setting used for the experiments.

C.5 Regret under an edit cap

  • ETC-m explores fixed batches, estimates compliance, batch load, and item parameters, then commits to the estimated best feasible file.The move to that file is scheduled in epochs so each edit period respects the m-edit cap.Source: §C.5 · pp. 24–25
  • The full regret bound separates exploration and file-move costs from the commit-phase estimation error.On the good estimation event, the commit error is at most 2n_B T ε_SD(n_0); the theorem also bounds the probability of the complementary event.Source: §C.5 · p. 26
  • With tuned exploration and other parameters fixed, the regret term is O(T^(2/3)(ln NT)^(1/3)); when m≤2B/c_max, the edit-cap term is at most ∆_max L(4N/m+3).The tuning uses ∆_max, which the curator does not know; a known upper bound can replace it.Source: §C.5 · p. 26

D EXPERIMENTAL DETAILS

  • Experiments used hosted Claude models through their command-line client, with the context file as the whole system prompt, no tools, and prompt caching off.Reported intervals are 95% percentile intervals from a task-cluster bootstrap with 2,000 replicates unless otherwise stated.Source: D EXPERIMENTAL DETAILS · p. 27

D.1 Size sweep

The size sweep finds that tested optimal files remain small as candidate pools grow, while larger files can dilute instruction compliance. Additional analyses examine instruction-density dilution and verify regret bounds under an edit cap.

D.1 Size sweep

  • At ρexp = 0.1, the measured optimum is 10, 5, and 10 items for Haiku and 40, 20, and 40 for Sonnet at N = 200, 800, and 3200.From N = 800 to N = 3200, accretion loss rises from 76.2 to 316.7 for Haiku and from 75.9 to 320.4 for Sonnet.Source: §D.1 · p. 28, Table 4 · p. 31
  • As ρexp rises, the optimum moves left; it is at b = N only for Sonnet at N = 200 and ρexp = 0.05.At N = 3200, gross value peaks at b = 200, then falls to 0.6 for Haiku and 4.0 for Sonnet when the entire pool is loaded.Source: §D.1 · pp. 28–29, Figure 3 · p. 29, Figure 5 · p. 32
  • At N = 3200, compliance of the b = 40 file’s relevant items falls from 0.27 to 0.05 for Haiku and from 0.91 to 0.05 for Sonnet as files grow.At b = 800, items in the first fifth of the file are followed about twice as often as the rest by both models, a pattern the set-level model does not represent.Source: §D.1 · p. 29, Figure 7 · p. 33, Figure 8 · p. 34

D.2 Dilution

  • The dilution experiment measures compliance across instruction density using 5,993 IFScale reports from 24 model configurations, without new model calls.It fits M(n) = n q(n) and reports compliance at n = 500; Figure 9 plots q(n) against n and sorted late/early slope ratios.Source: §D.2 · p. 35, Figure 9 · p. 35, Table 5 · p. 36

D.3 Regret

  • At N = 3200, the cap-term regret-to-lower-bound ratio is 4.08–5.38 across 51 cells with N ≥4m, and the cap term stays below its upper bound in all 60 cells.The log-log slope against N/m is 1.058 [1.029, 1.088] at each epoch length; this is a verification of the theorems, not an empirical test.Source: §D.3 · pp. 36–37, Table 6 · p. 37
  • More candidates increase edit-cap cost, a larger edit cap decreases it, and longer epochs increase how long each test batch must be retained.The regret experiment verifies theorem bounds on constructed instances rather than testing an empirical dataset.Source: §D.3 · pp. 36–37
Loading 2610.11007v1…