WorksComputer Science
Teaching Agents in their Own Style: Blackbox Teacher Distillation for Web Agents
Abstract
Frontier web agents using closed models have high inference and computational costs. Smaller open models can be an alternative, but to be performant, they require training supervision from a human or teacher model. Token-level teacher distillation is not an option for closed teachers as it needs access to the model's logits. The standard approach is to imitate teacher demonstrations offline, but it trains the student on states it has never visited, and in a style it does not write in. We introduce WebKD, where the teacher is the editor of the student's failures. Given a failed episode, the teacher finds the first point of mistake, and rewrites the student's reasoning traces, harness states, and actions from that point onward. The editing reveals that the teacher's corrections can be more surprising to the student than the student's own text. WebKD instead aims to edit minimally. In the data space, the teacher writes each correction in the student's style. In the objective space, the reasoning is weighted by its contribution to the action. A role-asymmetric KL anchor allows the corrected action to move freely while keeping the reasoning near the student's prior. On the TimeWarp benchmark, WebKD students gain about 5.5-10.7 pp over behavior cloning, outcome-reward RL, and teacher editing baselines. The performance transfers to unseen versions and to the live web in the OnlineMind2Web benchmark. WebKD opens a new way of distilling black-box models to improve the capabilities of open-weight web agents.
https://web-teach-kd.github.io/
Introduction
Agents built on the largest proprietary large language models (LLMs) now perform remarkably well on web tasks [30, 35]. Such a task hands the agent a goal and a browser, and asks it to navigate complex, changing interfaces, plan across tens of steps, and carry intermediate findings through to a final answer. Deploying these agents for everyday use is another matter. Frontier models have high latency because they are large reasoning models. The computational cost makes them less viable as agents that run in the background of daily work. Robotics faced a similar problem, which led to compact Vision-Language-Action (VLA) models distilled for real-time control [43, 15]. Web agents also need a small open-weight model that runs at interactive latency but carries the competence closer to its frontier teacher.
This raises the main challenge we address in this paper: how do we effectively transfer the competence of the black-box, teacher model to the small, more efficient model? Web tasks can be long-horizon or partially observed pages, and the agent must plan explicitly while reasoning in natural language [35]. The harness truncates the history to recent observations due to the limited context. So the agent also keeps a scratchpad memory, and what it writes there, together with its earlier responses, is the only state that persists across steps (de Chezelles et al., 2025) (§ 3.1).
Secondly, the outcome reward is a single value per episode, far too sparse to shape multiple structured decisions with reinforcement learning (RL) [29, 33]. Teacher supervision is denser, but the strongest teachers are black boxes that expose no internals or logits. Every distillation method that consumes the teacher’s next-token distribution, e.g., token-level knowledge distillation (KD), reverse Kullback–Leibler (KL) objectives, and on-policy distillation [7, 1, 22], is therefore unavailable. What a frontier teacher can emit is text. Our research asks how much of a black-box frontier teacher’s competence can be distilled into a small web agent through text alone.
The standard approach is behavior cloning, which involves sampling teacher demonstrations and fine-tuning the student on them offline [16]. For web agents, this is known to help substantially [9, 13], and it is where our pipeline begins. But behavior cloning creates two new problems. It trains the student only at states the teacher visits, so at deployment, small errors carry the student into states its supervision never covered, and the errors compound over the horizon [27]. Secondly, it trains the student on the teacher’s surface distribution, unintentionally importing a writing style that the small model cannot comfortably produce. Is offline imitation really the most a teacher has to offer?
The classical answer to this is DAgger [27], where the expert relabels the states the learner visits. However, DAgger corrects only the actions while a web agent’s generation is a structured response (Figure 1). With truncated history, the non-action parts of that response form the belief state that guides later decisions. Fixing the click while leaving the reasoning that led to it unchanged, therefore fixes the immediate mistake but not its source. Conversely, on-policy expert correction [18] gives control to the teacher from the point of failure and lets it finish the episode. So the completed suffix is the teacher’s trajectory, which is off-policy in state and style.
Figure 1. Overview of WEBKD. (Top) At step , the harness generates the observation history from the goal, accessibility tree, and previous responses. The web agent emits a five-component response conditioned on the observation history. The Think, Plan, and Step components carry their reasoning and running plan, the Memory component reads from and writes to the scratchpad memory, and only the Action component is executed in the web environment, which returns the next observation. (Bottom) The student is behavior-cloned on the teacher’s rollouts (P1) and then generates rollouts from the training tasks (P2). The teacher localizes each failure at (P3) and rewrites the faulty trajectory suffix in the student’s style (P4). The resulting corpus trains the student under action informativeness weighing, and KL anchored objective of § 3.3.1–§ 3.3.2.
An alternative is to use the teacher as an editor of the student’s own failures. The teacher reads a failed episode, localizes the earliest erroneous step, and rewrites the student’s full structured response, reasoning, and harness traces included, from that step to the end. Each rewrite is a single-step teacher rollout on a state the student actually visited, so the supervision is on-policy. However, it is not on-policy in style. A frontier teacher’s corrections are surprising to the student, which are at several times the perplexity of the student’s own steps. This gap is especially large in the reasoning components, where perplexity can increase by up to an order of magnitude, while the action itself remains much closer to the student’s distribution.
Under uniform fine-tuning, the loss is largest where the supervision is most foreign, which is the teacher’s wording rather than its decisions. WEBKD attacks this perplexity premium by editing the rationale minimally. In data space, the teacher writes each correction in the student’s own style from in-context exemplars of the student’s writing. In objective space, each reasoning span is weighted by how much it raises the student’s probability of the corrected action. A role-asymmetric anchor allows the corrected action to move freely while keeping the reasoning close to the student’s prior. The student adopts the teacher’s decisions in full, while being closer to its own writing style.
Our contributions are as follows:
Problem. We formulate distillation from a black-box frontier teacher into a small web agent by using teacher-edits and identify a key obstacle, the on-policy perplexity premium (Defn. 1). The premium is the excess surprisal of the student on the teacher supervision, and it concentrates on the reasoning components rather than the action (Figure 2).

Figure 2. The perplexity premium by response components against the student’s continuations, the teacher’s raw corrections, and the WEBKD’s corpus with in-context edits.
Method. We introduce WEBKD, a new distillation method that uses the teacher to edit the student’s failures without the teacher’s logits (Figure 1). The teacher localizes the first erroneous step and rewrites the subsequent reasoning traces, scratchpad memory, and actions in the student’s style instead of imitating teacher-style traces (§ 3.3). The student then trains under a novel objective function that weights each reasoning span by how much it informs the action (§ 3.3.1) and anchors the reasoning to the student’s prior (§ 3.3.2).
Evidence. On the TimeWarp benchmark, WEBKD lifts the performance of students by 5.5 – 10.7 pp across behavior cloning, outcome-reward RL, and teacher editing baselines using Qwen and Gemma models (Table 1). The gains translate to unseen TimeWarp versions, and the live web benchmark, OnlineMind2Web (Figure 4). Our ablations vary the source of the edits and styles, training objectives, and hyperparameters (Table 2, Table 3, Fig. 5).
| Model | Baseline | v1 | v2 | v3 | v4 | v5 | v6 (seen) |
| – | Teacher (GPT-5.5) | ||||||
| Qwen 3.5 4B | Zero-Shot | ||||||
| Behavior Cloning | |||||||
| Behavior Cloning (TW) | |||||||
| m-GRPO | |||||||
| Self/Student Edit | |||||||
| Off-policy Takeover | |||||||
| Student Re-style Edit | |||||||
| WEBKD | |||||||
| Qwen 3.5 9B | Zero-Shot | ||||||
| Behavior Cloning | |||||||
| Behavior Cloning (TW) | |||||||
| m-GRPO | |||||||
| Self/Student Edit | |||||||
| Off-policy Takeover | |||||||
| Student Re-style Edit | |||||||
| WEBKD | |||||||
| Gemma 4 E4B | Zero-Shot | ||||||
| Behavior Cloning | |||||||
| Behavior Cloning (TW) | |||||||
| m-GRPO | |||||||
| Self/Student Edit | |||||||
| Off-policy Takeover | |||||||
| Student Re-style Edit | |||||||
| WEBKD |
Table 1. Success rate (%) on the TimeWarp test split, in domain on v6 and on the five held-out versions v1–v5. Results are averaged over three runs with the standard error as the subscript.

