Revisiting LLMs as Context Engineers

Better context scores need not mean better reasoning

Would you ship a +6.10-point context?

Maya is reviewing whether to ship an automatically engineered math context. In the paper’s Gemma4 control, TF-GRPO raises the score from 67.70 to 73.80: +6.10 points. Table 10

Maya is a fictional reviewer. Her dashboard cannot tell her what improved: solving mathematics, following the answer format, or starting from better instructions. She needs that distinction before paying for another optimization run or promising stronger reasoning.

A unified benchmark locates a fragile step in automated context engineering: extracting reusable lessons—and shows why formatting controls can change the apparent gain.

Original paper · PDF

The fragile step is turning attempts into useful advice

This benchmark identifies extraction of useful experiences from diverse failures as a key bottleneck in existing context optimizers, while controls show that some apparent task gains mainly reflect better format adherence. §6; Appendix I

The paper studies existing methods, not a new optimizer. Turning attempts into advice can lose useful information, and a higher score can come from making an already-correct answer easier to recognize. §1; §6; Appendix I

For Maya’s TF-GRPO comparison, ordinary evaluation reports 67.70→73.80 (+6.10). With an LLM final-answer extractor, it is 91.10→92.60 (+1.50). The smaller gain supports a formatting explanation for much of this case, not every context-engineering gain. Table 10

Here, optimization edits text, not model weights. CoT asks for intermediate reasoning; the paper’s ICL baseline supplies three successful worked trajectories without first distilling them into advice. §2–3

Where these methods fit

The contribution is comparable evaluation, scaling, and diagnosis—not the invention of reflection. TextGrad and GEPA edit system prompts; TF-GRPO maintains experiences; ACE adds a structured playbook with identifiers and helpfulness counters. §1–3; Table 1

Follow one instruction through the optimization loop

Training attempts supply material for editing context. Validation selects a context. Separate test problems check transfer: selecting on validation does not turn validation into a held-out test. §3–4

Teaching fixture, not paper data. Our frozen arithmetic generator can learn to render an answer in a box, but cannot change its supplied answer value. The strict teaching evaluator requires a correct boxed answer; the paper uses task-specific evaluators.

Follow a retained box instructionOptimization uses training and validationTRAINING + VALIDATIONRollout supplies attemptsRollout R2+0 → 2; 2+2 → 4strict marks: [0,0]Rollout supplies attempts to extractionsupplies attempts ↓Extraction retains the box operationExtraction EBox the final answertwo identical artifactsExtraction proposes artifactsproposes artifacts ↓Consolidation selects context using validationConsolidation φDeduplicate → box instructionvalidation: 0/2 → 2/2Updated context conditions later attempts↶ conditions later attemptsHeld-out test boundarySEPARATE TEST DATA↓ supplies selected contextTest comparison leaves the wrong value wrongTest-time comparison[0,0,1,0] → [1,1,1,0]strict: 1/4 → 3/4D: boxed 9; reference 8
The two training attempts contain correct values but fail the required output shape.

Notice: only an operation retained through extraction can reach this selector. Retaining a format instruction need not repair reasoning.

Rollout R
Produces a trajectory under the sampled current context.
Extraction E
Turns query, trajectory, and reference into feedback or reusable experiences.
Consolidation φ
Uses evaluation to turn artifacts into context for later attempts.
Test-time comparison
Compares the selected context with its own start and simple baselines on separate data. §3–4
Different implementations, not one shared selector

GEPA samples prompt candidates from a Pareto frontier. TextGrad updates the previous prompt. TF-GRPO reflects on grouped trajectory differences and consolidates experiences. ACE incrementally updates a playbook and merges semantically similar entries, without actively deleting past bullets. None uses our exact toy selector. §3

Four test answers, one retained operation

Before following the specific-lesson example, predict the alternative: if E emits only “Be careful” for both training failures, can our consolidation rule recover the missing box instruction?

Teaching example. Now follow specific extraction and strict scoring. All values below are generated from the same fixed records.

  1. Rollout supplies the training attempts: correct values, unboxed outputs.
  2. Extraction emits a box instruction for each failure.
  3. Consolidation deduplicates and accepts the candidate on strict validation improvement.
  4. Separate test evaluation changes recognition, not answer values.

Fixture records and test cases

The four model tests cover specific/vague extraction crossed with strict/answer-aware auditing. Specific extraction selects the repair; vague extraction ties validation and keeps the start. Auditing never affects selection.

Change the ruler, not the answers

Keep the selected box instruction and every generated answer fixed. If an audit recognizes correct final values without requiring boxes, what happens to the measured optimization gain?

