Manuscript Offprint
arXiv:2609.00196WHALE: A Simple Recipe for Joint Harness-Weight Optimization
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Agent performance depends jointly on the model parameters and the executable harness code that manages context and control flow. Optimizing either component in isolation can leave the system bottlenecked by its frozen counterpart: weight updates can change which harness is effective, while harness updates can change which model capabilities are exposed. Existing joint-adaptation methods optimize weights and textual prompts but leave the broader harness fixed. We propose Weight-Harness Alternating LEarning (WHALE), a simple recipe that alternates two phases: updating the model under the current harness, then searching for a better harness under the updated model. We instantiate these two phases with online rejection-sampling fine-tuning and Meta-Harness (Lee et al., 2026), respectively. When to switch is a key design choice: to separate real improvements from noise without over-optimizing against a changing counterpart, WHALE uses either fixed phase durations or an adaptive patience rule over training signals. Using Qwen3.5-2B/4B agents across three domains (search question answering, mathematical reasoning, and chess puzzles), WHALE outperforms weight-only, harness-only, and Fast-Slow Training (Tiwari et al., 2026) by 4.15–24.38 percentage points in best mean@8 accuracy. Either component can be the bottleneck: harness search matches peak weight-only accuracy with far fewer rollouts in SearchQA, but improves math accuracy only after a weight update. Small interleaved updates also outperform stagewise weight-then-harness optimization in accuracy and rollout cost. The code is available at https://github.com/krafton-ai/WHALE.
(a) Joint Search Space

(b) Post-Adaptation Test Accuracy

Figure 1: Overview of WHALE. (a) Weight-only and harness-only adaptation move along a single axis of , whereas alternating updates allow both components to co-adapt. (b) Our simple joint harness–weight optimization recipe outperforms single-component updates across three diverse domains, as well as joint prompt–weight optimization.
1 INTRODUCTION
Model weights are only half of an agentic language-model system. The other half is the harness, the code that decides which observations enter the context, how tools are exposed and invoked, how execution errors are handled, and when an interaction terminates. Consider a question-answering agent with a retrieval tool: stronger weights cannot use evidence that a brittle harness never retrieves, while better retrieval cannot help a model that cannot synthesize the returned evidence. In this paper, we aim to address this shifting bottleneck by jointly optimizing the harness and the model for the given problem.
Prior work has jointly adapted model weights and their surrounding context, but has restricted the latter to textual prompts (Soylu et al., 2024; Zhang et al., 2026; Tiwari et al., 2026). Executable tool-using agents expose a broader target for adaptation: the harness code governing tools, observations, error handling, and control flow. Recent LLM-based optimizers make direct search over this code feasible (Hu et al., 2025; Lin et al., 2026; Lee et al., 2026). Although both components can now be optimized directly, how to coordinate model training with full-harness search remains unclear.
Coordinating model training with harness search is difficult because the two phases operate on different timescales. Harness search uses a long proposal-and-accept cycle conditioned on many rollouts, whereas online fine-tuning alternates rollout collection with gradient updates. Running the phases concurrently either evaluates each update against a moving counterpart, thereby confounding credit assignment, or requires synchronization barriers due to their mismatched update cadences. Alternation avoids this tradeoff by decomposing the coupled problem into conditional updates, each performed with respect to a fixed counterpart (Wright, 2015). This raises a key scheduling question: how much should each component change before switching? Each phase must gather enough evidence to distinguish genuine improvements from noise, but stop before over-optimizing against a fixed counterpart.
To study the design decisions surrounding alternating weight–harness updates, we propose Weight-Harness Alternating LEarning (WHALE), a modular framework that alternates model training under the current harness with harness search under the updated model (Figure 1(a)). In our experiments, we instantiate the weight-update and harness-search phases with online rejection-sampling fine-tuning (RSFT) (Dong et al., 2023; Gulcehre et al., 2023; Shao et al., 2024) and Meta-Harness (Lee et al., 2026), respectively. By default, fixed hyperparameters shared across cycles determine the duration of each phase. We also propose adaptive WHALE, which allows phase durations to vary across cycles by switching, after a minimum duration, when the current phase's training signal stops improving.
We evaluate WHALE against weight-only, harness-only, and Fast-Slow Training (FST, Tiwari et al. (2026)) across three domains: search question answering (SearchQA), mathematical reasoning with code execution (Math), and chess puzzles. To isolate the effect of the harness search space, our FST implementation uses the same update methods and schedule as WHALE but restricts the search to the system and user prompts. WHALE improves over the single-component baselines by 7.67–24.38 percentage points and over FST by 4.15–13.00 points (Figure 1(b)). Across domains, we observe both harness-limited and weight-limited regimes: in SearchQA, harness search alone matches peak weight-only accuracy with far fewer rollouts, whereas in Math it yields almost no improvement until a small weight update makes the same harness search effective. These contrasting regimes show why joint optimization matters: the bottleneck depends on the domain, and updating one component can unlock gains from the other. Compared with stagewise optimization, which spends the full weight-update budget before running the full harness-search budget once, WHALE's small alternating updates improve accuracy by 5.32 and 9.16 percentage points in SearchQA and Math, respectively, and surpass the stagewise result after only 29% and 49% as many rollouts. We also find that adaptive WHALE outperforms the main fixed schedule (with tuned hyperparameters) in both domains we evaluate. Together, our findings provide a controlled, budget-matched study of alternating weight-harness updates and motivate future work on joint weight-harness optimization.
Optimizing systems around fixed models. Work outside model weights optimizes increasingly expressive artifacts, from natural-language instructions and modular prompt programs (Yang et al., 2024a; Khattab et al., 2024; Agrawal et al., 2026) to agent architectures and workflows (Hu et al., 2024; Zhang et al., 2024; Zhuge et al., 2024; Shang et al., 2025). Recent methods extend this search to executable harnesses and their components through source-code editing, configuration search, and trajectory-driven updates (Lin et al., 2026; Sengupta & Wang, 2026; Pan et al., 2026; Park et al., 2026). We use Meta-Harness (Lee et al., 2026) as a simple, modular harness-search method that composes directly with weight updates. WHALE connects these lines of work by alternating reward-filtered model training with executable harness search.
Joint and alternating optimization. Alternating optimization methods address coupled problems by updating one component while holding the others fixed (Wright, 2015). Weight and harness adaptation has this structure: each component shapes the trajectories used to improve the other, so fixing one prevents its drift from confounding the active update. Prior methods that jointly adapt prompts and model weights differ in how they coordinate the two updates, but these works restrict the context-side variable to text (Soylu et al., 2024; Ziem et al., 2026; Bo et al., 2026; Lu et al., 2026; Zhang et al., 2026; Tiwari et al., 2026). WHALE instead searches over executable harness programs, motivated by recent work showing that non-prompt harness choices, including tool interfaces, orchestration, memory, and middleware, can substantially alter fixed-model behavior (Yang et al., 2024b; Zhuge et al., 2024; Lee et al., 2026; Lin et al., 2026). Our FST control (Tiwari et al., 2026) uses the same update methods and schedule as WHALE while restricting harness search to the system and user prompts, isolating this difference in expressivity.
3 PRELIMINARIES
Let be the model parameters and an executable harness program. The harness includes the system instructions, tool schemas, context management, parser and execution logic, and termination policy. Together, and induce a conditional distribution over trajectories comprising model messages, tool calls and results, and environment transitions. Given a task distribution and verifier , we can define the expected reward of the system as:
We seek a model–harness pair that maximizes Equation 1. Rather than optimizing this objective directly over , we separate adaptation into a weight-update phase that updates with fixed and a harness-search phase that updates with fixed. The two remain coupled through , since each update changes the policy on which the other operates. Many algorithms can instantiate either update; in this work, we use online RSFT and Meta-Harness, respectively, as described below.
3.1 WEIGHT UPDATES: ONLINE REJECTION-SAMPLING FINE-TUNING
We use online rejection-sampling fine-tuning (RSFT) for weight updates: an online variant of rejection-sampling fine-tuning (Shao et al., 2024) that trains the model with supervised learning only on its own verifier-accepted rollouts. Given a fixed harness , let denote the parameters being updated and the frozen copy that generates the rollouts at rollout step . For a batch , RSFT samples trajectories per prompt and keeps only the verifier-accepted pairs: collects every with , , and . For a trajectory , let denote the positions of model-generated tokens, excluding user prompts and tool results. RSFT maximizes the token-normalized supervised log-likelihood
In implementation, RSFT ascends with minibatch stochastic gradient steps: at rollout step , it draws SFT minibatches , applies gradient updates, and synchronizes the updated weights to the rollout workers before collecting the next group.
3.2 HARNESS SEARCH: META-HARNESS
We use Meta-Harness (MH) (Lee et al., 2026) for harness search: an iterative proposal–evaluation–selection search over executable harness programs. Given fixed model parameters , MH searches for a better harness over iterations, starting from an initial harness . Let denote the accumulated harness archive at iteration , seeded with . Evaluating a harness yields an artifact , comprising its aggregate score, per-example outcomes from the fixed binary verifier , and saved trajectory logs; collects the artifacts of the archived harnesses. The proposer selectively inspects these artifacts and the archived source files through filesystem tools, and one proposer session writes candidate harnesses ; the archive and its artifacts then grow to and . Each candidate is evaluated on with the rollout-based empirical score
Here, denotes the empirical mean over the trajectories sampled for each example; our experiments use one trajectory per example during harness search. MH then selects the accepted harness: , where the maximization is over the archive . After each iteration, MH marks the highest-scoring harness in the expanded archive as accepted. Subsequent proposals can inspect the full archive and its artifacts, allowing them to refine any prior candidate or revert to an earlier design. After iterations, MH returns the highest-scoring archived harness.
4 WHALE: WEIGHT-HARNESS ALTERNATING LEARNING
Weight-Harness Alternating Learning (WHALE) consists of two alternating phases, each improving one component while holding the other fixed: each cycle trains the model weights under the current harness, then searches for a better harness under the updated model, and repeats. WHALE requires only black-box interfaces for the two update procedures, and can therefore accommodate any weight-update and harness-search method. Starting from an initial model–harness pair , cycle computes
Budgets and other algorithm-specific settings belong to the instantiation. We instantiate ModelUpdate with RSFT (Section 3.1) and HarnessSearch with MH (Section 3.2). For RSFT, the weight-update phase budget is the number of training epochs: cycle consumes the span from a persistent sampler. For MH, the harness-search phase budget is the number of harness-search iterations, and is the number of candidate harnesses proposed per iteration. Algorithm 1 details the WHALE procedure for our instantiation with RSFT and MH.
The two phases use different update data and local objectives, but are coupled through the induced trajectory distribution : the weight-update phase adapts the model to the prompts, tools, observations, and termination policy defined by , changing behavior such as response length and reasoning patterns, and the harness-search phase then searches for a harness better matched to the updated . Repeating the two lets the components co-adapt.
Adaptive WHALE replaces these fixed phase budgets with a per-phase stopping rule. We monitor the training metrics of each phase. After a minimum phase length, the weight-update phase stops once its training reward, averaged over a sliding window of recent steps, has not improved for a fixed number of steps. The harness-search phase stops once the best training score in its archive has not improved for a fixed number of iterations. The rule is early stopping in spirit, but it is applied per phase rather than per run and is driven only by training signals, never by a validation dataset. This removes the schedule from the hyperparameters. Algorithm 2 in Appendix A.1 details the procedure and its stopping parameters, and Section 6.2.3 evaluates this adaptive schedule.
5 EXPERIMENTS
Our experiments ask whether alternating weight updates with full-harness search outperforms optimizing either component alone, and whether full-harness search offers gains beyond prompt-only
Algorithm 1 WHALE with RSFT and MH
Require: ; datasets , ; fixed binary verifier ; budgets
1: for do 2: 3: for each prompt batch in do 4: 5: collect under 6: ascend over minibatches of (Eq. 2) 7: end for 8: ; ; ; 9: for do 10: 11: evaluate for each (Eq. 3), yielding artifacts 12: ; 13: 14: end for 15: 16: end for 17: return the pair with the best accuracy on
adaptation. We test these questions across three tool-using domains, using shared initializations and matched update budgets within each domain to isolate the effect of joint adaptation.
5.1 DOMAINS AND DATA
SearchQA. Following Search-R1 (Jin et al., 2025), the weight-update training dataset contains 18,946 questions: 14,801 from HotpotQA (Yang et al., 2018) and 4,145 from Natural Questions (Kwiatkowski et al., 2019). The harness-search training dataset comprises 256 questions, 200 from HotpotQA and 56 from Natural Questions, matching the distribution. The test dataset contains 700 questions, with 100 each from 2WikiMultiHopQA (Ho et al., 2020), Bamboogle (Press et al., 2023), HotpotQA, MuSiQue (Trivedi et al., 2022), Natural Questions, PopQA (Mallen et al., 2023), and TriviaQA (Joshi et al., 2017). Natural Questions, PopQA, and TriviaQA are single-hop, whereas HotpotQA, 2WikiMultiHopQA, MuSiQue, and Bamboogle are multi-hop (Jin et al., 2025). The retrieval environment answers an agent's query with the top- nearest documents from the Wikipedia 2018 corpus (Karpukhin et al., 2020), indexed using FAISS (Johnson et al., 2017).
Mathematical Reasoning. The weight-update training dataset contains 17,917 problems from DAPO-Math-17K (Yu et al., 2025). The harness-search training dataset contains 256 problems randomly selected from DAPO-Math-17K. The test dataset comprises AIME 2024 (Maxwell-Jia, 2024) and AIME 2025 (yentinglin, 2025) problems. Following ReTool (Feng et al., 2025), the agent may write Python programs for intermediate computation; a CPU environment executes them and returns their output or error text as the tool response.
Chess Puzzles. All three datasets are derived from the Lichess open puzzle database (Lichess, 2026). , , and hold 16,384, 256, and another 256 puzzles, mutually disjoint. The agent generates chess moves in Universal Chess Interface (UCI) notation and passes them to an environment that maintains the board state. An incorrect legal move terminates the rollout immediately, whereas an illegal move terminates it after the permitted retry is exhausted. After a correct nonterminal move, the environment returns the puzzle's predefined fixed opponent reply as the tool response. A correct terminal move completes the reference solution sequence and ends the rollout.
Appendix B specifies each domain's harness-search space, initial harness and binary verifier . In every domain, the harness search may modify the system and user prompts, the formatting of tool inputs and outputs, the feedback returned after a tool call, and the stopping criteria and turn allocation, while the model, datasets, verifier, environment transition rules, and reference answers stay fixed. The verifier is a sparse trajectory-level reward: intermediate steps receive no reward, and only when the terminal task outcome is correct.