Figure 4. Success rate on Online-Mind2Web for the Qwen-3.5 4B and 9B students. The contributions are stacked across easy, medium, and hard categories.
| ES | SS | Variant | S.R. ↑ |
| T | T | Teacher takeover (off-policy) | 17.48±2.16 |
| T | T | Teacher edit + teacher style | 33.01±2.68 |
| T | S | Teacher edit + student style (in-context) | 41.10±2.80 |
| T | S} | Teacher edit + student re-style (2-pass) | 25.89±2.49 |
| S/T | S/T | Student proposes, teacher judges/fixes | 27.83±2.55 |
| S | S | Student-only edit | 24.27±2.44 |
Table 2. Edit–style ablation. Teacher edits paired with in-context student style perform best. Qwen-3.5 4B baselines are trained using , KL rationale anchor at . ES: Edit Source; SS: Style Source. T = Teacher, S = Student.
| Loss | w/ KL | w/o KL |
| 37.43±2.75 | 36.25±2.73 | |
| 41.10±2.80 | 38.51±2.77 | |
| 35.92±2.73 | 36.03±2.73 | |
| 37.54±2.75 | 35.81±2.73 | |
| 37.54±2.75 | 33.01±2.68 |
Table 3. Loss ablation. Token weightings on the filtered teacher rollouts, each with and without the KL rationale anchor at using the Qwen-3.5 4B model.
Related Work
Web Agents
Web agents, LLM-driven agents that operate a browser on a user’s behalf [5], are a subcategory of computer-use agents, which perceive rendered user interfaces and act through UIlevel commands [34]. The benchmark ecosystem spans curated demonstrations [5], sandboxed sites [42], live websites [8], and unified harnesses (de Chezelles et al., 2025). TimeWarp [13] additionally varies the era of the interface and tests robustness to temporal UI change. On these suites, proprietary frontier LLMs reach strong success rates, but their cost and latency make them impractical as always-on daily drivers. That gap motivates the small open-weight students this paper targets.
Training pipelines for such students span imitation and RL. WebRL [24], WebAgent-R1 [33], and DigiRL [2] train with outcome-reward RL and inherit its sparse signal, while OpenWebVoyager [9] and TimeWarp [13] fine-tune on teacher demonstrations, the recipe we start from. We differ in what happens after imitation. The teacher corrects the student’s own failures instead of supplying more demonstrations or rewards. Closest to us is WebCoT [11], which also distills reconstructed chain-of-thought rationales. However, the teacher rewrites stored records with template heuristics against observations simulated in the style of WebDreamer (Gu et al., 2025), and it does not localize the first fatal step before rewriting. WEBKD edits actual failures against the observations the student saw from the localized step in the student’s own style, using both the data and training objective.
Knowledge Distillation
Knowledge distillation transfers a teacher’s behavior to a smaller student [10], classically by matching token-level distributions or by fine-tuning on teacher generations at the sequence level [16]. For LLMs, the white-box distillation methods sharpen this line of work with reverse-KL objectives [7], on-policy distillation that scores student-sampled prefixes under the teacher [1, 22], and skew-divergence stabilizations [17]. All of them consume the teacher’s next-token distribution over a shared vocabulary. Black-box agents do not expose these, which forces distillation through text only. This introduces the notion of a perplexity premium (§ 3.2), which has previously been observed with LLM distillation [25] and is one of our paper’s main focuses.
A second lineage imitates the expert at the learner’s own states. DAgger (Ross et al. [27]) showed that relabeling learner-visited states turns quadratic compounding error into linear error, and LLM-era variants revive the recipe through turn-level policy interpolation (Li et al. [19]), mid-trajectory expert takeover (Lauffer et al. [18]), and iterated fine-tuning on privileged feedback (Choudhury & Sodhi [3]). We keep the state-distribution insight but change the label. Our teacher rewrites the full structured response offline instead of relabeling actions online. A third line removes the external teacher. Rejection fine-tuning keeps self-generated successes ([39, 38]), and on-policy self-distillation conditions the same model on privileged information such as a gold solution (Zhao et al. [40]), consensus (Li et al. [21]), or rich feedback (Hüböter et al. [12]), with agentic variants that target failure-relevant spans ([37, 20]). Self-distillation presupposes the competence the model already has, which a 4B student on realistic web tasks typically lacks (Table 1). So we keep an external frontier teacher and hold its supervision close to the student’s own states and style.
Methodology
Background
Web tasks as POMDP. A web task is specified by a natural-language goal on an interactive browser environment ([42] (de Chezelles et al. 2025)). Performing a web task is naturally formalized as a finite-horizon partially observable Markov decision process (POMDP) (Kaelbling et al. [14]) , with a step budget of actions per episode. The underlying browser state contains the full document object model (DOM), session, and site state, and is never observed directly. The initial state is drawn as . The agent receives the rendering , in the form of HTML or an AXTree. An LLM policy generates a structured response autoregressively, conditioned on the observation history . The browser-level action , e.g. click('63'), is deterministically parsed from and executed, producing through the effectively deterministic transition . The reward is sparse and terminal: , assigned once at the end of the episode. The task goal is rendered into every observation, so the full interaction history is . Carrying several high-dimensional observations (a single AXTree runs to thousands of tokens) overflows the context window, so the history is truncated to the most recent observation together with the full response history, .
Web harness. Between the policy and the browser sits the harness, the interface that turns the raw POMDP into an agentic loop. A harness also maintains its internal state across steps, namely the response history , which carries the scratchpad memory as the sequence of memory components emitted so far (§A.4). At step , the harness (i) generates the observation history , (ii) obtains the structured response , (iii) parses the action , and (iv) executes the action to advance the environment and .
Agent response. The harness enforces a five-component response, , generated sequentially (Figure 1) (de Chezelles et al. (2025)). tokens constitute the free-form reasoning grounded in the current observation, tokens form the running, numbered multi-step plan, re-emitted and revised at every step, the token(s) is a single integer naming the current plan step, tokens are the agent’s interface to the scratchpad memory (§A.4), and tokens form one executable browser command. Only the tokens () interact with the environment. Every other component acts on the harness state alone and enters future contexts as part of the observation history .
We provide additional preliminary discussion on behavior cloning (§A.1), knowledge distillation (§A.2), and the black-box constraint (§A.3) in the appendix.
Perplexity Premium
Teacher edits are high-perplexity text for the student. The perplexity of a response under a policy with context ,
measures how natural the text is to that policy. 1 means the policy would have emitted it with certainty, and each unit of log-perplexity is a nat of average per-token surprise. The relative quantity that matters for training is the premium the student pays on its supervision.
Definition 1 (On-policy perplexity premium). For a step with student response and supervision target at the same observation history , the premium is the excess per-token surprisal, under the behavior-cloned student (§A.1), of the supervision relative to the student’s own text:
This premium is one of the obstacles to distilling a frontier teacher through text. As shown in Figure 2, the teacher edits are high-perplexity for the student, while WEBKD’s corpus stays close to the student’s own continuations. Per-token cross-entropy is the surprisal inside Eq. (1), and under uniform SFT, the loss is largest on the tokens most foreign to the student. On raw teacher edits, those are mostly the rationale tokens. The action tokens that fix the failure carry only a few percent of the loss. The surprising spans mix the teacher’s style with its content and reasoning. What it shows is where uniform SFT spends its loss, which motivates the objective of Eq. (5). Any method that trains on teacher edits must address the premium. Our method attacks it from both sides. In data space, before training, the correction is written in the student’s own style (P4 of § 3). In objective space, during training, the learning signal is concentrated on the tokens that inform the action (§ 3.3.1), and the rationale is anchored to the student’s own prior, which damps the premium the student absorbs and caps it per token once exceeds the threshold of Corollary 1 (§ 3.3.2).
Web Knowledge Distillation (WebKD)
The core of WEBKD is to correct the student’s decisions at the states it visited, rewriting only the steps from the failure onward. How can the student policy be improved while minimizing the student’s surprisal to teacher edits? WEBKD starts from a student agent fine-tuned to replicate the teacher (P1). We then collect rollouts from the fine-tuned student agent and keep its failures (P2). The edit itself is a two-stage teacher intervention: where did the student fail? (P3), and how should the teacher correct it? (P4). The corpus of corrected trajectories trains the student under a premium-aware objective: action-informative token weighting (§ 3.3.1) and a role-asymmetric anchor to the student’s prior (§ 3.3.2). Figure 1 gives an overview, and Algorithm 1 states the full method. We characterize in closed form the per-token target of the WEBKD objective (Proposition 2) and bound the student’s failure rate by the teacher’s localization and correction errors plus the student’s own disagreement with the corrected process (Theorem 1).
P1: Behavior cloning on teacher rollouts. WEBKD first replicates the teacher rollouts on the training tasks via behavior cloning at the sequence level. For the teacher acting as the agent under the same harness, the base model is fine-tuned on the teacher demonstration trajectories , where each is a closed-loop teacher rollout, , kept only if its terminal reward is . Training uses the uniform BC objective of Eq. (6) to produce , which is then frozen and reused in the following phases.
P2: Student on-policy rollout. We collect on-policy rollouts from the behavior-cloned student on the training tasks. Each rollout is generated by the agentic loop of § 3.1, every response drawn from the student’s own policy at a context the student itself reached, , and we write for the induced trajectory distribution. collects these rollouts. The failed trajectories become the substrate for editing, and the solved episodes are kept as a style pool , mined for in-context exemplars in P4. Every observation in has been visited by the student, which places the teacher’s supervision of the following phases within the student’s own state distribution.
P3: Failure localization. For each failed trajectory, the teacher first localizes the error to prevent editing the correct steps. We establish that web trajectories carry enough structure for the “point of failure” to be a well-defined property of the trajectory (§B.2). The teacher call is an estimator of , reads the full trajectory and returns an index, , the earliest step whose action sets the trajectory on the path to failure. Localization splits the trajectory into a replayed prefix , which is kept verbatim, and a faulty suffix , which will be rewritten.
P4: Teacher editing in the student’s style. After localization, the teacher corrects the structured response of every step in the faulty suffix. Each correction is conditioned on the observation the student saw at that step, re-rendered by replaying the student’s original actions in the deterministic container, so the teacher sees exactly what the student saw. The correction query also carries the student’s response style in context. The corpus targets are
where each edit is a 1-step rollout of the teacher policy at the student’s context. is conditioned on the observation history the student saw (the same rendered goal, AXTree, and response history) and on in-context exemplars from the student’s style pool , one independent call per step. The edited structured response comprises the edited tokens (Details in §B.3).
Action-informative token weighting
P4 first lowers the premium in data space by having the teacher write in the student’s style. It cannot lower it to zero without giving up the correction. Some premium must be paid, and Figure 2 shows that on raw teacher edits, it falls almost entirely on the rationale components. The question for the objective is therefore which rationale tokens are worth their premium.
We ask, which tokens carry the learning signal? A rationale span is worth its premium to the extent that it changes the action, so Eq. (4) ranks the spans of each step by their measured effect on the student’s probability of the corrected action. Second, how far the policy may move? Eq. (5) adds a role-asymmetric anchor that damps how far the rationale moves toward the teacher’s phrasing while the action follows the teacher in full. Together, the objective pays the premium mainly where it buys the action. We weigh each rationale span by how much it contributes to the decision that follows.
Let be a non-action segment, a sentence or clause of the edited rationale . Its leave-one-out contribution to the teacher’s corrected action, measured under the student is
where denotes the teacher-edited action tokens, is the observation history, is the part of the edited response that precedes the action, so both terms are teacher-forced log-probabilities of the action tokens, and is that prefix with segment deleted. As is the student’s own credit assignment over the teacher’s rationale, it needs no teacher logits and is computable in the black-box setting. Perplexity says how foreign a span is to the student. says how much the span raises the student’s probability of the corrected action, and two spans can be equally foreign while differing in this. The weighting in §B.4 ranks the spans of a step by , so, outside the dead zone of Eq. (10) and when these spans are unique, the span that moves the action the most keeps full weight, and the span that moves it the least drops to the floor. Hence, the premium is paid mainly where it changes the decision rather than where it only changes the wording or style. Details on the action informativeness mapped to the WebKD loss have been provided in §B.4.
Role-asymmetric Anchoring and the WebKD Objective
The weighting decides which spans contribute to the action, but does not bound the magnitude of their contribution. A decisive span in keeps full weight, and fitting it under the weighed SFT objective asks the student to fully absorb that span’s influence. As this could cause SFT to move the policy further than intended, we add a KL penalty [10] toward , the frozen checkpoint of each run. The KL acts on the rationale tokens only, i.e., it pulls these tokens toward the student’s prior and leaves the non-rationale tokens free to drift. With the anchor strength and a per-token role mask, the WebKD objective is
where , , and is the student produced. We note that is role-asymmetric: on the tokens and on , so the student is free to adopt the teacher’s corrected decisions while being held near its prior on deliberation. Normalizing by makes a penalty per anchored token, comparable across masks that cover different numbers of tokens. Because is evaluated on corpus tokens rather than on samples from , it is a pointwise anchor penalty on the target sequence. Details on the intuition of update in §E.
Experiments
We organize our experiments around four research questions: RQ1 (performance). Does WEBKD’s teacher edit distillation outperform behavior cloning, outcome-reward RL, or other methods of teacher edit? RQ2 (transfer). Do the gains survive interface versions never seen in training, and the live web? RQ3 (edit-style). Who should edit the student’s decisions and in whose style? RQ4 (objective). Which tokens should the loss emphasize, and how should the policy be anchored?
Experimental setup
We describe our setup concisely here and include additional details in the Appendix (§ 8).
Models, Harness, Baselines. We compare latest open-weight models: Qwen-3.5 4B and 9B [31], and Gemma 4 E4B [31], in BrowserGym with the AgentLab harness (de Chezelles et al., 2025). We evaluate (a) zero-shot, (b) vanilla behavior cloning on actions, and the TimeWarp approach on the full response [13], (c) outcome-based RL baseline using multi-turn Group Relative Policy Optimization (m-GRPO) [33], and (d) black-box distillation baselines on student self-editing, off-policy takeover with the teacher completing the trajectory, the teacher prompting the student to restyle the edits, and (e) our method, WEBKD. The average results of three seeds are reported with the standard error.
Benchmarks. We evaluate on: (a) TimeWarp (TW) [13], a containerized web benchmark with websites from different eras of the internet, and (b) OnlineMind2Web (OM2W) [35], a live web benchmark with realistic tasks using real user workflows.
Results
WEBKD outperforms every baseline on the seen distribution (RQ1). WEBKD improves over the strongest baseline by 10.7pp for Qwen 3.5 4B, 8.1pp for Qwen 3.5 9B, and 5.5pp for Gemma 4 E4B, on the seen TimeWarp version v6 (Table 1). Zero-shot students are near 0% on every version, so the task is out of reach without training. Behavior cloning is competitive only when non-action tokens are included in the loss (BC-TW). No single alternative is reliably second best. m-GRPO is the strongest baseline on both Qwen models, but falls on Gemma. The other teacher-text baselines show the opposite pattern. Off-policy takeover is the strongest baseline on Gemma (34.3%), but every teacher baseline trail m-GRPO on either the Qwen models.
The gains hold on unseen versions and transfer to the live web (RQ2). On the unseen versions v1–v5, WEBKD beats the strongest baseline by 3.0–10.6pp. Once a shift itself costs little once a student is trained, and the seen–unseen gap stays below 5pp. WEBKD’s gains hold on the live web, where Online-Mind2Web’s numbers are low for all methods (below 8%, Figure 4). WEBKD is the only method that clearly separates from the rest, roughly doubling the strongest baseline for the 9B student. The gains are mostly concentrated on the easy tasks, which have a shorter horizon.
The teacher should edit in the student’s style, but minimally (RQ3). Following Table 2, off-policy takeover underperforms as it drifts too far from the states the student has visited. Edits or suggestions written by the student are worse still, which we can attribute to the student lacking a reliable sense of its own correctness. Asking the student to restyle the teacher’s edit on a second pass can also undermine the rationale. This is most evident on Qwen 3.5 9B, where the student re-style edit is a weaker baseline (Table 1). Although vanilla teacher editing works, its outputs deviate more from the student’s style and carry a larger perplexity premium (Figure 2). In-context student re-styling, as used by WEBKD, stays closer to the student distribution and outperforms it by 8.1pp.
Loss should emphasize action informativeness, and anchor the rationale (RQ4). Table 3 compares token weightings of the loss, with and without the KL anchor on the rationale. with the kl anchor (Eq. (5)) outperforms the other token-weighting schemes (§C.2) by 3.6pp. Sweeping the anchor strength shows that gives the highest success with rationale masking (Figure 5).

