Manuscript Offprint
arXiv:2610.02858Harness-Aware Distillation for Small Language Model Agents
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Moonseok Choi Taehong Moon Giung Nam Juho Lee
KAIST AI, Independent researcher
Abstract: Language model agents are deployed with a harness, the software around the model that manages its context, tools, and feedback. When such an agent is distilled into a smaller one, the harness stays in place, so the student mainly needs the teacher-specific abilities that the harness cannot provide, such as acting correctly on harness information. Standard distillation, however, imitates the teacher's full outputs and treats the harness as part of the input. We propose Harness-Aware Distillation (HAD), which focuses distillation on what the teacher adds beyond the harness. HAD complements on-policy distillation with two components: an action preference that contrasts the same teacher's actions with and without the harness information, scored after the student's own reasoning, and a validity check that drops preference pairs whose preferred action contradicts the harness records. We show that the contrast gives the student information that imitating the teacher alone cannot provide, and HAD needs no task rewards, success labels, or future information. Across multiple long-horizon agent benchmarks and models, HAD outperforms on-policy distillation baselines with the same fixed harness. Our analysis shows that HAD enters fewer unproductive loops and recovers from errors more often than the baselines, and suggests that it adaptively keeps learnable feedback in its weights while reading state information from the harness. The project page is available at link.
1. Introduction
Language model agents solve long-horizon tasks through repeated interactions with an environment and its tools (Yao et al., 2023; Yang et al., 2024a). They are usually deployed inside a harness, the software around the model that manages its context, tools, and feedback (Wang et al., 2025; Lee et al., 2026). A harness can, for example, track the environment state, list the available actions, and report when the agent repeats an action without effect. Changing only the harness, with the model fixed, can improve agent performance substantially (Yang et al., 2024a; Lee et al., 2026), so practical deployments assume a harness-equipped agent.
At the same time, the high cost of large models gives a strong incentive to distill their capabilities into smaller agents (Belcak et al., 2025; Zeng et al., 2024). On-policy distillation (OPD) is a common choice, as it provides teacher supervision at the states the student itself visits (Agarwal et al., 2024; Lu and Thinking Machines Lab, 2025; Wang et al., 2026; Zhou et al., 2026), but existing methods do not explicitly account for the harness. Distilling a harness-equipped agent is a problem between two systems that share the same harness. The harness
Task: clean a plate and put it in the cabinet
OPD
HAD (ours)
- Ignores the harness.
HARNESS plate not clean

I have the plate.
Put it in the cabinet.
go to cabinet

The plate is not clean.
Let's clean the plate.
go to sink
- Right goal, wrong action.
HARNESS plate not clean

The plate is not clean.
Let's clean the plate.
go to cabinet

The sink is where
I can wash it.
go to sink
- Copies teacher errors.
HARNESS holding nothing

TEACHER TARGET
clean plate
clean plate
copied as-is
TEACHER TARGET
clean plate
clean plate
dropped, not holding it
Figure 1: OPD versus HAD on the three failures of OPD. HAD acts on the harness information in the first two rows and drops the invalid teacher target from its preference term in the last.
stays fixed when the teacher is replaced by a smaller model, so the student does not need to learn what the harness already provides. What it needs is the teacher's own ability to act on what the harness reports. A natural approach is to run OPD with the same harness for the teacher and the student, yet this approach does not reliably transfer the ability. As Figure 2 shows, adding the harness to OPD changes the student's performance
Co-corresponding authors
Correspondence to: {ms.choi, giung, juholee}@kaist.ac.kr.

Figure 2: Harness utilization and performance of distilled students on ALFWorld. Left: Each OPD method distilled without (light) and with (dark) the harness. Right: The zero-shot student, a distilled student trained without and with the harness, and HAD. Adding the harness to distillation improves harness utilization (65.7%→73.1%) but not performance (43.1%→43.5%), while HAD improves both (65.7%→81.0%; 43.1%→57.4%).
inconsistently across methods. The agreement between the student's actions and the harness records, which we call harness utilization, also shows limited improvement and can even fall below that of the untrained student.
We attribute such limited gains to three failures in the supervision that OPD provides, illustrated in Figure 1. First, OPD leaves the teacher's use of the harness implicit. Table 2 shows that part of the teacher's performance comes from the harness, and keeping this benefit requires the student to learn when harness information should change its decision. OPD supervises every step in the same way, so it does not mark the few steps where the harness changes the teacher's action, and it never shows what the teacher would choose without the harness. Second, OPD does not separate what the harness provides from what the teacher adds. The harness supplies information and feedback, but deciding how to act on them is an ability of the teacher that the harness cannot provide. In the middle row of Figure 1, the student reads that the plate is not clean, yet goes to the cabinet instead of the sink. Third, OPD accepts teacher targets that contradict the harness records. Prior work shows that teachers can be less reliable at student-visited states (Wang et al., 2026; Li et al., 2026; Zhou et al., 2026). The harness records can reveal teacher errors, such as a target that requires an object the agent does not hold, but OPD does not check teacher targets against the harness records.
Our key insight is that the shared harness can itself guide distillation, as it shows which teacher decisions depend on it and its records reveal teacher targets that contradict observed facts. We propose Harness-Aware Distillation (HAD), which adds two components to response distillation, our term for on-policy distillation of the teacher's full response with the harness enabled, as illustrated in Figure 3. Harness-aware action preference learning queries the same teacher with and without the harness information and trains the student to prefer the action chosen with the harness, scored after the student's own reasoning. This contrast is active only at states where the harness changes the teacher's action, and as we show in Section 3.2, it carries information that imitating the teacher's response alone does not provide. Harness-aware action validity filtering drops preference pairs whose preferred action contradicts the harness records, while response distillation is unchanged. HAD uses no task rewards, success labels, or future information.
Our contributions are as follows:
• We view the distillation of a harness-equipped agent as distillation between two systems that share the harness, so the student should learn the teacher-specific abilities that the harness cannot provide. We show that on-policy distillation with the shared harness does not reliably teach the student what the teacher adds beyond the harness.
• We propose HAD, which queries the same teacher with and without the harness and teaches the student to prefer the action chosen with the harness. Since the teacher can still make mistakes, a validity check drops pairs whose preferred action contradicts the harness records. We show in Section 3.2 that the contrast adds information that imitating the teacher alone cannot provide.
• HAD outperforms on-policy distillation baselines with the same harness across multiple long-horizon agent benchmarks and models. Our analysis in Section 4.3 shows that HAD learns to recover from stalls, unlike the baselines, and suggests that it keeps learnable feedback in its weights while reading state information from the harness.
Learning with external context and agent harnesses. External context and agent harnesses can support inference and provide supervision during training. Context distillation and harness self-distillation aim to internalize contextual knowledge or harness-augmented reasoning into model weights (Ye et al., 2026; Zhao et al., 2026). Other work studies the interplay between harness design and post-training, including training compact agents to operate across varying harness configurations (Kim et al., 2026). External guidance can also shape the supervision signal itself: for example, rollout returns can determine the direction of distillation between skill-conditioned and unconditioned views (Tu et al., 2026). Our focus is instead on explicitly supervising how smaller agents use information provided by the harness, while retaining the harness at deployment time.
Contrastive supervision and preference-based distillation. Preference learning trains models to favor one candidate over another, using either a reference-based objective or a reference-free objective combined with imitation (Rafailov et al., 2023; Xu et al., 2024). These approaches also differ in how they construct preference pairs. Prior work constructs synthetic pairs through contrasting prompts (Yang et al., 2024b), compares answers generated with and without retrieval using answer correctness (Yan et al., 2025), or forms preferences between teacher and student generations (Li et al., 2024; Yu et al., 2026). Our method constructs action preferences from the same teacher with and without harness information at student-visited states. We treat the harness-conditioned action as preferred and exclude pairs when that action contradicts harness records. This supervision requires neither task rewards nor success labels.
3. Method
3.1. Harness-Aware Distillation
We consider a multi-turn agent interacting with an environment over a horizon . For a task , an external harness augments each environment observation with supplementary information , computed deterministically from the environment state and interaction history. HAD makes no assumption about what contains, and only requires that it is computed deterministically from the environment state and the interaction history. Writing , we define the harness-induced history and its stripped history as
The agent conditions on to generate a response consisting of a reasoning trace and an action. The environment executes and returns the next observation . Stripping removes only , not their influence on the realized observations and responses; is therefore not a separately generated harness-free trajectory.
Harness-equipped response distillation. Let be a teacher and a student. With the harness enabled for both the student and the teacher, we collect student rollouts matching deployment and query the teacher at each visited history.
We distill the teacher's complete response using its mean token negative log-likelihood:
Harness-aware action preference learning. Distilling at student-visited states addresses the distribution shift of training on teacher trajectories, but does not explicitly supervise harness-induced behavioral differences. We therefore query the same teacher on the stripped history:
Given the visited history, the two teacher responses, with and without the harness, are independent of each other and of the student's current reasoning. Using access to the explicit harness information as a quality proxy, we prefer over and score both under the same student reasoning :
Each score averages log-likelihood over action tokens only, excluding the reasoning prefix. We minimize the reference-free pairwise logistic loss (see Appendix A.4 for its regularization bias):
where is the sigmoid and controls the margin scale. Unlike response distillation, this term supervises actions under student rather than teacher reasoning.
Harness-aware action validity filtering. We set , where the validity checker evaluates actions using the harness-induced history. Specifically, we judge the action invalid if it conflicts with the harness-induced environment observation. The mask applies only to the harness-aware preference learning term, leaving the harness-equipped distillation term unchanged. See Appendix A.1 for details on how is implemented in practical settings.
Final objective. Let denote the distribution of collected training records. Our proposed Harness-Aware Distillation (HAD) combines response distillation with validity-filtered action preferences:
We adjust at each update using minibatch gradient-norm balancing of the two loss terms (Appendix A.1). The ablations in Section 4.5 show gains over harness-equipped distillation alone ( ), unfiltered preferences ( ), full-response preferences, positive-only supervision, and a teacher reference model. Full-response preferences compare with under the same augmented history, rather than comparing actions under student reasoning. Positive-only supervision imitates under the student reasoning prefix without contrasting it with . See Appendix A.2 for more detailed definitions; corresponding ablation results are provided in Section 4.5 and Appendix D.3.
3.2. What Harness Awareness Adds to Distillation
Our proposed harness-aware preference learning makes harness awareness explicit by contrasting the same teacher's actions with and without explicit harness information. For a fixed harness-induced history and its stripped history , let and be the teacher's action marginals. Here, + denotes the teacher with explicit harness information, while - denotes the same teacher with that information stripped from the history. Assuming that harness information generally helps the teacher choose better actions, we form each preference pair by labeling the harness-equipped action from positive and the stripped-history action from negative. The analysis below characterizes the auxiliary preference term; formal assumptions and derivations appear in Appendix A.3 and Appendix A.5.
- Student rollout with the harness