Figure 2: Best-so-far test mean@8 accuracy on the test datasets as rollouts accumulate. Harness-only is held constant after 40, 60, and 40 iterations in SearchQA, Mathematical Reasoning, and Chess Puzzles, respectively.
5.2 EVALUATION SETUP
SearchQA and Math use Qwen3.5-2B; Chess Puzzles use Qwen3.5-4B (Qwen Team, 2026). Every method starts from the same domain-specific , specified in Appendix B.2. Weight-only holds and trains for 4, 6, and 4 epochs in SearchQA, Math, and Chess Puzzles; harness-only holds and runs 40, 60, and 40 harness-search iterations; WHALE alternates the two under . All rollouts use a sampling temperature of 1.0, top- of 1.0, and top- of 20. The response lengths are 8,192, 8,192, and 16,384 tokens for SearchQA, Math, and Chess Puzzles, respectively. The weight update samples trajectories per prompt, the harness search 1 rollout per candidate-example pair, and test evaluation 8 trajectories per example, reported as mean@8.
Adaptive WHALE keeps this configuration but replaces the fixed budgets with the patience rule of Section 4: the weight-update phase uses a minimum phase length, patience, and averaging window of 0.2 epochs each, and the harness-search phase runs at least 6 iterations and stops after 2 iterations without a new best training score. FST (Tiwari et al., 2026) adapts prompts alongside weights. We run it as a prompt-restricted control, using the update methods and schedule of WHALE but with harness search confined to the system and user prompts of , thereby isolating search expressivity. The single-component baselines receive budgets matching the cumulative budgets of the WHALE and FST runs; Table 1 in Appendix B shows details for all configurations.
5.3 DOES JOINT WEIGHT-HARNESS OPTIMIZATION IMPROVE PERFORMANCE?
Figure 2 shows test mean@8 accuracy for single-component baselines and WHALE. Using one fixed schedule, , WHALE achieves the highest accuracy in all three domains. The ordering of the single-component baselines changes across domains: weight-only and harness-only are effectively tied in SearchQA, whereas weight-only is substantially stronger in Math and Chess Puzzles. WHALE improves under both orderings, outperforming the stronger single-component baseline by 7.67–10.05 percentage points. FST exhibits a different pattern: prompt–weight adaptation underperforms both single-component baselines in SearchQA but outperforms them in Math and Chess Puzzles. WHALE nevertheless exceeds FST by 4.15–13.00 points (Figure 1(b)). Because our FST control uses the same update methods and schedule while restricting harness search to prompts, this comparison measures the benefit of adapting the broader executable harness. The gains over the single-component baselines also hold on every individual benchmark; Table 2 reports the full per-dataset results.
Consistent gains across domains. With one fixed schedule, WHALE outperforms weight-only, harness-only, and prompt-restricted FST across all three domains, despite differences in which component is strongest alone.
6 ANALYSIS
The aggregate gains mask different interactions between model weights and harness code across domains. We first identify which component limits performance and how updating one changes the gains available to the other. We then test whether small interleaved updates improve over stagewise optimization, how phase duration affects performance, and whether training signals can determine when to switch.