Figure 5. Success rate of Qwen-3.5 4B on TimeWarp v6 as a function of the anchor strength with , anchoring the rationale tokens or all tokens. The dashed line is without KL.
Discussion. Behavior cloning for more epochs doesn’t simply improve performance like WEBKD (§D.1). Teacher capability matters. With the same prompts, states, and style exemplars, using Claude Opus 5 or Qwen-3.8 27B as the editor trains students to 33.3% and 26.9%, versus 41.1% with GPT-5.5. As Qwen-3.8 is a smaller, less-performant model, the distilled student’s performance is worse. Why can’t students self-improve? On average, self/student edit falls below BC (TC) on every backbone (Table 1). This is consistent with the findings on RQ3, i.e., without an external signal, the student cannot reliably tell which of its own decisions were wrong. How does WEBKD affect the behavior of the student? It mostly prunes redundant actions, e.g., scrolling nearly disappears (−99.7%) and key presses drop by 24.5% (Figure 6). send_msg rises by 12.3%, indicating higher task completion rate. Where do the gains come from? Our analysis reveals WEBKD’s strongest gains come from verifying the steps and answer +14.6pp and exiting loops +9.4pp. Detailed failure analysis (§D.2), and analysis of the improvements against behavior cloning (§D.3) have been provided in the Appendix.