Strict scoring versus answer-aware auditing

The input on both sides is the same set of initial and optimized outputs. Only answer recognition changes.

Same answers, two scoring viewsTeaching outputs with fixed referencesTOY: fixed generated outputsRef.InitialSelectedA: 2 2 boxed 2B: 4 4 boxed 4C: 6 boxed 6 boxed 6D: 8 boxed 9 boxed 9Strict score versus answer-aware scoreStrict: 1/4 → 3/4Answer-aware: 3/4 → 3/4Paper measurement is separate from toy outputsPAPER MEASUREMENT, NOT TOY OUTPUTGemma4 TF-GRPO · Table 10Without extractor67.70 → 73.80 (+6.10)With LLM extractor91.10 → 92.60 (+1.50)Uncertain accuracy of the real extractorRemaining extractor error? Unknown.
An answer-recognition control changes what the gain means; it does not correct the remaining wrong value. Table 10

The paper uses Qwen3.8-27B to extract final answers from Gemma4 failures. This is a controlled re-evaluation, not a new context optimizer. Appendix I

Our inference: unlike the toy’s exact answer-aware rule, an LLM extractor is not established as a perfect semantic oracle.

Final score alone versus two reference points

Same result: Gemma4 IFBench GEPA.

Against CoT
+6.94 points
A deployment advantage.
Against GEPA’s own start
−1.22 points
No improvement during optimization.

The one difference is the reference context. A better initial template can explain a final-score advantage. §4; Appendix B.1

All three Table 10 methods
Gemma4 · original method-specific endpoints · Table 10
MethodWithout extractor: initial → final (gain)With extractor: initial → final (gain)
GEPA67.70 → 71.20 (+3.50)91.70 → 91.20 (−0.50)
TF-GRPO67.70 → 73.80 (+6.10)91.10 → 92.60 (+1.50)
ACE67.80 → 69.40 (+1.60)88.80 → 88.00 (−0.80)

Make the gain disappear two ways

Make the strict gain disappear, first by losing a useful operation and then by changing only its measurement. Explain the difference.

Teaching playground · not a paper simulator

Try these
  1. Check that D stays wrong after the strict gain.
  2. Change only audit recognition: do the outputs change?
  3. Reset; choose vague extraction. Which information was lost?

25% → 75% · +50 pp

Selected context: solve the problem. Put the final answer in \boxed{...}

Strict validation: initial 0/2; candidate 2/2.

Test / referenceInitial outputSelected output
A / 22\boxed{2}
B / 44\boxed{4}
C / 6\boxed{6}\boxed{6}
D / 8\boxed{9}\boxed{9}

Invariant: answer values and weights never change. Selection always uses strict validation; the audit rule changes only test recognition.

What the model simplifies

Finite rules replace actual generation, reflection, semantic interpretation, stochastic sampling, and prompt search. Exact-string deduplication plus validation acceptance is not TF-GRPO, GEPA, or ACE. The perfect answer-aware rule is not Qwen-Verify or an LLM extractor. No failure-diversity score or causal diversity-to-gain function is simulated. The tiny dataset and large gains are invented for visible accounting.

The equations name the same information path

The symbols describe the concrete loop you just traced, not a promise of test improvement.

π∗=arg⁡maxπ⁡V(π;D)\pi^*=\arg\max_{\pi}V(\pi;D)

Search for the context that scores best on the evaluator’s dataset. In our restricted candidate set, strict validation prefers the box context. §3

SymbolMeaning / teaching value
π\piContext tokens; initial solve instruction, or that plus the box lesson.
π∗\pi^*Optimal context for the objective; the box context among our candidates.
D={(x,y)}D=\{(x,y)\}Queries and references; validation pairs (5+5,10), (6+6,12) in our selection calculation. The paper introduces D as learning data.
VVEvaluator; strict validation count 0/2 → 2/2.
arg⁡max⁡\arg\maxSelects a maximizing context; we compare only the start and one candidate, not all text.
π=ϕV({E(x,t,y)|t∼LLM(x,π−),(x,y)∼D}|π−∼Π)\pi=\phi_V\left(\{E(x,t,y)\mid t\sim\mathrm{LLM}(x,\pi^-),(x,y)\sim D\}\mid\pi^-\sim\Pi\right)

Generate trajectories under sampled contexts, extract artifacts, then consolidate with evaluation. This is worked-example steps 1–3; testing comes afterward. Eq. 1