Figure 3: Behavior metrics on test trajectories as rollouts accumulate. (a–c) SearchQA: the fraction of responses following the required answer format, the fraction of trajectories retrieving at least one document containing the reference answer, and correctness conditional on retrieving such a document. (d–e) Mathematical Reasoning: the fraction of responses reaching the token limit, and the fraction from which the verifier extracts a final boxed answer. Dotted vertical lines mark where each method achieves its best test mean@8 accuracy.
6.1 WHICH COMPONENT LIMITS PERFORMANCE?
We observe two domain-dependent bottleneck regimes. SearchQA is harness-dominant: harness search matches the peak accuracy of weight updates using only 5.79% as many rollouts. Math is model-dominant: harness search reaches only 0.42%, compared with 15.42% for weight updates. These comparisons count target-agent rollouts and exclude proposer compute in the harness search phase.
SearchQA is harness-dominant. Figure 3(a–c) quantifies three capabilities required for SearchQA. Both weight updates and harness search improve format compliance, with weight-only and harness-only peaking at 97.07% and 99.98%: weight updates learn the behavior from format-correct on-policy trajectories, whereas harness search emphasizes the answer format in the user prompt and requires an answer rather than another search on the final turn. Harness-only reaches the higher value with fewer rollouts, so harness search is the more efficient channel here.
For retrieval accuracy, weight-only improves it only modestly, whereas harness-only raises it from 26.88% to 60.61% with far fewer rollouts: the model writes the query, but the harness post-processes it and controls which documents return and how many. Combining both, WHALE reaches the highest retrieval accuracy of 65.41%. Answer extraction reverses the balance, with weight-only and harness-only peaking at 79.93% and 57.28%. In WHALE, the cycle 1 harness-search phase improves extraction sharply, and the cycle 2 weight-update phase improves it further, but from cycle 3 onward the harness-search phases hold it back.
Mathematical reasoning is weight-dominant. Figure 3(d–e) quantifies two capabilities required for Math, where the bottleneck is response truncation. Weight-only cuts the truncation rate from 95.83% to 30.83%, learning to shorten responses from correct on-policy trajectories that terminate before the token limit. Harness-only attempts the same through response caps, turn limits, and a final-answer recovery step, but cannot overcome the base model's behavior, which is also why its format accuracy barely moves. WHALE does shorten responses, reducing truncation and improving format accuracy, and its cycle 1 harness-search phase is the clearest case: in 4,608 rollouts it raises format accuracy from 0.83% to 4.38%, a gain of 3.54 percentage points, where harness-only spends 46,080 rollouts for a gain of 0.63 points (0.00% to 0.63%).
Dominance regimes. We observe both harness-dominant and model-dominant regimes, and for capabilities that both weight updates and harness search can improve, harness search is more rollout-efficient. A short harness search therefore serves as a low-cost diagnostic before extensive model training. Conversely, a small weight update can make harness search effective where it previously was not.
6.2 HOW SHOULD WEIGHT AND HARNESS UPDATES BE SCHEDULED?
We ablate the alternation schedule , the per-cycle weight-update epoch and harness-search iteration budgets, in SearchQA and Math, the harness-dominant and model-dominant extremes. Table 3 in Appendix C.2 lists the best point of every run.

Figure 4: Schedule comparison for (a) SearchQA and (b) Mathematical Reasoning. Each run—the five fixed schedules, stagewise , the weight-only and harness-only baselines, and adaptive WHALE—is marked by a star at its best test mean@8 accuracy; faint lines trace each run's best-so-far accuracy.
6.2.1 ALTERNATING VERSUS STAGEWISE OPTIMIZATION
The common way to combine the two is stagewise, with one pass per component: train under with the full weight-only budget, then run harness search under the resulting model for the full harness-only budget. Each phase selects its best point based on the training score; at the budgets, we denote .
In SearchQA, within the 4-epoch and 40-iteration budgets, reaching 43.02% test mean@8 accuracy (Figure 4(a)); in Math, within the 6-epoch and 60-iteration budgets, reaching 15.63% (Figure 4(b)). These fall 5.32 and 9.16 points short of WHALE with , which passes the final stagewise accuracy after only 29% of the stagewise rollouts in SearchQA and 49% in Math.
We attribute the weaker stagewise performance to conditional over-optimization (Figure 5). Because (Eq. 1) is not separable, each phase optimizes against a counterpart that later changes. A long weight-update phase over-optimizes the model's behavior for , leaving it poorly adapted to the harness produced by the subsequent harness search. A long harness-search phase can likewise over-optimize a harness to : in Math, the 60-iteration stagewise harness search keeps improving its training score, yet gains only +0.21 percentage points over weight-only on the test set (15.63% versus 15.42%).
Alternation dominates stagewise optimization. One large pass per component is dominated by short alternating phases, in both final accuracy and rollout cost, because spending a component's full budget in a single uninterrupted phase over-optimizes it against a counterpart that then changes.
6.2.2 HOW LONG SHOULD EACH PHASE RUN?
Given that alternation should take small steps, we next ask how many updates each cycle should contain. In SearchQA and Math, we compare five schedules (Figure 4). Although the two domains lie at opposite extremes of the regime, the same schedule is strongest in both: reaches 50.09% in SearchQA and 28.33% in Math, exceeding the schedule in the main comparison by +1.75 and +3.54 percentage points, respectively. An effective schedule must therefore lie between two failure extremes: each phase must gather enough evidence to avoid adopting a noisy choice, yet stop before it over-optimizes against its frozen counterpart. The two ends of the schedule spectrum exhibit exactly these failures, sketched in Figure 5.

Figure 5: Running each phase to the maximum of its own line ends at a local optimum (the over-optimized extreme); too little evidence per phase stalls on noise (the noisy extreme); adaptive WHALE tracks the valley to the joint optimum.
The noisy extreme is the Math (0.2, 2) run. With only two proposal iterations of evidence per cycle, a chance-inflated candidate is accepted, and the model then adapts to it; the run destabilized and was stopped. At the other end, the over-optimization of Section 6.2.1 sets in well before the stagewise limit: scaling the per-cycle budgets up from (0.2, 6) never helps in either domain, and along (0.2, 6), (0.6, 6), (1.0, 10) accuracy falls from 50.09% to 48.34% to 45.93% in SearchQA and from 28.33% to 24.79% to 24.79% in Math.
Neither budget can be chosen on its own, because the effect of one depends on the value of the other: in Math, increasing from 0.2 to 0.6 helps at (16.67% to 17.92%) but hurts at (28.33% to 24.79%), and the same crossover holds in the direction in SearchQA. Even in the model-dominant domain, the schedule that runs harness search most often per training epoch prevails, as explained by catalytic interaction (Section 6.1): each small weight update renews the gains attainable by a bounded harness search.
Effective schedules balance noisy selection and over-optimization. Across both domains, the strongest schedule pairs small weight updates with harness search that runs long enough to identify reliable improvements but stops before over-optimizing.
6.2.3 CAN WE AUTOMATICALLY DETERMINE WHEN TO SWITCH?
Our sweep over schedule hyperparameters identifies a strong range of phase durations but still requires choosing fixed budgets. We test whether adaptive WHALE can recover this range without fixing in advance. For SearchQA and Math, we compare against the main (0.6, 6) schedule and the strongest fixed schedule in our sweep, (0.2, 6). As Figure 4 shows, adaptive WHALE attains the best point of the entire comparison in SearchQA: 52.82% test mean@8 accuracy, +4.48 points over the (0.6, 6) schedule and +2.73 points over the best hand-tuned schedule (50.09%), reached with 23% fewer rollouts than the (0.6, 6) run needs for its own best. In Math, adaptive WHALE reaches 26.46%: +1.67 points over the (0.6, 6) schedule with 4% fewer rollouts, but 1.87 points below the best hand-tuned schedule (28.33%).
The realized schedules fall within the region identified by the ablation (Figure 6). Median phase lengths are 0.24 and 0.29 weight-update epochs in the two domains, with harness-search iterations per cycle in both, close to the (0.2, 6) optimum, while individual phases extend when their training signal keeps improving, up to 1.16 epochs and .
7 CONCLUSION
We presented WHALE, a modular framework that alternates weight updates with harness search over executable agent harnesses. Across SearchQA, Math, and Chess Puzzles it outperforms the weight-only and harness-only baselines by +7.67 to +24.38 percentage points, and FST, whose harness search is restricted to prompts, by +4.15 to +13.00 points. Our analysis shows that domains divide into harness-dominant and model-dominant regimes, and that a small weight update can unlock an otherwise ineffective harness search. A controlled schedule study further shows that one large pass per component is dominated by small alternating steps, and that per-cycle budgets must lie between the noisy and over-optimized extremes. Finally, a per-phase patience rule on training signals automatically identifies this interval, replacing the fixed budgets.
Future work includes instantiated the two operators with other weight-update and harness-search algorithms, as permitted by the black-box interfaces in Section 4, and scaling the study to larger


