Pricing Context by What Is Already There: Distraction as a State-Dependent Action Cost

Language models get worse when their prompt contains irrelevant or misleading text, and retrieval systems now try to decide how much text to feed them. Almost all of these systems price each retrieved passage the same way regardless of what the prompt already holds. Each passage either earns a fixed relevance score, or the whole retrieval is priced in tiers of zero, one, or many steps. We argue this misses the main effect. The harm of adding a passage, and the extra reasoning tokens it provokes, plausibly depend on what is already in the prompt. A loosely related paragraph may be harmless next to clean evidence. The same paragraph may be damaging when the prompt already contains a plausible contradiction that the model will try to reconcile. The planning literature has a name for this kind of problem: state-dependent action costs, meaning the price of an action depends on the situation in which it is taken rather than being a fixed number attached to the action.

This note proposes to treat building a prompt as a short planning problem whose action costs are state-dependent. The actions are inserting a passage, switching the model's step-by-step "thinking" mode on or off, and answering. Each action's cost is the predicted loss in accuracy plus the token expense it causes given the current prompt. The work has two parts. First, it measures directly whether distraction is non-additive in this sense. Second, if it is, the work learns a cheap predictor of these conditional costs and plans with it, calling the expensive language model only on the prompts the planner actually commits to. The measurement is the decisive first step. If distraction turns out to be additive across passages, a per-passage reranker with a cutoff is the right tool, and the project reports that negative result instead of building a planner.

Core Claim

The core claim is that the marginal cost of a context action is a function of the context already assembled. That cost has two parts: lost answer accuracy and inflated generation length. The interaction is large enough that a planner using conditional costs beats both per-passage scoring and learned policies that only see a token penalty in their reward.

Two pieces of evidence motivate this. Beyond RAG vs. Long-Context finds an inverted-U curve: adding passages helps until distraction dominates. That is already a sign that a passage's value depends on how much is there. Thinking in a Crowd shows that misleading snippets make reasoning traces longer and can make thinking mode harmful. On SciAux, Qwen3-8B falls from 96.22% clean accuracy to 77.03% with two misleading snippets and thinking on, against 74.87% with thinking off. So whether to "think" is itself an action whose value depends on the noise already in the prompt.

Neither paper formalizes these costs or acts on them. Decision-Focused Learning to Predict Action Costs for Planning supplies the method for learning costs that a planner uses. It trains cost predictors by penalizing the regret of the plan they induce rather than squared error. However, it uses fixed numeric features and explicitly leaves state-dependent costs to future work. We carry that method into a setting where the state is a text prompt.

Formulation

Let a state $s$ be the current prompt contents (question, inserted passages in order, thinking-mode flag). Let an action $a$ be one of: insert candidate passage $p$, toggle thinking, or answer. We define the cost

$$c(a \mid s) = \lambda \cdot \Delta\text{tokens}(a \mid s) + \Delta\text{risk}(a \mid s).$$

Here $\Delta\text{tokens}$ is the change in input plus generated tokens caused by taking $a$ in $s$, and $\Delta\text{risk}$ is the change in the reader's negative log-probability of the correct answer. The parameter $\lambda$ is a user-chosen price per token. The planner searches for the action sequence with the lowest total cost.

Non-additivity is measured as follows. For a fixed passage $p$, we take the marginal effect $\Delta_p(C) = f(C \cup \{p\}) - f(C)$ across many sampled contexts $C$, where $f$ is either answer log-probability or output length. We then ask what fraction of the variance of $\Delta_p(C)$ an additive model $\Delta_p(C) \approx g(p)$ explains. That fraction is the quantity the whole project hinges on.

Research Program

Measurement. The first stage measures interaction on controlled data. SciAux (dataset) labels auxiliary snippets as helpful, irrelevant, or misleading, so we can construct contexts mixing these types and record $\Delta_p(C)$ for Qwen3-8B with thinking on and off. We then repeat the measurement on the HotpotQA distractor setting (HotpotQA) and on MuSiQue (MuSiQue), where passages are naturally occurring rather than labeled. MuSiQue matters because it was built so that single passages cannot shortcut the answer. Interactions between a bridge passage and its partner are therefore expected to be strong, and filters that score passages independently are expected to drop them. We pre-register the reporting rule: we report the variance explained by the additive model and by a pairwise-interaction model. If the additive model explains nearly everything, we stop and publish the measurement.

Cost model. The second stage learns a cheap conditional cost predictor $\hat c_\theta(a \mid s)$. Its input features need no call to the reader: retriever scores, the passage's position and the current prompt length, and pairwise entailment or contradiction scores between $p$ and passages already in $s$ from a small inference model. Because the planner only needs costs to rank options correctly, we train $\hat c_\theta$ with the regret-based loss of Decision-Focused Learning and compare it with plain squared error. We inherit that paper's practical fixes: shifting predictions to avoid negative costs, and caching plans so the planner is not re-run at every training step.