Figure 6. Change in action distribution before and after teacher distillation using WE-BKDfor the Qwen-3.5 4B baseline.
Conclusion
Small, open-weight web agents are key to making web use automation widespread and accessible. Frontier agents have become highly capable, and distilling them into smaller models is a natural next step. Yet closed frontier models expose only their generated text, which rules out logit-based distillation. WEBKD addresses this by turning the teacher into an editor of the student’s failures. It rewrites failed episodes in the student’s own style and trains on them, using an objective that weights tokens based on action informativeness and a role-asymmetric KL anchor. Although WEBKD produced strong gains, the student still reaches only about half of the teacher’s success rate, leaving substantial room for improvement. We hope this work spurs further research on black-box distillation and helps narrow the gap between closed frontier models and small open-weight agents.
Additional Background Details
Behavior Cloning
Given a corpus of (context, target) pairs, behavior cloning is performed via supervised fine-tuning, which minimizes the teacher-forced cross-entropy [23],
Behavior cloning is typically performed on the action tokens. However, the TimeWarp version [13] uses the full response, including the reasoning traces, and is the default type of behavior cloning in our experiments. We note that in Eq. (6), every target token carries the same weight , whether it belongs to the executed action or to filler thinking tokens. The state distribution is the teacher’s, not the student’s. At deployment, the policy conditions on its own generations and observations, and errors compound, which is the classic distribution-shift argument of imitation learning, under which a per-step error rate can inflate to cost over a -step horizon unless supervision is collected on the student’s own state distribution [27].
Knowledge Distillation
Distillation replaces gold targets with supervision from a stronger teacher [10]. For autoregressive models, the token-level form matches full next-token distributions along a sequence,
where the choice of the sequence (teacher-generated, gold, or student-generated) and of the divergence defines the family. Sequence-level KD [16] sidesteps the inner distributions entirely and applies Eq. (6) to teacher-generated text. On-policy distillation evaluates the divergence at prefixes the student samples, correcting the train–inference mismatch [1].
Black-box Constraint
Every token-level instantiation of Eq. (7) needs two things from the teacher: its full next-token distribution , and a shared tokenizer. The strongest available teachers for web agents are black-box models that usually provide neither. The distillation channel is therefore only textual: the teacher writes, and the student trains on the writing via Eq. (6). But text entangles two signals, (a) the teacher’s decisions (which element to click, what to answer) and (b) its surface distribution (style, phrasing, tone). Training a small student on off-policy frontier text imports both at once, and the student pays a significant perplexity premium on the teacher’s style (Figure 2).
Scratchpad Memory
The scratchpad belongs to the harness state, not to the environment. It is the sequence of memory components () the agent has emitted so far, carried inside the response history that the harness places in every context (§ 3.1). The agent interacts with it only through the memory tokens. It writes by emitting and reads only what the harness surfaces back at later steps. Under truncated history, a fact from a page the agent has since left survives only if it was written into a rationale component, most durably into the scratchpad memory.
Extended Problem Formulation
Details deferred from the Background’s POMDP formulation [14].
Observation modalities. The observation function may render the browser state as raw HTML, a set-of-marks screenshot [36], or an accessibility tree. We use the AXTree throughout, a textual serialization of the rendered page, annotated with the element identifiers the action space refers to.
Action space. is a subset of BrowserGym’s browser-level action space (de Chezelles et al., 2025): page interactions (e.g. click, fill), navigation (e.g. goto), tab operations (e.g. tab_focus), and user interaction (send_msg_to_user, which is also how the agent submits its answer). The generated action is deterministically parsed from the action component of the response and passed to the browser for execution. The transition is treated as deterministic.
Initial states and episodes. draws the initial state uniformly over the benchmark’s tasks. An episode ends when the agent messages the user or exhausts its step budget, at which point the LLM-judge evaluator [41] assigns the terminal against the task specification.
Environment versions. The environment comes in multiple versions , the same sites captured at different points in time, each defining its own instance of the POMDP tuple. Training and evaluation fix one version, except when cross-version transfer is itself under test.
Methodology Details
Teacher Details
Teacher-as-agent. The teacher is prompted with the same rendered system and user prompt the student saw: identical goal, AXTree serialization, history format, and action-space description. This keeps the teacher’s output in-distribution as an SFT target rather than free-form advice, and makes the edit a drop-in replacement for the student’s own response. The teacher receives no privileged input in our method: no gold walkthrough, no hints.
Localization. The teacher makes one call per failed episode over the full logged trajectory. The instruction reads:
The agent’s trajectory above FAILED. Identify the FIRST
erroneous step -- the earliest step whose action set the
trajectory on the path to failure. Reply with ONLY the
integer step index (0-based). Nothing else.
Section contract. Every edit query ends with a format contract requiring exactly the five tags <think>, <plan>, <step>, <memory>, <action>: think-aloud reasoning grounded only in what is visible in the observation, the running multi-step plan, a single integer in <step> naming the plan step the action belongs to, facts worth carrying forward in <memory>, and exactly one executable action. The contract exists because the student is trained and evaluated with the thinking, planning, and memory components enabled. A teacher that omits one of these components would silently teach the student to drop the field.
Style block. The exemplars are appended after the contract, at the very end of the query. The contract is the instruction whose loss is most expensive (a missing tag costs the whole step), so it must not be pushed out of the recency window, whereas a style hint that is only partly followed
Require: base model , black-box teacher (text only), training tasks, exemplar count , grounding threshold , weight floor , dead zone , anchor strength
Ensure:
1: P1 (seed): fine-tune on successful teacher rollouts with (Eq. 6); freeze 2: P2 (rollout): run on every training task; split episodes into failures and style pool 3: 4: for all do 5: P3 (localize): , the earliest erroneous step (estimate of , Eq. 8) 6: Replay: for 7: P4 (edit): with style exemplars, unexecuted (Eq. 3), for 8: Filter: 9: end for 10: Weights: for each edited , score segments by under (Eq. 4), rank-map to (Eq. 10), spread to token weights (Eq. 12); pin tokens at ; replayed records keep uniform weights 11: Mask: on tokens; on tokens (Appendix B.6) 12: Train: (Eq. 5) over , initialized at with anchor 13: return
Algorithm 1 WEBKD: black-box distillation through grounded teacher edits
still leaves a usable record. Exemplar selection is deterministic given the task. Solved episodes are preferred, the task being edited is excluded, and at most one exemplar is drawn per source task. Exemplars carry the rationale components and the step index but never <action>.
Correction prompt. The correction query is assembled as the student’s rendered context, then the section contract, then the style block. The style block opens with the following instruction:
[STYLE -- write this step in the student agent’s own style] The five sections you emit become training data for the agent whose steps appear above. Match ITS writing style: same register, same typical length, same amount of detail, the same way of phrasing a plan and of noting a memory. Below are verbatim examples of how THIS agent writes. Copy the STYLE only. Do NOT copy their content, their decisions, or their conclusions -- they are unrelated steps from other tasks. Your decision for this step must remain exactly the one you would have made without these examples; only the wording changes.
It is followed by the exemplars, each delimited by how the student writes, example and end example . The correction call is made once per step , teacher-forced on the student’s original prefix.
P3 Failure Localization Details
Definition 2 (Recoverability). For a trajectory , let indicate that, from the underlying browser state reached after the first actions of , some action sequence within the remaining step budget ends with .
Proposition 1 (Every failed web trajectory has a unique first fatal step). Assume the harness of §3.1: a finite step budget , deterministic transitions and parsing, a terminal binary reward, and a task solvable from its initial state (). Then along any failed trajectory is non-increasing and equals at the episode’s end, so
exists and is unique: every step before leaves the task solvable, every step from on leaves it unsolvable, and at step a recoverability-preserving action existed but was not taken. (Proof and discussion in § F.1.)
The two ways can miss have very different costs. If the teacher localizes too early (), it rewrites steps from which the task was still solvable. The state at is still recoverable, so the only cost is extra edits to the corpus. If it localizes too late (), the replayed prefix includes, and so endorses, the fatal steps, and by Proposition 1 no continuation from can succeed. This asymmetry is why the localization prompt asks for the earliest erroneous step (§B.1), and it shows up again as the one-sided error in the guarantee of §E.2.
Localization Accuracy. We sample 200 failed episodes from the rollout pools of the three students. Two human annotators, blind to the teacher’s prediction and to each other, independently mark the earliest step after which success within the remaining budget became impossible, following the same recoverability instruction given to the teacher. Under the strict budget reading, a step counts as unrecoverable only when the remaining budget is insufficient to complete the task. Here, the teacher is never late. It is early on 93% of episodes and exact on the remaining 7%. Under the loop-onset reading, the failure point is the step at which the agent enters a loop that it never escapes. Here the teacher is early on about two-thirds of episodes, exact on about a quarter, and late on roughly 10%. Under both readings, its errors fall mostly on the early side, which is the benign direction. The budget reading is the of Proposition 1, so its late rate is the of Theorem 1.
P4 Teacher Edit Details
(i) Style conditioning. The teacher’s query ends with a style block containing verbatim exemplars of the student’s own writing. The exemplars are mined from the style pool , excluding the task being edited, and are selected deterministically per task, with at most one exemplar per source task. The block opens with an explicit instruction to match this agent’s register, typical length, and level of detail, and to copy only the style, keeping the decision “exactly the one you would have made without these examples, but only the wording changes” (Appendix B.1). Exemplars include the student’s rationale components but never its component: an action is a decision, and the style block should transfer the student’s style, not its decisions. This directly targets the perplexity premium of §3.2. Apart from the correction itself, the corrected trajectory should read as low-surprise text to the student.
(ii) Edits are never executed. The environment always steps on the student’s original action. An edit at step therefore leaves the observation at step unchanged, corrections never compound, and every in the corpus is a state the student actually reached. Each teacher call conditions on the student’s original prefix, never on an earlier edit. This mirrors the central idea of on-policy distillation, where the supervising distribution is evaluated on prefixes that the student itself produced [1, 40].
WebKD Loss Details
Remark 1 ( as a conditional pointwise mutual information). Writing for the context with deleted,
which reads as the pointwise mutual information, under the student’s own distribution, between the segment and the decision it precedes. The first equality is exact. The second takes the student’s probability given the shortened prefix as the reference , and deleting is not marginalizing over it, so it is an interpretation of the log-ratio rather than an identity. Negative is meaningful as it marks segments whose presence makes the student less certain of the correct decision, which is why such segments stay in the ranking and are never masked.
We use ranks rather than raw magnitudes by default. Because varies by two orders of magnitude across steps, a magnitude-based weighting would implicitly weight segments by action length. Ranking within each step removes this dependence on scale. Span weights become token weights by character-coverage average, so a token straddling a segment boundary receives the area-weighted blend (Eq. (12), Appendix § 7.§ 5).
Scoring policy and the complete map. Segments are sentences or lines of the , , and components. and are never segmented, and the merge rules and caps are given in Appendix § 7.§ 5. Both terms of Eq. (4) are scored once, offline, under the frozen seed checkpoint , the same policy that provides the initialization and, in § 3.3.2, the anchor, so the weights describe the student the training starts from. We write for the normalized average rank of within its step (ties share their mean rank), for the within-step spread in nats, and for the dead-zone width. Then
where nats. So a step whose segments are statistically indistinguishable () degrades to the midpoint weight on every segment (exactly so at ; within of it otherwise), which is the mean span weight of every ranked steps, since average ranks normalized to have mean . A single-segment step has and lands at the same midpoint. The imitation term of the objective is a weighted mean of per-token cross-entropies,
where indexes the supervised response tokens and is the cross-entropy of corpus token . The denominator is the weight sum, never the token count. This matters because it makes reproduce standard SFT (the per-token mean over the same tokens) exactly for any , so a scheme whose weights average does not silently train at an effective learning rate of , for learning rate .
Remark 2 (The update resamples tokens rather than rescaling the loss). Since is a probability distribution over supervised positions, , so gradient descent on Eq. (11) is gradient descent on ordinary SFT over a corpus in which tokens are resampled in proportion to their weights.
Action-Informative Weighting: Constants and Scoring Interface
Segmentation. Boundaries are newlines, or whitespace following sentence-final punctuation (. ! ? ; :). Each separator stays with the preceding segment, so segments exactly partition each component’s inner span. Segments shorter than 24 non-whitespace characters are merged into the previous segment (into the next, if first). A step is capped at 24 segments by repeatedly merging the shortest adjacent pair. Merges never cross a component boundary.
Scoring interface. Both terms of Eq. (4) are computed by teacher-forced echo-scoring against a served copy of the seed checkpoint: the full (context, target) string is submitted with the prompt echoed and per-token log-probabilities returned, at temperature zero and with no new tokens generated. The log-probability of is the sum over its token positions. The ablated variant deletes the segment’s characters (including its trailing separator) and re-tokenizes. Numbered plan lines are deliberately not renumbered after a deletion. Renumbering would perturb segments other than the ablated one and break the leave-one-out contract. The chat template’s pre-opened <think> tag is stripped before the target is appended, so the scored string matches the training-time rendering.
Characters to tokens. With the character span of token under the tokenizer’s offset mapping, the token weight is the coverage-weighted average
clamped to . Characters outside every rationale segment (tags, separators, and the components pinned at weight 1) contribute weight 1, zero-width special tokens take weight 1, and the response envelope (the template’s closing tokens) is never down-weighted.
Anchor Implementation
Estimator. in Eq. (5) is the “” estimator [28]: it is non-negative and low-variance, and unbiased for under sampling from . The log-ratio is clamped to . The asymmetry is deliberate. at initialization and drifts negative as the student fits the corpus, where grows only linearly and is harmless. The positive tail is the direction in which can overflow 16-bit precision, and it is not the direction the penalty exists to control.
Reference pass. is the frozen seed checkpoint, held in 16-bit precision and evaluated in a second, gradient-free forward pass per micro-batch. Per-token log-probabilities are gathered with a fused cross-entropy rather than a full log-softmax, avoiding a 32-bit intermediate. The anchor’s marginal memory cost is nonetheless substantial, an unsharded 16-bit copy of the reference policy on every rank (measured GB at 9B scale) on top of the loss computation’s 32-bit logit upcast, which is why training runs single-rank with ZeRO-3 parameter partitioning and CPU-offloaded optimizer state (Appendix § 8.§ 3).
Why normalize by . In our corpus, the rationale mask anchors roughly 88% of supervised characters, while an action mask would anchor roughly 9%. Normalized by token count instead, the same would be an order of magnitude weaker under the action mask because actions are short.
Additional Experimental Details
Benchmark Baselines
We describe each baseline of Table 1 and Figure 4 below.
Zero-Shot: The base model without fine-tuning.
Behavior Cloning (BC): The base model is trained using supervised fine-tuning (Eq. (6)) on the teacher rollouts containing the observation history, prompts, and actions only.
Behavior Cloning (TW): The TimeWarp version of behavior cloning [13]. It is identical to vanilla BC, except that it also includes the thinking, planning, step, and memory tokens during behavior cloning.
m-GRPO: Multi-turn Group Relative Policy Optimization (m-GRPO) is an outcome-based RL baseline, which uses the trajectory’s reward for credit assignment [33].
Self/Student Edit: An edit-style baseline in which the student, instead of an external teacher model, edits its own failed trajectories.
Off-policy Takeover: An edit-style baseline where, instead of the teacher editing the student’s failed trajectories, the teacher takes over from the point of failure and completes the trajectory. The student is then trained off-policy on the edited trajectories. This is similar to on-policy expert correction [18].
Student Re-style Edit: A two-pass edit, in which the teacher first edits the student’s failed trajectories, and the student is then prompted to rewrite the edits in its own style. The student is then trained on-policy on the re-styled edits.
Loss Ablation Baselines
Each variant keeps the weighted objective of Eq. (11) and changes only the token weights . The and tokens stay at in every variant. Span weights become token weights by the same character-coverage average as in WebKD. The “w/ KL” column of Table 3 adds the anchor of Eq. (5) unchanged.
(uniform). Standard SFT cross-entropy with equal weight on every response token, the control for all weighted variants.
(grounding). A soft, within-step version of the grounding filter of Algorithm 1, which floors any rationale span that makes a claim not supported by the goal or by the AxTrees
observed up to step . The claims of a span are its quoted strings, numbers, element identifiers, and capitalized entities, and a claim is grounded if its case- and whitespace-folded form occurs in the goal or in one of those AXTrees,
(teacher self-consistency). A span is weighted by how much of it the teacher reproduces when it re-edits the same step times, net of the overlap expected by chance,
where is the IDF-weighted containment of in the teacher’s resampled edits of the same step and is the same statistic against resampled edits of steps from other tasks.
(student perplexity). Each token is weighted by how likely the seed student already finds it, so the high-perplexity tokens of the teacher’s edit are floored,
where is the normalized average rank of among the rationale tokens of its step.
Training Configuration
Corpus. The corpus records are step-level: one (context, response) pair per step, the context being the full rendered agent state (goal, AXTree, history) and the response the five-component output. On the corpus used throughout, 15 failed training episodes yield 432 step records. The teacher edits 403 of them (the remaining 29 precede and are replayed), the grounding filter of Algorithm 1 removes 40 edited steps (9.9%), and 392 records survive (363 edited, 29 replayed). The edited targets total 64k response tokens (16.6k think, 19.3k plan, 8.7k memory, 5.2k action, 13.8k structural). Rollouts (P2) use temperature 0.01 and a 30-step budget, with the thinking, plan, and memory components enabled and no hints, the same interface as evaluation. Training is full-parameter fine-tuning from the seed checkpoint with the hyperparameters of Table 4.
| Hyperparameter | Value |
| fine-tuning | full-parameter, from the seed checkpoint |
| learning rate | , cosine decay, warmup ratio 0.1 |
| epochs | 2 |
| context cutoff | 20,480 tokens |
| batch | 1 per device 16-step gradient accumulation (effective 16) |
| precision | bf16, gradient checkpointing |
| partitioning | ZeRO-3 with CPU offload |
| CE weight floor | 0.1 |
| dead zone | 0.05 nats |
| anchor strength | 0.03 (per anchored token) |
| anchor mask | 1 on think/plan/memory, elsewhere |
Table 4. Training hyperparameters for the combined objective.
Compute. Each fine-tune runs on a single H200 GPU with ZeRO-3 parameter partitioning and CPU-offloaded optimizer state. Corpus generation and evaluation parallelize over a farm of single-GPU workers, one containerized browser environment per GPU, and all teacher and judge calls go through hosted APIs.
Cost and latency. Most of the teacher cost is in P1, which makes 4,448 calls and uses 21.8 M prompt tokens to produce the demonstrations. The correction stage is much cheaper. P3 makes one call per failed episode (15 calls, 0.47M tokens), and P4 makes one call per edited step (403 calls, 4.0 M tokens, 6% of which is the style block). Correction is therefore 17% of the pipeline’s 26.3 M prompt tokens, paid once, or about the cost of 135 teacher episodes at the teacher’s in-harness rate of 33k prompt tokens per episode. These counts are lower bounds, since the prompts of 13% of the P1 conversations were not kept and hidden reasoning tokens were not logged (0.78 M visible completion tokens). A fine-tune takes 1.0 GPU-hour on one H200, and evaluating the 103 v6 tasks takes 20 minutes on one 48 GB L40S. Measured inside the harness, the trained 4B student takes a median of 6.10 s per step (38.8 s per episode), against 9.05 s per step for the seed and 12.80 s per step (68.1 s per episode) for the teacher acting as the agent.
Additional Experimental Results
Can we simply train behavior cloning for longer?
We fine-tune Qwen-3.5 9B using the TimeWarp version of Behavior Cloning (BC) for longer epochs, and compare it against the standard setting of WEBKD where we fine-tune from the BC seed. Figure 7 shows the success rate of these two baselines for the Qwen-3.5 9B model. BC alone plateaus early, remaining between 0.24 and 0.26 regardless of the training budget. This suggests that additional epochs on the same training data alone provide little benefit. In contrast, adding WEBKD results in consistent gains at every budget beyond the one-epoch BC seed. The best checkpoint is when WEBKD is trained for two additional epochs.