-
Query the teacher with and without the harness
-
Train the student
Figure 3: Overview of HAD. (1) The student acts through the harness, which tracks the environment state and monitors the student's behavior. (2) At each visited state, the same teacher is queried with and without the harness information. (3) The student imitates the teacher's response given the harness and learns to prefer the action chosen with the harness over the action chosen without it, which gives a signal only when the two actions differ. The validity mask drops pairs whose preferred action contradicts the harness records.
What supervision is added? Response distillation already supervises harness-equipped behavior, but it does not distinguish actions that are generally likely under the teacher from those that become more likely specifically because of the harness. Our additional supervision reveals how the teacher's action probabilities differ without the harness information. For independent draws from strictly positive laws on a common finite action set, the isolated unfiltered preference loss has optimal unrestricted scores , with arbitrary constant as in Proposition A.1. Thus, our harness-aware preference term does not simply reinforce actions with high ; it emphasizes actions with high relative to . Response distillation alone cannot identify this relative change, since its risk depends only on the positive response law as mentioned in Observation A.1.
Why filter positive preference labels? Harness access does not guarantee that the positive action is valid. When it is impossible to know which action is correct, the best we can do is exclude actions that are clearly invalid because they conflict with the harness-induced environment observation. We thus use the validity checker , with denoting acceptance. If the positive action is rejected, we drop only its preference loss, leaving response distillation unchanged. With independent teacher sampling and nonzero acceptance, the masked risk is the acceptance probability times the preference risk with conditioned on acceptance and unchanged (cf. Observation A.2). However, filtering cannot remove cases where the positive action is valid yet incorrect; this limitation is inherent to any distillation framework that follows the incomplete teacher.
3.3. Why Action-Only Preference under Student Reasoning
Our preference term is designed with two considerations: what to compare and under which reasoning context to compare it. We motivate these choices in the following paragraphs, with further formal analysis in Appendices A.6 and A.7.
Why action-only? Our goal is to supervise the action difference induced by the harness, rather than differences between complete teacher responses. When the teacher is queried with and without the harness, its reasoning can differ substantially in content or style even when the resulting action is the same. Comparing complete responses can therefore spend much of the preference signal on distinguishing such reasoning differences, rather than focusing on the action change induced by the harness. This effect is further amplified because reasoning traces are typically much longer than actions, allowing them to dominate the full-response comparison and weaken the action-level signal. Indeed, our empirical ablation in Table 15 shows that the full-response variant performs worse. Appendix A.6 further formalizes this distinction: full-response preferences combine the desired action contrast with an additional teacher-reasoning contrast, which can alter the induced action ordering even when the teacher action marginals are unchanged.
Why student-generated reasoning? Having isolated the action-level comparison, we score the teacher actions with and without the harness under the student's own sampled reasoning. This matches the deployed student's decision context: at inference time, it chooses an action after its own reasoning, not after the reasoning underlying either teacher action. Accordingly, the preference term does not condition action supervision on the teacher's no-harness reasoning; the harness-equipped teacher's reasoning is instead learned separately through response distillation. Thus, the auxiliary preference term focuses on action choices under the student's own reasoning, while response distillation provides supervision for the desired teacher reasoning. Appendix A.7 further formalizes that student-prefix conditioning preserves and at student-visited reasoning contexts, while response distillation complements the auxiliary objective with reasoning-dependent supervision.
4. Experiment
4.1. Experimental setup
Models and datasets. We evaluate on ALFWorld (Shridhar et al., 2021), WebShop (Yao et al., 2022), and ScienceWorld (Wang et al., 2022). Using models from the Qwen3 family (Yang et al., 2025), we distill 1.7B from the 8B teacher on ALFWorld, and 0.6B from the 30B-A3B teacher on WebShop and ScienceWorld. To assess generalization across model families, we additionally distill Gemma-4-E2B from Gemma-4-12B on ALFWorld (Gemma Team et al., 2026). All evaluations use temperature 0.4 with thinking disabled; Appendix B.1 gives further details.
Harness. We set the harness to be task-agnostic, sharing the same code and templates across environments without task-specific knowledge such as subgoals, and it only adds text to the observation without selecting or blocking actions. Its components follow functions common in agent harnesses (Wang et al., 2025) and fall into state tracking and behavior monitoring, as listed in Table 1. State tracking is shown at every step, and behavior monitoring only when its condition fires. Every method uses the same harness for training and evaluation, and Appendix B.2 gives the templates, thresholds, validity check, and example pages.
Metrics. We report the success rate (SR) on all environments, the percentage of episodes that complete the task within the step limit, and the score on WebShop and ScienceWorld, given by the mean final reward scaled to 100 and the mean final task score, respectively. We also report the average number of turns in successful episodes, and harness utilization (HU), which measures how often the agent's next action agrees with what the harness reports. For each harness component, we compute the fraction of steps where the next action is consistent with its report and average these fractions over the components. For example, the next action should be among the available actions and should differ from an action reported as failed. We use this metric only as a diagnostic of how the agent responds to the harness, and Appendix B.3 gives the full rules and counting procedure.
Baselines. We compare HAD with four OPD methods, all trained and evaluated with the same harness. OPD (Agarwal et al., 2024) matches the teacher with the token-level reverse KL divergence on the student's own responses, SAGE-OPD (Zhou et al., 2026) reweights each turn by how strongly the teacher judges that it needs correction, Guided-OPD (Li et al., 2026) lets the teacher take over a decreasing fraction of turns, and SOPD (Sun et al., 2026) imitates a full step written by the teacher at each state the student visits. All methods share the same training loop, task pool, and number of updates, and we also report the zero-shot teacher and student. Appendix B.4 gives implementation details and differences from the original papers.
Table 1: Harness components.
| Component | Computed from |
|---|---|
| STATE TRACKING | |
| Available actions | Environment action list |
| Situation | Location and inventory |
| History | Visit history |
| Budget | Step counter |
| BEHAVIOR MONITORING | |
| Failure | Actions at the same state |
| Stall | Recent states |
Table 2: Main results. Each cell reports performance with harness / without harness. All distillation methods are trained with the harness, and the teacher and the student are evaluated zero-shot. Bold marks the best student in each column.
| Method | ALFWorld (1.7B ← 8B) | WebShop (0.6B ← 30B) | ScienceWorld (0.6B ← 30B) | |||
|---|---|---|---|---|---|---|
| Unseen SR | Seen SR | Score | SR | Score | SR | |
| Teacher | 51.49 / 38.06 | 50.00 / 37.86 | 49.96 / 41.41 | 18.80 / 13.40 | 20.26 / 18.47 | 20.13 / 15.44 |
| Student | 9.70 / 2.99 | 20.71 / 6.43 | 20.95 / 4.29 | 9.80 / 1.40 | -16.47 / -16.97 | 3.36 / 3.36 |
| OPD | 47.01 / 31.34 | 40.00 / 31.43 | 41.59 / 39.05 | 19.00 / 16.60 | -0.82 / -0.64 | 8.05 / 7.38 |
| SAGE-OPD | 31.34 / 25.37 | 41.43 / 34.29 | 42.21 / 39.15 | 17.00 / 14.00 | 0.77 / 1.41 | 6.04 / 6.71 |
| Guided-OPD | 46.27 / 33.58 | 35.71 / 27.14 | 43.89 / 40.09 | 16.60 / 14.40 | -2.52 / -4.17 | 6.04 / 6.04 |
| SOPD | 45.52 / 26.87 | 41.43 / 27.86 | 39.97 / 37.64 | 13.80 / 13.60 | -8.45 / -8.00 | 6.71 / 5.37 |
| HAD (ours) | 63.43 / 40.30 | 51.43 / 37.86 | 47.19 / 41.63 | 19.60 / 15.00 | 4.17 / 4.37 | 9.40 / 8.72 |
TASK put a hot cup in cabinet
ALFWorld 0.4.2 (TextWorld 1.7.0, json_2.1.1), unseen, trial_T20190907_083346_800823
RULE heat X with Y heats the object in hand.
| All students | put cup 2 in/on microwave 1 | heat cup 2 with microwave 1 | |||
|---|---|---|---|---|---|
| Nothing happens. | HARNESS | Location: microwave 1. | In hand: nothing. | ||
| Baselines Fail, turn 30 | OPD / SOPD | heat cup 2 with microwave 1 | × N | Nothing happens. | |
| SAGE-OPD | heat cup 2 with microwave 1 | stoveburner 1 | toaster 1 | Nothing happens. | |
| Guided-OPD | take cup 2 from cabinet 2 | × N | Nothing happens. | ||
| HAD Success, turn 25 | Turns 14–20 | examine microwave 1 | close microwave 1 | open microwave 1 | stuck in a loop |
| Turn 21 | HARNESS | No new observation in 5 steps. | Progress has stopped. | ||
| Turn 22 | take cup 2 from microwave 1 | → leaves the loop | |||
| HARNESS | You are holding cup 2. | ||||
| heat cup 2 with microwave 1 | → heats the cup it holds | ||||
Figure 4: An unseen ALFWorld task where heating works only on the object in hand. The baselines loop on actions until the step limit, while HAD leaves its loop after the stall report and heats the cup once the harness reports that it holds it.
Hyperparameter setting. All methods use full fine-tuning with AdamW, a cosine learning rate schedule with 15 warmup updates, gradient clipping at 1.0, weight decay 0.01, and an effective batch size of 60. The learning rate is for all methods. Each round rolls out 16 tasks with the current student, and each collected step is used once within two policy versions. We train for 250 updates on ALFWorld and 150 updates on WebShop and ScienceWorld. For HAD, we use and set at each update so that the gradient norm of the preference term is times that of response distillation. Appendix A.1 and Appendix B.4 list all the details.
4.2. Main experiment
Quantitative analysis. HAD achieves the best performance in every environment in Table 2. With the harness, it reaches 63.4% on unseen and 51.4% on seen ALFWorld tasks, against 47.0% and 41.4% for the best baseline, and it even exceeds its 8B teacher. The harness also matters more for HAD than for the baselines, consistent with our design that trains the student on the decisions the harness changes. Removing the harness at evaluation lowers HAD from 63.4% to 40.3% on unseen tasks, the largest drop among all methods, yet HAD still outperforms the majority of baselines. Appendices B.3 and D.1 further show that its actions are the most consistent with the harness and that it takes a similar number of turns in successful episodes as the other methods.
Qualitative analysis. Figure 4 shows an unseen ALFWorld task that asks the agent to heat a cup and put it in a cabinet, where heating works only on the object the agent holds. Every student puts the cup in the microwave
Table 3: Prevention (episodes without stalls) and recovery (stalls escaped) rates (%) on ALFWorld.
| Prevention | Recovery | |
|---|---|---|
| Teacher | 64.6 | 47.0 |
| Student | 20.4 | 46.8 |
| OPD | 64.2 | 42.9 |
| SAGE-OPD | 60.2 | 32.4 |
| Guided-OPD | 60.6 | 18.8 |
| SOPD | 62.0 | 50.0 |
| HAD (ours) | 75.9 | 59.7 |
Table 4: Success rate of HAD on ALFWorld with one harness category hidden or harness-rejected actions blocked.
| Harness at evaluation | Unseen | Seen |
|---|---|---|
| Full harness | 63.43 | 51.43 |
| Hidden | ||
| Behavior monitoring | 55.97 | 45.00 |
| State tracking | 37.31 | 40.71 |
| Blocked | ||
| Rejected actions | 55.22 | 46.43 |
and then tries to heat it with an empty hand, and the baselines keep repeating actions with no effect until the step limit. HAD falls into a similar loop but leaves it with the help of the harness. After the harness flags that five steps produced nothing new, HAD takes the cup back, and once the harness shows that it holds the cup, HAD heats it and completes the task. Appendix C gives additional examples.
4.3. Analysis
Error trajectory recovery. Long-horizon agents often fall into loops of actions that have no effect, and escaping such error states is a known difficulty (Wang et al., 2025; Zhou et al., 2026). We ask whether HAD avoids these states, which we call prevention, and whether it leaves a stall once stuck, which we call recovery, counting a stall as escaped when the agent reaches a new state. HAD improves both prevention and recovery over every other model, as shown in Table 3. It avoids stalls and repeated failed actions in 75.9% of its episodes, against at most 64.6% for the other models. Standard distillation does not teach recovery, as no baseline clearly improves over the untrained student at 46.8%, whereas HAD escapes 59.7% of its stalls. Every stall we count is flagged by the harness, which suggests that HAD learns to act on the harness to leave a stall, and the states where the two teacher actions differ are spread over the whole episode, as shown in Appendix D.4.
Harness internalization. A harness is internalized when the model learns to produce, from its own weights, the behavior that the harness would otherwise supply, so that it acts correctly even when that part of the harness is removed (Zhao et al., 2026). HAD is not designed to internalize the harness, but our results suggest that it may internalize part of the harness while still relying on the rest. Without the harness, HAD reaches 40.3% on unseen and 37.9% on seen tasks in Table 2, above every baseline without the harness and on par with or above the teacher without the harness. Table 4 shows that this reliance differs across harness categories. Hiding state tracking lowers the success rate of HAD from 63.4% to 37.3% on unseen tasks and from 51.4% to 40.7% on seen tasks, whereas hiding behavior monitoring lowers it to 56.0% and 45.0%, although behavior monitoring also appears on fewer steps. Blocking the actions that the harness rejects also lowers the success rate on both splits, which suggests that the harness is more useful to HAD as information to act on than as a hard constraint. These results are consistent with HAD internalizing part of the feedback from behavior monitoring, while it still reads state information, such as the places visited and the objects held, from the harness. State tracking thus appears more essential at deployment.
4.4. Cross-model generalization
Table 5 repeats the ALFWorld evaluation with the Gemma-4 family; E2B students are distilled from the 12B teacher, under the same recipe and harness. HAD again achieves the highest success rate among the students, with 37.3% on unseen and 36.4% on seen tasks against 32.1% and 34.3% for the strongest baseline. Its harness utilization also exceeds even that of the teacher, as detailed in Appendix D.2. This agreement across model families suggests that the gain of HAD comes from the harness contrast rather than from properties of a specific model family.
Table 5: Gemma-4 results.
| Method | Unseen SR | Seen SR |
|---|---|---|
| Teacher | 51.49 / 43.28 | 49.29 / 42.14 |
| Student | 14.93 / 8.21 | 18.57 / 15.71 |
| OPD | 26.87 / 18.66 | 31.43 / 29.29 |
| SAGE-OPD | 24.63 / 20.90 | 28.57 / 27.14 |
| Guided-OPD | 29.10 / 18.66 | 32.86 / 24.29 |
| SOPD | 32.09 / 29.85 | 34.29 / 25.71 |
| HAD (ours) | 37.31 / 23.88 | 36.43 / 30.00 |
4.5. Ablation study
Component ablation. Table 6 removes each component of HAD in turn on ALFWorld. Removing the validity check () lowers the SR from 57.4% to 50.8%, since teacher actions that contradict the harness records then enter the preference loss. Removing the negative, so that the student only imitates the action chosen with the harness after its own reasoning, lowers the SR to 52.4% and harness utilization from 81.0% to 74.4%, close to the 73.1% of response distillation alone. The contrast with the action chosen without the harness therefore accounts for most of the gain in harness utilization (HU), while the validity check mainly protects task performance. Removing the preference term leaves response distillation alone (), and the SR drops to 43.5%. Each component thus contributes to HAD in a complementary manner.
Table 6: Component ablations.
| Variant | SR | HU |
|---|---|---|
| HAD (ours) | 57.4 | 81.0 |
| w/o validity () | 50.8 | 78.9 |
| w/o negative (pos-only) | 52.4 | 74.4 |
| w/o preference () | 43.5 | 73.1 |
Teacher budget. In the main results, every method is trained for the same number of updates, but HAD queries the teacher twice per state, once with and once without the harness, while the baselines query it once. To separate the effect of this extra teacher budget, Table 7 also trains OPD and SOPD with twice the teacher budget. Each baseline sees twice as many student trajectories, so that the teacher is queried as often as in HAD, which also gives the baselines twice as many updates and favors them in this comparison. Even with this advantage, the success rate averaged over seen and unseen tasks only rises from 43.5% to 46.7% for OPD and from 43.5% to 46.8% for SOPD, far below the 57.4% of HAD. The gain of HAD is therefore not explained by the additional teacher queries.
Table 7: Teacher budget ablations.
| Method | Unseen SR | Seen SR |
|---|---|---|
| OPD | 47.0 | 40.0 |
| OPD, 2× | 47.8 | 45.7 |
| SOPD | 45.5 | 41.4 |
| SOPD, 2× | 50.8 | 42.9 |
| HAD (ours) | 63.4 | 51.4 |
Design choices. HAD scores only the action after the student's own reasoning and uses no reference model, following Section 3.3. As shown in Table 15, both alternatives to these choices are less effective than HAD (see Appendix D.3). Comparing full responses instead of actions lets the loss drop by telling apart the teacher's reasoning styles with and without the harness, and the long reasoning dilutes the signal from the short action. Scoring only the action after the student's own reasoning avoids both problems and matches how the student chooses its action at deployment. Using the teacher as a reference model does not help either, since the teacher's probabilities after the student's reasoning are not a reliable prior at the states the student visits. In Table 16, the success rate peaks at , which suggests that a smaller weight gives too little signal from the harness contrast while a larger weight may pull the small student away from the task.
5. Conclusion
We have presented Harness-Aware Distillation (HAD), a distillation framework for small language model agents that are deployed with a harness. HAD starts from the view that distilling such an agent is a problem between two systems that share the same harness, so the student mainly needs the teacher's ability to act on what the harness reports. It complements on-policy distillation with an action preference that contrasts the same teacher's actions with and without the harness information, and with a validity check that drops pairs whose preferred action contradicts the harness records. Across multiple long-horizon agent tasks, our method achieves the best performance among on-policy distillation methods equipped with the same harness.
Future work and limitations. We evaluated HAD with students of up to 2B parameters and teachers of up to 30B parameters in text-based environments; extending it to larger models and tool-calling or software agents remains future work. Our harness is also designed by hand, and harnesses that are learned or optimized automatically may interact with HAD differently. More broadly, HAD reflects a principle that distillation into a system with a fixed component should focus on what that component cannot provide, which may also apply to agents that rely on retrieval or external tools.
References
Rishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stanczyk, Sabela Ramos Garea, Matthieu Geist, and Olivier Bachem. On-policy distillation of language models: Learning from self-generated mistakes. In International Conference on Learning Representations (ICLR), 2024.
Peter Belcak, Greg Heinrich, Shizhe Diao, Yonggan Fu, Xin Dong, Saurav Muralidharan, Yingyan Celine Lin, and Pavlo Molchanov. Small language models are the future of agentic ai, 2025. URL https://arxiv.org/abs/2506.02153v3.
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.05915v1.
Gemma Team, Sherif El Abd, Vaibhav Aggarwal, Robin Algayres, Alek Andreev, Olivier Bachem, Ian Ballantyne, Cormac Brick, Victor Cärbune, Michelle Casbon, Mayank Chaturvedi, Aditya Chawla, Victor Cotruta, Alice Coucke, Phil Culliton, Robert Dadashi, Lucas Dixon, Mohamed Elhawaty, Utku Evci, Clément Farabet, Johan Ferret, Filippo Galgani, Sertan Girgin, Jean-Bastien Grill, Maarten Grootendorst, Jiaxian Guo, Cassidy Hardin, Yanzhang He, Steven M. Hernandez, Omri Homburger, Léonard Hussenot, Juyeong Ji, Armand Joulin, Aishwarya Kamath, Parnian Kassraie, Olivier Lacombe, Preethi Lahoti, Gaël Liu, Gus Martins, Luciano Martins, Tatiana Matejovicova, Ramona Merhej, Nikola Momchev, Sneha Mondal, Ryan Mullins, Sindhu Raghuram Panyam, Shreya Pathak, Sarah Perrin, André Susano Pinto, Etienne Pot, Angéline Pouget, Alexandre Ramé, Sabela Ramos, Douglas Reid, David Rim, Morgane Rivière, Karsten Roth, Louis Rouillard, Omar Sanseviero, Pier Giuseppe Sessa, Shane Settle, Danila Sinopalnikov, Sara Smoot, Piotr Stanczyk, Andreas Steiner, Lawrence Stewart, Ilya Tolstikhin, Michael Tschannen, Anton Tsitsulin, Nino Vieillard, Renjie Wu, Pingmei Xu, Haichuan Yang, Edouard Yvinec, Biao Zhang, Li Zhang, Joe Zou, Nicolas Aagnes, Abdelrahman Abdelhamed, Jakub Adamek, Shivani Agrawal, Shubham Agrawal, Ibrahim Alabdulmohsin, Jean Baptiste Alayrac, Uri Alon, Chandramouli Amarnath, Ankesh Anand, Chrysovalantis Anastasiou, Setareh Ariafar, François-Xavier Aubet, Kyriakos Axiotis, Federico Barbero, Joelle Barral, Alexei Bendebury, Urs Bergmann, Stanley Bileschi, Kat Black, Mathieu Blondel, Sebastian Borgeaud, Arthur Bražinskas, Ryan Burnell, Robert Busa-Fekete, Mu Cai, Daniele Calandriello, Glenn Cameron, Charlotte Caucheteux, Rahma Chaabouni, Garima Chadha, Jetha Chan, Blake Jianhang Chen, Jesse Chen, Lin Chen, Xu Chen, Derek Cheng, Tzu hsiang Chien, Nikolai Chinaev, Yi Chou, Zhaohui Chu, Benjamin Coleman, Pooja Consul, Sam Conway-Rahman, Scott Crowell, Dylan Cutler, Vivek Dani, Samira Daruki, Anil Das, Daniel Deutsch, Nishanth Dikkala, Li Ding, Qiuhan Ding, Shenil Dodhia, Konstantin Donhauser, Tulsee Doshi, Anca Dragan, Alex Druinsky, Sahil Dua, Zoltan Egyed, Danielle Eisenbud, Daniel Eppens, Cindy Fan, Bahare Fatemi, Yassir Fathullah, Vlad Feinberg, Milen Ferev, Sebastian Flennerhag, Takumi Fujimoto, João Gabriel Oliveira, Isaac Galatzer-Levy, João Gante, Simon Geisler, Soham Ghosal, Antonious M. Girgis, Tamara von Glehn, Alec Go, Alhaad Gokhale, Alex Grills, Yiming Gu, Mayank Gupta, Pramod Gupta, Guru Guruganesh, Raia Hadsell, Hamza Harkous, Jitendra Harlalka, Demis Hassabis, Anja Hauth, Joe Heyward, Arian Hosseini, Chih-Yang Hsia, I-Hung Hsu, Xiaopeng Huang, Yangsibo Huang, Kevin Hui, Adrian Hutter, Te I, Fotis Iliopoulos, Advait Jain, Ganesh Jawahar, Ziwei Ji, Qilin Jin, Melvin Johnson, Kandarp Joshi, Arun Kandoor, Wang-Cheng Kang, Koray Kavukcuoglu, Mehran Kazemi, Kathleen Kenealy, Amr Khalifa, Phoebe Kirk, Ivan Korotkov, Suraj Kothawade, Vitaly Kovalev, Neel Kovelamudi, Adam Kraft, Ravin Kumar, Vivek Kumar, Harish Kuppam, Justin Lannin, Chen-Yu Lee, Seungji Lee, Dmitry Lepikhin, Alon Levkovitch, Dongdong Li, Qiujia Li, Valentin Liévin, Ethan Lin, Ziqian Lin, Casper Liu, Tianlin Liu, Tianqi Liu, Xin Liu, Ivan Lobov, Mayank Lunayach, Min Ma, Gagan Madan, Andrii Maksai, Eric Malmi, Michal Matuszak, Daniel McDuff, Gaurav Menghani, Maciej Mikuła, Daniil Mirylenka, Karolis Misiunas, Vedant Misra, Andreea Mitran, Kareem Mohamed, Maksim Mukha, Eric Noland, James O'Donnell, Brendan O'Donoghue, Kate Olszewska, Bernett Orlando, Wanqiong Pan, Rina Panigrahy, Unnati Parekh, Nicolas Perez-Nieves, Chunjong Park, Eric Paskie, Liqian Peng, Bryce Petrini, Slav Petrov, Jonas Pfeiffer, Bilal Piot, Martyna Plomecka, Siim Poder, Octavio Ponce, Arijit Pramanik, David Racz, Anish Rajan, Michelle Ramanovich, Anand Rao, Marvin Ritter, Vitor Rodrigues, Evan Rosen, Mikołaj Rybiński, Noveen Sachdeva, Michaël E. Sander, Rohit Sathyanarayana, Sagar Savla, Samuel Schmidgall, Tal Schuster, George Scrivener, Benoit Seguin, Andrew Sellergren, Aliaksei Severyn, Izhak Shafran, Dhruv Shah, Bobak Shahriari, Yuan Shangguan, Ashish Shenoy, Pradeep Shenoy, Rakesh Shivanna, Pauline Sho, Lucas Spangher, Wojciech Stokowiec, Tim Strother, Yao Su, Yinghao Sun, Mukund Sundararajan, Andrea Tacchetti, Mor Hazan Taege, Pouya Tafti, Jean Tarbouriech, Chetan Tekur, Shantanu Thakoor, Rahul Thapa, Madeleine Traverse, Lenart Treven, Tao Tu, Chien Te Tung, Çağlar Ünlü, Petar Veličković, Malini Pooni Venkat, Sagar Gubbi Venkatesh, Vidya Venkiteswaran, Francesco
Visin, Alex Vitvitskyi, Kiran Vodrahalli, Weiyi Wang, Xin Wang, Tris Warkentin, Jan Wassenberg, John Wieting, Cindy Wu, Lechao Xiao, Hao Xu, Yuhui Xu, Fuzhao Xue, Arun Yadav, Jun Yan, Antoine Yang, Lin Yang, Ming-Hsuan Yang, Ziyu Ying, Jae Hyeon Yoo, Morteza Zadimoghaddam, Sajjad Zafar, Fred Zhang, Jiageng Zhang, Jianyi Zhang, Xiaofan Zhang, Chao Zhao, David Zhou, and Chen Zou. Gemma 4 technical report, 2026. URL https://arxiv.org/abs/2607.02770v2.
Yuxian Gu, Li Dong, Furu Wei, and Minlie Huang. MiniLLM: Knowledge distillation of large language models. In International Conference on Learning Representations (ICLR), 2024.
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network, 2015. URL https://arxiv.org/abs/1503.02531v1.
Minki Kang, Jongwon Jeong, Seanie Lee, Jaewoong Cho, and Sung Ju Hwang. Distilling LLM agent into small models with retrieval and code tools. In Conference on Neural Information Processing Systems (NeurIPS), 2025.
Kyungmin Kim, Youngbin Choi, Seoyeon Lee, Suhyeon Jun, Dongwoo Kim, and Sangdon Park. The interplay of harness design and post-training in LLM agents, 2026. URL https://arxiv.org/abs/2606.25447v1.
Yoon Kim and Alexander M. Rush. Sequence-level knowledge distillation. In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2016.
Yoonho Lee, Roshen Sanjay Nair, Qizheng Zhang, Kangwook Lee, Omar Khattab, and Chelsea Finn. Meta-Harness: End-to-end optimization of model harnesses. In Conference on Language Modeling (COLM), 2026.
Gengsheng Li, Mao Zheng, Mingyang Song, Ruiqi Liu, Tianyu Yang, Jie Sun, Qiyong Zhong, Haiyun Guo, Junfeng Fang, Dan Zhang, and Jinqiao Wang. On-policy distillation with curriculum turn-level guidance for multi-turn agents, 2026. URL https://arxiv.org/abs/2606.15912v2.
Yixing Li, Yuxian Gu, Li Dong, Dequan Wang, Yu Cheng, and Furu Wei. Direct preference knowledge distillation for large language models, 2024. URL https://arxiv.org/abs/2406.19774v2.
Jun Liu, Zhenglun Kong, Peiyan Dong, Changdi Yang, Tianqin Li, Yanyue Xie, Yifan Gong, Xuan Shen, Pu Zhao, Hao Tang, Geng Yuan, Wei Niu, Wenbin Zhang, Xue Lin, Dong Huang, and Yanzhi Wang. Structured agent distillation for large language model agents. In International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2026.
Kevin Lu and Thinking Machines Lab. On-policy distillation. Thinking Machines Lab: Connectionism, 2025. doi:10.64434/tml.20251026. https://thinkingmachines.ai/blog/on-policy-distillation.
Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. Direct preference optimization: Your language model is secretly a reward model. In Conference on Neural Information Processing Systems (NeurIPS), 2023.
Noah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan, and Shunyu Yao. Reflexion: language agents with verbal reinforcement learning. In Conference on Neural Information Processing Systems (NeurIPS), 2023.
Mohit Shridhar, Xingdi Yuan, Marc-Alexandre Cote, Yonatan Bisk, Adam Trischler, and Matthew Hausknecht. ALFWorld: Aligning text and embodied environments for interactive learning. In International Conference on Learning Representations (ICLR), 2021.
Changhui Sun, Lanbo Liu, Hang Lei, Tong Ling, Jiahang Xie, Zhiyong Zheng, Yujia Wang, Hao Liu, Feng Xiao, Lu Liu, Yanlong Du, Zifeng Cheng, Ziwei Jiang, and Qing Gu. Step-level on-policy distillation: Interpolating between on-policy distillation and supervised fine-tuning, 2026. URL https://arxiv.org/abs/2608.16333v1.
Songjun Tu, Chengdong Xu, Qichao Zhang, Yiwen Ma, Yaocheng Zhang, Linjing Li, Dong Li, Xiangyuan Lan, and Dongbin Zhao. UCOB: Learning to utilize and evolve agentic skills via credit-aware on-policy bidirectional self-distillation, 2026. URL https://arxiv.org/abs/2606.29502v2.
Jiaqi Wang, Wenhao Zhang, Weijie Shi, Yaliang Li, and James Cheng. Exploring temporal curriculum in on-policy distillation for multi-turn autonomous agents. In Conference on Language Modeling (COLM), 2026.
Ruoyao Wang, Peter Jansen, Marc-Alexandre Côté, and Prithviraj Ammanabrolu. ScienceWorld: Is your agent smarter than a 5th grader? In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2022.
Xingyao Wang, Boxuan Li, Yufan Song, Frank F. Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, Hoang H. Tran, Fuqiang Li, Ren Ma, Mingzhang Zheng, Bill Qian, Daniel Shao, Niklas Muennighoff, Yizhe Zhang, Binyuan Hui, Junyang Lin, Robert Brennan, Hao Peng, Heng Ji, and Graham Neubig. OpenHands: An open platform for AI software developers as generalist agents. In International Conference on Learning Representations (ICLR), 2025.
Haoran Xu, Amr Sharaf, Yunmo Chen, Weiting Tan, Lingfeng Shen, Benjamin Van Durme, Kenton Murray, and Young Jin Kim. Contrastive preference optimization: Pushing the boundaries of LLM performance in machine translation. In International Conference on Machine Learning (ICML), 2024.
Shi-Qi Yan, Quan Liu, and Zhen-Hua Ling. RPO: Retrieval preference optimization for robust retrieval-augmented generation. In Annual Meeting of the Association for Computational Linguistics (ACL), 2025.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, Chujie Zheng, Dayiheng Liu, Fan Zhou, Fei Huang, Feng Hu, Hao Ge, Haoran Wei, Huan Lin, Jialong Tang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jing Zhou, Jingren Zhou, Junyang Lin, Kai Dang, Keqin Bao, Kexin Yang, Le Yu, Lianghao Deng, Mei Li, Mingfeng Xue, Mingze Li, Pei Zhang, Peng Wang, Qin Zhu, Rui Men, Ruize Gao, Shixuan Liu, Shuang Luo, Tianhao Li, Tianyi Tang, Wenbiao Yin, Xingzhang Ren, Xinyu Wang, Xinyu Zhang, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yinger Zhang, Yu Wan, Yuqiong Liu, Zekun Wang, Zeyu Cui, Zhenru Zhang, Zhipeng Zhou, and Zihan Qiu. Qwen3 technical report, 2025. URL https://arxiv.org/abs/2505.09388v1.
John Yang, Carlos Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. SWE-agent: Agent-computer interfaces enable automated software engineering. In Conference on Neural Information Processing Systems (NeurIPS), 2024a.
Kevin Yang, Dan Klein, Asli Celikyilmaz, Nanyun Peng, and Yuandong Tian. RLCD: Reinforcement learning from contrastive distillation for LM alignment. In International Conference on Learning Representations (ICLR), 2024b.
Shunyu Yao, Howard Chen, John Yang, and Karthik Narasimhan. WebShop: Towards scalable real-world web interaction with grounded language agents. In Conference on Neural Information Processing Systems (NeurIPS), 2022.
Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R Narasimhan, and Yuan Cao. ReAct: Synergizing reasoning and acting in language models. In International Conference on Learning Representations (ICLR), 2023.
Tianzhu Ye, Li Dong, Xun Wu, Shaohan Huang, and Furu Wei. On-policy context distillation for language models, 2026. URL https://arxiv.org/abs/2602.12275v2.
Xin Yu, Liuchen Liao, Yiwen Zhang, Yingchen Yu, Lingzhou Xue, and Qinzhen Guo. Preference-based self-distillation: Beyond KL matching via reward regularization, 2026. URL https://arxiv.org/abs/2605.05040v2.
Aohan Zeng, Mingdao Liu, Rui Lu, Bowen Wang, Xiao Liu, Yuxiao Dong, and Jie Tang. AgentTuning: Enabling generalized agent abilities for LLMs. In Findings of the Association for Computational Linguistics: ACL, 2024.
Zhengyang Zhao, Lu Ma, and Wentao Zhang. Training with harnesses: On-policy harness self-distillation for complex reasoning, 2026. URL https://arxiv.org/abs/2605.08741v1.
Yuhang Zhou, Lizhu Zhang, Yifan Wu, Mingyi Wang, Bo Peng, Jiayi Liu, Xiangjun Fan, and Zhuokai Zhao. SAGE-OPD: Selective agent-guided intervention for multi-turn on-policy distillation, 2026. URL https://arxiv.org/abs/2606.19659v1.
A. Additional Supervision from Harness Awareness
A.1. Practical Implementation
Scaling preference margins (). The margin compares mean log-likelihoods over action tokens, so its scale does not grow with the length of the compared actions. The coefficient then sets how quickly the logistic loss saturates in this margin. With a small , the loss is close to linear in and every retained pair contributes a similar gradient, whereas a large concentrates the gradient on pairs whose margin is still small or negative. Since rescales the preference gradient to a fixed fraction of the distillation gradient, mainly changes how this gradient is distributed across pairs rather than its overall size. We use in all environments, selected together with on a validation split held out from the training tasks. When the two teacher actions are identical, for every , so the pair contributes a constant loss and no gradient.
Filtering invalid actions (). The checker judges the positive teacher action only against the records that the harness computes at the visited state , and uses no task rewards or future information. At a high level, it rejects an action that the harness records contradict, that is, an action the harness itself would report as impossible or ineffective at this state. Examples include an action outside the available actions that the harness lists, an action that uses an object the agent does not hold, and an action that repeats one reported as having had no effect at the same state. The checks for each environment are listed in Appendix B.2 and Appendix B.4. Negative actions are not checked, since lowering the likelihood of an invalid action does not harm the student. A rejected pair is removed from the preference term only, and the teacher response at that state still enters . The checker is therefore conservative, as it removes actions that contradict the records but cannot detect actions that are valid yet do not advance the task (Section 3.2).
Balancing distillation and preference losses (). In practice, we compute the mini-batch losses
for a minibatch of records, where when , and perform backpropagation on the combined loss . Rather than using a fixed value of , we introduce a per-mini-batch heuristic that scales the newly introduced preference loss-gradient so that its contribution to the parameter update is approximately half that of the original distillation loss-gradient:
A.2. Ablation Variants
Response distillation alone and no filtering. Setting removes the auxiliary term, whereas setting retains every positive preference candidate.
Positive-only action supervision. Replace by
retaining the positive teacher actions, student reasoning prefixes, length normalization, and validity masks. This preserves direct student-prefix supervision without the stripped-history comparison.
Full-response preferences. Replace and by
Each target contains its own teacher reasoning and action, and both are scored under the same augmented history. For , autoregressive factorization gives
Thus this variant changes both the scored span and the action-conditioning prefix, rather than merely adding reasoning supervision to an otherwise identical comparison.
A.3. What Harness-Aware Action Preference Learning Adds
We fix a realized harness-induced history , its stripped counterpart , and the student reasoning prefix . Write the teacher response laws and action marginals as
Teacher draws are independent of each other and of current student reasoning conditional on the history. Let be a student response law at , where includes the boundary before the action. Set and , and take student likelihoods to be positive wherever they are scored. The response-distillation risk is
It depends on the full positive response law , but not on the negative teacher law. Zero-weight imitation terms are interpreted as zero, including at zero student probabilities.
Definition A.1 (Unfiltered preference risk). For probability laws and on a common finite, nonempty alphabet , independent draws and , and scores , define
For action comparisons, define the unweighted, unmasked preference risk and the action-preference score by
Proposition A.1 (Bayes-optimal action-preference scores). Let and be strictly positive probability laws on a finite, nonempty action set , with independent sampling. The minimizers of over all are exactly
Proof. Write , , and
Symmetrizing the risk gives
where . The weights sum to one, and full support makes every weight positive and every strictly between zero and one. Each cross-entropy is uniquely minimized at its target probability, with log-odds
Thus minimizes all terms simultaneously, and equality requires for every pair. Equivalently, is constant.
The argument also yields the exact excess-risk identity
This calibrates scores to teacher-input provenance, not to measured action utility.
Observation A.1 (Contrast is not identified by response imitation). The positive response law determines D, but does not generally determine the optimal action-preference score differences, which also depend on .
For example, fix and consider two negative action laws,
The distillation risks agree for every Q, whereas Proposition A.1 gives
The additional query therefore identifies a contrast absent from the positive response law alone. This does not preclude useful harness-dependent behavior learned through response imitation.
A.4. Regularization Bias and Reference-Relative Preferences
Regularization bias in isolation. Under the assumptions of Proposition A.1, take and a common action length . When , the optimal scores are constant, so the isolated preference optimum over normalized action laws is uniform even if the common teacher law is not. For example, if over two actions, the positive–negative pairs and each occur with probability 0.09. These symmetric comparisons yield the preference-only optimum , rather than the teacher's . Thus reference-free preferences can flatten action probabilities even without a harness-induced action contrast.
A reference-relative variant. To address this bias, one can introduce a fixed reference policy that assigns positive probability to every scored action, define
and replace by in Equation 7, leaving all other components unchanged. Under the assumptions above, with student and reference action laws normalized on , now yields the reference law as the isolated optimum.
However, choosing the reference policy is nontrivial: a teacher reference evaluates continuations conditioned on student-generated reasoning, rather than under the marginal , while a frozen student may itself make poor use of the harness. Thus, neither provides a canonical prior over the decision contexts visited by the student. Consistent with this concern, an ablation that sets yields worse empirical performance (cf. Appendix D.3). For equal-length actions, reference-free scoring is equivalent to the uniform reference . Note that HAD also retains direct teacher supervision through response distillation, with the preference gradient balanced against that signal. The flattening bias therefore remains an auxiliary regularization trade-off; the isolated uniform optimum does not imply a uniform solution for the combined objective.
A.5. What Harness-Aware Validity Filtering Adds
Definition A.2 (Filtered preference risk). For a fixed checker and independent teacher actions, define
Observation A.2 (Positive-action filtering). Under the full-support and independence assumptions of Proposition A.1, fix a checker V and let . The filtered risk in Definition A.2 satisfies, for ,
For , the risk is identically zero. For each accepted–rejected pair, only the comparison favoring the accepted action remains, and its contribution strictly decreases as the accepted action’s score margin increases.
Proof. Substituting into the filtered risk gives the identity; when , all positive-candidate weights vanish. If and , the oriented comparison weights are and . The retained comparison contributes
whose derivative with respect to is strictly negative.
Without filtering, a rejected action can have a larger ratio than an accepted action. Validity filtering addresses this failure of harness access as a preference proxy, without requiring checks on negative candidates during training.
A.6. Why Action-Only Preference Rather Than Full-Response Preference
Section 3.3 motivates a conditional action comparison at the student's own reasoning prefix. Full-response preferences instead score each candidate together with its teacher reasoning, changing both the scored span and the action-conditioning context. We show that this substitution can change the preferred actions even when teacher action marginals stay fixed. Appendix A.7 then formalizes how the conditional comparison complements response distillation. Throughout, teacher reasoning still generates the candidates and the complete positive response remains a distillation target.
Definition A.3 (Full-response preference risk). Let and be probability laws on a common finite, nonempty response set , whose action projection is , with independent teacher draws. Definition A.1 gives the unweighted, unmasked full-response risk and score
This is the population counterpart of Equation 12 with .
Corollary A.1 (Full-response contrast and conditional action odds). Under Definition A.3, assume and are strictly positive on . All minimizers of over unrestricted scores are
If additionally and all actions have length , write and . Let and be the isolated unfiltered optima over positive laws normalized on and , respectively. Then, for every ,
Proof. Applying Proposition A.1 to the response alphabet and factoring gives the joint score target. For positive student laws normalized on , Equation 49 gives
with the unique normalizing constant characterized in Section A.8. For equal action lengths, Proposition A.1 gives , while the joint optimum gives . Subtracting scores at a shared prefix cancels the normalizing constants and the reasoning marginal , proving Equation 34.
These identities concern isolated preference optima, not optima of the combined objective. Because both length factors are positive, an opposite action ordering requires the additional term to change the sign of the action contrast. A reasoning contrast constant across actions at the given prefix cancels instead.
Reasoning-based source discrimination. For any action score , its lift satisfies after marginalizing reasoning. Taking therefore yields
Equality holds exactly when the lifted action optimum is also a full-response optimum, requiring to be a single constant on . Normalization of each conditional law forces that constant to be zero, so equality is equivalent to for every action. If , the optimal action risk is , but the optimal full-response risk is strictly smaller whenever the conditional reasoning laws differ. For example, with distinct, full-support and yields a full-response target depending only on reasoning. A lower full-response risk can therefore reflect reasoning-based source discrimination without an action-marginal contrast. This alone need not change the conditional action ordering: the relevant question is whether the additional reasoning contrast differs across actions.
Marginal versus reasoning-conditioned contrasts. Under the same full-support assumptions, Bayes' rule gives
where . The prefix-dependent constant cancels in action comparisons. Thus, for equal action lengths, the full-response optimum ranks actions at a shared prefix by a reasoning-conditioned action contrast, whereas the action-only optimum uses the marginal contrast . The conditional contrast may encode useful reasoning–action compatibility; it is not necessarily a nuisance signal. Our choice of action-only scoring isolates the harness-induced action contrast after marginalizing teacher reasoning, rather than asserting that marginal contrasts always yield better actions.
Observation A.3 (Negative-reasoning invariance). At a fixed history and student prefix, the combined objective depends on negative teacher responses only through . Holding , , the checker , and the weight fixed therefore leaves it unchanged for every admissible , including parameterized students and variable action lengths. This follows directly from the loss definitions and concerns negative teacher reasoning, not the student prefix used to score actions.
Proposition A.2 (Full-response preferences need not preserve action ordering). With and fixed, changing only negative reasoning can reverse the full-response probability optimum's action ordering both at a shared prefix and marginally over reasoning, even with constant lengths and . The reversed conditional ordering can oppose the action-preference optimum and incur strictly greater action-preference risk.
Proof. Take two one-token actions , two one-token reasoning prefixes , , and , with teacher laws
Rows index reasoning prefixes and columns index actions. Both laws have full support, with and . Equation 49, applied to action scores, gives and score margin log 4. Full responses have length two, so Equation 35 gives
This favors both at and marginally, since . Its action-score margin at is , rather than , giving strictly greater action risk by Equation 23. Now replace by , leaving and unchanged. The joint teacher ratio becomes , independent of reasoning, and
Thus negative reasoning alone reverses both full-response orderings while the conditional HAD objective stays fixed.
The example holds the positive response law fixed, alongside the action marginals, lengths, and checker acceptance, isolating sensitivity to negative reasoning. It compares isolated preference optima; it does not establish the same reversal for the full-response variant after adding response distillation, nor does it order the variants by task utility. More generally, an action-only positive filter leaves unchanged for accepted actions, so it does not remove their conditional reasoning contrast. Action-only preferences avoid directly contrasting teacher reasoning, but do not eliminate its role in producing the candidate actions or in the positive response-distillation term.
A.7. Action-Only Preferences at Student Reasoning Prefixes
We now formalize the coupled construction in Section 3.3: the student's sampled reasoning supplies the context, and teacher actions supply the preference candidates. The resulting loss supplements imitation of complete teacher responses with supervision of the student's conditional action choice. All probabilities below are conditional on the fixed harness-induced history.
Definition A.4 (Student-decision preference risk and excess risk). Let Z be a common finite, nonempty reasoning-prefix alphabet. At every prefix, use the same finite action alphabet A, positive action lengths , candidate laws , and checker V. Let be a fixed distribution of collected student prefixes, and draw , , and independently. For student action conditionals that are positive laws normalized on A, define
(41)
For positive action laws normalized on , write and . Define the per-prefix and prefix-averaged excess risks by
Using an infimum allows filtered risks whose best separating margins are attained only in a limit. These excesses concern the isolated action-preference term, not task utility. The prefix law is held fixed during the comparison, as are collected records during differentiation.
Observation A.4 (Response imitation and student-decision supervision). Under Definition A.4, let be strictly positive on . Write and . The response-distillation risk decomposes as
It therefore scores action conditionals under positive teacher reasoning. In contrast, for fixed , depends on only through at prefixes with and is invariant to changes in with these action conditionals held fixed. For each retained pair, the preference loss is strictly decreasing as a function of its conditional action-score margin .
Proof. Substituting into Equation 16 gives the decomposition. Equation 41 contains only action conditionals at prefixes weighted by . For a retained pair with margin , the loss is , whose derivative is . No teacher- or student-reasoning likelihood appears as a separate score in that margin.
The two scoring choices describe one conditional comparison: is the context of the action law being compared, not another response span receiving a preference label. This is a property of the collected-data loss, not a claim that preference updates leave the student's reasoning unchanged: neural parameters may be shared, and resampling prefixes would change .
Corollary A.2 (Independent prefixes preserve the marginal action target). Under Definition A.4, whenever , the conditional candidate law is . Thus the same per-prefix risk is used at every supervised prefix. If additionally have full support, , and all actions have length , the isolated optimum over independently variable positive normalized action conditionals is
In particular, the isolated target is independent of the scoring prefix.
Proof. Independence of the prefix and the two teacher responses gives the product conditional law, so the masked candidate risk at each prefix is . For unfiltered comparisons with full support and equal action lengths, Proposition A.1 and Equation 49 give the stated optimum at every supervised prefix.
Teacher reasoning generates the candidates but is marginalized in their action law; student reasoning specifies where the same marginal action contrast is taught, not which contrast is taught. This neither replaces by teacher continuation laws conditioned on nor labels the student's reasoning as correct. Equation 44 is a relative-preference target, not generally the teacher action law . With variable but prefix-independent action lengths, Equation 49 likewise yields the same isolated action law at every supervised prefix. A fixed action-only checker also leaves the per-prefix risk identical, although a filtered infimum may only be approached in a limit.
Importantly, our auxiliary preference objective favors consistency across student reasoning contexts but does not, by itself, preserve useful reasoning-dependent action variation. This does not imply that the combined HAD optimum is prefix-invariant, as it also includes response distillation and may constrain action conditionals through shared parameters.
Corollary A.3 (Reusing positive teacher reasoning changes the action target). Let and be independent teacher responses. If the positive reasoning is reused as the shared scoring prefix, then, for every with , the conditional candidate law is . When and have full support and , the optimal unrestricted scores at that prefix are
Proof. Conditioning the positive draw on its reasoning changes its action law to , while independence leaves the negative action law equal to . Proposition A.1 gives the first score identity, and Bayes' rule gives the second.
This target adds compatibility with the selected positive reasoning trace to the marginal action contrast. An independently sampled student prefix avoids this extra conditioning; choosing the student rather than another independent prefix law additionally determines the weighting analyzed next. Full-response preferences are not simply Equation 41 under a different prefix law: they also change the scored span and couple each candidate to its own teacher reasoning.
Which prefixes receive supervision? We now hold the candidate laws and checker fixed, changing only the distribution of independently sampled scoring prefixes. Definition A.4 supplies the common per-prefix excess risk used to compare these distributions.
Proposition A.3 (Prefix coverage and excess-risk transfer). Let be another fixed prefix distribution used with the same action comparison, and define
with the ratio interpreted as +∞ when τ(z) = 0. For finite Cω|τ and every admissible student Q,
If is nonconstant and positive action conditionals can vary independently, this is the smallest uniform factor; when , no finite factor suffices.
Proof. Every is nonnegative by definition of . For finite , multiplying by these excesses and summing proves the bound. For sharpness, choose a prefix attaining the largest ratio and an action law with strictly positive excess there, which exists because the risk is nonconstant. At every other prefix, independently choose action laws whose risks approach . The ratio of averaged excesses then approaches . If , the -averaged excess can approach zero while the -averaged excess remains bounded away from zero, ruling out every finite factor.
The bound applies to parameterized students too; only its sharpness uses independently variable conditionals. It addresses unequal coverage even when both prefix laws have full support. For example, with two prefixes, , , , and excesses with , the two averaged excesses are and . Such excesses are realizable in the unfiltered full-support setting, where the isolated minimum is attained. With full prefix coverage and unrestricted conditionals, alternative prefix weights share the same pointwise target and risk infimum. Their practical difference concerns residual errors due to finite data, limited model capacity, or imperfect optimization, rather than a better pointwise population target. Student-prefix sampling avoids this transfer step by using the collected prefix law itself; it does not guarantee small excess risk or improved task return.
Uncovered prefixes in teacher-forced losses. The decomposition in Observation A.4 also makes the zero-coverage case explicit for the actual response losses. If both teacher reasoning marginals vanish at , varying at fixed and other action conditionals leaves both and unchanged: no positive-weight term scores a response there. Filtering positive actions cannot create this missing coverage. If and the per-prefix action risk is nonconstant, such a variation can nevertheless change through Equation 41. This concerns directly scored conditionals, not the absence of generalization through shared neural parameters.
What the positive-only control retains. The loss in Equation 10 retains student-prefix supervision but removes the negative action contrast. At the fixed history, write for the binary checker and let be a normalized action law on the finite teacher action set. Its isolated risk is , whose optimum is
when the denominator is positive; if it vanishes, the risk is identically zero. The weighted-imitation argument in Section A.8 proves the formula, allowing zero probabilities on zero-weight actions. Thus this control retains direct prefix supervision without learning the contrast. It does not by itself isolate the effect of student rather than teacher reasoning conditioning.
A.8. From Scores to Probabilities
This section supplies the probability realizations used in the preceding comparisons. The score characterizations in Proposition A.1 and Equation 32 apply to mean token log-likelihoods, not directly to sequence probabilities.
More generally, suppose a risk on a finite, nonempty alphabet has exactly the optimal scores . For positive lengths and scores , its unique optimum over positive probability laws normalized on is
The normalization sum is continuous, strictly increasing in , and ranges from zero to infinity, so exactly one constant realizes the optimal score differences. For action preferences, take , , and ; for full-response preferences, take , , and . When is constant, , preserving the score ordering; with variable lengths, probability and score orderings can differ. Without normalization on the specified alphabet, score calibration alone does not identify probability mass outside it. These are isolated preference-loss optima, not optima of the combined HAD objective. For comparison, minimizing a weighted imitation loss gives whenever has positive total mass, allowing boundary probabilities. This follows by expressing the loss as that total mass times cross-entropy from the normalized weights.
B. Experiment settings
B.1. Models and tasks
Table 8 summarizes the environments and models. All models are public checkpoints served with thinking disabled, and the Gemma pair uses the same prompts, harness, and training recipe as the Qwen3 pair on ALFWorld. Every environment asks the model for exactly two lines, Thought: <brief reasoning> followed by Action: <one command>. A reply without a parsable action consumes a turn. Training rollouts use temperature 1.0, and evaluations use temperature 0.4.
Table 8: Environments, models, and evaluation settings.
| ALFWorld | WebShop | ScienceWorld | |
|---|---|---|---|
| Teacher | Qwen3-8B | Qwen3-30B-A3B | Qwen3-30B-A3B |
| Student | Qwen3-1.7B | Qwen3-0.6B | Qwen3-0.6B |
| Teacher (other family) | Gemma-4-12B | - | - |
| Student (other family) | Gemma-4-E2B | - | - |
| Test set | 140 seen, 134 unseen | 500 goals | 149 tasks (30 types) |
| Training pool | 3,553 tasks | 11,587 goals | 3,592 tasks |
| Step limit | 30 | 15 | 15 |
| Max reply tokens | 2,048 | 512 | 128 |
| Context length | 24,576 | 24,576 | 16,384 |
| History in the prompt | full | last 2 steps | full |
| Metrics | SR | score, SR | score, SR |
ALFWorld. Each user turn contains the task, the observation, and the list of admissible commands, and the full history is kept as alternating turns. Harness lines are inserted only in the latest turn, between the observation and the admissible commands. The task line is the first human annotation of each trial rather than the templated goal, as in the original release. This annotation differs from the templated goal in 10 of the 274 evaluation tasks, all methods see the same text, and these tasks are not used for the qualitative examples.
WebShop. We use the 1,000-product version of the environment. The score is the mean final reward multiplied by 100, and the success rate is the percentage of episodes with reward 1.0.
ScienceWorld. We use version 1.2.3 with the teleport simplification and 149 test variations over 30 task types. The score is the mean final score, which can be negative, and the success rate is the percentage of episodes with a score of at least 100.
B.2. Harness
Design. All three environments share the same harness code and templates, and only the part that reads the environment state differs. The harness contains no hints about the task, such as subgoals or solution steps, and reports only what the environment and the agent's own history already reveal. It only adds text to the observation and never selects or blocks an action. Some environments already display part of this information in their own observations, such as the list of admissible commands in ALFWorld and WebShop and the interaction history in the prompt. Since the agent sees this information regardless of the harness, we keep it in every condition, including evaluation without the harness and with a harness category hidden, and the remaining components are added only when the harness is used.
Lines. Table 9 lists the lines the harness can add at each step. Each line has three paraphrases, and one of them is chosen at random for each firing with a seed that depends on the episode and step. The same templates are used in all environments.
Table 9: Harness lines. One of the three paraphrases is shown for each line.
| Line | Function | Template (one paraphrase) | When it fires |
|---|---|---|---|
| Situation | State tracking | You are at {location}. You are holding {holdings}. {m} of {n} places visited; {k} unvisited ({names}). | Every step |
| Visit | State tracking | This visit to {location}: arrived turn {a}, {c} commands executed since. and, for a revisit, Previous visit: arrived turn {a}, {c} commands executed, left turn {l}. | Every step with a known location |
| Budget | State tracking | Step {t} of {cap}. and the warning Only {left} steps remain. Commit to finishing the task now. | Counter at every step, warning when fewer than steps remain |
| Failure | Behavior monitoring | '{action}' did not work here (this was attempt {N}). It will keep failing at this state - choose a different action from the displayed list. | The same action was refused or had no effect at the same state at least the minimum number of times |
| Stall | Behavior monitoring | Nothing new has been observed for {k} steps. You are not making progress. | No new state was reached in the last steps |
Thresholds. The thresholds are part of the harness design, which is shared by all methods, including the baselines, for both training and evaluation (Table 10). They are fixed once for each environment before any distillation, using a validation split held out from the training tasks, and no evaluation task is used. The stall window is the smallest value, and the budget threshold the largest value, for which the corresponding line fires on at most 5% of the steps within successful validation episodes of an untrained model, so that the harness rarely interrupts an agent that is making progress. The minimum number of failed attempts is chosen with the same criterion. WebShop does not announce refused actions, so its failure line fires from the first attempt without effect. This calibration belongs to the harness and not to HAD, and the training objective of HAD uses no task rewards or success labels.
Table 10: Harness thresholds for each environment. They are part of the harness shared by all methods and are fixed before distillation on a validation split held out from the training tasks.
| ALFWorld | WebShop | ScienceWorld | |
|---|---|---|---|
| Stall window | 5 | 4 | 8 |
| Budget threshold | 11 | 5 | 11 |
| Minimum failed attempts | 2 | 1 | 2 |
Example pages. Figure 5 shows one harness-equipped page from each environment, with long parts shortened.
ALFWorld (history omitted)
Task: Put two remotes on an ottoman. Observation: Nothing happens.
You are at sofa 1. You are holding remotecontrol 1. 12 of 14 places visited; 2 unvisited (garbagecan 1, ottoman 1). This visit to sofa 1: arrived turn 18, 2 commands executed since. Here, 'take remotecontrol 2 from sofa 1' does nothing (this was attempt 2). This state will not accept it - select another action from the displayed list. Step 21 of 30. Only 9 steps remain. Commit to finishing the task now.
Admissible commands: examine remotecontrol 1 / examine sofa 1 / go to armchair 1 / ...
WebShop
Observation: [item page: The Spicy Beef Backpacking Bundle ... Price: $14.49 ... [button] Buy Now]
You are at item B0978Q1KK9 / page. You are holding nothing. 3 of 14 places visited; 11 unvisited (home, b0978q1kk9, ..., +6 more). Not yet chosen here: flavor name. This visit to item B0978Q1KK9 / page: arrived turn 6, 1 commands executed since. Previous visit: arrived turn 3, 1 commands executed, left turn 4. Nothing new has been observed for 4 steps. You are not making progress. Step 7 of 15.
Admissible commands: click[back to search] / click[< prev] / ...
ScienceWorld
Action: move baby wolf to yellow box in living room Observation: No known action matches that input.
Location: outside. In hand: orange. 2 of 4 places visited; 2 unvisited (greenhouse, kitchen). This visit to outside: arrived turn 0, 5 commands executed since. Here, 'move baby wolf to yellow box in living room' does nothing (this was attempt 2). This state will not accept it - select another action from the displayed list. Step 5 of 15.
Figure 5: Example pages that the zero-shot teacher sees with the harness. Long parts of the pages are shortened.
B.3. Harness utilization
Harness utilization counts only the components whose report implies a rule that holds for every task. The visit component and the visited places in the situation component are not included, since the right response to them depends on the task, and neither is the budget counter, which only states the current step. Each of the five remaining components is scored separately, and harness utilization is their unweighted mean (Equation 50), so that components applying to every step do not outweigh those that fire rarely.
For each component with a task-agnostic rule , harness utilization averages the fraction of the steps where the component applies at which the rule holds,
The rules require the next action to be available, to use only held objects, to avoid purely informational actions after a budget warning, to differ from an action reported as failed, and to reach a new state within steps after a stall report.
A step is counted for a component if the page shown before action carries that component and its rule can be evaluated. Seen and unseen ALFWorld tasks are pooled. An action outside the ALFWorld command grammar is counted as inconsistent for available actions and is not counted for the other components, so that each error is counted once.
Rules. Available actions applies to every step, and the action is consistent if it is in the admissible commands shown at that step. The situation component applies to every step, and the action is inconsistent if it places, heats, cools, or cleans an object the agent is not holding, slices with a tool the agent is not holding, or takes an object while already holding one. The budget component applies to steps with a budget warning, and the action is inconsistent if it is look, inventory, examine, or help. Failure applies to steps with a failure report, and the action is inconsistent if it equals the reported action. Stall applies to steps with a stall report, and the step is consistent if a state not seen earlier in the episode is reached within the next steps or the episode ends with success. States are identified by the same key the harness uses, namely the location, the held objects, and the admissible commands.
Table 11: Harness utilization and the rate of each component on ALFWorld with the harness.
| Available actions | Situation | Budget | Failure | Stall | HU | |
|---|---|---|---|---|---|---|
| Teacher | 90.1 | 97.2 | 87.8 | 79.4 | 16.9 | 74.3 |
| Student | 73.7 | 96.2 | 79.1 | 61.2 | 18.1 | 65.7 |
| OPD | 87.8 | 97.0 | 88.4 | 52.9 | 17.6 | 68.8 |
| SAGE-OPD | 88.0 | 97.9 | 83.7 | 52.3 | 11.0 | 66.6 |
| Guided-OPD | 82.5 | 94.1 | 85.7 | 28.6 | 5.3 | 59.2 |
| SOPD | 84.8 | 96.5 | 92.3 | 67.3 | 24.7 | 73.1 |
| HAD | 93.3 | 99.0 | 87.7 | 91.1 | 33.8 | 81.0 |
B.4. Implementation details
Common implementation. All baselines and HAD run in one synchronous on-policy loop. In each round, the current student rolls out 16 tasks at temperature 1.0 with the harness on the page, and the teacher reads the same harness-equipped page. Collected steps are kept for two policy versions and each is used once. All methods use full fine-tuning with the settings in Table 12. For methods based on OPD, the KL divergence is computed over the teacher's top 64 tokens at each position instead of the full vocabulary. The original papers use a learning rate of , which did not train the students in our setting, so we use for all methods.
Teacher sampling, truncation, and validity check. Following prior on-policy distillation work for multi-turn agents (Li et al., 2026; Sun et al., 2026), student rollouts are sampled at temperature 1.0 and all evaluations use temperature 0.4. The teacher samples its responses with and without the harness independently at the same temperature 1.0, so that the two teacher actions are draws from the action laws and analyzed in Appendix A. Since both teacher responses are sampled, the rates in Appendix D.4 at which the two teacher actions differ include differences due to sampling as well as those due to the harness. For the methods based on OPD, the KL divergence is computed over the teacher's top 64 tokens at each position, with both distributions renormalized over these tokens. The validity checker of HAD applies the same checks in all three environments, rejecting a positive action that is not among the admissible commands, that uses an object the agent does not hold, or that repeats an action reported as having had no effect at the same state.
Baseline implementations. For OPD, the student is trained with the token-level reverse KL divergence to the teacher on its own sampled responses, the on-policy case of GKD (Agarwal et al., 2024). For SAGE-OPD, following the original paper (Zhou et al., 2026), each student turn is weighted by the teacher's judgment of whether it needs no, weak, or strong correction, multiplied by the teacher's confidence over the turn, and the weights are normalized in each update. For Guided-OPD, following the original paper (Li et al., 2026), the teacher takes over each turn with a probability that decays from 1 to 0 with a cosine schedule over the first of updates, and student turns are trained with the OPD loss. Teacher turns are trained with cross-entropy on the teacher's decoded tokens instead of the forward KL divergence of the original paper. Finally, for SOPD, following the original paper (Sun et al., 2026), the teacher writes one full step at every state the student visits, and the student is trained with cross-entropy on these steps, averaged over the tokens of each step and then over steps.
Table 12: Training hyperparameters, shared by all methods unless noted.
| ALFWorld | WebShop | ScienceWorld | |
|---|---|---|---|
| Optimizer | AdamW, weight decay 0.01, gradient clipping 1.0 | ||
| Learning rate | |||
| Schedule | cosine to 0, 15 warmup updates | ||
| Effective batch size | 60 | 60 | 60 |
| Updates | 250 | 150 | 150 |
| Tasks per round | 16 | 16 | 16 |
| Staleness | 2 | 2 | 2 |
| Rollout temperature | 1.0 | 1.0 | 1.0 |
| Evaluation temperature | 0.4 | 0.4 | 0.4 |
| HAD | 0.5 | 0.5 | 0.5 |
| HAD | 0.5 | 0.5 | 0.5 |
Instructions shared by all prompts
<system>You are an agent acting in a text-based ALFWorld household environment. Your goal is to complete the household task by choosing one environment action at a time. On every turn, respond with exactly two lines and nothing else:
Thought: <brief reasoning about the next step>
Action: <one command>
Choose the Action from the admissible commands provided for the current state. Copy the command exactly, including object and receptacle names and their numeric identifiers. Issue exactly one action.
If the environment returns "Nothing happens.", the previous action had no effect.
Use the current observation and the interaction history to decide what to do next. Do not add any text before the Thought line or after the Action line.
Figure 6: Instructions elided from the per-case figures. They are identical across all ALFWorld cases.
C. Prompts and Examples
We show the prompts and replies of each method for one success case and one failure case on ALFWorld. Each prompt is shown as recorded, with the role markers <system>, <user>, and <assistant>, and the server adds the chat template tokens of each model. The instructions are the same in all prompts, so each figure replaces them with [... instructions elided ...], and Figure 6 shows them in full. Each figure keeps only the last three turns and shows the admissible commands only in the last turn. The harness lines appear in the last user turn, between the observation and the admissible commands. The task line is the first human annotation of the trial, while the templated goal appears once in the first observation of each episode.
D. Further experiments
D.1. Analysis: turns
Table 13 reports the mean number of turns over successful ALFWorld episodes, evaluated with and without the harness. With the harness, HAD takes a similar number of turns to the other methods while solving the most tasks. Adding the harness increases the number of turns for most models, including the teacher and the untrained student.
Table 13: Mean number of turns over successful ALFWorld episodes.
| With harness | Without harness | |
|---|---|---|
| Teacher | 14.10 | 12.99 |
| Student | 13.86 | 9.77 |
| OPD | 13.16 | 13.45 |
| SAGE-OPD | 14.71 | 12.85 |
| Guided-OPD | 14.14 | 12.23 |
| SOPD | 15.15 | 12.31 |
| HAD | 14.83 | 13.14 |
Full prompt (HAD, turn 22)
<system>[... instructions elided ...]
[... earlier turns elided ...] <user>Task: Put two remotes on an ottoman. Observation: On the diningtable 1, you see a book 1, a bowl 3, a bowl 2, a bowl 1, a newspaper 1, a plate 1, a tissuebox 1, and a vase 2.
[... admissible commands elided ...] <assistant>Thought: There are no remotes on the dining table. I should check the remaining unvisited locations like the garbagecan or ottoman. Action: go to ottoman 1 <user>Task: Put two remotes on an ottoman. Observation: On the ottoman 1, you see a creditcard 1.
[... admissible commands elided ...] <assistant>Thought: I need to place the first remote on the ottoman. I should put it there now. Action: put remotecontrol 1 in/on ottoman 1 <user>Task: Put two remotes on an ottoman. Observation: You put the remotecontrol 1 in/on the ottoman 1.
[... admissible commands elided ...] <assistant>Thought: I need to find the second remote control. I should check the remaining unvisited locations like the garbagecan or sofa. Action: go to garbagecan 1 <user>Task: Put two remotes on an ottoman. Observation: On the garbagecan 1, you see nothing.
You are at garbagecan 1. You are holding nothing. 13 of 14 places visited; 1 unvisited (sofa 1). This visit to garbagecan 1: arrived turn 20, 0 commands executed since. Step 21 of 30. You have 9 steps remaining. Commit to completing the task now.
Admissible commands: examine garbagecan 1 go to armchair 1 go to coffeetable 1 go to diningtable 1 go to drawer 1 go to drawer 2 go to drawer 3 go to drawer 4 go to drawer 5 go to drawer 6 go to drawer 7 go to ottoman 1 go to sidetable 1 go to sofa 1 help inventory look
Templated goal
find two remotecontrol and put them in ottoman.
HAD, turns 22 and 23 (succeeds at turn 25)
Thought: I need to check the sofa next as it is the last unvisited location. I should go to the sofa to find the second remote. Action: go to sofa 1 -> You arrive at sofa 1. On the sofa 1, you see a creditcard 3, a keychain 2, a laptop 3, a laptop 2, a newspaper 2, and a remotecontrol 2. Thought: I found the second remote control on the sofa. I should take it and place it on the ottoman. Action: take remotecontrol 2 from sofa 1 -> You pick up the remotecontrol 2 from the sofa 1.
OPD, turns 26 and 27 (fails at turn 30)
Thought: I have checked all locations and found no remote controls. I should check the ottoman again to place the first remote control. Action: go to ottoman 1 -> You arrive at ottoman 1. On the ottoman 1, you see a creditcard 1, and a remotecontrol 2. Thought: I need to place the first remote control on the ottoman. I should put remotecontrol 1 in the ottoman. Action: put remotecontrol 1 in/on ottoman 1 -> Nothing happens.
SOPD, turn 27 (fails at turn 30)
Thought: I have already placed one remote on the ottoman. I need to find the second remote and place it there. Action: go to sidetable 1 -> You arrive at sidetable 1. On the sidetable 1, you see a book 2, a houseplant 1, and a watch 1.
Figure 7: ALFWorld success case, seen task trial_T20190906_182952_858723. HAD follows the harness report that the sofa is the only unvisited place and finds the second remote. The baselines had passed the sofa earlier without taking the remote, and their replies are shown at the corresponding point near the end of their episodes. OPD tries to place a remote it is not holding, and SOPD returns to a place it has already searched.
Full prompt (HAD, turn 28)
<system>[... instructions elided ...]
[... earlier turns elided ...] <user>Task: Move a heated mug to the base of the coffee maker. Observation: On the coffeemachine 1, you see a mug 1.
[... admissible commands elided ...] <assistant>Thought: The task is complete as the mug is now in the coffee machine. Action: inventory <user>Task: Move a heated mug to the base of the coffee maker. Observation: You are not carrying anything.
[... admissible commands elided ...] <assistant>Thought: I need to confirm that the mug is now in the coffee machine and that the task is complete. Action: examine coffeemachine 1 <user>Task: Move a heated mug to the base of the coffee maker. Observation: On the coffeemachine 1, you see a mug 1.
[... admissible commands elided ...] <assistant>Thought: The task is complete as the mug is now in the coffee machine. Action: go to countertop 1 <user>Task: Move a heated mug to the base of the coffee maker. Observation: Nothing happens.
Location: coffeemachine 1. In hand: nothing. 12 of 25 places visited; 13 unvisited (countertop 2, countertop 3, garbagecan 1, microwave 1, shelf 1, +8 more). This visit to coffeemachine 1: arrived turn 20, 5 commands executed since. Nothing new has been observed for 5 steps. You are not making progress. Step 27 of 30. You have 3 steps remaining. Commit to completing the task now.
Admissible commands: examine coffeemachine 1 examine countertop 1 go to cabinet 1 go to cabinet 2 go to cabinet 3 go to cabinet 4 go to cabinet 5 go to cabinet 6 go to countertop 2 go to countertop 3 go to drawer 1 go to drawer 2 go to drawer 3 go to fridge 1 go to garbagecan 1 go to microwave 1 go to shelf 1 go to shelf 2 go to shelf 3 go to sinkbasin 1 go to stoveburner 1 go to stoveburner 2 go to stoveburner 3 go to stoveburner 4 go to toaster 1 help inventory look take mug 1 from coffeemachine 1 take pan 1 from countertop 1 take spoon 1 from countertop 1
Templated goal
put a hot mug in coffeemachine.
HAD, turn 28 (fails at turn 30)
Thought: I need to confirm that the mug is now in the coffee machine and that the task is complete. Action: inventory -> You are not carrying anything.
OPD, turn 28 (succeeds at turn 28)
Thought: I need to place the heated mug in the coffee machine. Action: put mug 2 in/on coffeemachine 1 -> You put the mug 2 in/on the coffeemachine 1.
Figure 8: ALFWorld failure case, unseen task trial_T20190907_171933_349922. Earlier in the episode, HAD placed an unheated mug on the coffee machine and concluded that the task was done. The harness reports a lack of progress, but HAD repeats inventory, one of the actions it has been cycling through, and fails at the step limit. OPD succeeds, but it is in a different state at this turn, holding a heated mug, so its reply does not answer the same page.
D.2. Generalization to other model architecture
Table 14 reports the full results with Gemma models, including the number of turns and harness utilization. With the harness, HAD achieves the highest success rate on both splits and the highest harness utilization at 77.9%, above even the 75.9% of the teacher. Every OPD baseline instead ends below the 71.4% of the untrained student in harness utilization, so adding the harness to standard distillation does not make the Gemma student use it better. Without the harness, HAD loses more than the baselines on unseen tasks, where SOPD reaches 29.9% against 23.9% for HAD, which is consistent with HAD relying on the harness that stays in place at deployment. HAD also takes more turns in successful episodes than the other methods, while solving the most tasks.
Table 14: Full results on ALFWorld with Gemma models (E2B ← 12B). SR cells report performance with harness / without harness. Turns (mean over successful episodes) and harness utilization (HU) are measured with the harness.
| Method | Unseen SR | Seen SR | Turns | HU |
|---|---|---|---|---|
| Teacher | 51.49 / 43.28 | 49.29 / 42.14 | 13.91 / 13.93 | 75.92 |
| Student | 14.93 / 8.21 | 18.57 / 15.71 | 12.26 / 12.92 | 71.38 |
| OPD | 26.87 / 18.66 | 31.43 / 29.29 | 13.26 / 12.97 | 68.76 |
| SAGE-OPD | 24.63 / 20.90 | 28.57 / 27.14 | 14.30 / 13.79 | 67.35 |
| Guided-OPD | 29.10 / 18.66 | 32.86 / 24.29 | 14.84 / 11.58 | 64.05 |
| SOPD | 32.09 / 29.85 | 34.29 / 25.71 | 13.85 / 12.33 | 69.04 |
| HAD (ours) | 37.31 / 23.88 | 36.43 / 30.00 | 15.42 / 12.99 | 77.91 |
D.3. Additional ablations
We report two further ablations on ALFWorld, with all other settings fixed. Table 15 compares HAD with a full-response contrast and with the teacher as a reference model, whose definitions are given in Appendices A.2 and A.4 and whose results are discussed in Section 4.5. Table 16 varies the preference weight from 0.25 to 2.0, and the success rate is highest at , the value used in all main experiments.
Table 15: Design choices of the preference term on ALFWorld, with the harness.
| Variant | Unseen SR | Seen SR |
|---|---|---|
| Full-response contrast | 59.7 | 47.1 |
| Teacher as reference | 56.0 | 46.4 |
| HAD (ours) | 63.4 | 51.4 |
Table 16: Preference weight on ALFWorld, with the harness.
| ρ | Unseen SR | Seen SR |
|---|---|---|
| 0.25 | 53.7 | 47.9 |
| 0.5 | 63.4 | 51.4 |
| 1.0 | 49.3 | 50.7 |
| 2.0 | 51.5 | 49.3 |
D.4. Where the harness changes the teacher's action

Figure 9: How often the teacher actions with and without the harness differ at each position in the episode.
We measure how often the teacher chooses a different action with and without the harness at the states visited during HAD training. As Figure 9 shows, the two teacher actions differ at of the states on ALFWorld, on WebShop, and on ScienceWorld. These states are spread over the whole episode rather than concentrated at its start.