Planner and lazy evaluation. The third stage is the planner. It runs a best-first search over prompt states with $\hat c_\theta$. Following Efficient Optimal Search under Expensive Edge Cost Computation, which delays computing expensive edge costs until a node is actually selected, we call the reader only on the state the planner pops for commitment. From that call we observe actual generation length and the agreement among a few sampled answers, both of which can be checked without labels. If these exceed the prediction, the state is re-queued with the corrected cost.

We do not claim the optimality guarantee from that paper. It requires the cheap estimate never to exceed the true cost, and a learned predictor cannot promise that. What we keep is the economy of calling the expensive evaluator only on promising states. The search depth is small, a handful of insertions and one mode toggle. This avoids the depth-capped explosion that Reasoning in Action faced with tree search over a knowledge graph.

Baselines

The naive reference feeds the top-$k$ retrieved passages, with $k$ tuned on validation data, plus a full-context variant. Thinking mode is either always on or always off. This tells us whether any structure is needed at all.

The strongest retrieval-side competitor is LDAR from Beyond RAG vs. Long-Context. It reads only retriever similarity scores and learns, by reinforcement, a contiguous band of ranks tuned to how much distraction a particular reader tolerates. The paper reports using 25% to 63% of full-context tokens while improving accuracy. We retrain LDAR for each reader on our training splits with the same number of reader calls during training that our cost model consumes.

The strongest sequential competitor is CompAct (CompAct). It reads passages in batches, updates a summary, and stops greedily, and it reports a 7.0 F1 gain over the RECOMP compressor on HotpotQA. The file gives no absolute HotpotQA F1 for CompAct, so no reported result was found on Lacuna for that number. We run the released compressor on identical retrieved candidate sets. Beating it means higher F1 at equal or lower total tokens (generated plus input) on HotpotQA and MuSiQue.

We also include Ext2Gen (Aligning Extraction and Generation), which trains the reader to extract evidence before answering. It raised Llama-3.1-8B-Instruct average QA from 0.473 to 0.557 under noisy retrieval. It is the strongest "fix the reader instead" competitor, and we report it on its own and combined with our planner.

Flare-Aug (Fast or Better?) is included at several settings of its user-controlled knob. It is the clearest example of fixed-tier retrieval pricing.

On SciAux, the bar is the Qwen3-8B numbers above. Recovering most of the gap between 77.03% and the 96.22% clean ceiling, at fewer generated tokens than always-on thinking, would count as a win.

Two ablations isolate the key ingredient. The first, the additive ablation, runs the same planner with $\hat c_\theta$ forced to depend only on the passage and not on the state. The second replaces regret-based training of $\hat c_\theta$ with squared error. If the additive ablation matches the full system, the state-dependence claim fails regardless of headline numbers.

Why not just…?

Why not just score each passage independently with a strong reranker and cut at a threshold? This is exactly the hypothesis the measurement stage tests. If the additive model explains almost all variance in marginal harm, it is the right answer. The additive ablation of our planner is effectively this baseline with a tuned threshold, so the comparison settles it directly. The MuSiQue result that single-hop models lose 30 F1 points relative to HotpotQA suggests that passages matter jointly. But that is evidence about helpful passages, not about distractors, so we treat this alternative as a live threat.

Why not just train a policy with reinforcement learning and a token penalty in the reward, the way LDAR or the memory controller in GRPO-Trained Memory Policies do? Such a policy can learn state dependence implicitly, and the latter reports 67.4% versus 60.8% for supervised fine-tuning on BFCL-v3. This is the most serious alternative. Our bet is narrower: an explicit cost model can be re-planned at a new token price $\lambda$ without retraining, and its predictions can be checked against observed generation length at test time. We give the policy baseline the same features, the same training reader calls, and $\lambda$ as an input. If it matches our Pareto curve across unseen prices, the explicit model buys nothing beyond interpretability and we will say so.

Why not just tell the model to ignore irrelevant text, or always turn thinking off when context is noisy? Thinking in a Crowd shows thinking mode rationalizes misleading premises rather than filtering them. But turning thinking off also fails, at 74.87%, so neither fixed setting is right. Treating the toggle as a state-dependent action is the proposal's answer. The "ignore irrelevant text" instruction and the abstention prompt from Improving Zero-shot Reader are added to every baseline, so gains cannot come from prompting alone.

Proposed Experiments

The decisive check is the variance decomposition on SciAux and MuSiQue. It tells us whether there is anything to plan over.

Conditional on a positive answer, the main experiment plots accuracy against total tokens on SciAux, HotpotQA distractor, MuSiQue, and 2WikiMultiHopQA. Readers are Qwen3-8B with thinking on and off, and Llama-3.1-8B-Instruct. The comparison covers all baselines under matched retrieval candidates and matched training budgets. We sweep $\lambda$, holding out several values from training.

A secondary check reports how often lazy evaluation re-queues a state. We also report the fraction of reader calls saved relative to evaluating every expanded state, which mirrors the edge-evaluation savings reported for delayed expansion in symbolic planning.

The claim is supported only if three things hold together: the full planner beats its additive ablation, regret-based training beats squared error at the same budget, and the price-conditioned reinforcement learning policy does not match the planner on held-out prices.