SymbolMeaning / worked example
π\piResulting context; solve instruction plus one box instruction.
ϕV\phi_VEvaluation-guided consolidation; exact deduplication and acceptance only on strict validation improvement.
EEExtractor; emits the box lesson per training record.
x,t,yx,t,yQuery, trajectory, reference; first record 2+0, “2”, 2.
LLM\mathrm{LLM}Task generator; our frozen fixed-record generator.
π−\pi^-Current context; “solve the problem.”
Π\PiPrior-context distribution; point mass on the initial instruction here.
DDLearning query/reference pairs; (2+0,2), (2+2,4).
∼\simSampling; deterministic records replace stochastic sampling here.
How prior-context distributions differ

TextGrad uses the last prompt, a delta distribution. GEPA samples using a Pareto frontier in its search tree. The shared notation does not mean identical search algorithms. §3

What survives the broader benchmark?

Only 7 of 15 main model/task settings have best-LCE minus best-baseline >1; only 5 show significant improvement (p<0.05p<0.05). No evaluated method consistently beats CoT or ICL. §4; §6

What was compared?

Five fixed seeds; Qwen3-8B, Gemma-4-E4B-it, and Ministral-3-8B-Instruct-2512-BF16. Tasks: MATH500, HotpotQA, IFBench, MiddleMatch, AppWorld. Validation selects contexts. The main held-out comparison retains TF-GRPO, GEPA, and ACE, excluding TextGrad after unstable validation improvement. HotpotQA supplies gold and distractor passages, removing retrieval. AppWorld tests sustained interaction. §4; Appendix B.1

Failure diversity is a diagnostic, not a knob

The study embeds textual failure diagnoses and measures Vendi Score: an effective number of distinct samples, not a human-counted list of causes. Lower scores mean more homogeneous diagnoses. §5; Appendix B.2

Measuring the diversity associationFailed initial training trajectoriesFailed initial training trajectoriesLLM diagnoses reusable mechanisms↓ diagnosesLLM reusable-mechanism diagnosesEmbedding diagnoses↓ embedsall-mpnet-base-v2 vectorsEqual-size subsampling↓ subsamplesEqual-size subsamplesVendi Score averages 100 resamplings↓ summarizesMean Vendi Score · 100 resamplingsNegative association with final-minus-initial gainNegative association, not directionFinal-minus-initial test gainr = -0.5; p ≤ 0.05Controlled β = -0.793; p ≤ 0.05Uncertain causal effect of changing diversityChange diversity → change gain?Sensitive to diagnoses / embeddings?
The study compares observed settings; it does not experimentally set diversity and guarantee a gain. Abstract; §5; Appendix B.2; Table 8

Aggregate association: r=−0.5,p≤0.05r=-0.5,p\leq0.05. GEPA and TF-GRPO are individually significant; ACE is not. With dataset and initial performance as fixed effects and models and methods as random effects, diversity’s coefficient is β=−0.793,p≤0.05\beta=-0.793,p\leq0.05. Abstract; §5; Table 8

Measurement and robustness details

Qwen3.8-27B diagnoses failed initial training trajectories pooled across five seeds. Equal-size subsamples are scored and averaged over 100 resamplings. Generator-self-labeling also yields a significant negative association. Vendi ranges from 1 to the subsample size. The dataset accounts for the largest main-effect variation; no exact shares are stated here. §5; Appendix B.2

Keep trajectories versus extract experiences

For each setting below, compare ways of using training information: direct successful trajectories, sampled extracted experiences, and the final consolidated pool. Table 3

Context useQwen3 MiddleMatchMin3 MATH500
ICL trajectories46.07±4.8068.10±2.41
All-Exps Random32.00±6.0087.40±0.55
Final-Exps37.73±8.5788.30±1.15

Extraction can discard details or produce useful compact advice; consolidation does not universally restore raw-demonstration performance. §5–6

Our inference: representation and utilization change together. These variants also differ in sampling, number, and length, so this is not a perfectly isolated causal intervention on extraction.

Even useful context can become too long

Length, target confusion, and the gold-context control
Min3 MATH500 · Tables 6–7
DemonstrationsAvg. prompt tokensAccuracyAnswers a demonstration
Random ICL, 33,85968.1015.10%
Retrieved, 13,80768.5014.90%
Retrieved, 311,11226.5064.30%

A separate control constructs 318 matched synthetic/original math pairs. Concise matched gold demonstrations help. Early padding can help further, but eventually both repeated-gold and irrelevant padding drive performance below all three baselines—including no-demonstration CoT. Appendix F; Figure 20

Scale and extra attempts are not universal repairs

The reflector writes reflections; the generator executes tasks. The study swaps their sizes between 8B and 32B, jointly scales Qwen3 from 0.6B to 235B-A22B, and compares Qwen1.5-7B through Qwen3.5-9B. Underlying solvers generally improve; incremental context-engineering gains remain inconsistent. §4; Figures 3–4