Figure 7. Behavior cloning over more epochs doesn’t improve the success rate, as it flattens at 25%, whereas WEBKD continues to improve and peaks at the 3rd total epoch for the Qwen-3.5 9B model. WEBKD is trained from the first epoch of the BC seed.
Error Analysis
Figure 8 assigns every evaluation trajectory to a single outcome, which separates navigation failures (the agent never reaches the page containing the answer) from failures that occur after the relevant page has been found. The zero-shot model almost never completes a task. 97% of its trajectories end by it getting stuck in a loop. Behavior Cloning (BC) substantially reduces looping but leaves it as the dominant failure mode ( 62.5%). Behavior Cloning (TW) and m-GRPO both reach roughly 30% success, yet each still loses 15.5% – 19.4% trajectories to loops. Off-policy takeover produces the fewest unsupported answers among the methods (27). However, it also has the highest looping failure rate (36.6%) among the non-BC methods.
Figure 8. Failure mode analysis of Qwen3.5-4B. Each bar assigns every evaluation trajectory of a method to exactly one outcome for the tasks.
WEBKD passes the most tasks while getting stuck in a loop less than any other method ( 8.7%). Most of the gain comes from navigation. Counting trajectories that either pass or end in right page, wrong answer, WEBKD reaches the correct page 202 times, while no baseline does so more than 143 times. Because of this, its remaining errors move downstream, and right page, wrong answer becomes its largest failure category ( 24.3%). This suggests that further improvements are more likely to come from better answer extraction once the relevant page is found than from better navigation. Task and judge defects remain roughly constant across methods (8–12 trajectories where labeled), indicating a small noise floor in the evaluation that does not depend on the agent.
Where do the gains come from?
Figure 9 breaks the overall improvement down by task type. Gains are positive in all five categories, but their size varies considerably. Placing an order improves the most, rising from 0% to 25.9% (+25.9 pp), and it is the only category where performance started at zero. Counting/listing (+9.5 pp, from 11.9% to 21.4%) and lookup (+8.7 pp) show moderate gains, while multi-hop (+5.7 pp) and verification (+4.8 pp) improve the least. Because each category has only 9–29 examples, these differences should be read with caution: only the gains on placing an order and counting/listing have 95% confidence intervals that exclude zero.

Figure 9. Absolute gain by task type, in percentage points.
A Complete Worked Example
This subsection gives the unabridged text of the step shown in Figure 3.