Figure 6: Realized per-cycle budgets chosen by the patience rule of adaptive WHALE in (a) SearchQA and (b) Mathematical Reasoning: weight-update epochs (bars, left axis) and harness-search iterations (dots, right axis). Dotted horizontal lines mark the minimum phase lengths (0.2 epoch, ).
models and additional domains. More broadly, these results motivate treating the model and its harness not as separately engineered artifacts but as one jointly trained system.
ACKNOWLEDGMENTS
We would like to express our sincere gratitude to Myungseok Oh and Yun Jegal for their valuable contributions and support throughout this work.
REFERENCES
Lakshya A. Agrawal, Shangyin Tan, Dilara Soylu, Noah Ziems, Rishi Khare, Krista Opsahl-Ong, Arnav Singhvi, Herumb Shandilya, Michael J. Ryan, Meng Jiang, Christopher Potts, Koushik Sen, Alexandros G. Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, and Omar Khattab. GEPA: Reflective prompt evolution can outperform reinforcement learning. In International Conference on Learning Representations, 2026.
Xiaohoe Bo, Rui Li, Zexu Sun, Quanyu Dai, Zeyu Zhang, Zihang Tian, Xu Chen, and Zhenhua Dong. Prompt and parameter co-optimization for large language models. In International Conference on Learning Representations, volume 2026, pp. 116697–116723, 2026.
Baian Chen, Chang Shu, Ehsan Shareghi, Nigel Collier, Karthik Narasimhan, and Shunyu Yao. Fireact: Toward language agent fine-tuning, 2023. URL https://arxiv.org/abs/2310.05915.
Hanze Dong, Wei Xiong, Deepanshu Goyal, Yihan Zhang, Winnie Chow, Rui Pan, Shizhe Diao, Jipeng Zhang, KaShun Shum, and Tong Zhang. RAFT: Reward ranked finetuning for generative foundation model alignment. Transactions on Machine Learning Research, 2023.
Jiazhan Feng, Shijue Huang, Xingwei Qu, Ge Zhang, Yujia Qin, Baoquan Zhong, Chengquan Jiang, Jinxin Chi, and Wanjun Zhong. Retool: Reinforcement learning for strategic tool use in llms. arXiv preprint arXiv:2504.11536, 2025.
Caglar Gulcehre, Tom Le Paine, Srivatsan Srinivasan, Ksenia Konyushkova, Lotte Weerts, Abhishek Sharma, Aditya Siddhant, Alex Ahern, Miaosen Wang, Chenjie Gu, Wolfgang Macherey, Arnaud Doucet, Orhan Firat, and Nando de Freitas. Reinforced self-training (ReST) for language modeling. arXiv preprint arXiv:2308.08998, 2023.
Xanh Ho, Anh-Khoa Duong Nguyen, Saku Sugawara, and Akiko Aizawa. Constructing a multi-hop qa dataset for comprehensive evaluation of reasoning steps. In Proceedings of COLING, 2020.
Shengran Hu, Cong Lu, and Jeff Clune. Automated design of agentic systems. arXiv preprint arXiv:2408.08435, 2024.
Shengran Hu, Cong Lu, and Jeff Clune. Automated design of agentic systems, 2025. URL https://arxiv.org/abs/2408.08435.
Bowen Jin, Hansi Zeng, Zhenrui Yue, Dong Wang, Hamed Zamani, and Jiawei Han. Search-r1: Training llms to reason and leverage search engines with reinforcement learning. arXiv preprint arXiv:2503.09516, 2025.
Jeff Johnson, Matthijs Douze, and Hervé Jégou. Billion-scale similarity search with gpus. arXiv preprint arXiv:1702.08734, 2017.
Mandar Joshi, Eunsol Choi, Daniel S. Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of ACL, 2017.
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. Dense passage retrieval for open-domain question answering. In Proceedings of EMNLP, pp. 6769–6781, 2020.
Omar Khattab, Arnav Singhvi, Paridhi Maheshwari, Zhiyuan Zhang, Keshav Santhanam, Sri Vardhamanan, Saiful Haq, Ashutosh Sharma, Martin Josifoski, Carlos Guestrin, Matei Zaharia, and Christopher Potts. Dspy: Compiling declarative language model calls into self-improving pipelines. In International Conference on Learning Representations, 2024.
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. Natural questions: A benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:452–466, 2019.
Yoonho Lee, Roshen Nair, Qizheng Zhang, Kangwook Lee, Omar Khattab, and Chelsea Finn. Meta-harness: End-to-end optimization of model harnesses. arXiv preprint arXiv:2603.28052, 2026.
Lichess. Open database: Puzzle database. https://database.lichess.org/, 2026. Accessed 2026-07-20.
Jiahang Lin, Shichun Liu, Chengjun Pan, Lizhi Lin, Shihan Dou, Zhiheng Xi, Xuanjing Huang, Hang Yan, Zhenhua Han, Tao Gui, et al. Agentic harness engineering: Observability-driven automatic evolution of coding-agent harnesses. arXiv preprint arXiv:2604.25850, 2026.
Xinyu Lu, Kaiqi Zhang, Jinglin Yang, Boxi Cao, Yaojie Lu, Hongyu Lin, Min He, Xianpei Han, and Le Sun. P° 2o: Joint policy and prompt optimization. arXiv preprint arXiv:2603.21877, 2026.
Alex Mallen, Akari Asai, Victor Zhong, Rajarshi Das, Daniel Khashabi, and Hannaneh Hajishirzi. When not to trust language models: Investigating effectiveness of parametric and non-parametric memories. In Proceedings of ACL, 2023.
Maxwell-Jia. AIME 2024. Hugging Face dataset, https://huggingface.co/datasets/Maxwell-Jia/AIME_2024, 2024. Accessed 2026-07-20.
Reiichiro Nakano, Jacob Hilton, Suchir Balaji, Jeff Wu, Long Ouyang, Christina Kim, Christopher Hesse, Shantanu Jain, Vineet Kosaraju, William Saunders, Xu Jiang, Karl Cobbe, Tyna Eloundou, Gretchen Krueger, Kevin Button, Matthew Knight, Benjamin Chess, and John Schulman. Webgpt: Browser-assisted question-answering with human feedback, 2022. URL https://arxiv.org/abs/2112.09332.
Wenbo Pan, Shujie Liu, Chin-Yew Lin, Jingying Zeng, Xianfeng Tang, Xiangyang Zhou, Yan Lu, and Xiaohua Jia. Evolving agents in the dark: Retrospective harness optimization via self-preference, 2026. URL https://arxiv.org/abs/2606.05922.
Sungho Park, Wonjoong Kim, Rongyuan Tan, Jue Zhang, Wook-Shin Han, Pengfei Gao, Chanyoung Park, Yongqiang Yao, Rao Fu, Elsie Nallipogu, Qingwei Lin, Saravan Rajmohan, and Dongmei Zhang. Autosaddler: Automatic harness optimization with durable updates from agent execution traces, 2026. URL https://arxiv.org/abs/2608.23041.
Ofir Press, Muru Zhang, Sewon Min, Ludwig Schmidt, Noah A. Smith, and Mike Lewis. Measuring and narrowing the compositionality gap in language models. Findings of the Association for Computational Linguistics: EMNLP, 2023.
Qwen Team. Qwen3.5: Towards native multimodal agents. https://qwen.ai/blog?id=qwen3.5, 2026.
Biswa Sengupta and Jinhua Wang. Harbor: Automated harness optimization, 2026. URL https://arxiv.org/abs/2604.20938.
Yu Shang, Yu Li, Keyu Zhao, Likai Ma, Jiahe Liu, Fengli Xu, and Yong Li. Agentsquare: Automatic llm agent search in modular design space, 2025. URL https://arxiv.org/abs/2410.06153.
Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, Y. K. Li, Y. Wu, and Daya Guo. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300, 2024.
Avi Singh, John D. Co-Reyes, Rishabh Agarwal, Ankesh Anand, Piyush Patil, Xavier Garcia, Peter J. Liu, James Harrison, Jaehoon Lee, Kelvin Xu, Aaron Parisi, Abhishek Kumar, Alex Alemi, Alex Rizkowsky, Azade Nova, Ben Adlam, Bernd Bohnet, Gamaleldin Elsayed, Hanie Sedghi, Igor Mordatch, Isabelle Simpson, Izzeddin Gur, Jasper Snoek, Jeffrey Pennington, Jiri Hron, Kathleen Kenealy, Kevin Swersky, Kshiteej Mahajan, Laura Culp, Lechao Xiao, Maxwell L. Bileschi, Noah Constant, Roman Novak, Rosanne Liu, Tris Warkentin, Yundi Qian, Yamini Bansal, Ethan Dyer, Behnam Neyshabur, Jascha Sohl-Dickstein, and Noah Fiedel. Beyond human data: Scaling self-training for problem-solving with language models, 2024. URL https://arxiv.org/abs/2312.06585.
Dilara Soylu, Christopher Potts, and Omar Khattab. Fine-tuning and prompt optimization: Two great steps that work better together. arXiv preprint arXiv:2407.10930, 2024.
Rishabh Tiwari, Kusha Sareen, Lakshya A. Agrawal, Joseph E. Gonzalez, Matei Zaharia, Kurt Keutzer, Inderjit S. Dhillon, Rishabh Agarwal, and Devvrit Khatri. Learning, fast and slow: Towards LLMs that adapt continually. arXiv preprint arXiv:2605.12484, 2026.
Harsh Trivedi, Niranjan Balasubramanian, Tushar Khot, and Ashish Sabharwal. Musique: Multihop questions via single-hop question composition. Transactions of the Association for Computational Linguistics, 10:539–554, 2022.
Stephen J Wright. Coordinate descent algorithms. Mathematical programming, 151(1):3–34, 2015.
Chengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu, Quoc V. Le, Denny Zhou, and Xinyun Chen. Large language models as optimizers. arXiv preprint arXiv:2309.03409, 2024a.
John Yang, Carlos Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. Swe-agent: Agent-computer interfaces enable automated software engineering. Advances in Neural Information Processing Systems, 37:50528–50652, 2024b.
Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William W. Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. Hotpotqca: A dataset for diverse, explainable multi-hop question answering. In Proceedings of EMNLP, 2018.
Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. React: Synergizing reasoning and acting in language models. In International Conference on Learning Representations, 2023.
yentinglin. AIME 2025. Hugging Face dataset, https://huggingface.co/datasets/yentinglin/aime_2025, 2025. Accessed 2026-07-20.
Qiying Yu, Zheng Zhang, Ruofei Zhu, Yufeng Yuan, Xiaochen Zuo, Yu Yue, Tiantian Fan, Gaohong Liu, Lingjun Liu, Xin Liu, Haibin Lin, Zhiqi Lin, Bole Ma, Guangming Sheng, Yuxuan Tong, Chi Zhang, Mofan Zhang, Wang Zhang, Hang Zhu, Jinhua Zhu, Jiaze Chen, Jiangjie Chen, Chengyi Wang, Hongli Yu, Weinan Dai, Yuxuan Song, Xiangpeng Wei, Hao Zhou, Jingjing Liu, Wei-Ying Ma, Ya-Qin Zhang, Lin Yan, Mu Qiao, Yonghui Wu, and Mingxuan Wang. Dapo: An open-source llm reinforcement learning system at scale. arXiv preprint arXiv:2503.14476, 2025.
Hongyi Yuan, Zheng Yuan, Chuanqi Tan, Wei Wang, Songfang Huang, and Fei Huang. Rrhf: Rank responses to align language models with human feedback. In A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (eds.), Advances in Neural Information Processing Systems, volume 36, pp. 10935–10950. Curran Associates, Inc., 2023. doi: 10.52202/075280-0482. URL https://proceedings.neurips.cc/paper_files/paper/2023/file/23e6f78bdec844a9f7b6c957de2aae91-Paper-Conference.pdf.
Eric Zelikman, Yuhuai Wu, Jesse Mu, and Noah D. Goodman. Star: Bootstrapping reasoning with reasoning, 2022. URL https://arxiv.org/abs/2203.14465.
Jiayi Zhang, Jinyu Xiang, Zhaoyang Yu, Fengwei Teng, Xionghui Chen, Jiaqi Chen, Mingchen Zhuge, Xin Cheng, Sirui Hong, Jinlin Wang, Bingnan Zheng, Bang Liu, Yuyu Luo, and Chenglin Wu. Aflow: Automating agentic workflow generation. arXiv preprint arXiv:2410.10762, 2024.
Lunjun Zhang, Ryan Chen, and Bradly C. Stadie. Evolutionary system prompt learning for reinforcement learning in LLMs. arXiv preprint arXiv:2602.14697, 2026.
Mingchen Zhuge, Wenyi Wang, Louis Kirsch, Francesco Faccio, Dmitrii Khizbullin, and Jürgen Schmidhuber. Language agents as optimizable graphs. arXiv preprint arXiv:2402.16823, 2024.
Noah Ziems, Dilara Soylu, Lakshya A Agrawal, Isaac Miller, Liheng Lai, Chen Qian, Kaiqiang Song, Meng Jiang, Dan Klein, Matei Zaharia, Karel D'Oosterlinck, Christopher Potts, and Omar Khattab. Composing policy gradients and prompt optimization for language model programs. In ACM Conference on AI Systems (CAIS), 2026.
A ALGORITHMS
A.1 ADAPTIVE WHALE
Algorithm 2 details adaptive WHALE for our instantiation with RSFT and MH, replacing the fixed budgets and of Algorithm 1 with per-phase stopping rules. The weight-update phase uses three parameters, all measured in rollout steps: an averaging window , a minimum phase length , and a patience . At step of a phase, the signal is the mean verifier reward of the rollouts collected in the most recent steps, and and track the best signal within the phase and the step that attained it; the phase ends once and the signal has not set a new phase best for steps. The harness-search phase uses a minimum number of iterations , counting the evaluation of the incoming harness as the first, and a patience . Here tracks the best training score in the archive and the iteration that attained it; the phase ends once at least iterations have run and has not improved for iterations. An improvement of any margin counts. Our experiments set epoch and .
Algorithm 2 Adaptive WHALE with RSFT and MH
Require: ; datasets , ; fixed binary verifier ; budget ; stopping parameters and
1: for do 2: ; ; ; 3: repeat 4: ; ; draw the next prompt batch from 5: collect under 6: ascend over minibatches of (Eq. 2) 7: mean verifier reward of the rollouts of the most recent steps 8: if then 9: ; 10: end if 11: until and 12: ; ; ; 13: ; ; 14: repeat 15: ; 16: evaluate for each (Eq. 3), yielding artifacts 17: ; 18: if then 19: ; 20: end if 21: until and 22: 23: end for 24: return the pair with the best accuracy on
B EXPERIMENTAL DETAILS
B.1 PRINCIPAL SETTINGS
Table 1 collects the settings of every reported run. The domains differ only in model size, dataset sizes, total budgets, and context lengths, the longer prompt limit in Chess Puzzles matching its longer board-state observations. Within a domain the four systems draw on the same blocks: weight-only on the first, harness-only on the second, WHALE and FST on both under the per-cycle budgets of the third.
Four points the table does not state. The weight update runs its single SFT epoch over the trajectories accepted in the step that produced them, so no trajectory is revisited later. A harness-search iteration scores every candidate with one rollout per harness-search training example, costing
Table 1: Principal experimental settings for the three domains.
| Setting | SearchQA | Math | Chess Puzzles |
|---|---|---|---|
| Models and datasets | |||
| Base model | Qwen3.5-2B | Qwen3.5-2B | Qwen3.5-4B |
| Weight-update training examples | 18,946 | 17,917 | 16,384 |
| Harness-search training examples, | 256 | 256 | 256 |
| Test examples | 700 | 60 | 256 |
| Weight-only configuration | |||
| Weight-only epoch budget | 4 | 6 | 4 |
| Prompt batch, | 256 | 256 | 256 |
| SFT epochs per accepted trajectory set | 1 | 1 | 1 |
| Learning rate | |||
| SFT minibatch, | 64 | 64 | 64 |
| Rollouts per prompt, | 8 | 8 | 8 |
| Harness-only configuration | |||
| Harness-only iterations, | 40 | 60 | 40 |
| Proposer | Claude Opus 4.7 | ||
| Proposer sessions per harness-search iteration | 1 | 1 | 1 |
| Candidate harnesses per harness-search iteration, | 3 | 3 | 3 |
| Rollouts per candidate–example pair | 1 | 1 | 1 |
| WHALE and FST configuration | |||
| Train epochs per cycle, | 0.6 | 0.6 | 0.6 |
| Search iterations per cycle, | 6 | 6 | 6 |
| Harness search space | full harness (WHALE); system and user prompts (FST) | ||
| Completed cycles | 6 | 9 | 6 |
| Sampling and evaluation | |||
| Test rollouts per example | 8 | 8 | 8 |
| Sampling temperature | 1.0 | 1.0 | 1.0 |
| Top- | 1.0 | 1.0 | 1.0 |
| Top- | 20 | 20 | 20 |
| Prompt token limit | 2,048 | 2,048 | 4,096 |
| Response length | 8,192 | 8,192 | 16,384 |
rollouts in every domain. FST is run with RSFT replacing its reinforcement-learning weight update and MH, restricted to the system and user prompts of , replacing its reflective prompt evolution. The weight-only epoch budgets match the cumulative training epochs of the WHALE and FST runs, and the harness-only iteration budgets their cumulative harness-search iterations.
B.2 HARNESS-SEARCH SPACES AND BASE HARNESS
Section 5.1 states what the harness search may modify in every domain, and FST is confined to the system and user prompts of . Below are each domain’s additions to that space and its .
SearchQA. The harness search may additionally rewrite or expand a model-generated query before retrieval and set retrieval parameters and the ranking of retrieved documents. Each tool call accepts one query, and at most 16 assistant turns are allowed. The initial harness instructs the model to answer factual questions, use search when needed, and place the final answer within <answer> tags; it forwards queries unchanged, returns one passage truncated to 200 tokens, and terminates after two assistant turns or a response without a tool call.
Mathematical Reasoning. The harness search may additionally change how Python code is extracted and normalized before execution and how standard output and execution errors are surfaced. Each code-interpreter call accepts one program, and at most 16 assistant turns are allowed. The initial harness has no system prompt and requires a final answer in \boxed{...}; it extracts the first code block, inserts a print call for a final expression that is not explicitly printed, returns standard output and error text verbatim, and terminates after two assistant turns or a response without a tool call.
Chess Puzzles. The harness search may additionally change how the board observation is presented, how one UCI move is extracted and malformed or ambiguous outputs are handled, how accepted moves and opponent replies are retained or shortened, the retry budgets, and whether the parsed move is validated against the visible legal-move list; it may not generate, substitute, or search for a move. Retry budgets are capped at 10 each and at most 18 assistant turns are allowed. The initial harness asks for exactly one UCI move chosen from the visible position, presents the board and the complete move history without compaction, gives corrective feedback after malformed or illegal output, permits one retry of each kind, and allows nine assistant turns.
B.3 BINARY VERIFIERS
Trajectory acceptance in training, harness-candidate scoring, and test evaluation share one binary verifier per domain, fixed with its reference answers while and change.
SearchQA. The verifier extracts the answer enclosed by <answer> tags in the final assistant response, returning without a judge call if parsing fails. Otherwise GPT-5.4-mini, at temperature zero and a 256-token cap, judges the extracted answer against the reference answers under a fixed rubric, and on a CORRECT judgment. Appendix B.3.1 reproduces the complete judge prompt.
Mathematical Reasoning. Following DAPO's strict boxed-answer verification procedure (Yu et al., 2025), the verifier extracts the final \boxed{...} answer. It returns if the extracted answer matches the ground-truth answer and if parsing fails or the answers differ.
Chess Puzzles. The verifier parses a single UCI move from the model response, checks its legality with python-chess, and compares it with the reference move. Failed parsing, failed legality, or a legal move other than the reference one gives ; only a completed reference sequence gives .
B.3.1 SEARCHQA LLM-AS-A-JUDGE PROMPT
The SearchQA judge prompt in full. Placeholders are filled per call with the question, the reference answers, and the extracted model answer.
You are an impartial judge for a question-answering task.
Mark CORRECT when predicted answer refers to the same entity/value/fact as any reference. Acceptable:
(1) Surface variation (case, articles, punctuation)
(2) Alias / abbreviation / full-vs-short form ('Pete' = 'Peter')
(3) Added/removed qualifier ('actor X' = 'X')
(4) Less-specific date/place CONTAINED IN reference ('1962' if reference is 'September 10, 1962'; 'Wellington' if reference is 'Wellington, New Zealand')
(5) Number/unit form ('4' = 'four', '188 acres' = '188 acre')
(6) Different framing of the SAME geographic feature (e.g., 'Gulf of California' = 'between Baja California and Sonora' | both describe the same body of water)
(7) Self-correcting answer | if the prediction explores alternatives but commits to a final answer that matches the reference, count CORRECT (e.g., 'X... actually, Y' where Y matches reference)
Mark INCORRECT for:
(a) Different specific person/place/song/team/company/year
(b) Numeric/date mismatch where neither contains the other ('40 miles' vs '35 miles'; '1985' vs '1986')
(c) Opposite or contradictory meaning (winner vs loser; 'no one' vs a named entity)
(d) Different ENTITY TYPE even if related (city is NOT stadium; block is NOT channel; episode title is NOT episode number)
(e) Failure to commit to an entity (only explanation/disclaimer)
(f) Listing multiple distinct candidates joined by separators (slashes "/", pipes "|", commas, "or", "either...or") | even if one candidate matches the reference. A valid answer commits to a single entity; "Beijing / Tokyo / Seoul" listing the gold among 2+ alternatives is INCORRECT.
(g) Verbatim passage or document quote | prediction is a multi-sentence passage, paragraph, or doc-formatted text (e.g., contains "Doc N (Title: ...) " patterns) that contains the reference answer as a substring but is not itself a concise answer. A valid answer is the entity/value alone, not the surrounding evidence prose.
Question: {question}
Reference answer(s): {gold}
Predicted answer: {prediction}
Respond with exactly one word: CORRECT or INCORRECT.
C ADDITIONAL RESULTS
C.1 MAIN COMPARISON: PER-BENCHMARK RESULTS
Table 2 breaks the main comparison of Section 5.3 down to the seven SearchQA datasets, the two AIME datasets, and the Lichess puzzle test set. WHALE is best on every one, so its domain-level gains are not carried by a subset of benchmarks.
Table 2: Test mean@8 accuracy (%) across domains and test dataset subsets. WHALE uses . Bold denotes the best result in each column.
| Method | SearchQA | Math | Chess Puzzles | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2Wiki | Bamb. | Hotpot | MuSiQue | NQ | PopQA | Trivia | Avg. | AIME24 | AIME25 | Avg. | Lichess | Avg. | |
| Harness-only | 26.38 | 36.75 | 38.38 | 13.88 | 46.00 | 40.13 | 66.50 | 38.29 | 0.83 | 0.00 | 0.42 | 19.82 | 19.82 |
| Weight-only | 28.38 | 31.50 | 34.88 | 14.50 | 51.00 | 40.88 | 66.75 | 38.27 | 16.25 | 14.58 | 15.42 | 22.17 | 22.17 |
| FST | 22.25 | 25.00 | 34.25 | 13.63 | 46.88 | 40.62 | 64.75 | 35.34 | 15.83 | 20.00 | 17.92 | 25.68 | 25.68 |
| WHALE | 35.75 | 53.00 | 50.25 | 22.13 | 55.50 | 49.25 | 72.50 | 48.34 | 27.08 | 22.50 | 24.79 | 29.83 | 29.83 |
C.2 SCHEDULE COMPARISON: BEST POINTS
Table 3 tabulates the schedule comparison of Section 6.2.2, plotted in Figure 4.
Table 3: Best test mean@8 accuracy (%) of each run in Figure 4 and the rollouts consumed up to that point. Bold denotes the best accuracy in each domain and underlining the second best.
| Run | SearchQA | Math | ||
|---|---|---|---|---|
| mean@8 | Rollouts | mean@8 | Rollouts | |
| Weight-only | 38.27 | 530,432 | 15.42 | 645,120 |
| Harness-only | 38.29 | 30,720 | 0.42 | 46,080 |
| Stagewise () | 43.02 | 604,160 | 15.63 | 893,952 |
| 46.63 | 526,336 | 16.67 | 240,128 | |
| 50.09 | 589,824 | 28.33 | 599,040 | |
| 48.84 | 378,880 | 17.92 | 582,656 | |
| 48.34 | 382,464 | 24.79 | 720,384 | |
| 45.93 | 294,400 | 24.79 | 510,464 | |
| Adaptive WHALE | 52.82 | 295,424 | 26.46 | 689,152 |
D TRAJECTORY EXAMPLES
For each domain we show one test item that the base model under answers incorrectly and that WHALE with answers correctly, with the two trajectories side by side. Message roles are colour-coded: system prompt, user prompt, model response, tool call, tool response, and, in Chess Puzzles, the environment's reply. Long spans are trimmed where marked.
D.1 SEARCHQA
The question is Where was the husband of Octavie Coudreau born?, whose reference answers are Sonnac and Sonnac, Charente-Maritime. The base pair scores 0/8, WHALE 8/8.
Base model with the base harness (incorrect). The harness allows two assistant turns and returns one passage. The first retrieval names the husband but not his birthplace; the model searches again, and the rollout ends with no <answer> tag.
Tools
You have access to the following functions:
<tools> {"type": "function", "function": {"name": "search", "description": "Searches the web for relevant information based on a single query. Returns the top-k passages for that one query.\\nMirrors `verl/tools/search_tool.py:SearchTool.execute`[... trimmed ...]
- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls </IMPORTANT>
Answer factual questions using search when needed.
USER PROMPT
Question: Where was the husband of Octavie Coudreau born?
Use the search tool if needed. Put the final answer only inside <answer>...</answer>.
MODEL RESPONSE
I need to find information about Octavie Coudreau, specifically her husband's birthplace. ↔ Let me search for this information. </think>
TOOL CALL
<tool_call> <function=search> <parameter=query_list> ["Octavie Coudreau husband birthplace"] </parameter> <parameter=topk> 5 </parameter> <parameter=max_doc_tokens> 200 </parameter> </function> </tool_call>
TOOL RESPONSE
<tool_response> {"result": "Doc 1 (Title: \Octavie Coudreau\)\nOctavie Coudreau Marie Octavie Coudreau → (\"née\"\ Renard; 1867(1938) was a French explorer from Anais, Charente, and author of several books on French Guiana and northern Brazil. In 1899, the Brazilian states of Pará and Amazonas hired Coudreau to explore and chart the Amazon region. Her husband ↔ was the French explorer and geographer Henri Coudreau.
[... trimmed ...]
MODEL RESPONSE
<think> The search result mentions that Octavie Coudreau's husband was Henri Coudreau, but it ↔ doesn't state where Henri Coudreau was born. Let me try a more specific search to find ↔ information about Henri Coudreau's birthplace. </think>TOOL CALL
<tool_call> <function=search> <parameter=query_list> ["Henri Coudreau birthplace"] </parameter> <parameter=topk> 3 </parameter> <parameter=max_doc_tokens> 200 </parameter> </function> </tool_call>
WHALE with (correct). Everything that differs on the prompt side is written by the searched harness. Its system prompt grants three search calls and four assistant turns, against the two turns of , and requires at least one retrieval. Its user prompt appends a checklist: the passage must state the answer verbatim, and the answer must be one specific value. Between turns the harness inserts a state line listing the titles retrieved so far. The model searches again when the first passage misses the birthplace, then commits.
SYSTEM PROMPT [... trimmed ...]
s using search when needed. You have a budget of up to three search calls and up to four ↔ assistant turns total. You MUST consult the retriever at least once before your final ↔ answer; do not rely on parametric memory alone. If your first search does not fully ↔ answer the question, use a follow-up search that targets a MORE SPECIFIC missing fact ↔ (a different entity, a linked concept, or a narrower time/place) | do not repeat the ↔ same query. On or before the fourth turn, commit to your final answer inside ↔ <answer>...</answer> (a single name, date, number, or short noun phrase).
USER PROMPT Question: Where was the husband of Octavie Coudreau born?
Use the search tool if needed. After each retrieval, before producing <answer>, verify: (1) Does a retrieved passage state the specific answer verbatim (a name, date, or number ↔ that directly answers the question)? If not, search again with a DIFFERENT phrasing ↔ or clue. (2) If the question has multiple constraints (e.g. "X who did A and B"), does your ↔ candidate answer satisfy EVERY constraint, not just one? (3) Your answer must be a single specific value (name, date, number, or short noun ↔ phrase) | not a category, list, or explanation. Put the final answer only inside <answer>...</answer>.
MODEL RESPONSE The user is asking a question: "Where was the husband of Octavie Coudreau born?"
I need to find information about Octavie Coudreau and then find out where her husband was ↔ born.
First, I need to find information about Octavie Coudreau. I should search for information ↔ about her to find out who her husband is, and then find out where that husband was ↔ born. </think>
TOOL CALL <tool_call> <function=search> <parameter=query_list> ["Octavie Coudreau", "Octavie Coudreau"] </parameter> <parameter=topk> 3 </parameter> <parameter=max_doc_tokens> 200 </parameter> </function> </tool_call>
TOOL RESPONSE <tool_response> {"result": "Doc 1 (Title: \"Octavie Coudreau\")\nOctavie Coudreau Marie Octavie Coudreau → (\"née\"" Renard; 1867{1938}) was a French explorer from Anais, Charente, and author ↔ of several books on French Guiana and northern Brazil. In 1899, the Brazilian states of ↔ Pará and Amazonas hi [... trimmed ...]
USER PROMPT Titles retrieved so far: Octavie Coudreau. You have used 1 of 4 assistant turns; up to 2 ↔ more searches are possible. If any title in the list above already contains the answer, ↔ commit now inside <answer>...</answer>. Otherwise, your next search MUST target a NEW ↔ entity or attribute not already represented in the list | do NOT re-query a title ↔ above.
| TOOL CALL |
|---|
| <tool_call><function=search><parameter=query_list>[{"Henri Coudreau birth place", "Henri Coudreau birth"]}</parameter><parameter=topk>3</parameter><parameter=max_doc_tokens>200</parameter></function></tool_call> |
| TOOL RESPONSE |
| $<tool_response>{"result": "Doc 1 (Title: \\"Henri Coudreau\\")\\nHenri Coudreau Henri Anatole Coudreau (6 May → 1859 Sonnac { 10 November 1899, State of Pará, Brazil) was a French professor of history and geography, explorer and geographer of French Guiana and the tributaries of the Amazon. At the time[... trimmed ...]$ |
| MODEL RESPONSE |
| and the search result explicitly states he was born in **Sonnac** (6 May 1859).<answer>Sonnac</think>The search results identify her husband as **Henri Coudreau** and the text explicitly ↔ states he was born in **Sonnac**.<answer>Sonnac |
D.2 MATHEMATICAL REASONING
The problem is an AIME 2025 counting question with reference answer 279. The base pair scores 0/8, WHALE 8/8.
Base model with the base harness (incorrect). The response never calls the code interpreter. It reasons in prose for 20,035 characters, reaches the token limit and is truncated mid-sentence, so the verifier finds no \boxed{...} answer to extract.
Tools
You have access to the following functions:
<tools> { "type": "function", "function": {"name": "code_interpreter", "description": "A tool for executing code.", "parameters": {"code": {"type": "string", "description": "The code to execute."}}, "required": ["code"], "type": "object"}} </tools>If you choose to call a function ONLY reply in the following format with NO suffix:
<tool_call> <function=example_function_name> <parameter=example_parameter_1> value_1 </parameter> <parameter=example_parameter_2> This is the value for the second parameter that can span multiple lines </parameter> </function> </tool_call>
<IMPORTANT> Reminder: - Function calls MUST follow the specified format: an inner <function=...></function> block ↔ must be nested within <tool_call></tool_call> XML tags - Required parameters MUST be specified - You may provide optional reasoning for your function call in natural language BEFORE the ↔ function call, but NOT after - If there is no function call available, answer the question like normal with your current ↔ knowledge and do not tell the user about function calls </IMPORTANT>USER PROMPT
There are eight-digit positive integers that use each of the digits ↔ exactly once. Let be the number of these integers that are ↔ divisible by 22. Find the difference between and 2025. The answer format must be: \boxed{'The final answer goes here.'}
MODEL RESPONSE
The user wants to find the number of permutations of the digits that form an 8-digit integer divisible by 22. Then subtract 2025 from this number.
Let the digits be in some order. The digits are distinct and form the sequence . The number must be divisible by 22. . So the number must be divisible by 2 and by 11.
Condition 1: Divisible by 2. This means the last digit () must be even. The even digits a
[... trimmed ...]
Positions are . We need to place digits into positions and into positions . Wait, the positions are distinct. So if we have a fixed set of digits for positions , say , there ↔ are ways
WHALE with (correct). The harness leaves the opening prompt untouched; the system and user messages are byte-identical to the base pair's. What it changes is the turn budget, seven assistant turns against two, and what follows execution: the tool response carries the interpreter's output and then a reminder to return a settled result as \boxed{...} rather than as another call. The switch from prose to a single code call is therefore attributable to the weight updates, which is what Section 6.1 means by model-dominant. The response is 3,149 characters and ends in a boxed answer.
Tools
You have access to the following functions:
<tools> {"type": "function", "function": {"name": "code_interpreter", "description": "A tool for executing code.", "parameters": {"properties": {"code": {"type": "string", "description": "The code to execute."}}}, "required": ["code", "type": "object"]}} </tools>If you choose to call a function ONLY reply in the following format with NO suffix:
<tool_call> <function=example_function_name> <parameter=example_parameter_1> value_1 </parameter> <parameter=example_parameter_2> This is the value for the second parameter that can span multiple lines </parameter> </function> </tool_call>
<IMPORTANT> Reminder: - Function calls MUST follow the specified format: an inner <function=...></function> block ↔ must be nested within <tool_call></tool_call> XML tags - Required parameters MUST be specified - You may provide optional reasoning for your function call in natural language BEFORE the ↔ function call, but NOT after - If there is no function call available, answer the question like normal with your current ↔ knowledge and do not tell the user about function calls </IMPORTANT>USER PROMPT
There are eight-digit positive integers that use each of the digits ↔ exactly once. Let be the number of these integers that are ↔ divisible by 22. Find the difference between and 2025. The answer format must be: \boxed{'The final answer goes here.'}
MODEL RESPONSE
We have a problem: "There are eight-digit positive integers that use each of the ↔ digits exactly once. Let be the number of these integers that are ↔ divisible by 22. Find the difference between and 2025.
So we need to count how many 8-digit numbers formed by digits 1-8 (distinct) that are ↔ divisible by 22. Since 22 = 2*11. So number must be divisible by 2 (i.e., even) and by ↔ 11.
The digits a
[... trimmed ...]
So just brute force.
We have digits 1-8. 8! = 40320. That's manageable.
Let's brute force.
We can write Python to count.
Then output final answer.
We must output answer as a boxed value.
Okay, let's compute. </think>
TOOL CALL
<tool_call> <function=code_interpreter> <parameter=code> import itertools
def count_divisible_by_22(): digits = [1,2,3,4,5,6,7,8] import itertools # generate permutations import itertools digits = [1,2,3,4,5,6,7,8] from itertools import permutations count=0 for p in itertools.permutations(digits, 8): # form number # digits are 1-8 so no leading zero issue # convert to int n = int("".join(map(str, p))) # check 22 if n % 22 == 0: count+=1 return count
count = count_divisible_by_22() count </parameter> </function> </tool_call>
TOOL RESPONSE
<tool_response> 2304
[reminder] If the answer is now clear from this output, your next reply should be the final ↔ answer in \boxed{<answer>} -- no more tool calls are required. Only call ↔ code_interpreter again if you spotted a specific numerical error. </tool_response>
MODEL RESPONSE
<think> We found 2304 numbers. That's the number of 8-digit integers using digits 1-8 exactly once ↔ divisible by 22.Now we need to find N = 2304.
Find difference between N and 2025.
2304 - 2025 = 279.
So answer = 2304 - 2025 = 279.
Let's double-check logic: we need 8-digit numbers using digits 1-8 exactly once. That's 8! ↔ = 40320 permutations. We counted those divisible by 22. That's correct.
Thus N = 2304.
N - 2025 = 27
[... trimmed ...]
A number is divisible by 22 if it's divisible by 2 and 11.
- Divisible by 2: last digit must be even. Digits available: 1,2,3,4,5,6,7,8 → even ↔ digits: 2,4,6,8.
- Divisible by 11: alternating sum of digits must be divisible by 11.
We can brute force to find the count N.
\boxed{279}
D.3 CHESS PUZZLES
The puzzle is a mate in two for Black, shown in Figure 7. The base pair scores 0/8, WHALE 8/8.
Base model with the base harness (incorrect). The base harness states the position as a FEN string and an ASCII board, lists the legal moves flat, and asks for one move. The model never commits: it deliberates to the 8,129-token cap and is cut off mid-word, emitting no <move> tag while quoting
(a) Puzzle position, Black to move

(b) After 1...Qb1+ 2.Bd1, Black mates with Qxd1

Figure 7: The Chess Puzzles example. (a) the puzzle position, with the black queen on e4 outlined. (b) after 1...Qb1+ 2.Bd1, where Qxd1 mates.
21 bracketed UCI tokens from the list, so the verifier reports _ambiguous_multipleMoves... The harness offers a retry, shown below, but the budget is spent and no second turn follows. This is typical: 2,025 of the 2,048 base rollouts stop at the same cap, averaging 8,112 assistant tokens against 764 under WHALE.
SYSTEM PROMPT
You solve chess tactics by choosing one legal move at a time. Use only the board position and legal moves shown in the prompt. Do not claim hidden engine analysis or external knowledge. Return exactly one move.
Solve the current chess puzzle position.
Task: solve the chess puzzle one move at a time. Side to move: Black FEN: 6nr/1pN2ppp/p2Qbk2/4p3/3Bq3/8/PP2BPPP/5K1R b - - 0 19 Board: 8 . . . . . . n r 7 . p N . . p p p 6 p . . Q b k . . 5 . . . . p . . . 4 . . . . B q . . . 3 . . . . . . . 2 P P . . B P P P 1 . . . . . K . R a b c d e f g h Puzzle move number: 1 Legal moves:
- [a6a5] SAN=a5
- [b7b5] SAN=b5
- [b7b6] SAN=b6
- [e4b1] SAN=Qb1+
- [e4c2] SAN=Qc2
- [e4c6] SAN=Qc6
- [e4d3] SAN=Qd3
- [e4d4] SAN=Qxd4
- [e4d5] SAN=Qd5
- [e4e2] SAN=Qxe2+
- [e4e3] SAN=Qe3
- [e4f3] SAN=Qf3
- [e4f4] SAN=Qf4
- [e4f5] SAN=Qf5
- [e4g2] SAN=Qxg2+
- [e4g4] SAN=Qg4
- [e4g6] SAN=Qg6
- [e4h4] SAN=Qh4
- [e5d4] SAN=exd4
- [f6f5] SAN=Kf5
- [f6g5] SAN=Kg5
- [f6g6] SAN=Kg6
- [g7g5] SAN=g5
- [g7g6] SAN=g6
- [g8e7] SAN=Ne7
- [g8h6] SAN=Nh6
- [h7h5] SAN=h5
- [h7h6] SAN=h6
Return exactly one move as <move>uci</move>, for example <move>e2e4</move>. Do not include explanation.
MODEL RESPONSE
The user wants me to solve a chess puzzle. I need to determine the best move for Black given the current position.
Position Analysis:**
FEN: 6nr/1pN2ppp/p2Qbk2/4p3/3Bq3/8/PP2BPPP/5K1R b - - 0 19
Side to move: Black
Board Breakdown:**
- Black pieces:
- Q on e4
- N on g8
- B on b4 (Wait, looking at FEN, 'b' on rank 6 is a king. Wait, let's parse FEN → carefully)
[... trimmed ...]
Black Bishop on b7? 1pN2ppp 'p' on b7.
Black Knight on c7? No.
Black Bishop on e6? Maybe.
Is there any protection?
If g6h7 pawn exists.
Wait, 7...
Black King on f6.
Wait, I
ENVIRONMENT RESPONSE
The verifier could not parse exactly one UCI move from "ambiguous_multiple_moves".
↔ Reply with exactly one move, e.g. <move>e2e4</move>, and no explanation.
USER PROMPT
[... trimmed ...]
[f6g5] SAN=Kg5
- [f6g6] SAN=Kg6
- [g7g5] SAN=g5
- [g7g6] SAN=g6
- [g8e7] SAN=Ne7
- [g8h6] SAN=Nh6
- [h7h5] SAN=h5
- [h7h6] SAN=h6
Feedback from verifier:
The verifier could not parse exactly one UCI move from "ambiguous_multiple_moves".
↔ Reply with exactly one move, e.g. <move>e2e4</move>, and no explanation.
Return exactly one move as <move>uci</move>, for example <move>e2e4</move>.
Do not include explanation.
WHALE with (correct). The prompt below is the searched harness's own work. It parses a piece list from the board and splits it by side, then groups the legal moves by origin square and annotates them (mate), (check) and (capture). Each turn restates the moves accepted so far and the opponent's last reply, so the position need not be carried in the reasoning; the environment itself returns only the short line between the two prompts. The harness also fixes how a move is read off a reply: bracketed [uci] tokens inside <think> are scratch notes, and the last <move> tag outside it is the commitment. That rule disposes of the failure above. The model plays Qb1+, sees Bd1 interpose, and mates with Qxd1, in 828 generated tokens.
SYSTEM PROMPT
You solve chess tactics one move at a time. Reply with exactly this two-part structure: <think>at most three short lines of reasoning about the visible legal moves</think> <move>PUT_UCI Here</move>
Rules for the <move> tag:
- Replace PUT_UCI Here with a UCI string copied verbatim from a bracketed [uci] entry in the legal moves list, for example <move>e2e4</move> or <move>b7f7</move>.
- DO NOT emit the literal pl
[... trimmed ...]
- If you emit multiple <move> tags outside <think> (for example because you revised your pick after a second look), the LAST <move> tag is treated as your final commitment. Earlier <move> tags are scratch. Do not claim hidden engine analysis or external knowledge.
Solve the current chess puzzle position.
Side to move: Black Board: 8 . . . . . . n r 7 . p N . . p p p 6 p . . Q b k . . 5 . . . . p . . . 4 . . . B q . . . 3 . . . . . . . . 2 P P . . B P P P 1 . . . . . K . R a b c d e f g h
Piece coordinates ( parsed from the ASCII board above, K=king Q=queen R=rook B=bishop ↔ N=knight P=pawn ): Your pieces (you are BLACK, lowercase on the board): Ng8, Rh8, Pb7, Pf7, Pg7, Ph7, Pa6, ↔ Be6, Kf6, Pe5, Qe4 Opponent pieces (WHITE, uppercase on the board): Nc7, Qd6, Bd4, Pa2, Pb2, Be2, Pf2, Pg2, ↔ Ph2, Kf1, Rh1
Legal moves (28 total, grouped by origin square):
From a6 (P on a6) - 1 move(s):
- [a6a5] SAN=a5
From b7 (P on b7) - 2 move(s):
- [b7b5] SAN=b5
- [b7b6] SAN=b6
From e4 (Q on e4) - 15 move(s):
- [e4b1] SAN=Qb1+ (check)
- [e4c2] SAN=Qc2
- [e4c6] SAN=Qc6
- [e4d3] SAN=Qd3
- [e4d4] SAN=Qxd4 (capture)
- [e4d5] SAN=Qd5
- [e4e2] SAN=Qxe2+ (check, capture)
- [e4e3] SAN=Qe3
- [e4f3] SAN=Qf3
- [e4f4] SAN=Qf4
- [e4f5] SAN=Qf5
- [e4g2] SAN=Qxg2+ (check, capture)
- [e4g4] SAN=Qg4
- [e4g6] SAN=Qg6
- [e4h4] SAN=Qh4
From
[... trimmed ...]
- If you cannot fit reasoning, skip <think> and reply only with <move>UCI</move>.
- Any bracketed [uci] tokens inside <think> are treated as scratch notes, not as your commitment.
- If you emit multiple <move> tags outside <think> (because you revised your pick), the LAST <move> tag outside <think> is treated as your final commitment. Earlier <move> tags are scratch.
MODEL RESPONSE
The position shows Black to move. The legal moves list includes a checkmate move [e4b1] ↔ SAN=Qb1+ which is a check, but I need to verify if it's actually checkmate or just ↔ check. Looking at the legal moves provided, [e4b1] is listed as a legal move for ↔ Black's queen to b1. However, I need to find the best move. The list shows 28 total ↔ legal moves. The most forcing move would be checkmate if available, or check if it l
[... trimmed ...]
</think>Black's queen can deliver check to the white king on b1. This is the only check move available in the legal moves list. <move>e4b1</move>
ENVIRONMENT RESPONSE
Correct. Opponent replied e2d1 (Bd1). Continue with the next move.
Solve the current chess puzzle position.
Side to move: Black Board: 8 . . . . . . n r 7 . p N . . p p p 6 p . . Q b k . . 5 . . . . p . . . 4 . . . . B . . . . 3 . . . . . . . . 2 P P . . . P P P 1 . q . B . K . R a b c d e f g h Last opponent reply: e2d1 Your accepted moves so far: e4b1
Piece coordinates ( parsed from the ASCII board above, K=king Q=queen R=rook B=bishop ↔ N=knight P=pawn): Your pieces (you are BLACK, lowercase on the board): Ng8, Rh8, Pb7, Pf7, Pg7, Ph7, Pa6, ↔ Be6, Kf6, Pe5, Qb1 Opponent pieces (WHITE, uppercase on the board): Nc7, Qd6, Bd4, Pa2, Pb2, Pf2, Pg2, Ph2, ↔ Bd1, Kf1, Rh1
Legal moves (23 total, grouped by origin square):
From a6 (P on a6) - 1 move(s):
- [a6a5] SAN=a5
From b1 (Q on b1) - 10 move(s):
- [b1a1] SAN=Qa1
- [b1a2] SAN=Qxa2 (capture)
- [b1b2] SAN=Qxb2 (capture)
- [b1c1] SAN=Qc1
- [b1c2] SAN=Qc2
- [b1d1] SAN=Qxd1# (mate, capture)
- [b1d3] SAN=Qd3+ (check)
- [b1e4] SAN=Qe4
- [b1f5] SAN=Qf5
- [b1g6] SAN=Qg6
From b7 (P on b7) - 2 move(s)
[... trimmed ...]
pick), the LAST <move> tag outside <think> is treated as your final commitment. Earlier <move> tags are scratch.
MODEL RESPONSE
<think> The board position is critical. Black to move. The legal moves include [b1d1] which is ↔ Qxd1# (checkmate). This is the immediate winning move for Black if the pieces are set ↔ up as described, but I must verify if this is indeed a legal move for Black. The list says "From b1 (Q on b1) ... - [b1d1] SAN=Qxd1# (mate, capture)". Wait, the prompt says "Your pieces (you are BLACK, lowercase on the board)". But the leg[... trimmed ...]
Therefore, the move is b1d1.
<move>b1d1</move> </think>
Black to move and delivers immediate checkmate with the queen on b1 capturing on d1. This move ends the game immediately. The legal moves list confirms [b1d1] is mate.
<move>b1d1</move>
ENVIRONMENT RESPONSE
Correct. Puzzle solved.