Best-of-K is not consistency across all K

Using 128 generated responses per problem, Pass@K asks whether at least one of K succeeds; Best@K asks for the expected maximum score; all-K correctness asks whether every attempt succeeds. IFBench’s all-K version uses the expected score product. GEPA’s HotpotQA deficit persists through Pass@128; all-K curves also expose reliability losses. Appendix C; Figures 18–19

Our inference: persistent high-K differences do not decisively identify genuinely new knowledge rather than supplied information or changed access to existing capability.

Other nonsignificant controls

Qwen3 across four datasets shows no significant gain correlation with optimization calls or token consumption. Scaling analyses find no significant relation with baseline accuracy, including after controlling size. A paired comparison after adding a concise-answer instruction is also nonsignificant. Appendix H.1–H.3

Our inference: nonsignificance does not establish equivalence or absence of effects.

What these results do not show: a best-method count is not proof that every method fails. Formatting controls do not explain all gains, diversity is not a causal law, and the stage comparisons do not hold every context property fixed. The findings are not an impossibility result for context engineering.

A bottleneck is not yet a remedy

The authors leave improving LCEs open. They suggest better extraction and exploring knowledge on demand to reduce irrelevant content and control length; they do not validate a remedy. §6

Initial templates and method budgets differ. The budget association is not an equal-budget comparison. Appendix B.1; H.1

Our inference: diversity depends on LLM diagnoses, embeddings, and the diversity statistic. Statistical controls and self-labeling checks do not create a human-validated causal taxonomy.

Our inference: conclusions are bounded by these tasks, splits, and implementations. HotpotQA removes retrieval; AppWorld alone tests sustained agent interaction here; TextGrad is absent from the main held-out comparison.

Unknowns that should stay unknown

Our inference: the real extractor can fail, and finite sampling from a frozen model cannot decisively separate supplied knowledge from altered access to existing capability.

Our inference: the text does not specify the common subsample size, exact curve coordinates, variance shares, gold-padding turning point, or complete main-table significance-testing and multiple-comparison details. Plausible numbers would not fill those gaps honestly.

Open questions

Explain it without the diagram

Answer each in your head before opening it.

1 · Reconstruct the mechanism

Extraction returns “Be careful.” What reaches consolidation, what does validation select, and what is strict test accuracy?

Check your answer

Two vague artifacts deduplicate to one candidate, tying validation at 0/2. The initial context is retained; strict test accuracy stays 1/4 (25%).

The useful box operation was lost before consolidation. Generic encouragement does not trigger the toy repair.

2 · Transfer the control

A code assistant improves after learning valid JSON. Design a same-output control separating schema compliance from better program content. Predict the result if only serialization improved.

Check your answer

Keep both sets of outputs fixed. Independently recover the intended program when possible, validate that recovery, and run the same functional tests. If only serialization improved and recovery is equally effective, the functional-content gain should shrink or disappear while JSON compliance still improves.

Recovery can fail: report its errors instead of assuming a perfect oracle.

3 · Respect the boundary

A colleague proposes deleting unusual failures to guarantee higher test accuracy. What prediction is justified, and what experiment would test it?

Check your answer

The evidence supports an association, not a guarantee from deletion. Manipulate diversity while matching data size, difficulty as far as possible, initial contexts, models, and budgets; evaluate on a common untouched test set.

Our inference: deletion changes coverage as well as diversity. Rare failures may contain valuable lessons; observational controls do not establish the intervention’s effect.

Glossary
LLM as Context Engineer (LCE)
An LLM learning reusable textual context from data without weight updates. §1–2
Context π\pi
Tokens accompanying a query: instructions, experiences, or metadata.
Rollout
A trajectory answering a query under a sampled context.
Experience
A reusable strategy or failure lesson extracted into external context. §3
Reflector / Generator
Model writing reflections / model executing tasks; they can differ. §4
Performance gain
Final minus the method’s own initial score. §5
Δbest\Delta_{\mathrm{best}}
Best LCE minus best simple baseline in a setting. §4
Vendi Score
Effective number of distinct samples, from 11 to NN for NN descriptions. §5
False Failure
Contains the ground-truth answer but fails exact match; some refusal-like cases are filtered. Appendix B.4
Pass@K/Best@K/PassK\mathrm{Pass@}K\;/\;\mathrm{Best@}K\;/\;\mathrm{Pass}^{K}
At-least-one correctness / expected best score / all-K correctness. IFBench’s all-K version uses expected score products. Appendix C