Figure 3. Edits for the same student step. The raw teacher edit replaces the student’s action but rewrites the plan in its own style. The style-conditioned edit keeps the student’s nested plan format. Values in brackets give the span weight . : think, : plan, : memory, : action.
Student, step 5.
<think> We successfully purchased the Welch’s item and are
on the thank-you page showing code B644DDC66C. Next, we need
to search for the Mojito mix. I will click the search box
(bid "15") to bring up the search input. </think>
<plan> 1. Search for Mojito mix - Click search box -
Type query - Press Enter 2. Open first result and
buy - Click first result link - Click Buy Now and note
confirmation code 3. Search for Italian Basil Pesto
[...] 5. Send all confirmation codes to the user </plan>
<step> 2 </step>
<memory> I am clicking the search box to prepare for ordering the Mojito mix. </memory>
<action> click(’15’) </action>
Raw teacher edit.
<think> The page shows the order confirmation for Welch’s Orange Pineapple Juice with code B644DDC66C. I need now search for the second product, so I will navigate back to the shop home page within the allowed SHOP environment. </think>
<plan> 1. Record Welch’s confirmation code. 2. Navigate to shop home/search page. 3. Search for Stirrings Simple Classic Cocktail Mix Mojito. 4. Open matching product, buy it, and record confirmation code. 5. Navigate to shop home/search page. 6. Search for Italian Basil Pesto. 7. Open matching product, buy it, and record confirmation code. 8. Send all confirmation codes to the user. </plan>
<step> 2 </step>
<memory> Welch’s Orange Pineapple Juice confirmation code: B644DDC66C. </memory>
<action> goto(’http://localhost:5002/abc’) </action>
Style-conditioned teacher edit (the WEBKD target), with span weights in brackets.
<think> [0.10] The purchase confirmation page for Welch’s Orange Pineapple Juice is displayed, and the code shown is B644DDC66C. [0.90] I need to continue shopping for the next product, so I will return to the shop search page. </think>
<plan> [0.80] 1. Record Welch’s confirmation code [0.40] 2. Search for Stirrings Simple Classic Cocktail Mix Mojito – Go to shop page – Type query and press Enter – Open matching result [1.00] – Click Buy Now and record code [0.70] 3. Search for Italian Basil Pesto – Go to shop page – Type query and press Enter – Open matching result [0.60] – Click Buy Now and record code [0.50] 4. Send all confirmation codes to the user </plan>
<step> 2 </step>
<memory> [0.30] Welch’s Orange Pineapple Juice confirmation code is B644DDC66C. [0.20] Next I need to search for Stirrings Simple Classic Cocktail Mix Mojito. </memory>
<action> goto(’http://localhost:5002/abc’) </action>
Theoretical Intuition and Analysis
What the Anchored Update Does
Write and for the two policies’ probabilities of corpus token , for the student’s full next-token distribution at that position, for the one-hot target, and collect the two normalized coefficients acting on token : (imitation) and (anchor). Because the pointwise anchor depends on the position- logits only through , the gradient of (5) at that position factorizes exactly:
Eq. 16 says the anchor never rotates the update. Every anchored token still moves along the SFT direction, toward the corpus token while and away from it when , and the anchor only rescales it through the data-dependent scalar coefficient , which we call the throttle:
At initialization the anchor is inert. Training starts from , so and , and the first update is exactly weighted SFT. The penalty acts on drift accumulated during training, never on the starting point.
Below the reference, the anchor helps. If interference drives under (the student losing probability on text its prior found natural), then and , so the anchor adds force toward the corpus token, protecting prior competence rather than fighting the corpus.
Above the reference, it throttles and can stop. As climbs past the throttle falls monotonically toward . When it vanishes at and is negative beyond it, where the update pushes back down; that point lies below 1, so the throttle actually stops the token, only when (Corollary 1), which is the content of Proposition 2.
On and , it is absent. and carry , so and throughout, and the teacher’s decision is learned at full strength, all the way to the one-hot target.
Proposition 2 (Per-token target of the anchored objective). Fix a supervised position , treat its logits as free parameters, and hold the context fixed. The contribution of position to Eq. (5) is minimized at
(Proof in Appendix § 11.)
That is, the anchor does not shrink the step toward the corpus. It moves the target, from the one-hot corpus token to a bounded multiple of the reference policy’s own probability.
Corollary 1 (Critical anchor strength). The cap in Eq. (17) exists iff . Because , the cap appears first on the spans the action-informative weighting marked as least informative about the action.
The condition makes the interior optimum of Eq. (17) finite. That optimum is below 1, and so limits the token, only under the stronger condition , that is, . In anchor strength this is , so the order in which caps bind also depends on : among tokens with equal the least informative spans are capped first, but a span the reference already finds likely can stay uncapped at a that caps a more informative, less likely one.
A Single-Round Relabeling Bound
The pipeline admits an imitation-learning guarantee in the style of DAgger ([27]), with the classical action oracle replaced by the two calls a black-box teacher actually answers: localize (P3) and correct (P4). Write for the success rate of a policy on the task distribution and for the fraction of tasks whose logged seed rollout (P2) succeeded, an estimate of . Three error rates describe one correction round, each a population quantity over the sampled failed episodes. is the late-localization rate of P3 (early misses are benign for the guarantee; they only spend edits). is the teacher’s own failure rate when it takes over as the agent from a still-recoverable localized state and plays the episode out. is the trained student’s per-step disagreement, over the full structured response, with the relabeled process that replays the seed through step and then follows the teacher, measured on that process’s own history distribution, that is, (formal definitions in Appendix § 11.§ 3).
Theorem 1 (Single-round relabeling bound, informal). Under the assumptions of Proposition 1, the student trained on the P1–P4 corpus satisfies
where is disagreement with the seed’s logged responses on episodes the seed already solves (retention), is disagreement with the relabeled process at the states the corpus supervises (the logged response before , and at the teacher’s response distribution, of which the corpus record is
one draw), and is disagreement at the post-correction states no corpus record covers. (Formal statement and proof in Appendix § 11.§ 3.)
Eq. (18) separates what the teacher limits from what the student limits. With a perfect student (), the remaining failure is the fraction of seed failures that the teacher either localizes too late or cannot repair itself. We estimate both error rates on the 15 seed failures the corpus is built from. Taking over at , the teacher solves 14 of them. The one it fails was localized at the first step, a state that is recoverable by assumption, so the failure counts against correction rather than localization, giving and on this pool. The teacher term is then , well below the observed student failure rate of 0.61, so the teacher’s errors are not the main limit. This is an estimate rather than a direct measurement of the term, because the takeover failure rate comes from training-split states under one judge and the seed failure rate from the test split under another. For reference, the teacher succeeds on 0.71 of test episodes in the same harness (Table 1).
The student term is linear in because is evaluated on the history distribution of the relabeled process, which the corpus supervises except at the post-correction states counted in . This is where collecting the corpus on the student’s own states enters the bound. The bound concerns terminal failure, whereas the bound for cloning off-policy demonstrations (§A.1) concerns cumulative cost, so the two are not directly comparable. Because the disagreement is measured on the full structured response, any rewording of a rationale counts as disagreement, so is conservative and can exceed one. We use the bound for its structure, which separates the teacher’s errors from the student’s and places the student’s error on the relabeled process’s own histories, not as a numerical prediction of the student’s failure rate.
Premium Split, Rank Weighting, and the Anchor Budget
This subsection relates the per-token result of Proposition 2 to the premium of Definition 1. Under uniform SFT, the premium determines how the update splits between rationale and action (Proposition 3). The rank map of Eq. (10) orders the update optimally to first order in an additive twin with a common emission probability (Theorem 2). The anchor limits how much premium each token can absorb, and the limit is largest on the spans that the weighting marks as decisive (Corollary 2). Proofs are in Appendix § 11.§ 4.
Where the uniform update goes. Fix a set of corpus steps and score them under the seed , the policy every run starts from. Write for the positions of the rationale tokens (, , ) and for the positions of the action tokens across those steps, with and . Write and for the per-token perplexity of Eq. (1) pooled over each set, so that , and for the logit-gradient mass that uniform SFT places on set .
Lemma 1 (Gradient norm is sandwiched by the surprisal). At every supervised position , .
Assumption 1 (Bounded surprisal). Every per-token surprisal is bounded, for some .
Proposition 3 (The premium fixes the split of the uniform update). (i) Restricted to , the share of the token-pooled uniform loss (every supervised token weighted equally, rather than each step normalized by its length as in Eq. (6)) that the action tokens contribute at initialization is exactly
(ii) Under Assumption 1, the action’s share of the logit-gradient mass satisfies
Why the rank map is the right order. Proposition 3 says how much of the update lands on the rationale. The weighting of §3.3.1 decides how that part is spent across segments. Fix a corpus step with corrected action and rationale segments (Appendix § 7.§ 5), and write for the score of Eq. (4) on segment .
Assumption 2 (Additive twin). For every subset of segments present in the rationale, the student’s log-probability of the corrected action is for some constant , so the leave-one-out score of Eq. (4) recovers exactly.
Assumption 3 (Independent emission). At deployment the student writes segment into its own rationale independently with probability , and raising by nats costs nats of premium on that segment (Definition 1).
Theorem 2 (Rank weighting is first-order optimal credit assignment). Under Assumptions 2 and 3, the deployment probability of the corrected action is , and the gain in per nat of premium absorbed on segment is
which is strictly increasing in , zero at , and negative for . If moreover for all segments of the step and a step on sheds premium on segment at a rate proportional to its weight (Remark 2), then for any fixed multiset of segment weights the first-order gain is maximized by assigning the weights in the order of , and the maximizing assignment depends on the only through that order.
Remark 3 (What the twin predicts). The twin makes two predictions. First, segments with have , so learning them lowers the deployment probability of the corrected action. The weighting of §B.4 does not mask them: it ranks them below the step’s segments with and keeps their weights in ; outside the dead zone a unique lowest-ranked segment reaches , and 42% of segments fall in this class. The twin predicts that masking them costs nothing and may help. Second, the gain of LWD over LCE in Table 3 should grow with the within-step spread of , since a step with has nothing to reorder, which is what the dead zone of Eq. (10) already assumes.
The anchor as a premium budget
Proposition 2 gives the per-token target of the anchored objective. Read in the units of Definition 1, it is a budget.
Corollary 2 (Per-token premium budget). Under the anchored objective of Eq. (5), the premium the student can shed on a rationale token , its at initialization minus its at the per-token optimum of Eq. (17), satisfies
with equality when the interior cap is at most 1 (when it exceeds 1 the token is fit to and sheds its full , which is below the right-hand side), and is the full at initialization (the token may be fit to ) when . The budget decreases in and increases in , so at a fixed the spans the weighting marks as decisive receive the largest budget.
Proofs and Theoretical Remarks
The first fatal step: proof of Proposition 1
Fix a task and a failed trajectory executed under the harness of §3.1. Write for the underlying browser state after the first actions of , with at the initial state, and recall the recoverability indicator of Definition 2. The assumptions of Proposition 1, stated in full:
Assumption 4 (Finite budget). The harness enforces a step budget , and an episode that issues a terminal action earlier enters an absorbing state with its reward fixed.
Assumption 5 (Determinism). , , and are deterministic, so the state reached by a given action sequence from is unique and replayable.
Assumption 6 (Terminal binary reward). is assigned once, when the episode ends.
Assumption 7 (Feasibility). : the task is solvable from its initial state within the budget.
Lemma 2 (Recoverability is absorbing). Under Assumptions 4–6, implies along .
Proof. Suppose : some action sequence with reaches from . Since deterministically, the sequence has length and reaches from , so . The contrapositive gives the claim.
Proof of Proposition 1. by Assumption 7. At the episode’s end . If the budget is exhausted, the only continuation within budget 0 is the empty one, and it ends with the episode’s own reward . If a terminal action ended the episode early, the state is absorbing with (Assumption 4). By Lemma 2 the sequence is non-increasing over , so it crosses exactly once, and exists and is unique, with for all and for all . For the final clause, supplies a within-budget success sequence from . Its first action leaves the task solvable in the remaining budget, so a recoverability-preserving action existed at step , and the executed was not one, since it produced .
Remarks. (i) The role of the budget. Recoverability is defined within the remaining budget, so even a diffuse failure with no single wrong click, an agent that dithers, loops, or re-reads pages, has a unique : the first step after which the shortest completion no longer fits in the budget. Without Assumption 4 the proposition is false, since an agent on an unbounded horizon can wander indefinitely without failure ever becoming irreversible. (ii) What is and is not. is an interventional quantity, the earliest step after which no policy could still succeed, which is what the localization instruction of Appendix B.1 asks for. By Assumption 5 it is a property of the executed actions and the environment alone: attainability depends only on the browser state and the remaining budget, so rationale tokens influence which action a policy will take but never whether success is still attainable. It need not coincide with the causal “root cause” a human would narrate (a misread page three steps earlier), which is why the localization study of §B.2 anchors annotators to the recoverability definition rather than to blame. (iii) Live sites. Assumption 5 holds exactly in a containerized benchmark and only approximately on the live web, where transitions are stochastic. There generalizes to the optimal success probability from , monotonicity can fail (a lucky refresh can restore a lost option), and must be defined relative to a threshold on . Nothing in the paper relies on this extension. (iv) Infeasible tasks. If , the task is unsolvable from the start: Eq. 8 gives , but no recoverability-preserving action ever existed, and no correction can lead to success. Assumption 7 is thus a benchmark-design requirement, witnessed per task by any successful demonstration.
Proof of Proposition 2
Restrict Eq. 5 to a single supervised position and write for , suppressing the index. Substituting into , position contributes
with and as in Appendix E. Differentiating,
recovering the throttle of Eq. 16. For the function is strictly decreasing in , with and as , and for it is the constant . If , then for every (here ), so is strictly decreasing on and the minimum sits at the boundary (approached as the target logit grows, since finite logits give ). If , solving gives the unique interior stationary point
with below it and above it, so it is the minimum. Clipping at the boundary yields Eq. 17. The minimization can also be checked without calculus, which is how the Lean proof does it. With and , for every , because . When , or when , on , by in the first case and by with in the second. For the full-softmax statement, note and , while . Combining gives Eq. (16), which vanishes iff or . Under gradient flow from the initialization (the reference’s full distribution, since ), every logit moves along the SFT direction scaled by . The target logit rises at rate and each off-target logit falls at rate , in proportion to its current probability, so the gap between two off-target logits moves at rate and the more probable alternatives lose ground faster. The off-target distribution therefore flattens rather than keeping the reference’s shape, while rises toward , where vanishes when is interior.
We note that the closed form exists because the anchor is pointwise in . A full-distribution KL to would couple every vocabulary coordinate and add a second, non-collinear term to Eq. (16). The tabular idealization treats each position’s logits as free and ignores parameter sharing across positions. It characterizes the force each token contributes, not the coupled optimum of the network. The clamp of to (Appendix § 7.6) is also outside the analysis. It is inactive for , so Proposition 2 is unchanged for every token with (below the clamp only removes the anchor’s force, and stays decreasing there). For rarer tokens is again decreasing above , so its minimum over can move to even when .
A single-round imitation bound: proof of Theorem 1
P1 is behavior cloning on teacher rollouts, whose error can compound quadratically in the horizon ([26]). P2–P4 implement the oracle that DAgger uses to make it linear ([27]), expert-quality labels at states drawn from , but in a setting the classical theory does not cover: the expert is black-box, answers only in text, runs for a single round rather than DAgger’s iterated no-regret scheme, and its labels can fail in ways an action oracle’s cannot (a mislocalized failure, a fluent reference to state that was never observed). This subsection accounts for these differences. Throughout, Assumptions 4–7 hold, is treated as ground truth (the LLM judge that implements it adds measurement noise orthogonal to this analysis), and success rates average over the training-task distribution and any policy stochasticity.
The relabeled process. The comparator is the process that the corpus of P2–P4 supervises. On a task whose logged seed rollout succeeded, replays that rollout and nothing is edited. On a task whose seed rollout failed with localization , replays the logged responses through step and then hands control to the teacher-as-agent of Appendix B.1, style-conditioned exactly as in P4, which plays the episode out closed-loop from . All quantities are conditional on the logged P2 rollouts, one per task, so the replay is exact and is a policy of the task. Accordingly is the fraction of tasks whose logged rollout succeeded, which estimates because P2 rolls out at temperature 0.01 (Appendix C.3).
Error terms. All are population quantities, conditioned on failed seed rollouts where indicated:
late localization (P3),
corrector capacity (P4),
student disagreement,
where is the step- history distribution of the relabeled process and the total variation is over the full structured response . Remark iii explains why the action alone does not suffice. We write for the per-step disagreement of Theorem 1.
Lemma 3 (Imitation on a deterministic harness). *For any two policies on the harness of § 3.1,
Proof. By Assumption 5 a history is determined by the task and the responses emitted so far. Write for the history after response at , and for the probability that succeeds from within the remaining budget, so that , with once the budget is spent. At every history,
Both rows sum to one and , so the second sum equals . The first sum is the same gap one step later, averaged under . Unrolling it from the initial history over the steps and averaging over tasks gives the claim. This is the coupling argument in recursive form: the second sum bounds the probability that a maximal coupling of and separates the two responses at , and the first follows the coupled process along while they agree.
Theorem 3 (Single-round relabeling bound, formal). Under Assumptions 4–7,
Proof. First bound the relabeled process. On tasks whose logged seed rollout succeeds, probability , replays that rollout and succeeds, by Assumption 5. On a failed rollout, distinguish the localization outcomes. If , then , so by Proposition 1 and no continuation from within the remaining budget can succeed: the episode is lost regardless of the teacher. If , then , the state is recoverable, and the teacher-as-agent fails with probability by definition. Hence
The first inequality does not use the lateness of the localization: a late episode is counted as a failure, which bounds its failure probability whatever the teacher does there, so it holds for any localization. Proposition 1 makes the count exact, since a late episode is then lost with probability one, and Remark (i) uses this. Apply Lemma 3 with and combine.
Corollary 3 (Regime decomposition). Partition the states of into three cells. The first holds states of solved seed episodes, where replays the logged rollout and no record supervises. The second holds states of failed episodes up to and including , where the corpus supervises exactly the histories visits (replay records before , the edited record at ). The third holds post-correction states of failed episodes, which no record covers. Writing for the per-step average of on each cell respectively,
since each episode contributes at most steps to its cells. With this is the second inequality of (18). The bound adds the two failed-episode cells; weighting each instead by its share of those episodes’ steps makes it an equality.
Remarks. (i) The DAgger correspondence. plays the role of DAgger’s training loss on the aggregated on-policy dataset, and its linear-in-horizon error term [27]. The teacher term can be measured directly. A takeover run, in which the teacher plays the episode out from , reports the bracket of the proof directly, since a late localization fails with probability one, so times the measured takeover failure rate is a tighter teacher term than the that (26) prints and needs no separate estimate of . (ii) Teacher capacity sets the bound’s floor, and the degradation is graceful. A weaker teacher enters the bound three times, through (worse P1 demonstrations, themselves subject to the off-policy regime above), through , and through , each linearly. The bound is one-directional: it caps failure and does not preclude the student empirically exceeding the teacher-in-harness, but any such gain is outside the guarantee. (iii) Why the disagreement is over the full response. contains , so two policies that always agree on the executed action but phrase their rationale differently still diverge in history, and the coupling of Lemma 3 breaks. This is the truncated-history argument of Appendix A.4 as it appears in the bound. Rationale tokens are part of the harness state, which is why the method supervises and anchors them. Action-level agreement suffices exactly when rationale differences never change a later decision, a policy-dependent property the anchor pushes toward but does not certify. (iv) The single-round residual. lives on the states the teacher’s correction steers into, which no record covers by design, since edits never execute (P4ii). Two mechanisms keep it small: recovered states resemble the teacher-demonstration states P1 already cloned, and the anchor limits how far moves from on corpus tokens, which limits drift where the corpus is silent only indirectly, through shared parameters. Iterating P2–P4 from would convert into supervised coverage, which is DAgger’s aggregation. Likewise is the retention term the anchor of §3.3.2 targets: on solved episodes the reference behavior is the seed’s own, so any drift there is pure loss. Because the anchor is a pointwise, role-masked penalty on corpus tokens (§3.3.2), it lowers and by limiting drift, but it does not bound either through a distributional inequality.
(v) What the deep-suffix records do. Edited records at sit at seed-visited states that are unrecoverable whenever (Proposition 1), so they cannot rescue those episodes and do not appear in Eq. (26). They teach the policy how to behave at bad states and influence the bound only through generalization, that is, through lowering and at nearby states. The grounding filter of Algorithm 1 removes a kind of label error that an action oracle cannot make, fluent references to state that was never observed, which would otherwise corrupt these records.
Proofs for §E.3
Proof of Lemma 1. Write for the student’s next-token distribution at position , for the target, and for its probability. Since , the gradient is , so . The sum is non-negative, which gives the lower bound, and because every , which gives the upper bound.
Proof of Proposition 3. (i) By Eq. (1) pooled over a set , , so . The uniform loss restricted to is times the sum of the two, and the action’s share is the ratio in Eq. (19). (ii) By Lemma 1 and for , . The function is concave, so on it lies above its chord, . With Assumption 1 and Lemma 1, . Finally is increasing in and decreasing in , so .
Scope. The proposition is about gradients with respect to the logits, similar to Proposition 2.
Proof of Theorem 2. Under Assumption 3 the set of segments the student writes has , and under Assumption 2
since the sum over subsets factorizes coordinate by coordinate. Taking logarithms and differentiating the -th factor with respect to gives Eq. (21). Writing , has derivative in equal to , which simplifies to , so is strictly increasing in . It vanishes at and is negative for .
For the ordering claim, the rate hypothesis says a step on raises by for a common . To first order the change in is then by Eq. (21). With for all , is an increasing function of alone, so the and the have the same order. The rearrangement inequality states that for two finite real sequences the sum of products is maximized when both are sorted the same way, so among all assignments of a fixed multiset to the segments, is maximized by assigning the weights in the order of . The maximizing assignment is a function of the order of the alone, which is what Eq. 10 computes, up to ties, which the average rank resolves without changing the maximum.
Scope. Assumption 2 makes the leave-one-out score exact and removes interactions among segments, so a segment that matters only jointly with another is scored as inert. Assumption 3 treats the segments as independently emitted and prices a nat of log-probability on a segment as a nat of premium, which is Definition 1 applied to that segment. The rate hypothesis holds in logit space when the rationale tokens of a step have equal gradient norm at initialization and its segments have equal token length. A logit-space step of size on at a token with weight moves the logits by up to the common normalizer , and since , it raises by to first order. Summed over the tokens of , it raises by up to the normalizer, where , so the rate is proportional to only when the agree. Equal surprisal across the step’s rationale tokens makes these squared norms equal within a factor of two by Lemma 1, and equal when the off-target mass is spread alike. In general the first-order gain is and the optimal order is by . Here also depends on : by Eq. (21) its magnitude grows with , so it increases with when and decreases when .
Proof of Corollary 2. By Proposition 2, if the per-token optimum is , so . With and , , which is Eq. (22), and is (Corollary 1). Training starts at (§3.3.2), so the surprisal shed on token between initialization and the per-token optimum is . If the optimum is and the shed surprisal is the full at initialization. The budget is decreasing in and increasing in . On tokens with , and there is no cap. □
Declaration of LLM Usage
The authors acknowledge the use of LLMs to polish the draft, to brainstorm ideas and research directions, to orchestrate experiments, to formalize and check the proofs in Lean, and to review code. We take full responsibility for the paper’s content and correctness.
Reproducibility Statement
We have taken several steps to ensure our results are reproducible. The complete source code is included in the supplementary material and will be released publicly upon acceptance. It comes with a README describing environment setup, dependencies, and each component. Every proposition, lemma, corollary, and theorem of the theory appendix is formalized in Lean 4 on finite models of the setting, and the formalization is included in the supplementary material. Its README maps each result to its Lean declaration and states the modeling choices and what is trusted. All datasets are publicly available and have been cited.
References
- [1]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 The Twelfth International Conference on Learning Representations, 2024.arxiv.org/abs/2306.13649
- [2]Hao Bai, Yifei Zhou, Mert Cemri, Jiayi Pan, Alane Suhr, Sergey Levine, and Aviral Kumar. DigiRL: Training in-the-wild device-control agents with autonomous reinforcement learning. In Advances in Neural Information Processing Systems, volume 37, 2024.
- [3]Sanjiban Choudhury and Paloma Sodhi. Better than your teacher: LLM agents that learn from privileged AI feedback. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=st7XqFgBAH.
- [5]Xiang Deng, Yu Gu, Boyuan Zheng, Shijie Chen, Samuel Stevens, Boshi Wang, Huan Sun, and Yu Su. Mind2Web: Towards a generalist agent for the web. In Thirty-seventh Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2023. URL https://openreview.net/forum?id=kiYqbO3wqw.arxiv.org/abs/2306.06070
- [7]Yuxian Gu, Li Dong, Furu Wei, and Minlie Huang. MiniLLM: Knowledge distillation of large language models. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=5h0qf7IBZZ.DOI
- [8]Hongliang He, Wenlin Yao, Kaixin Ma, Wenhao Yu, Yong Dai, Hongming Zhang, Zhenzhong Lan, and Dong Yu. WebVoyager: Building an end-to-end web agent with large multimodal models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, 2024.
- [9]Hongliang He, Wenlin Yao, Kaixin Ma, Wenhao Yu, Hongming Zhang, Tianqing Fang, Zhenzhong Lan, and Dong Yu. OpenWebVoyager: Building multimodal web agents via iterative real-world exploration, feedback and optimization. In Wanxiang Che, Joyce Nabende, Ekaterina Shutova, and Mohammad Taher Pilehvar (eds.), Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 27545–27564, Vienna, Austria, July 2025. Association for Computational Linguistics. ISBN 979-8-89176-251-0. doi: 10.18653/v1/2025.acl-long.1336. URL https://aclanthology.org/2025.acl-long.1336/.
- [10]Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.arxiv.org/abs/1503.02531
- [11]Minda Hu, Tianqing Fang, Jianshu Zhang, Jun-Yu Ma, Zhishong Zhang, Jingyan Zhou, Hongming Zhang, Haitao Mi, Dong Yu, and Irwin King. WebCoT: Enhancing web agent reasoning by reconstructing chain-of-thought in reflection, branching, and rollback. In Findings of the Association for Computational Linguistics: EMNLP 2025, 2025.
- [12]Jonas Hübotter, Frederike Lübeck, Lejs Deen Behric, Anton Baumann, Marco Bagatella, Daniel Marta, Ido Hakimi, Idan Shenfeld, Thomas Kleine Buenning, Carlos Guestrin, and Andreas Krause. Reinforcement learning via self-distillation. In Forty-third International Conference on Machine Learning, 2026. URL https://openreview.net/forum?id=QfkxyRiZz.
- [13]Md Farhan Ishmam and Kenneth Marino. TimeWarp: Evaluating web agents by revisiting the past. In Fortieth Conference on Neural Information Processing Systems Evaluations and Datasets Track, 2026. URL https://arxiv.org/abs/2603.04949. To appear.
- [14]Leslie Pack Kaelbling, Michael L Littman, and Anthony R Cassandra. Planning and acting in partially observable stochastic domains. Artificial Intelligence, 101(1-2):99–134, 1998.
- [15]Moo Jin Kim, Karl Pertsch, Siddharth Karamcheti, Ted Xiao, Ashwin Balakrishna, Suraj Nair, Rafael Rafailov, Ethan P Foster, Pannag R Sanketi, Quan Vuong, Thomas Kollar, Benjamin Burchfiel, Russ Tedrake, Dorsa Sadigh, Sergey Levine, Percy Liang, and Chelsea Finn. Open-vla: An open-source vision-language-action model. In Pulkit Agrawal, Oliver Kroemer, and Wolfram Burgard (eds.), Proceedings of The 8th Conference on Robot Learning, volume 270 of Proceedings of Machine Learning Research, pp. 2679–2713. PMLR, 06–09 Nov 2025. URL https://proceedings.mlr.press/v270/kim25c.html.DOI
- [16]Yoon Kim and Alexander M Rush. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1317–1327, 2016.arxiv.org/abs/1606.07947
- [17]Jongwoo Ko, Sungnyun Kim, Tianyi Chen, and Se-Young Yun. DistiLLM: Towards streamlined distillation for large language models. In Proceedings of the 41st International Conference on Machine Learning, 2024.arxiv.org/abs/2402.03898
- [18]Niklas Lauffer, Xiang Deng, Srivatsa R Kundurthy, Brad Kenstler, and Jeff Da. Imitation learning for multi-turn LM agents via on-policy expert corrections. In Forty-third International Conference on Machine Learning, 2026. URL https://openreview.net/forum?id=1OLA4SUA50.arxiv.org/abs/2512.14895
- [19]Changhao Li, Rushi Qiang, Jiawei Huang, Chenxiao Gao, Chao Zhang, Niao He, and Bo Dai. Revisiting DAgger in the era of LLM-agents. arXiv preprint arXiv:2605.12913, 2026a.arxiv.org/abs/2605.12913
- [20]Xiaozhe Li, Tianyi Lyu, Yang Li, Yichuan Ma, Peiji Li, Linyang Li, Qipeng Guo, Dahua Lin, and Kai Chen. What and when to distill: Selective hindsight distillation for multi-turn agents. arXiv preprint arXiv:2605.19447, 2026b.
- [21]Yijiang Li, Bingyang Wang, Yijun Liang, Yunjie Tian, Di Fu, and Nuno Vasconcelos. On-policy self-distillation without any supervision. arXiv preprint arXiv:2608.06296, 2026c.arxiv.org/abs/2608.06296
- [22]Kevin Lu and Thinking Machines Lab. On-policy distillation. Thinking Machines Lab: Connection-ism, 2025. https://thinkingmachines.ai/blog/on-policy-distillation.
- [23]Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. In Advances in Neural Information Processing Systems, volume 35, pp. 27730–27744, 2022.arxiv.org/abs/2203.02155
- [24]Zehan Qi, Xiao Liu, Iat Long Long, Hanyu Lai, Xueqiao Sun, et al. WebRL: Training LLM web agents via self-evolving online curriculum reinforcement learning. In The Thirteenth International Conference on Learning Representations, 2025.arxiv.org/abs/2411.02337
- [25]Xuan Ren, Biao Wu, and Lingqiao Liu. I learn better if you speak my language: Understanding the superior performance of fine-tuning large language models with LLM-generated responses. In Yaser Al-Onaizan, Mohit Bansal, and Yun-Nung Chen (eds.), Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pp. 10225–10245, Miami, Florida, USA, November 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.emnlp-main.571. URL https://aclanthology.org/2024.emnlp-main.571/.DOI
- [26]Stéphane Ross and Drew Bagnell. Efficient reductions for imitation learning. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 661–668, 2010.
- [27]Stéphane Ross, Geoffrey J Gordon, and J Andrew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 627–635, 2011.arxiv.org/abs/1011.0686
- [28]John Schulman. Approximating KL divergence, 2020. http://joschu.net/blog/kl-approx.html.
- [29]Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Y Wu, et al. DeepseekMath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300, 2024.arxiv.org/abs/2402.03300
- [30]Yixiao Song, Katherine Thai, Chau Minh Pham, Yapei Chang, Mazin Nadaf, and Mohit Iyyer. BEARCUBS: A benchmark for computer-using web agents. In Second Conference on Language Modeling, 2025. URL https://openreview.net/forum?id=0JzWiigkUy.arxiv.org/abs/2503.07919
- [31]Gemma Team, Sherif El Abd, Vaibhav Aggarwal, Robin Algayres, Alek Andreev, Olivier Bachem, Ian Ballantyne, Cormac Brick, Victor Cärbune, Michelle Casbon, et al. Gemma 4 technical report. arXiv preprint arXiv:2607.02770, 2026.arxiv.org/abs/2607.02770
- [33]Zhepei Wei, Wenlin Yao, Yao Liu, Weizhi Zhang, Qin Lu, Liang Qiu, Changlong Yu, Puyang Xu, Chao Zhang, Bing Yin, Hyokun Yun, and Lihong Li. WebAgent-r1: Training web agents via end-to-end multi-turn reinforcement learning. In Christophorus Christodoulopoulos, Tannoy Chakraborty, Carolyn Rose, and Violet Peng (eds.), Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pp. 7909–7928, Suzhou, China, November 2025. Association for Computational Linguistics. ISBN 979-8-89176-332-6. doi: 10.18653/v1/2025.emnlp-main.401. URL https://aclanthology.org/2025.emnlp-main.401/.DOI
- [34]Tianbao Xie, Danyang Zhang, Jixuan Chen, Xiaochuan Li, Siheng Zhao, Ruisheng Cao, Toh Jing Hua, Zhoujun Cheng, Dongchan Shin, Fangyu Lei, Yitao Liu, Yiheng Xu, Shuyan Zhou, Silvio Savarese, Caiming Xiong, Victor Zhong, and Tao Yu. OSWorld: Benchmarking multimodal agents for open-ended tasks in real computer environments. In The Thirty-eighth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2024. URL https://openreview.net/forum?id=tN61DTr4Ed.arxiv.org/abs/2404.07972
- [35]Tianci Xue, Weijian Qi, Tianneng Shi, Chan Hee Song, Boyu Gou, Dawn Song, Huan Sun, and Yu Su. An illusion of progress? Assessing the current state of web agents. In Conference on Language Modeling (COLM), 2025.arxiv.org/abs/2504.01382
- [36]Jianwei Yang, Hao Zhang, Feng Li, Xueyan Zou, Chunyuан Li, and Jianfeng Gao. Set-of-mark prompting unleashes extraordinary visual grounding in GPT-4V. arXiv preprint arXiv:2310.11441, 2023.arxiv.org/abs/2310.11441
- [37]Woongyeng Yeo, Yumin Choi, Taekyung Ki, and Sung Ju Hwang. HinT-SD: Targeted hindsight self-distillation for long-horizon agents. arXiv preprint arXiv:2605.17873, 2026.DOI
- [38]Zheng Yuan, Hongyi Yuan, Chengpeng Li, Guanting Dong, Keming Lu, Chuanqi Tan, Chang Zhou, and Jingren Zhou. Scaling relationship on learning mathematical reasoning with large language models. arXiv preprint arXiv:2308.01825, 2023.arxiv.org/abs/2308.01825
- [39]Eric Zelikman, Yuhuai Wu, Jesse Mu, and Noah D. Goodman. STaR: Bootstrapping reasoning with reasoning. In Advances in Neural Information Processing Systems, volume 35, 2022.arxiv.org/abs/2203.14465
- [40]Siyan Zhao, Zhihui Xie, Mengchen Liu, Jing Huang, Guan Pang, Feiyu Chen, and Aditya Grover. Self-distilled reasoner: On-policy self-distillation for large language models. In ICLR 2026 Workshop on Lifelong Agents: Learning, Aligning, Evolving, 2026. URL https://openreview.net/forum?id=31wkVZXEaJ.arxiv.org/abs/2601.18734
- [41]Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric Xing, et al. Judging LLM-as-a-judge with MT-Bench and chatbot arena. In Advances in Neural Information Processing Systems, volume 36, 2023.arxiv.org/abs/2306.05685
- [42]Shuyan Zhou, Frank F Xu, Hao Zhu, Xuhui Zhou, Robert Lo, Abishek Sridhar, Xianyi Cheng, Tianyue Ou, Fontan Fisk, Daniel Fried, Uri Alon, and Graham Neubig. WebArena: A realistic web environment for building autonomous agents. In The Twelfth International Conference on Learning Representations, 2024.arxiv.org/abs/2307.13854
- [43]Brianna Zitkovich, Tianhe Yu, Sichun Xu, Peng Xu, Ted Xiao, Fei Xia, Jialin Wu, Paul Wohlhart, Stefan Welker, Ayzaan Wahid, Quan Vuong, Vincent Vanhoucke, Huong Tran, Radu Soricut, Anikait Singh, Jaspiar Singh, Pierre Sermanet, Pannag R. Sanketi, Grecia Salazar, Michael S. Ryoo, Krista Reymann, Kanishka Rao, Karl Pertsch, Igor Mordatch, Henryk Michalewski, Yao Lu, Sergey Levine, Lisa Lee, Tsang-Wei Edward Lee, Isabel Leal, Yuheng Kuang, Dmitry Kalashnikov, Ryan Julian, Nikhil J. Joshi, Alex Irpan, Brian Ichter, Jasmine Hsu, Alexander Herzog, Karol Hausman, Keerthana Gopalakrishnan, Chuyuan Fu, Pete Florence, Chelsea Finn, Kumar Avinava Dubey, Danny Driess, Tianli Ding, Krzysztof Marcin Choromanski, Xi Chen, Yevgen Chebotar, Justice Carbajal, Noah Brown, Anthony Brohan, Montserrat Gonzalez Arenas, and Kehang Han. Rt-2: Vision-language-action models transfer web knowledge to robotic control. In Jie Tan, Marc Toussaint, and Kourosh Darvish (eds.), Proceedings of The 7th Conference on Robot Learning, volume 229 of Proceedings of Machine Learning Research, pp. 2165–2183. PMLR, 06–09 Nov 2023. URL https://proceedings.mlr.press/v229/zikovich23a.html.arxiv.org/abs/2307.15818

