Weasel: Out-of-Domain Generalization for Web Agents via Importance-Diversity Data Selection

arXiv cs.LG Papers

Summary

Weasel is a trajectory selection method for offline training of web agents that improves out-of-domain generalization by balancing importance and diversity. It achieves up to 12.5x training speedups and improved performance across several benchmarks.

arXiv:2605.20291v1 Announce Type: new Abstract: Large language models (LLMs) have enabled web agents that follow natural language goals through multi-step browser interactions. However, agents fine-tuned on specific trajectories and domain often struggle to generalize out of domain, and offline training can be compute-inefficient due to noisy, redundant trajectories and long accessibility-tree (AXTree) states. To address both issues, we propose Weasel, a trajectory selection method for offline training of web agents. Weasel selects a fixed-budget subset of trajectory steps by optimizing an objective that balances unary importance with pairwise diversity over states, websites, and interaction patterns, solving efficiently with a greedy algorithm. We further improve efficiency with target-centered AXTree pruning that keeps only content around the ground-truth action target, and we mitigate style mismatch for reasoning-native models by replacing expert traces with model-generated, style-consistent rationales. Across AgentTrek and NNetNav training datasets, evaluations in WebArena, WorkArena, and MiniWob, and experiments with Qwen2.5-7B, Gemma3-4B, and Qwen3-8B, Weasel improves out-of-domain performance while reducing training cost, producing roughly 9.7-12.5$\times$ training speedups over standard fine-tuning. We make the code available at https://github.com/fatemehpesaran310/weasel.
Original Article
View Cached Full Text

Cached at: 05/21/26, 06:21 AM

# Weasel: Out-of-Domain Generalization for Web Agents via Importance-Diversity Data Selection
Source: [https://arxiv.org/html/2605.20291](https://arxiv.org/html/2605.20291)
###### Abstract

Large language models \(LLMs\) have enabled web agents that follow natural language goals through multi\-step browser interactions\. However, agents fine\-tuned on specific trajectories and domain often struggle to generalize out of domain, and offline training can be compute\-inefficient due to noisy, redundant trajectories and long accessibility\-tree \(AXTree\) states\. To address both issues, we proposeWeasel, a trajectory selection method for offline training of web agents\.Weaselselects a fixed\-budget subset of trajectory steps by optimizing an objective that balances unary importance with pairwise diversity over states, websites, and interaction patterns, solving efficiently with a greedy algorithm\. We further improve efficiency with target\-centered AXTree pruning that keeps only content around the ground\-truth action target, and we mitigate style mismatch for reasoning\-native models by replacing expert traces with model\-generated, style\-consistent rationales\. Across AgentTrek and NNetNav training datasets, evaluations in WebArena, WorkArena, and MiniWob, and experiments with Qwen2\.5\-7B, Gemma3\-4B, and Qwen3\-8B,Weaselimproves out\-of\-domain performance while reducing training cost, producing roughly 9\.7\-12\.5×\\timestraining speedups over standard fine\-tuning\. We make the code available at[https://github\.com/fatemehpesaran310/weasel](https://github.com/fatemehpesaran310/weasel)\.

Machine Learning, ICML

![Refer to caption](https://arxiv.org/html/2605.20291v1/figures/figure1.png)Figure 1:Overview ofWeasel\. Conventional trained web agents show a sharp performance drop under out\-of\-domain shifts to unseen websites and interaction patterns\.Weaseltackles this challenge via novel trajectory selection: it scores offline demonstration steps for goal relevance and diversity, then applies greedy subset selection under a fixed budget\. Agents trained withWeaselgeneralize better to unseen test domains, achieving a \+4\.8 gain in zero\-shot transfer from AgentTrek\(Xuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib59)\)→\\rightarrowWebArena\-Lite\(Qiet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib49)\)with Qwen3\-8B\(Team,[2025](https://arxiv.org/html/2605.20291#bib.bib34)\)\. Note that bar\-top labels indicate the training data source\.## 1Introduction

Large Language Models \(LLMs\) have moved beyond text generation to support multi\-step reasoning, planning, and action in interactive environments\(Wanget al\.,[2023](https://arxiv.org/html/2605.20291#bib.bib50); Liuet al\.,[2023](https://arxiv.org/html/2605.20291#bib.bib46)\)\. This progress has accelerated interest in LLM\-based web agents that map natural\-language goals to sequences of browsing\(Qiet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib49); Zhouet al\.,[2024a](https://arxiv.org/html/2605.20291#bib.bib48)\)\. Recent improvements are fueled by strong foundation models and large\-scale instruction data\(Ouet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib43); Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45); Xuet al\.,[2025b](https://arxiv.org/html/2605.20291#bib.bib44)\), along with agent\-specific training such as imitation learning and reinforcement learning\(Qiet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib42); Weiet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib41)\), enabling agents to solve increasingly complex, long\-horizon web tasks\.

Despite this progress, recent web agents remain limited in two key respects\. First, agents fine\-tuned on specific trajectories and environments often fail to generalize to out\-of\-domain tasks and settings\. Performance often drops substantially when deployed on the websites, layouts, or interaction patterns that differ from those seen during training\(Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45)\)\. Recent studies mostly evaluate under in\-benchmark settings\(Qiet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib49); Laiet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib39); Zhouet al\.,[2024b](https://arxiv.org/html/2605.20291#bib.bib38); Shenet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib40); Weiet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib41)\), training on a subset of tasks from a benchmark environment and testing on held\-out tasks within the same environment \(e\.g\., WebArena\-to\-WebArena in[Figure1](https://arxiv.org/html/2605.20291#S0.F1)\)\. This limits their applicability in real\-world web tasks where distribution shifts are inevitable\.

Second, offline web interaction data are often noisy and redundant\(Nekoeiet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib19); Xuet al\.,[2025a](https://arxiv.org/html/2605.20291#bib.bib18)\); expert trajectories can be overly long while containing relatively sparse task\-relevant signal, due to redundant steps, drifting behaviors, or partially misaligned actions\. Thus, models are prone to overfitting to narrow patterns rather than learning robust, transferable behaviors\. This motivates improving both learning efficiency and generalization ability by curating an informative and diverse subset of trajectories and pruning distracting page content\.

To address these two challenges, we proposeWeasel\(WEbAgents with trajectorySELection\), a data selection approach for offline web agent training that improves both learning efficiency and out\-of\-domain generalization\.Weaselformulates a fixed\-budget subset selection problem with a quadratic objective that balances unary importance and pairwise diversity \(§[2\.2](https://arxiv.org/html/2605.20291#S2.SS2)\)\. The unary importance prioritizes the steps that are semantically relevant to the goal, while the pairwise diversity encourages coverage over heterogeneous states, websites, and interaction patterns\. Since the resulting subset selection problem is NP\-hard in general, we employ an efficient greedy algorithm that scales to large collections of long trajectory in practice \(§[2\.3](https://arxiv.org/html/2605.20291#S2.SS3)\)\.Weaselimproves \(1\) out\-of\-domain generalization by explicitly encouraging diversity, which mitigates overfitting to website\-specific artifacts \([Figure1](https://arxiv.org/html/2605.20291#S0.F1)\), and \(2\) training efficiency by removing redundant and noisy steps from long trajectories, achieving higher accuracy with up to 12\.5×\\timestraining speed\-up compared to training on the full data \([Table1](https://arxiv.org/html/2605.20291#S3.T1)\)\.

To further improve training efficiency, we introduce target\-centered pruning\. In web agent settings, each state can contain a large accessibility tree \(AXTree\), where action\-relevant cues may be diluted by substantial irrelevant page content\(Denget al\.,[2023](https://arxiv.org/html/2605.20291#bib.bib37); Kerbouaet al\.,[2025a](https://arxiv.org/html/2605.20291#bib.bib11)\)\. Thus, we prune each state by retaining AXTree content localized around the ground\-truth action target, compactly preserving the information most relevant for predicting the expert action \(§[2\.4](https://arxiv.org/html/2605.20291#S2.SS4)\)\. This pruning is orthogonally applicable and effectively reduces both the input length and training cost\.

For reasoning\-native models such as Qwen3\(Yanget al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib36)\), we find that fine\-tuning with reasoning traces written by a different model can be detrimental\. The issue arises when the reasoning style in the training data differs from that used in the pretraining of the model; as a result, it can harm both out\-of\-domain generalization and overall performance\. To address this, we let the model self\-generate style\-consistent reasoning traces while preserving the original action supervision in the trajectories \(§[2\.5](https://arxiv.org/html/2605.20291#S2.SS5)\)\. We find this step crucial for improving out\-of\-domain generalization in reasoning\-native models \([Table4](https://arxiv.org/html/2605.20291#S3.T4)\)\.

In summary, our contributions are as follows\.

- •To the best of our knowledge, we proposeWeasel, the first data selection approach for offline web agent training that is explicitly designed to achieve two goals: \(1\) improved out\-of\-domain generalization and \(2\) more compute\-efficient learning\.Weaselformulates a subset selection objective that balances unary importance and pairwise diversity\. We develop a greedy algorithm that scales to large trajectory collections\. We also introduce target\-centered AXTree pruning to remove redundant context and accelerate training\. For reasoning\-native models, we synthesize style\-consistent reasoning traces to mitigate style mismatch during fine\-tuning\.
- •We perform a diverse evaluation; web agents trained from two offline datasets, AgentTrek\(Xuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib59)\)and NNetNav\(Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45)\), are evaluated across multiple benchmarks \(e\.g\., WebArena\(Zhouet al\.,[2024a](https://arxiv.org/html/2605.20291#bib.bib48)\), WorkArena\(Drouinet al\.,[2024a](https://arxiv.org/html/2605.20291#bib.bib22)\), and MiniWob\(Shiet al\.,[2017](https://arxiv.org/html/2605.20291#bib.bib20); Liuet al\.,[2018](https://arxiv.org/html/2605.20291#bib.bib21)\)\) in a zero\-shot manner, using multiple model families \(e\.g\., Qwen2\.5\-7B\(Qwenet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib35)\), Gemma3\-4B\(Teamet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib25)\)and Qwen3\-8B\(Team,[2025](https://arxiv.org/html/2605.20291#bib.bib34)\)\)\. We provide ablations that isolate the effects of subset selection, state pruning, and reasoning synthesis\. Beyond substantial out\-of\-domain generalization gains \(see[Table1](https://arxiv.org/html/2605.20291#S3.T1)\),Weaselimproves training efficiency over standard SFT baselines, achieving 9\.7\-12\.5×\\timestraining speed\-ups depending on the model\.

## 2Weasel

Weaselis a data selection method for training of offline web agents from long, noisy demonstrations\. Given an expert trajectory dataset,Weaselconstructs a compact supervision set by selecting a fixed\-budget subset of informative yet diverse steps\. To further reduce training time, we prune each Web state to retain only action\-relevant AXTree content \(§[2\.4](https://arxiv.org/html/2605.20291#S2.SS4)\)\. For reasoning\-native models, self\-reasoning synthesis mitigates reasoning\-style mismatch when the training traces are produced by a different model \(§[2\.5](https://arxiv.org/html/2605.20291#S2.SS5)\)\.

![Refer to caption](https://arxiv.org/html/2605.20291v1/figures/WEASEL.png)Figure 2:\(Left\): An example of a curated trajectory after applyingWeasel\. Although the original collected data contain noisy steps \(t=4t=4\), and erroneous actions \(t=0t=0\),Weaselselects a compact subset that retains only the most informative steps \(in red\) for the goal\. \(Right\): Overview ofWeasel\. We first perform element\-wise score calculation using unary importance and pairwise diversity\.Weaselthen applies a greedy subset selection procedure to derive an informative subsetJJ\. The algorithm initializesJJby selecting the best\-scoring pair that maximizes the objective, and then iteratively adds the elementkkthat yields the largest marginal gain, until the budget is met \([Algorithm1](https://arxiv.org/html/2605.20291#alg1)\)\.### 2\.1Problem Formulation

#### Setup\.

Let𝒟=\{τ\(n\)\}n=1N\\mathcal\{D\}=\\\{\\tau^\{\(n\)\}\\\}\_\{n=1\}^\{N\}denote an offline dataset of expert web trajectories\. Each trajectoryτ∈𝒟\\tau\\in\\mathcal\{D\}is a sequenceτ=\(g,\{\(st,ht,at,rt\)\}t=0T−1\)\\tau=\\bigl\(g,\\\{\(s\_\{t\},h\_\{t\},a\_\{t\},r\_\{t\}\)\\\}\_\{t=0\}^\{T\-1\}\\bigr\), whereggis a natural\-language goal,sts\_\{t\}is a Web state,hth\_\{t\}is an interaction history up to steptt,at∈𝒜a\_\{t\}\\in\\mathcal\{A\}is an expert action \(e\.g\.,click,type,scroll,goto\), andrtr\_\{t\}is a reasoning trace\. We learn a policyπθ\\pi\_\{\\theta\}that imitates the expert in an offline manner by predicting both the action and the reasoning trace at each step, conditioning on the goal, interaction history, and Web state, i\.e\.,πθ​\(at,rt∣g,ht,st\)\\pi\_\{\\theta\}\(a\_\{t\},r\_\{t\}\\mid g,h\_\{t\},s\_\{t\}\)\. We denote the model answer byyt=\[rt;at\]y\_\{t\}=\[r\_\{t\};\\,a\_\{t\}\], formed by concatenating the reasoning trace and action\.

#### States and actions for web agents\.

We represent each statests\_\{t\}as a linearization of the page accessibility tree \(AXTree\)\. We write the linearized node sequence asVt=\[vt,1,vt,2,…,vt,Kt\]V\_\{t\}=\[v\_\{t,1\},v\_\{t,2\},\\ldots,v\_\{t,K\_\{t\}\}\], where each nodevt,kv\_\{t,k\}has a unique identifier \(e\.g\., abid\), andKt=\|Vt\|K\_\{t\}=\|V\_\{t\}\|is the number of nodes in the linearization\. For the action space𝒜\\mathcal\{A\}, we follow BrowserGym\(de Chezelleset al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib23)\)to include node\-grounded actions that reference an AXTree element via its identifier \(e\.g\.,click,type\) as well as non\-node actions that do not require an identifier \(e\.g\.,goto,noop\)\.

#### Goal\.

Since raw web trajectories include many redundant steps and noisy, overly long demonstrations,Weaselconstructs a compact supervision set by selecting a fixed\-budget subset of stepsJ⊆\{0,…,T−1\}J\\subseteq\\\{0,\\ldots,T\-1\\\}with\|J\|=T0≪T\|J\|=T\_\{0\}\\ll T\. This yields the curated dataset𝒟~=⋃τ∈𝒟\{\(g,ht,st,at,rt\)\}t∈J∗​\(τ\)\\tilde\{\\mathcal\{D\}\}=\\bigcup\_\{\\tau\\in\\mathcal\{D\}\}\\\{\(g,h\_\{t\},s\_\{t\},a\_\{t\},r\_\{t\}\)\\\}\_\{t\\in J^\{\*\}\(\\tau\)\}, whereJ∗​\(τ\)J^\{\*\}\(\\tau\)is obtained by our goal\-conditioned importance\-diversity objective \(§[2\.2](https://arxiv.org/html/2605.20291#S2.SS2)\) and solved using a greedy algorithm \(§[2\.3](https://arxiv.org/html/2605.20291#S2.SS3)\)\.

Algorithm 1Weaselsubset selection \(greedy\)0:Goal

gg, trajectory

\{\(st,yt\)\}t=0T−1\\\{\(s\_\{t\},y\_\{t\}\)\\\}\_\{t=0\}^\{T\-1\}, budget

T0T\_\{0\}, weight

λ\\lambda
1:Compute

Φ​\(t\)=BERTScore​\(g,st\)\\Phi\(t\)=\\mathrm\{BERTScore\}\(g,s\_\{t\}\)for all

tt
2:Compute \(or cache on\-demand\)

D​\(i,j\)D\(i,j\)via Eq\. \([3](https://arxiv.org/html/2605.20291#S2.E3)\)

3:

\(i1,i2\)←arg⁡maxi<j⁡Φ​\(i\)\+Φ​\(j\)\+λ​D​\(i,j\)\(i\_\{1\},i\_\{2\}\)\\leftarrow\\arg\\max\_\{i<j\}\\ \\Phi\(i\)\+\\Phi\(j\)\+\\lambda D\(i,j\)
4:

J←\{i1,i2\}J\\leftarrow\\\{i\_\{1\},i\_\{2\}\\\}
5:for

m=3m=3to

T0T\_\{0\}do

6:

im←arg⁡maxk∉J⁡Φ​\(k\)\+λ​∑i∈JD​\(k,i\)i\_\{m\}\\leftarrow\\arg\\max\_\{k\\notin J\}\\ \\Phi\(k\)\+\\lambda\\sum\_\{i\\in J\}D\(k,i\)
7:

J←J∪\{im\}J\\leftarrow J\\cup\\\{i\_\{m\}\\\}
8:endfor

8:

J∗←sort​\(J\)J^\{\*\}\\leftarrow\\mathrm\{sort\}\(J\)

### 2\.2Goal\-conditioned Subset Selection

Trajectories in the training set for Web agents are often unnecessarily long\. In AgentTrek\(Xuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib59)\), a single trajectory contains up to 45 state\-action pairs, although only a small fraction is directly relevant to the task goal\. Training on long, redundant trajectories is also prone to overfitting to environment\-specific patterns\. We therefore cast trajectory curation as a subset selection problem that retains only the most informative steps while maintaining diversity among the retained steps to improve generalization\.

Given a trajectory of lengthTT, we select a compact subset ofT0≪TT\_\{0\}\\ll Tsteps; letJ⊂\{0,…,T−1\}J\\subset\\\{0,\\dots,T\-1\\\}denote the selected indices with\|J\|=T0\|J\|=T\_\{0\}\. We maximize the objective that combines unary importance and pairwise diversity:

maximizeJ⊆\{0,…,T−1\}\\displaystyle\\underset\{J\\subseteq\\\{0,\\dots,T\-1\\\}\}\{\\mathrm\{maximize\}\}\\quad∑j∈JΦ​\(j\)\+λ​∑i<ji,j∈JD​\(i,j\)\\displaystyle\\sum\_\{j\\in J\}\\Phi\(j\)\\;\+\\;\\lambda\\sum\_\{\\begin\{subarray\}\{c\}i<j\\\\ i,j\\in J\\end\{subarray\}\}D\(i,j\)\(1\)s\.t\.\|J\|=T0,\\displaystyle\|J\|=T\_\{0\},whereΦ​\(j\)\\Phi\(j\)is an*importance*score andD​\(i,j\)D\(i,j\)is a*diversity*score, andλ\\lambdacontrols the tradeoff\.

For importanceΦ​\(j\)\\Phi\(j\), we score each stepsts\_\{t\}by its semantic relevance to the goal:

Φ​\(t\)=BERTScore​\(g,st\),\\Phi\(t\)=\\mathrm\{BERTScore\}\(g,s\_\{t\}\),\(2\)where we use the BERTScore\(Zhanget al\.,[2020](https://arxiv.org/html/2605.20291#bib.bib27)\)to quantify how well the content of stepttaligns with the goalgg\. In principle, BERTScore can be replaced by any embedding similarity; we study alternative similarity models in[AppendixB](https://arxiv.org/html/2605.20291#A2)\. However, maximizing importance alone can select redundant, highly similar states and may encourage overfitting to website\-specific patterns\. We therefore incorporate a pairwise diversity termD​\(i,j\)D\(i,j\)defined as the maximum pseudo\-distance between either the states or the associated model answers:

D​\(i,j\)=max⁡\(δ​\(si,sj\),δ​\(yi,yj\)\),D\(i,j\)=\\max\\\!\\Big\(\\delta\(s\_\{i\},s\_\{j\}\),\\ \\delta\(y\_\{i\},y\_\{j\}\)\\Big\),\(3\)whereyi=\[ri;ai\]y\_\{i\}=\[r\_\{i\};\\,a\_\{i\}\]denotes the model answer for stepiiformed by concatenating its reasoning tracerir\_\{i\}and actionaia\_\{i\}, and the pseudo\-distanceδ​\(x,y\)\\delta\(x,y\)between two text sequencesxxandyyis defined as

δ​\(x,y\)≜1−BERTScore​\(x,y\),\\delta\(x,y\)\\triangleq 1\-\\mathrm\{BERTScore\}\(x,y\),\(4\)so thatδ​\(x,y\)\\delta\(x,y\)is small whenxxandyyare semantically similar\. Together, these terms yield the subset selection objective in Eq\. \([1](https://arxiv.org/html/2605.20291#S2.E1)\) under the constraint in set size\. Unless otherwise stated, we setλ=1\\lambda=1in all experiments\.

### 2\.3The Greedy Algorithm

While the problem in Eq\. \([1](https://arxiv.org/html/2605.20291#S2.E1)\) is NP\-hard\(Garey and Johnson,[2002](https://arxiv.org/html/2605.20291#bib.bib31)\), it can be formulated as a variant of the max\-sum diversification problem, which maximizes a modular quality term plus a sum of pairwise distances under a cardinality constraint\(Borodinet al\.,[2017](https://arxiv.org/html/2605.20291#bib.bib26)\)\. For metric distances, a greedy algorithm achieves a constant\-factor guarantee, including a22\-approximation\(Borodinet al\.,[2017](https://arxiv.org/html/2605.20291#bib.bib26), Theorem 4\.1\)\. In our problem,D​\(i,j\)D\(i,j\)is defined using semantic pseudo\-distances \(e\.g\.,1−BERTScore1\-\\mathrm\{BERTScore\}and a max\-composition\) that do not satisfy metric properties, so this guarantee does not formally apply\. Nevertheless, greedy selection remains an efficient and effective heuristic in practice\. We empirically examine the approximation quality of this greedy procedure in §[3\.3](https://arxiv.org/html/2605.20291#S3.SS3.SSS0.Px4)\.

We first initialize the selected set by choosing the best pair:

\(i1,i2\)=arg⁡max0≤i<j<T⁡\(Φ​\(i\)\+Φ​\(j\)\+λ​D​\(i,j\)\),\\displaystyle\(i\_\{1\},i\_\{2\}\)=\\arg\\max\_\{0\\leq i<j<T\}\\Big\(\\Phi\(i\)\+\\Phi\(j\)\+\\lambda D\(i,j\)\\Big\),\(5\)J2=\{i1,i2\}\.\\displaystyle\\qquad J\_\{2\}=\\\{i\_\{1\},i\_\{2\}\\\}\.Starting from this seed, form=3,4,…,T0m=3,4,\\dots,T\_\{0\}, we expand the set by adding the index that yields the largest marginal gain with respect to the objective:

Δ​\(k∣Jm−1\)\\displaystyle\\Delta\(k\\mid J\_\{m\-1\}\)≔Φ​\(k\)\+λ​∑i∈Jm−1D​\(k,i\),\\displaystyle\\coloneqq\\Phi\(k\)\+\\lambda\\sum\_\{i\\in J\_\{m\-1\}\}D\(k,i\),\(6\)im\\displaystyle i\_\{m\}=arg⁡maxk∉Jm−1⁡Δ​\(k∣Jm−1\),\\displaystyle=\\arg\\max\_\{k\\notin J\_\{m\-1\}\}\\Delta\(k\\mid J\_\{m\-1\}\),Jm\\displaystyle J\_\{m\}=Jm−1∪\{im\}\.\\displaystyle=J\_\{m\-1\}\\cup\\\{i\_\{m\}\\\}\.We outputJ⋆=JT0J^\{\\star\}=J\_\{T\_\{0\}\}as the selected subset of indices\. The full procedure is summarized in[Algorithm1](https://arxiv.org/html/2605.20291#alg1)\.

In terms of complexity, computing all unary scoresΦ​\(t\)\\Phi\(t\)takesO​\(T\)O\(T\)\. In addition, precomputing all pairwise distancesD​\(i,j\)D\(i,j\)costsO​\(T2\)O\(T^\{2\}\)\(or they can be cached on demand\)\. Given cached distances, each greedy iteration evaluates marginal gains for up toTTcandidates, leading to an overall cost ofO​\(T0​T\)O\(T\_\{0\}T\)for the selection stage\.

### 2\.4Target\-centered Pruning

![Refer to caption](https://arxiv.org/html/2605.20291v1/figures/token-distribution.png)Figure 3:Token distribution of 10K subsamples of AgentTrek\(Xuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib59)\)before pruning \(green\) and after target\-centered pruning \(blue\)\. Pruning substantially reduces long\-tail states, making the resulting sequences more manageable for training\.![Refer to caption](https://arxiv.org/html/2605.20291v1/figures/pruning.png)Figure 4:An illustration ofTarget\-centered Pruning\. Given a statests\_\{t\}in the form of AXTree and gold actionata\_\{t\}, we retain only the AXTree elements within a fixed window of sizewwcentered at the target indexkt∗k\_\{t\}^\{\*\}, producing the pruned states~t\\tilde\{s\}\_\{t\}\. Thekk\-th node in the linearized AXTree at step t is denotedvt,kv\_\{t,k\}\(e\.g\.,vt,1v\_\{t,1\},vt,2v\_\{t,2\}\), andvt,kt∗v\_\{t,k\_\{t\}^\{\*\}\}is the gold target node\.Web states can be prohibitively long\(Denget al\.,[2023](https://arxiv.org/html/2605.20291#bib.bib37); Lùet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib60); Kerbouaet al\.,[2025a](https://arxiv.org/html/2605.20291#bib.bib11)\)because the accessibility tree \(AXTree\) includes highly repeated and peripheral content \(e\.g\., headers, sidebars, duplicated menus\)\. In AgentTrek, a single linearized state can reach 180K tokens\(Xuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib59)\), far exceeding the context limits of most training and inference setups \([Figure3](https://arxiv.org/html/2605.20291#S2.F3)\)\. This length is not only costly but also noisy; only a small subset of nodes informs the expert’s next action\. To address this, we propose target\-centered pruning, which preserves a compact neighborhood around the target element of the expert action, since local context is shown to be more informative for learning node\-grounded web behaviors\(Liuet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib29)\)\.

Specifically, at steptt, letVt=\[vt,1,…,vt,Kt\]V\_\{t\}=\[v\_\{t,1\},\\ldots,v\_\{t,K\_\{t\}\}\]be the linearized AXTree node sequence\. For node\-grounded actions, letkt∗k\_\{t\}^\{\*\}be the gold target index such thatvt,kt∗=ut∗v\_\{t,k\_\{t\}^\{\*\}\}=u\_\{t\}^\{\*\}, whereut∗∈Vtu\_\{t\}^\{\*\}\\in V\_\{t\}denotes the corresponding*target node*\. We use\(Vt,kt∗\)\(V\_\{t\},k\_\{t\}^\{\*\}\)to define target\-centered pruning\. Given a fixed window sizew∈ℕw\\in\\mathbb\{N\}, we keep a contiguous window of length\(2​w\+1\)\(2w\{\+\}1\)centered atkt∗k\_\{t\}^\{\*\}\. Let

𝒦t=\[kt∗−w,kt∗\+w\]∩\{1,…,Kt\}\.\\mathcal\{K\}\_\{t\}=\\big\[\\;k\_\{t\}^\{\*\}\-w,\\;k\_\{t\}^\{\*\}\+w\\;\\big\]\\cap\\\{1,\\ldots,K\_\{t\}\\\}\.\(7\)We retain the subsequenceV~t=\[vt,k:k∈𝒦t\]\\tilde\{V\}\_\{t\}=\[\\,v\_\{t,k\}:k\\in\\mathcal\{K\}\_\{t\}\\,\]and denote the pruned \(linearized\) state ass~t\\tilde\{s\}\_\{t\}\([Figure4](https://arxiv.org/html/2605.20291#S2.F4)\)\. For non\-node actions \(e\.g\.,goto,noop\), we instead keep a fixed\-length prefix under the same length budget \(e\.g\.,2​w\+12w\{\+\}1or a fixedLL\) to obtainV~t\\tilde\{V\}\_\{t\}\. We compare our pruning method against prior state\-pruning baselines in[Table3](https://arxiv.org/html/2605.20291#S3.T3), and further analyze the importance of retaining target\-local context in[Figure5](https://arxiv.org/html/2605.20291#S3.F5)\. This target\-centered pruning is applied as a preprocessing step, prior to runningWeasel\.

### 2\.5Self\-Reasoning Synthesis for Reasoning Models

Reasoning\-native models are fine\-tuned to emit intermediate reasoning traces before producing final outputs\(DeepSeek\-AI,[2025](https://arxiv.org/html/2605.20291#bib.bib33); Team,[2025](https://arxiv.org/html/2605.20291#bib.bib34)\)\. When fine\-tuning such models on expert tracesrtr\_\{t\}produced by a different model or annotation process, we observe that naive fine\-tuning can introduce a style mismatch\. In practice, this mismatch destabilizes training and may degrade performance, sometimes even falling below the base model before fine\-tuning\.

To mitigate this, we replace expert reasoning traces with*self\-synthesized*traces that match the base model’s reasoning style\(Zelikmanet al\.,[2022](https://arxiv.org/html/2605.20291#bib.bib32)\), while keeping the action supervision unchanged\. For each selected stept∈J∗t\\in J^\{\*\}, we prompt the target reasoning model to generate a tracer^t\\hat\{r\}\_\{t\}conditioned on the goal, history, pruned state, and the expert action:

r^t∼q​\(r∣g,ht,s~t,at\),\\hat\{r\}\_\{t\}\\sim q\(\\,r\\mid g,h\_\{t\},\\tilde\{s\}\_\{t\},a\_\{t\}\\,\),\(8\)whereqqis implemented by prompting the base model to produce a plausible rationale consistent withata\_\{t\}\. Refer to Section[F\.2](https://arxiv.org/html/2605.20291#A6.SS2)for full details of the prompt\. We then fine\-tune the policy to predict both the synthesized trace and the expert action:

maxθ​∑τ∈𝒟∑t∈J⋆​\(τ\)log⁡πθ​\(at,r^t∣g,ht,s~t\)\.\\max\_\{\\theta\}\\sum\_\{\\tau\\in\\mathcal\{D\}\}\\sum\_\{t\\in J^\{\\star\}\(\\tau\)\}\\log\\pi\_\{\\theta\}\\\!\\big\(a\_\{t\},\\hat\{r\}\_\{t\}\\mid g,h\_\{t\},\\tilde\{s\}\_\{t\}\\big\)\.\(9\)We ablate the effect of self\-reasoning synthesis in[Table4](https://arxiv.org/html/2605.20291#S3.T4)\.

## 3Experiments

### 3\.1Setup

#### Baselines\.

Table 1:Success rates \(SR\) under a zero\-shot transfer setting\. We fine\-tune Qwen2\.5\-7B\-Instruct\(Qwenet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib35)\), Gemma3\-4b\-IT\(Teamet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib25)\), and Qwen3\-8B\(Team,[2025](https://arxiv.org/html/2605.20291#bib.bib34)\)on AgentTrek\(Xuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib59)\), and evaluate on different benchmarks, WebArena\-Lite\(Liuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib8)\), WebArena\(Zhouet al\.,[2024a](https://arxiv.org/html/2605.20291#bib.bib48)\), MiniWob\(Shiet al\.,[2017](https://arxiv.org/html/2605.20291#bib.bib20); Liuet al\.,[2018](https://arxiv.org/html/2605.20291#bib.bib21)\), and WorkArena\(Drouinet al\.,[2024b](https://arxiv.org/html/2605.20291#bib.bib47)\), with no training\.We compareWeaselagainst standard supervised fine\-tuning \(SFT\) baselines under an offline training using AgentTrek\(Xuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib59)\)and NNetNav\(Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45)\)datasets\. For LLMs of agents, we use the pretrained Qwen2\.5\-7B\-Instruct\(Qwenet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib35)\), Gemma3\-4b\-IT\(Teamet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib25)\)and Qwen3\-8B\(Yanget al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib36)\)\. For all models and datasets, we report performance obtained by reproducing the training process using the hyperparameters specified in[AppendixA](https://arxiv.org/html/2605.20291#A1)\. We test baselines that are fine\-tuned with different configurations of training sets: \(i\) fine\-tune on the full AgentTrek training set of 52K datapoints with multiple epoch budgets \(e\.g\., 2/4 epochs, depending on the model\), \(ii\) on a uniformly sampled subset of 10K datapoints using the same epoch count asWeasel, \(iii\) on a sampled subset via LLM\-as\-Judge\(Zhenget al\.,[2023](https://arxiv.org/html/2605.20291#bib.bib24)\), whose details can be found §[F\.1](https://arxiv.org/html/2605.20291#A6.SS1)\.

#### Evaluation of Out\-of\-Domain Generalization\.

While agents are trained on AgentTrek or NNetNav, we measure their success rates \(SR\) on WebArena\-Lite\(Liuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib8)\), WebArena\(Zhouet al\.,[2024a](https://arxiv.org/html/2605.20291#bib.bib48)\), MiniWob\(Shiet al\.,[2017](https://arxiv.org/html/2605.20291#bib.bib20); Liuet al\.,[2018](https://arxiv.org/html/2605.20291#bib.bib21)\), and WorkArena\(Drouinet al\.,[2024a](https://arxiv.org/html/2605.20291#bib.bib22)\)\. For evaluation, we use GPT\-4\.1\-mini as the judge model on WebArena\-Lite and GPT\-4\-1106\-preview on WebArena\. For consistent benchmark execution, we follow the default environment configuration and evaluation settings provided by the AgentLab framework\(de Chezelleset al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib23); Drouinet al\.,[2024a](https://arxiv.org/html/2605.20291#bib.bib22)\)\. We report aggregate SR over the full evaluation set for each benchmark\. For WorkArena, we additionally report SR on Level\-1 \(L1\) and Level\-2 \(L2\) tasks to show the performance on simpler and more compositional workflows\.

### 3\.2Results

[Table1](https://arxiv.org/html/2605.20291#S3.T1)reports zero\-shot transfer success rates; the agents are trained on AgentTrek and evaluated on WebArena\-Lite, WebArena, MiniWob, and WorkArena \(L1/L2\) with no additional fine\-tuning\.Weaseldelivers the strongest accuracy\-efficiency trade\-off; it achieves the best SR across benchmarks while reducing training cost by an order of magnitude compared to full\-data SFT, about 10\.7\-12\.5×\\timesspeed\-up, depending on the model\. The one\-time preprocessing cost ofWeasel, which is amortized across training runs, is reported in[AppendixE](https://arxiv.org/html/2605.20291#A5)\. Notably,Weaselyields strong transfer performance on the harder benchmarks, e\.g\., reaching19\.219\.2SR on WebArena and4\.34\.3\(L2\) on WorkArena with Qwen3\-8B, and14\.514\.5SR on WebArena\-Lite with Qwen2\.5\-7B\-Instruct\. Under the same 10K\-step training budget,Weaselalso outperforms standard baselines, including uniform subsampling and LLM\-as\-judge selection\. Additional simple filtering baselines, including length\-based heuristics, are presented in[AppendixD](https://arxiv.org/html/2605.20291#A4)\. We note that for Qwen3\-8B, the observed training speed\-up is slightly lower than that of the other 10K baselines\. This is due to the reasoning synthesis in §[2\.5](https://arxiv.org/html/2605.20291#S2.SS5), which uses self\-generated rationales that are longer on average than the original AgentTrek traces, increasing the token budget, but yielding performance that outperforms full fine\-tuning\.

Table 2:Success rates \(SR\) under a different zero\-shot transfer setting where NNetNav\-Live dataset\(Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45)\)is used for training instead of AgentTrek in[Table1](https://arxiv.org/html/2605.20291#S3.T1)\.[Table2](https://arxiv.org/html/2605.20291#S3.T2)reports the results obtained by replacing the AgentTrek training set with NNetNav\-Live\(Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45)\), which is constructed from real\-world browser interactions\. We fine\-tune Qwen2\.5\-7B\-Instruct for 4 epochs under the identical training setting and compare against full\-data SFT and random subsampling\. As in[Table1](https://arxiv.org/html/2605.20291#S3.T1),Weaseloutperforms all baselines across all benchmarks\. Moreover, training on 10K datapoints yields a 9\.7×\\timesspeed\-up relative to the full 52K setting\. This showsWeasel’s robustness with the changed training set\.

#### Pruning\.

Table 3:Comparison of state\-truncation strategies under the same budget \(about 32% of the original tokens\)\. We fine\-tune Qwen2\.5\-7B\-Instruct on sampled 10K datapoints of AgentTrek, and report success rates \(SR\) on WebArena\-Lite\. Training speed\-up is relative to the original \(untruncated\) dataset\.[Table3](https://arxiv.org/html/2605.20291#S3.T3)compares pruning strategies under a fixed pruning ratio on a 10K random subset of AgentTrek\. We report WebArena\-Lite success rate \(SR\) and training speed\-up\. We fix the token budget across methods \(32% of the original tokens\)\. We test three pruning baselines: \(1\)Prune\-by\-Bid, which keeps a prefix up to the gold bid for each web state; \(2\)Semantic\(Tanet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib30)\), which ranks nodes by semantic relevance to the gold action using BERTScore; and \(3\)Target\-centered \+ Semantic, an ablation that forms the pruned state by taking the union of nodes selected by Target\-centered \(ours\) and Semantic\. Since these methods rely on node\-grounded actions, we apply the same fixed\-length prefix truncation to non\-node actions \(i\.e\., the firstLLnodes\)\. Our Target\-centered method in §[2\.4](https://arxiv.org/html/2605.20291#S2.SS4)achieves the best SR, outperforming all baselines\. Notably, all pruning variants yield the same2×2\\timestraining speed\-up relative to the unpruned data \(i\.e\., cutting training time by 50%\)\. Please refer to §[G](https://arxiv.org/html/2605.20291#A7)for more details\.

#### Reasoning Synthesis\.

[Table4](https://arxiv.org/html/2605.20291#S3.T4)reports an ablation on Qwen3\-8B on WebArena\-Lite, isolating the effects of data selection and reasoning synthesis \(RS\) in §[2\.5](https://arxiv.org/html/2605.20291#S2.SS5)\. For a fair comparison, all variants are fine\-tuned under the same training setting with 2 epochs on a 10K subset of AgentTrek\. Our experiments show that combining data selection with RS\.Weaselachieves the best result, reaching 21\.2% SR, indicating that the two components are complementary\.

Table 4:Ablation on isolating the effects of data selection and reasoning synthesis \(RS\)\. All fine\-tuned Qwen3\-8B variants are trained on 10K data points for 2 epochs and evaluated on WebArena\-Lite\.

### 3\.3Analyses

#### Importance Score\.

Table 5:Ablation of the unary importance scoreΦ\\Phion WebArena\-Lite\. We compare different text paired with the goal when computingΦ\\Phi, including the state, the reasoning trace, and a summary of the state\.[Table5](https://arxiv.org/html/2605.20291#S3.T5)ablates the unary importance scoreΦ\\Phion WebArena\-Lite\(Liuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib8); Zhouet al\.,[2024a](https://arxiv.org/html/2605.20291#bib.bib48)\)by varying the text paired with the goal when computingΦ\\Phi\. For a fair comparison, all variants fine\-tune Qwen2\.5\-7B\-Instruct for 4 epochs under the same training setting\. Using the goal\-state pairing \(ours\) yields the best transfer performance, 14\.5 SR, outperforming goal\-reasoning, and goal\-state summary, where state summaries are generated with Flan\-T5\-XL\(Chunget al\.,[2022](https://arxiv.org/html/2605.20291#bib.bib7)\)\.

#### Diversity Score\.

Table 6:Ablation of the pairwise diversity termD​\(i,j\)D\(i,j\)on WebArena\-Lite\. We compare using diversity computed from \(1\) states only \(δ​\(si,sj\)\\delta\(s\_\{i\},s\_\{j\}\)\), \(2\) model answer only \(δ​\(yi,yj\)\\delta\(y\_\{i\},y\_\{j\}\)\), and \(3\) their max\-compositionD​\(i,j\)=max⁡\(δ​\(si,sj\),δ​\(yi,yj\)\)D\(i,j\)=\\max\(\\delta\(s\_\{i\},s\_\{j\}\),\\delta\(y\_\{i\},y\_\{j\}\)\)\.In[Table6](https://arxiv.org/html/2605.20291#S3.T6), we ablate the pairwise diversity term by isolating state diversity, model answer diversity, and their max\-composition\. All results are obtaiend by fine\-tuning Qwen2\.5\-7B\-Instruct for 4 epochs, changing only the definition ofD​\(i,j\)D\(i,j\)\. State\-only diversity yields 9\.7 SR on WebArena\-Lite, model answer\-only improves to 13\.9, and the max\-composition performs the best at 14\.5\. This indicates the two signals are complementary; state diversity promotes coverage over UI and interaction contexts, while model answer diversity captures diverse intents and rationales; taking the maximum preserves diversity in either space, reducing redundancy and improving generalization\.

#### Effect of Unary and Binary term\.

Table 7:Ablation of the data selection objective on WebArena\-Lite\. We isolate the unary importance term \(Φ\\Phi\) and the pairwise diversity term \(DD\) in our subset selection objective\.[Table7](https://arxiv.org/html/2605.20291#S3.T7)examines our data selection objective by isolating the unary importance termΦ\\Phiand the pairwise diversity termDD\. All variants fine\-tune Qwen2\.5\-Instruct\-7B under the same training setting for 4 epochs, with the only change of objective terms\. Selecting data using the unary term alone improves performance to 10\.9, while using the diversity term alone yields a smaller gain of 7\.9\. Combining both terms inWeaselachieves the best result at 14\.5 SR, indicating that importance and diversity provide complementary signals for constructing an effective training subset\.

#### Greedy Approximation Quality\.

As discussed in §[2\.3](https://arxiv.org/html/2605.20291#S2.SS3), the 2\-approximation guarantee for max\-sum diversification with metric distances does not directly apply to our objective, since our diversity termD​\(i,j\)D\(i,j\)is based on semantic pseudo\-distances and max\-composition, and therefore does not satisfy metric properties\. We therefore empirically evaluate how close the greedy solution is to the global optimum on NNetNav\. For each trajectory with length between 10 and 37, we enumerate all\(TT0\)\\binom\{T\}\{T\_\{0\}\}subsets withT0=3T\_\{0\}=3and compute the exact objective value in Eq\. \(1\)\. Across 1,877 trajectories, this yields up to\(373\)=7,770\\binom\{37\}\{3\}=7\{,\}770candidate subsets per trajectory\. The greedy solution matches the exact optimum in more than 96% of trajectories and falls within the top 1% of all candidate subsets in 99\.7% of trajectories\. The ratio between the greedy objective value and the optimal objective value is0\.9999±0\.00050\.9999\\pm 0\.0005\. Since the algorithm is deterministic given fixed scores and tie\-breaking, the selected subsets are also stable across repeated runs\. These results show that, despite the lack of a formal metric approximation guarantee, greedy selection is near\-optimal in practice for our importance\-diversity objective\.

#### Effect of Target\-centered Pruning\.

In[Figure5](https://arxiv.org/html/2605.20291#S3.F5), we further validate the effect of locality in our target\-centered pruning strategy \(§[2\.4](https://arxiv.org/html/2605.20291#S2.SS4)\)\. We shift the retained context away from the target indexkt∗k\_\{t\}^\{\*\}while keeping the token budget identical\. Concretely, for an offseto≥0o\\geq 0, we define

𝒦t\(o\)=\(\\displaystyle\\mathcal\{K\}\_\{t\}^\{\(o\)\}=\\Big\(\[kt∗−o−w,kt∗−o\]∪\{kt∗\}∪\\displaystyle\\big\[\\;k\_\{t\}^\{\*\}\-o\-w,\\;k\_\{t\}^\{\*\}\-o\\;\\big\]\\;\\cup\\;\\\{k\_\{t\}^\{\*\}\\\}\\;\\cup\\;\[kt∗\+o,kt∗\+o\+w\]\)∩\{1,…,Kt\},\\displaystyle\\big\[\\;k\_\{t\}^\{\*\}\+o,\\;k\_\{t\}^\{\*\}\+o\+w\\;\\big\]\\Big\)\\cap\\\{1,\\ldots,K\_\{t\}\\\},\(10\)and keepV~t\(o\)=\[vt,k:k∈𝒦t\(o\)\]\\tilde\{V\}\_\{t\}^\{\(o\)\}=\[\\,v\_\{t,k\}:k\\in\\mathcal\{K\}\_\{t\}^\{\(o\)\}\\,\], and report the success rate in[Figure5](https://arxiv.org/html/2605.20291#S3.F5)\. Asooincreases, the success rate decreases roughly linearly, with random pruning performing the worst\. This supports that AXTree elements near the target action are the most informative, and it motivates our design of target\-centered pruning\.

51020506070804466881010121211\.5%11\.5%10\.9%10\.9%10\.3%9\.1%7\.3%Padding sizeSuccess Rate \(%\)Figure 5:Success rate decreases as the pruning offset increases\. Results are reported on WebArena\-Lite\.
#### Transfer beyond AXTree\-based Web Agents\.

Although our main experiments focus on text\-based web agents with linearized AXTree observations, we further evaluate whether the selection component ofWeaseltransfers to a multimodal GUI\-agent setting\. We conduct an additional experiment on Android in the Wild \(AITW\)\(Rawleset al\.,[2023](https://arxiv.org/html/2605.20291#bib.bib4)\), where agents observe screenshots and execute mobile UI actions, without AXTree linearization or target\-centered AXTree pruning\. We keep the greedy trajectory\-selection algorithm unchanged and replace only the scoring modules with multimodal ones: for diversity, we compute state similarity using SigLIP2\-Large\-384\(Tschannenet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib3)\)screenshot embeddings, and for importance, we compute goal\-text/screenshot alignment using CLIP ViT\-L/14\-336\(Radfordet al\.,[2021](https://arxiv.org/html/2605.20291#bib.bib2)\)\. Starting from a 10K training pool constructed from the official AITW training split, we compare matched\-size 3\.1K subsets selected by uniform random sampling andWeasel\. Using Qwen2\.5\-VL\-3B\-Instruct as the base policy model,Weaselimproves accuracy on a held\-out 500\-example AITW test subset from 5\.8% with random selection to 6\.6%, compared to 4\.4% for the base model, as shown in[Table8](https://arxiv.org/html/2605.20291#S3.T8)\. These preliminary results suggest thatWeaselis not tied to AXTree\-based web states or text\-only inputs, although further exploration of multimodal scoring choices may yield stronger configurations for GUI agents\.

Table 8:Transfer ofWeaselto a multimodal GUI\-agent setting on Android in the Wild \(AITW\)\. We evaluate on a held\-out 500\-example test subset\.We further analyze the sensitivity ofWeaselto key hyperparameters, including the importance\-diversity trade\-offλ\\lambda, pruning window sizeww, and selection budgetT0T\_\{0\}, in[AppendixC](https://arxiv.org/html/2605.20291#A3)\.

## 4Related Work

#### Training Data and Environment for Web Agents\.

Early progress on LLM\-based web agents has been driven by training with online interaction and reinforcement learning\. WebRL\(Qiet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib49),[2025](https://arxiv.org/html/2605.20291#bib.bib42)\), TTI\(Shenet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib40)\), WebAgent\-R1\(Weiet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib41)\), and AutoWebGLM\(Laiet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib39)\)improve agent performance through interactive training and environment rollouts\. However, these approaches are often developed and evaluated in in\-benchmark settings, which may not fully reflect performance under distribution shift\.

More recently, large\-scale foundation datasets have enabled scaling supervision for web agent training\. AgentTrek\(Xuet al\.,[2025b](https://arxiv.org/html/2605.20291#bib.bib44)\)synthesizes large\-scale web agent trajectories from tutorial resources, while NNetNav\(Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45)\)collects broad supervision from real\-world browsing and retroactive labeling\. Despite this progress, agents trained on such data can still exhibit substantial performance drops in out\-of\-domain test settings when evaluated on websites and interaction patterns that differ from those seen during training\(Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45)\)\. Our work complements these efforts by treating out\-of\-domain transfer and training efficiency as first\-class goals of*data selection*, selecting a fixed\-budget subset that is both goal\-relevant and diverse to reduce redundancy and improve robustness under distribution shift\.

#### Data Selection and State Pruning for Web Agents\.

Selecting an informative subset of training data is a classic problem in machine learning, with coreset and data subset selection methods studied for efficiency and robustness\(Sener and Savarese,[2018](https://arxiv.org/html/2605.20291#bib.bib16); Mirzasoleimanet al\.,[2020](https://arxiv.org/html/2605.20291#bib.bib15); Killamsettyet al\.,[2021](https://arxiv.org/html/2605.20291#bib.bib14)\)\. Related ideas have also been explored for preference optimization of LLMs, where careful curation can reduce training cost while improving alignment\(Denget al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib13)\)\. Similar trends appear in instruction tuning and pretraining, where curated subsets or optimized data mixtures can match or improve performance at lower cost\(Xieet al\.,[2023](https://arxiv.org/html/2605.20291#bib.bib1); Bukharinet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib5)\)\.

To our knowledge, we proposeWeasel, the first principled subset selection method tailored to Web agent training, which improves out\-of\-domain generalization and training efficiency by jointly prioritizing goal\-relevant steps and promoting diversity among selected steps\. Several lines of work reduce web observation states primarily for test\-time efficiency or context limitations, for example via learned contextualization/summarization modules or LLM\-based retrieval over AXTree lines\(Leeet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib12); Kerbouaet al\.,[2025a](https://arxiv.org/html/2605.20291#bib.bib11),[b](https://arxiv.org/html/2605.20291#bib.bib10)\)\. Our target\-centered pruning instead targets training efficiency and trims states without introducing any additional modules or parameters\.

## 5Conclusion

We presentedWeasel, a data selection framework for compute\-efficient offline web agent training that explicitly targets out\-of\-domain transfer\.Weaselselects a fixed\-budget subset of trajectory steps by optimizing a simple objective that balances goal\-conditioned importance and pairwise diversity, solved efficiently with a greedy algorithm\. In addition, we introduced target\-centered AXTree pruning to further reduce redundant input context, and self\-reasoning synthesis to better fine\-tune reasoning\-native models\. Across multiple web agent benchmarks and model families,Weaselconsistently improves zero\-shot transfer performance under domain shift while substantially reducing training cost\. Notably, training with only 19% of the original training data achieves comparable or better performance than full\-data SFT, while delivering roughly 9\.7\-12\.5×\\timesspeed\-ups, making offline Web agent training more practical at scale\. More broadly, our results suggest that careful step\-level curation and lightweight observation pruning can be complementary to scaling data, enabling stronger generalization without requiring additional modules or complex test\-time components\.

## Impact Statement

Our work makes offline training of web agents more practical by reducing the amount of redundant supervision needed to achieve strong transfer to unseen websites and interaction patterns\. By selecting a small but informative subset of trajectory steps and pruning irrelevant state context,Weaselcan substantially lower compute and energy costs for training and iteration, which may help broaden access to web agent research beyond groups with large training budgets\.

At the same time, improving web agent capability can increase the risk of misuse \(e\.g\., automating spam, scraping, or unauthorized actions on websites\)\. We encourage responsible release practices, including clear usage policies, rate limits, and safety evaluations on harmful or policy violating tasks, and we recommend deploying agents with safeguards such as action constraints and human oversight for high stakes\.

## Acknowledgements

This work was financially supported by Institute of Information & Communications Technology Planning & Evaluation \(IITP\) grant funded by the Korea government \(MSIT\) \(No\. RS\-2019\-II191082, SW StarLab, No\. RS\-2022\-II220156, Fundamental research on continual meta\-learning for quality enhancement of casual videos and their 3D metaverse transformation, No\. RS\-2025\-25442338, AI star Fellowship Support Program\(Seoul National Univ\.\) and No\. RS\-2021\-II211343, Artificial Intelligence Graduate School Program \(Seoul National University\)\) and the InnoCORE program of the Ministry of Science and ICT \(N10250156\)\. Xing Han Lù acknowledges the support of the Natural Sciences and Engineering Research Council of Canada \(NSERC\) \[funding reference no\. 579403\]\. Gunhee Kim is the corresponding author\.

## References

- A\. Borodin, A\. Jain, H\. C\. Lee, and Y\. Ye \(2017\)Max\-sum diversification, monotone submodular functions, and dynamic updates\.ACM Transactions on Algorithms \(TALG\)13\(3\),pp\. 1–25\.Cited by:[§2\.3](https://arxiv.org/html/2605.20291#S2.SS3.p1.3)\.
- A\. Bukharin, S\. Li, Z\. Wang, J\. Yang, B\. Yin, X\. Li, C\. Zhang, T\. Zhao, and H\. Jiang \(2024\)Data diversity matters for robust instruction tuning\.InFindings of the Association for Computational Linguistics: EMNLP 2024,Y\. Al\-Onaizan, M\. Bansal, and Y\. Chen \(Eds\.\),Miami, Florida, USA,pp\. 3411–3425\.External Links:[Document](https://dx.doi.org/10.18653/v1/2024.findings-emnlp.195)Cited by:[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p1.1)\.
- H\. W\. Chung, L\. Hou, S\. Longpre, B\. Zoph, Y\. Tay, W\. Fedus, E\. Li, X\. Wang, M\. Dehghani, S\. Brahma, A\. Webson, S\. S\. Gu, Z\. Dai, M\. Suzgun, X\. Chen, A\. Chowdhery, S\. Narang, G\. Mishra, A\. Yu, V\. Zhao, Y\. Huang, A\. Dai, H\. Yu, S\. Petrov, E\. H\. Chi, J\. Dean, J\. Devlin, A\. Roberts, D\. Zhou, Q\. V\. Le, and J\. Wei \(2022\)Scaling instruction\-finetuned language models\.arXiv\.External Links:[Document](https://dx.doi.org/10.48550/ARXIV.2210.11416)Cited by:[§3\.3](https://arxiv.org/html/2605.20291#S3.SS3.SSS0.Px1.p1.2)\.
- T\. L\. S\. de Chezelles, M\. Gasse, A\. Lacoste, M\. Caccia, A\. Drouin, L\. Boisvert, M\. Thakkar, T\. Marty, R\. Assouel, S\. O\. Shayegan, L\. K\. Jang, X\. H\. Lù, O\. Yoran, D\. Kong, F\. F\. Xu, S\. Reddy, G\. Neubig, Q\. Cappart, R\. Salakhutdinov, and N\. Chapados \(2025\)The browsergym ecosystem for web agent research\.Transactions on Machine Learning Research\.Note:Expert CertificationExternal Links:ISSN 2835\-8856Cited by:[§F\.2](https://arxiv.org/html/2605.20291#A6.SS2.p1.1),[§2\.1](https://arxiv.org/html/2605.20291#S2.SS1.SSS0.Px2.p1.5),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px2.p1.1)\.
- DeepSeek\-AI \(2025\)DeepSeek\-r1: incentivizing reasoning capability in llms via reinforcement learning\.External Links:2501\.12948Cited by:[§2\.5](https://arxiv.org/html/2605.20291#S2.SS5.p1.1)\.
- X\. Deng, Y\. Gu, B\. Zheng, S\. Chen, S\. Stevens, B\. Wang, H\. Sun, and Y\. Su \(2023\)Mind2Web: towards a generalist agent for the web\.External Links:2306\.06070Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p5.1),[§2\.4](https://arxiv.org/html/2605.20291#S2.SS4.p1.1)\.
- X\. Deng, H\. Zhong, R\. Ai, F\. Feng, Z\. Wang, and X\. He \(2025\)Less is more: improving llm alignment via preference data selection\.External Links:2502\.14560Cited by:[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p1.1)\.
- A\. Drouin, M\. Gasse, M\. Caccia, I\. H\. Laradji, M\. Del Verme, T\. Marty, D\. Vazquez, N\. Chapados, and A\. Lacoste \(2024a\)WorkArena: how capable are web agents at solving common knowledge work tasks?\.InProceedings of the 41st International Conference on Machine Learning,R\. Salakhutdinov, Z\. Kolter, K\. Heller, A\. Weller, N\. Oliver, J\. Scarlett, and F\. Berkenkamp \(Eds\.\),Proceedings of Machine Learning Research, Vol\.235,pp\. 11642–11662\.Cited by:[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px2.p1.1)\.
- A\. Drouin, M\. Gasse, M\. Caccia, I\. H\. Laradji, M\. D\. Verme, T\. Marty, L\. Boisvert, M\. Thakkar, Q\. Cappart, D\. Vazquez, N\. Chapados, and A\. Lacoste \(2024b\)WorkArena: how capable are web agents at solving common knowledge work tasks?\.External Links:2403\.07718Cited by:[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- M\. R\. Garey and D\. S\. Johnson \(2002\)Computers and intractability\.Vol\.29,wh freeman New York\.Cited by:[§2\.3](https://arxiv.org/html/2605.20291#S2.SS3.p1.3)\.
- E\. J\. Hu, Y\. Shen, P\. Wallis, Z\. Allen\-Zhu, Y\. Li, S\. Wang, L\. Wang, and W\. Chen \(2021\)LoRA: low\-rank adaptation of large language models\.External Links:2106\.09685Cited by:[Appendix A](https://arxiv.org/html/2605.20291#A1.p1.1)\.
- I\. Kerboua, S\. O\. Shayegan, M\. Thakkar, X\. H\. Lù, L\. Boisvert, M\. Caccia, J\. Espinas, A\. Aussem, V\. Eglin, and A\. Lacoste \(2025a\)FocusAgent: simple yet effective ways of trimming the large context of web agents\.External Links:2510\.03204Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p5.1),[§2\.4](https://arxiv.org/html/2605.20291#S2.SS4.p1.1),[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p2.1)\.
- I\. Kerboua, S\. O\. Shayegan, M\. Thakkar, X\. H\. Lù, M\. Caccia, V\. Eglin, A\. Aussem, J\. Espinas, and A\. Lacoste \(2025b\)LineRetriever: planning\-aware observation reduction for web agents\.External Links:2507\.00210Cited by:[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p2.1)\.
- K\. Killamsetty, D\. Sivasubramanian, G\. Ramakrishnan, and R\. Iyer \(2021\)GLISTER: generalization based data subset selection for efficient and robust learning\.External Links:2012\.10630Cited by:[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p1.1)\.
- H\. Lai, X\. Liu, I\. L\. Iong, S\. Yao, Y\. Chen, P\. Shen, H\. Yu, H\. Zhang, X\. Zhang, Y\. Dong, and J\. Tang \(2024\)AutoWebGLM: a large language model\-based web navigating agent\.External Links:2404\.03648Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p2.1),[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px1.p1.1)\.
- P\. Langley \(2000\)Crafting papers on machine learning\.InProceedings of the 17th International Conference on Machine Learning \(ICML 2000\),P\. Langley \(Ed\.\),Stanford, CA,pp\. 1207–1216\.Cited by:[Appendix G](https://arxiv.org/html/2605.20291#A7.p5.1)\.
- D\. Lee, J\. Lee, K\. Kim, J\. Tack, J\. Shin, Y\. W\. Teh, and K\. Lee \(2025\)Learning to contextualize web pages for enhanced decision making by llm agents\.External Links:2503\.10689Cited by:[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p2.1)\.
- E\. Z\. Liu, K\. Guu, P\. Pasupat, T\. Shi, and P\. Liang \(2018\)Reinforcement learning on web interfaces using workflow\-guided exploration\.External Links:1802\.08802Cited by:[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px2.p1.1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- J\. Liu, J\. Hao, C\. Zhang, and Z\. Hu \(2025\)Wepo: web element preference optimization for llm\-based web navigation\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.39,pp\. 26614–26622\.Cited by:[§2\.4](https://arxiv.org/html/2605.20291#S2.SS4.p1.1)\.
- X\. Liu, H\. Yu, H\. Zhang, Y\. Xu, X\. Lei, H\. Lai, Y\. Gu, H\. Ding, K\. Men, K\. Yang, S\. Zhang, X\. Deng, A\. Zeng, Z\. Du, C\. Zhang, S\. Shen, T\. Zhang, Y\. Su, H\. Sun, M\. Huang, Y\. Dong, and J\. Tang \(2023\)AgentBench: evaluating llms as agents\.External Links:2308\.03688Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p1.1)\.
- X\. Liu, T\. Zhang, Y\. Gu, I\. L\. Iong, Y\. Xu, X\. Song, S\. Zhang, H\. Lai, X\. Liu, H\. Zhao, J\. Sun, X\. Yang, Y\. Yang, Z\. Qi, S\. Yao, X\. Sun, S\. Cheng, Q\. Zheng, H\. Yu, H\. Zhang, W\. Hong, M\. Ding, L\. Pan, X\. Gu, A\. Zeng, Z\. Du, C\. H\. Song, Y\. Su, Y\. Dong, and J\. Tang \(2024\)VisualAgentBench: towards large multimodal models as visual foundation agents\.External Links:2408\.06327Cited by:[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px2.p1.1),[§3\.3](https://arxiv.org/html/2605.20291#S3.SS3.SSS0.Px1.p1.2),[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- Y\. Liu, M\. Ott, N\. Goyal, J\. Du, M\. Joshi, D\. Chen, O\. Levy, M\. Lewis, L\. Zettlemoyer, and V\. Stoyanov \(2019\)RoBERTa: A robustly optimized BERT pretraining approach\.CoRRabs/1907\.11692\.External Links:1907\.11692Cited by:[Appendix A](https://arxiv.org/html/2605.20291#A1.p1.1),[Appendix B](https://arxiv.org/html/2605.20291#A2.p1.2)\.
- X\. H\. Lù, Z\. Kasner, and S\. Reddy \(2024\)Weblinx: real\-world website navigation with multi\-turn dialogue\.arXiv preprint arXiv:2402\.05930\.Cited by:[§2\.4](https://arxiv.org/html/2605.20291#S2.SS4.p1.1)\.
- B\. Mirzasoleiman, J\. Bilmes, and J\. Leskovec \(2020\)Coresets for data\-efficient training of machine learning models\.External Links:1906\.01827Cited by:[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p1.1)\.
- S\. Murty, H\. Zhu, D\. Bahdanau, and C\. D\. Manning \(2025\)NNetNav: unsupervised learning of browser agents through environment interaction in the wild\.External Links:2410\.02907Cited by:[Appendix A](https://arxiv.org/html/2605.20291#A1.p1.1),[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[§1](https://arxiv.org/html/2605.20291#S1.p1.1),[§1](https://arxiv.org/html/2605.20291#S1.p2.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px1.p1.1),[§3\.2](https://arxiv.org/html/2605.20291#S3.SS2.p2.1),[Table 2](https://arxiv.org/html/2605.20291#S3.T2),[Table 2](https://arxiv.org/html/2605.20291#S3.T2.7.2),[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px1.p2.1)\.
- H\. Nekoei, A\. Jaiswal, P\. Bechard, O\. Shliazhko, O\. M\. Ayala, M\. Reymond, M\. Caccia, A\. Drouin, S\. Chandar, and A\. Lacoste \(2025\)Just\-in\-time episodic feedback hinter: leveraging offline knowledge to improve llm agents adaptation\.External Links:2510\.04373Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p3.1)\.
- T\. Ou, F\. F\. Xu, A\. Madaan, J\. Liu, R\. Lo, A\. Sridhar, S\. Sengupta, D\. Roth, G\. Neubig, and S\. Zhou \(2024\)Synatra: turning indirect knowledge into direct demonstrations for digital agents at scale\.External Links:2409\.15637Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p1.1)\.
- Z\. Qi, X\. Liu, I\. L\. Iong, H\. Lai, X\. Sun, W\. Zhao, Y\. Yang, X\. Yang, J\. Sun, S\. Yao,et al\.\(2024\)Webrl: training llm web agents via self\-evolving online curriculum reinforcement learning\.arXiv preprint arXiv:2411\.02337\.Cited by:[Figure 1](https://arxiv.org/html/2605.20291#S0.F1),[Figure 1](https://arxiv.org/html/2605.20291#S0.F1.2.1),[§1](https://arxiv.org/html/2605.20291#S1.p1.1),[§1](https://arxiv.org/html/2605.20291#S1.p2.1),[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px1.p1.1)\.
- Z\. Qi, X\. Liu, I\. L\. Iong, H\. Lai, X\. Sun, W\. Zhao, Y\. Yang, X\. Yang, J\. Sun, S\. Yao, T\. Zhang, W\. Xu, J\. Tang, and Y\. Dong \(2025\)WebRL: training llm web agents via self\-evolving online curriculum reinforcement learning\.External Links:2411\.02337Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p1.1),[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px1.p1.1)\.
- Qwen, :, A\. Yang, B\. Yang, B\. Zhang, B\. Hui, B\. Zheng, B\. Yu, C\. Li, D\. Liu, F\. Huang, H\. Wei, H\. Lin, J\. Yang, J\. Tu, J\. Zhang, J\. Yang, J\. Yang, J\. Zhou, J\. Lin, K\. Dang, K\. Lu, K\. Bao, K\. Yang, L\. Yu, M\. Li, M\. Xue, P\. Zhang, Q\. Zhu, R\. Men, R\. Lin, T\. Li, T\. Tang, T\. Xia, X\. Ren, X\. Ren, Y\. Fan, Y\. Su, Y\. Zhang, Y\. Wan, Y\. Liu, Z\. Cui, Z\. Zhang, and Z\. Qiu \(2025\)Qwen2\.5 technical report\.External Links:2412\.15115Cited by:[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px1.p1.1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- A\. Radford, J\. W\. Kim, C\. Hallacy, A\. Ramesh, G\. Goh, S\. Agarwal, G\. Sastry, A\. Askell, P\. Mishkin, J\. Clark, G\. Krueger, and I\. Sutskever \(2021\)Learning transferable visual models from natural language supervision\.External Links:2103\.00020Cited by:[§3\.3](https://arxiv.org/html/2605.20291#S3.SS3.SSS0.Px6.p1.1)\.
- C\. Rawles, A\. Li, D\. Rodriguez, O\. Riva, and T\. Lillicrap \(2023\)Android in the wild: a large\-scale dataset for android device control\.External Links:2307\.10088Cited by:[§3\.3](https://arxiv.org/html/2605.20291#S3.SS3.SSS0.Px6.p1.1)\.
- O\. Sener and S\. Savarese \(2018\)Active learning for convolutional neural networks: a core\-set approach\.External Links:1708\.00489Cited by:[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p1.1)\.
- J\. Shen, H\. Bai, L\. Zhang, Y\. Zhou, A\. Setlur, S\. Tong, D\. Caples, N\. Jiang, T\. Zhang, A\. Talwalkar, and A\. Kumar \(2025\)Thinking vs\. doing: agents that reason by scaling test\-time interaction\.External Links:2506\.07976Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p2.1),[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px1.p1.1)\.
- T\. Shi, A\. Karpathy, L\. Fan, J\. Hernandez, and P\. Liang \(2017\)World of bits: an open\-domain platform for web\-based agents\.InProceedings of the 34th International Conference on Machine Learning,D\. Precup and Y\. W\. Teh \(Eds\.\),Proceedings of Machine Learning Research, Vol\.70,pp\. 3135–3144\.Cited by:[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px2.p1.1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- J\. Tan, Z\. Dou, W\. Wang, M\. Wang, W\. Chen, and J\. Wen \(2025\)Htmlrag: html is better than plain text for modeling retrieved knowledge in rag systems\.InProceedings of the ACM on Web Conference 2025,pp\. 1733–1746\.Cited by:[§3\.2](https://arxiv.org/html/2605.20291#S3.SS2.SSS0.Px1.p1.2),[Table 3](https://arxiv.org/html/2605.20291#S3.T3.3.3.3.3.3.2)\.
- G\. Team, A\. Kamath, J\. Ferret, S\. Pathak, N\. Vieillard, R\. Merhej, S\. Perrin, T\. Matejovicova, A\. Ramé, M\. Rivière, L\. Rouillard, T\. Mesnard, G\. Cideron, J\. Grill, S\. Ramos, E\. Yvinec, M\. Casbon, E\. Pot, I\. Penchev, G\. Liu, F\. Visin, K\. Kenealy, L\. Beyer, X\. Zhai, A\. Tsitsulin, R\. Busa\-Fekete, A\. Feng, N\. Sachdeva, B\. Coleman, Y\. Gao, B\. Mustafa, I\. Barr, E\. Parisotto, D\. Tian, M\. Eyal, C\. Cherry, J\. Peter, D\. Sinopalnikov, S\. Bhupatiraju, R\. Agarwal, M\. Kazemi, D\. Malkin, R\. Kumar, D\. Vilar, I\. Brusilovsky, J\. Luo, A\. Steiner, A\. Friesen, A\. Sharma, A\. Sharma, A\. M\. Gilady, A\. Goedeckemeyer, A\. Saade, A\. Feng, A\. Kolesnikov, A\. Bendebury, A\. Abdagic, A\. Vadi, A\. György, A\. S\. Pinto, A\. Das, A\. Bapna, A\. Miech, A\. Yang, A\. Paterson, A\. Shenoy, A\. Chakrabarti, B\. Piot, B\. Wu, B\. Shahriari, B\. Petrini, C\. Chen, C\. L\. Lan, C\. A\. Choquette\-Choo, C\. Carey, C\. Brick, D\. Deutsch, D\. Eisenbud, D\. Cattle, D\. Cheng, D\. Paparas, D\. S\. Sreepathihalli, D\. Reid, D\. Tran, D\. Zelle, E\. Noland, E\. Huizenga, E\. Kharitonov, F\. Liu, G\. Amirkhanyan, G\. Cameron, H\. Hashemi, H\. Klimczak\-Plucińska, H\. Singh, H\. Mehta, H\. T\. Lehri, H\. Hazimeh, I\. Ballantyne, I\. Szpektor, I\. Nardini, J\. Pouget\-Abadie, J\. Chan, J\. Stanton, J\. Wieting, J\. Lai, J\. Orbay, J\. Fernandez, J\. Newlan, J\. Ji, J\. Singh, K\. Black, K\. Yu, K\. Hui, K\. Vodrahalli, K\. Greff, L\. Qiu, M\. Valentine, M\. Coelho, M\. Ritter, M\. Hoffman, M\. Watson, M\. Chaturvedi, M\. Moynihan, M\. Ma, N\. Babar, N\. Noy, N\. Byrd, N\. Roy, N\. Momchev, N\. Chauhan, N\. Sachdeva, O\. Bunyan, P\. Botarda, P\. Caron, P\. K\. Rubenstein, P\. Culliton, P\. Schmid, P\. G\. Sessa, P\. Xu, P\. Stanczyk, P\. Tafti, R\. Shivanna, R\. Wu, R\. Pan, R\. Rokni, R\. Willoughby, R\. Vallu, R\. Mullins, S\. Jerome, S\. Smoot, S\. Girgin, S\. Iqbal, S\. Reddy, S\. Sheth, S\. Põder, S\. Bhatnagar, S\. R\. Panyam, S\. Eiger, S\. Zhang, T\. Liu, T\. Yacovone, T\. Liechty, U\. Kalra, U\. Evci, V\. Misra, V\. Roseberry, V\. Feinberg, V\. Kolesnikov, W\. Han, W\. Kwon, X\. Chen, Y\. Chow, Y\. Zhu, Z\. Wei, Z\. Egyed, V\. Cotruta, M\. Giang, P\. Kirk, A\. Rao, K\. Black, N\. Babar, J\. Lo, E\. Moreira, L\. G\. Martins, O\. Sanseviero, L\. Gonzalez, Z\. Gleicher, T\. Warkentin, V\. Mirrokni, E\. Senter, E\. Collins, J\. Barral, Z\. Ghahramani, R\. Hadsell, Y\. Matias, D\. Sculley, S\. Petrov, N\. Fiedel, N\. Shazeer, O\. Vinyals, J\. Dean, D\. Hassabis, K\. Kavukcuoglu, C\. Farabet, E\. Buchatskaya, J\. Alayrac, R\. Anil, Dmitry, Lepikhin, S\. Borgeaud, O\. Bachem, A\. Joulin, A\. Andreev, C\. Hardin, R\. Dadashi, and L\. Hussenot \(2025\)Gemma 3 technical report\.External Links:2503\.19786Cited by:[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px1.p1.1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- Q\. Team \(2025\)Qwen3 technical report\.External Links:2505\.09388Cited by:[Figure 1](https://arxiv.org/html/2605.20291#S0.F1),[Figure 1](https://arxiv.org/html/2605.20291#S0.F1.2.1),[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[§2\.5](https://arxiv.org/html/2605.20291#S2.SS5.p1.1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- M\. Tschannen, A\. Gritsenko, X\. Wang, M\. F\. Naeem, I\. Alabdulmohsin, N\. Parthasarathy, T\. Evans, L\. Beyer, Y\. Xia, B\. Mustafa, O\. Hénaff, J\. Harmsen, A\. Steiner, and X\. Zhai \(2025\)SigLIP 2: multilingual vision\-language encoders with improved semantic understanding, localization, and dense features\.External Links:2502\.14786Cited by:[§3\.3](https://arxiv.org/html/2605.20291#S3.SS3.SSS0.Px6.p1.1)\.
- G\. Wang, Y\. Xie, Y\. Jiang, A\. Mandlekar, C\. Xiao, Y\. Zhu, L\. Fan, and A\. Anandkumar \(2023\)Voyager: an open\-ended embodied agent with large language models\.External Links:2305\.16291Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p1.1)\.
- Z\. Wei, W\. Yao, Y\. Liu, W\. Zhang, Q\. Lu, L\. Qiu, C\. Yu, P\. Xu, C\. Zhang, B\. Yin, H\. Yun, and L\. Li \(2025\)WebAgent\-r1: training web agents via end\-to\-end multi\-turn reinforcement learning\.External Links:2505\.16421Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p1.1),[§1](https://arxiv.org/html/2605.20291#S1.p2.1),[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px1.p1.1)\.
- S\. M\. Xie, H\. Pham, X\. Dong, N\. Du, H\. Liu, Y\. Lu, P\. Liang, Q\. V\. Le, T\. Ma, and A\. W\. Yu \(2023\)DoReMi: optimizing data mixtures speeds up language model pretraining\.External Links:2305\.10429Cited by:[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px2.p1.1)\.
- R\. Xu, K\. Ma, W\. Yu, H\. Zhang, J\. C\. Ho, C\. Yang, and D\. Yu \(2025a\)Retrieval\-augmented gui agents with generative guidelines\.External Links:2509\.24183Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p3.1)\.
- Y\. Xu, D\. Lu, Z\. Shen, J\. Wang, Z\. Wang, Y\. Mao, C\. Xiong, and T\. Yu \(2024\)Agenttrek: agent trajectory synthesis via guiding replay with web tutorials\.arXiv preprint arXiv:2412\.09605\.Cited by:[Appendix A](https://arxiv.org/html/2605.20291#A1.p1.1),[Figure 1](https://arxiv.org/html/2605.20291#S0.F1),[Figure 1](https://arxiv.org/html/2605.20291#S0.F1.2.1),[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[Figure 3](https://arxiv.org/html/2605.20291#S2.F3),[Figure 3](https://arxiv.org/html/2605.20291#S2.F3.3.2),[§2\.2](https://arxiv.org/html/2605.20291#S2.SS2.p1.1),[§2\.4](https://arxiv.org/html/2605.20291#S2.SS4.p1.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px1.p1.1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- Y\. Xu, D\. Lu, Z\. Shen, J\. Wang, Z\. Wang, Y\. Mao, C\. Xiong, and T\. Yu \(2025b\)AgentTrek: agent trajectory synthesis via guiding replay with web tutorials\.External Links:2412\.09605Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p1.1),[§4](https://arxiv.org/html/2605.20291#S4.SS0.SSS0.Px1.p2.1)\.
- A\. Yang, A\. Li, B\. Yang, B\. Zhang, B\. Hui, B\. Zheng, B\. Yu, C\. Gao, C\. Huang, C\. Lv, C\. Zheng, D\. Liu, F\. Zhou, F\. Huang, F\. Hu, H\. Ge, H\. Wei, H\. Lin, J\. Tang, J\. Yang, J\. Tu, J\. Zhang, J\. Yang, J\. Yang, J\. Zhou, J\. Zhou, J\. Lin, K\. Dang, K\. Bao, K\. Yang, L\. Yu, L\. Deng, M\. Li, M\. Xue, M\. Li, P\. Zhang, P\. Wang, Q\. Zhu, R\. Men, R\. Gao, S\. Liu, S\. Luo, T\. Li, T\. Tang, W\. Yin, X\. Ren, X\. Wang, X\. Zhang, X\. Ren, Y\. Fan, Y\. Su, Y\. Zhang, Y\. Zhang, Y\. Wan, Y\. Liu, Z\. Wang, Z\. Cui, Z\. Zhang, Z\. Zhou, and Z\. Qiu \(2025\)Qwen3 technical report\.External Links:2505\.09388Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p6.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px1.p1.1)\.
- E\. Zelikman, Y\. Wu, J\. Mu, and N\. Goodman \(2022\)STaR: bootstrapping reasoning with reasoning\.InAdvances in Neural Information Processing Systems,S\. Koyejo, S\. Mohamed, A\. Agarwal, D\. Belgrave, K\. Cho, and A\. Oh \(Eds\.\),Vol\.35,pp\. 15476–15488\.Cited by:[§2\.5](https://arxiv.org/html/2605.20291#S2.SS5.p2.2)\.
- T\. Zhang, V\. Kishore, F\. Wu, K\. Q\. Weinberger, and Y\. Artzi \(2020\)BERTScore: evaluating text generation with bert\.External Links:1904\.09675Cited by:[Appendix G](https://arxiv.org/html/2605.20291#A7.p2.1),[§2\.2](https://arxiv.org/html/2605.20291#S2.SS2.p3.5)\.
- Y\. Zhang, M\. Li, D\. Long, X\. Zhang, H\. Lin, B\. Yang, P\. Xie, A\. Yang, D\. Liu, J\. Lin, F\. Huang, and J\. Zhou \(2025\)Qwen3 embedding: advancing text embedding and reranking through foundation models\.arXiv preprint arXiv:2506\.05176\.Cited by:[Appendix B](https://arxiv.org/html/2605.20291#A2.p1.2)\.
- L\. Zheng, W\. Chiang, Y\. Sheng, S\. Zhuang, Z\. Wu, Y\. Zhuang, Z\. Lin, Z\. Li, D\. Li, E\. P\. Xing, H\. Zhang, J\. E\. Gonzalez, and I\. Stoica \(2023\)Judging llm\-as\-a\-judge with mt\-bench and chatbot arena\.External Links:2306\.05685Cited by:[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px1.p1.1)\.
- S\. Zhou, F\. F\. Xu, H\. Zhu, X\. Zhou, R\. Lo, A\. Sridhar, X\. Cheng, T\. Ou, Y\. Bisk, D\. Fried, U\. Alon, and G\. Neubig \(2024a\)WebArena: a realistic web environment for building autonomous agents\.External Links:2307\.13854Cited by:[2nd item](https://arxiv.org/html/2605.20291#S1.I1.i2.p1.1),[§1](https://arxiv.org/html/2605.20291#S1.p1.1),[§3\.1](https://arxiv.org/html/2605.20291#S3.SS1.SSS0.Px2.p1.1),[§3\.3](https://arxiv.org/html/2605.20291#S3.SS3.SSS0.Px1.p1.2),[Table 1](https://arxiv.org/html/2605.20291#S3.T1),[Table 1](https://arxiv.org/html/2605.20291#S3.T1.18.2)\.
- Y\. Zhou, Q\. Yang, K\. Lin, M\. Bai, X\. Zhou, Y\. Wang, S\. Levine, and E\. Li \(2024b\)Proposer\-agent\-evaluator\(pae\): autonomous skill discovery for foundation model internet agents\.External Links:2412\.13194Cited by:[§1](https://arxiv.org/html/2605.20291#S1.p2.1)\.

## Appendix AExperimental Details

Training setup and hyperparametersWe report the hyperparameters for trainingWeaselin[Table9](https://arxiv.org/html/2605.20291#A1.T9)\. We fine\-tune base models with LoRA\(Huet al\.,[2021](https://arxiv.org/html/2605.20291#bib.bib9)\)adapter with the configuration in[Table9](https://arxiv.org/html/2605.20291#A1.T9)\. For computing BERTScore similarities used inWeasel, we use roberta\-large\(Liuet al\.,[2019](https://arxiv.org/html/2605.20291#bib.bib17)\)as the encoder\. After applyingWeaselwithT0=3T\_\{0\}=3to each dataset \(AgentTrek and NNetNav\-Live\), we obtain 12K selected datapoints from AgentTrek\(Xuet al\.,[2024](https://arxiv.org/html/2605.20291#bib.bib59)\)and 16K from NNetNav\-Live\(Murtyet al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib45)\); for consistency across datasets, we uniformly sample 10K datapoints from each for training\.

Table 9:Training hyperparameters for fine\-tuning Qwen2\.5\-7B\-Instruct, Gemma3\-4B\-IT, and Qwen3\-8B on AgentTrek\.
## Appendix BAlternative Similarity Model forΦ\\PhiandDD

[Table10](https://arxiv.org/html/2605.20291#A2.T10)evaluates how the choice of similarity encoder affectsWeaselby replacing BERTScore with a learned embedding model for computing bothΦ\\PhiandDD\. Under the same 10K\-step training budget and identical hyperparameters, the embedding\-based variant Qwen3\-Embedding\-0\.6B and Qwen3\-Embedding\-4B\(Zhanget al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib6)\)still substantially outperforms the SFT baseline with random subsampling, indicating thatWeaselis not sensitive to the similarity implementation, and the gains are robust\. In our experiments, BERTScore with roberta\-large\(Liuet al\.,[2019](https://arxiv.org/html/2605.20291#bib.bib17)\)is the default in the main results\.

Table 10:Effect of the similarity model used inWeaselfor computingΦ\\PhiandDDon WebArena\-Lite\. All 10K runs use the same training hyperparameters; only the similarity encoder is changed\.
## Appendix CHyperparameter Sensitivity

We analyze the sensitivity ofWeaselto key design hyperparameters, including the importance\-diversity trade\-offλ\\lambda, the pruning window sizeww, and the selection budgetT0T\_\{0\}\. In the main experiments, we useλ=1\\lambda=1,w=60w=60, andT0=3T\_\{0\}=3\. We additionally evaluate alternative settings by varyingλ\\lambda, changing the pruning window size, and selecting different numbers of steps per trajectory, whereTTdenotes the trajectory length\.

As shown in[Table11](https://arxiv.org/html/2605.20291#A3.T11),Weaselconsistently outperforms the standard baselines across a broad range of hyperparameter choices\. Although the default setting achieves the best overall performance, the gains remain robust under different trade\-off weights, pruning windows, and selection budgets\. These results indicate thatWeaselis not overly sensitive to these design choices\.

Table 11:Sensitivity ofWeaselto key hyperparameters on WebArena\-Lite\. We vary the importance\-diversity trade\-offλ\\lambda, pruning window sizeww, and selection budgetT0T\_\{0\}\.
## Appendix DAdditional Filtering Baselines

Table 12:Comparison with simple filtering baselines on WebArena\-Lite\. All SFT variants use 10K selected datapoints from AgentTrek\.MethodWebArena\-LiteQwen2\.5\-7B\-Instruct5\.5SFT \(Random, 10K\)9\.1SFT \(LLM\-as\-Judge, 10K\)8\.5SFT \(Length\-sorted indices 5K–15K\)5\.5SFT \(Length\-sorted indices 35K–45K\)10\.9Weasel\(10K\)14\.5We further compareWeaselwith simple filtering heuristics that do not use our importance\-diversity objective\. In addition to uniform random subsampling and LLM\-as\-judge filtering, we evaluate two length\-based filtering baselines, motivated by curriculum\-style selection where trajectory length is used as a proxy for difficulty\. Specifically, we sort the AgentTrek dataset by trajectory length and retain datapoints whose sorted indices fall within a fixed range\. We consider indices 5K–15K and 35K–45K, yielding 10K datapoints in each case\.

As shown in[Table12](https://arxiv.org/html/2605.20291#A4.T12), length\-based filtering improves over some simple baselines when selecting later, longer trajectories, but still underperformsWeasel\. This suggests that trajectory length alone is not sufficient for selecting transferable supervision; balancing goal relevance with diversity provides a stronger signal for out\-of\-domain generalization\.

## Appendix EPreprocessing Cost

Weaselincurs a one\-time preprocessing cost before training, after which the selected subset can be reused across training runs without additional selection overhead\. On the full AgentTrek dataset, the preprocessing pipeline takes 7\.7 hours using RTX 6000 GPUs, including importance computation, diversity computation, greedy subset selection, and reasoning synthesis\. This cost is substantially smaller than full\-data SFT, which takes 136 hours on 4 RTX 6000 GPUs, while enabling the training speedups reported in[Table1](https://arxiv.org/html/2605.20291#S3.T1)\. As shown in[Table13](https://arxiv.org/html/2605.20291#A5.T13), the main preprocessing cost comes from reasoning synthesis, whereas importance\-diversity scoring and greedy selection are relatively lightweight\.

Table 13:Cost breakdown of theWeaselpreprocessing pipeline on the full AgentTrek dataset\. Preprocessing is a one\-time cost; the selected subset can be reused for multiple training runs\.
## Appendix FPrompt Used for Experiments

### F\.1LLM\-as\-a\-Judge Experiment Details

We use the following prompt to score each datapoint for the LLM\-as\-a\-judge filtering step\. For generation, we set the sampling parameters to temperature of 0\.0 and top\-ppof 0\.9\. After generating a score, we group datapoints by their assigned score and construct the final set by sampling equally from scores 4 and 5, yielding 10K datapoints in total\.

Prompt for LLM\-as\-a\-Judge[⬇](data:text/plain;base64,WW91IGFyZSBldmFsdWF0aW5nIGhvdyB1c2VmdWwgYSBzaW5nbGUgc3RhdGUtYWN0aW9uIHN0ZXAgaXMgZm9yIHNvbHZpbmcgYSB3ZWIgdGFzay4KClRhc2sgZ29hbDoKe0dPQUx9CgpTdGF0ZSArIGFjdGlvbiBkZXNjcmlwdGlvbiAoQVhUcmVlICsgaGlzdG9yeSArIGFzc2lzdGFudCBvdXRwdXQpOgp7U1RBVEVfQkxPQ0t9CgpPbiBhIHNjYWxlIGZyb20gMSB0byA1LCB3aGVyZQotIDEgPSBub3QgaGVscGZ1bCBhdCBhbGwgZm9yIGFjaGlldmluZyB0aGUgZ29hbCwKLSAyID0gc2xpZ2h0bHkgaGVscGZ1bCBidXQgbm90IGNyaXRpY2FsLAotIDMgPSBzb21ld2hhdCBoZWxwZnVsIGJ1dCBub3QgY3JpdGljYWwsCi0gNCA9IGhlbHBmdWwgYW5kIGNyaXRpY2FsLAotIDUgPSB2ZXJ5IGhlbHBmdWwgb3IgZGlyZWN0bHkgY3J1Y2lhbCwKcmF0ZSBob3cgbXVjaCB0aGlzIHN0ZXAgaGVscHMgdG8gc29sdmUgdGhlIGdvYWwuCgpQcm92aWRlIDItMyBjb25jaXNlIHNlbnRlbmNlcyBvZiByZWFzb25pbmcgdGhhdCBjaXRlIHNwZWNpZmljIG9ic2VydmF0aW9ucy9hY3Rpb25zLgpFbmQgd2l0aCBhIGxpbmUgZXhhY3RseSBsaWtlOgpTY29yZTogPG51bWJlciBiZXR3ZWVuIDEgYW5kIDU+)Youareevaluatinghowusefulasinglestate\-actionstepisforsolvingawebtask\.Taskgoal:\{GOAL\}State\+actiondescription\(AXTree\+history\+assistantoutput\):\{STATE\_BLOCK\}Onascalefrom1to5,where\-1=nothelpfulatallforachievingthegoal,\-2=slightlyhelpfulbutnotcritical,\-3=somewhathelpfulbutnotcritical,\-4=helpfulandcritical,\-5=veryhelpfulordirectlycrucial,ratehowmuchthisstephelpstosolvethegoal\.Provide2\-3concisesentencesofreasoningthatcitespecificobservations/actions\.Endwithalineexactlylike:Score:<numberbetween1and5\>

### F\.2Self\-Reasoning Synthesis Details

We use the prompt shown in Appendix X to self\-synthesize reasoning\. The prompt is largely adapted from the BrowserGym\-style instructions\(de Chezelleset al\.,[2025](https://arxiv.org/html/2605.20291#bib.bib23)\)\. For generation, we set the sampling parameters to temperature of 0\.2 and top\-ppof 0\.9\. After generation, we parse the model output and replace the original dataset’sthinkandmemoryblocks with those extracted from the generated response\.

Prompt for reasoning synthesis\\KV@do, fontsize=, breaklines=true, breakanywhere=true, breaksymbolleft=, breaksymbolright=, breaksymbol= ,,\# General InstructionsYou are a UI Assistant, your goal is to help the user perform tasks using a web browser\. You can communicate with the user via a chat, in which the user gives you instructions and in which you can send back messages\. You have access to a web browser that both you and the user can see, and with which only you can interact via specific commands\.Review the instructions from the user, the current state of the page and all other information to find the best possible next action to accomplish your goal\. Your answer will be interpreted and executed by a program, make sure to follow the formatting instructions\.\#\# Goal:\{GOAL\}\# Observation of current step:\#\# AXTree: \{STATE\_BLOCK\}\# History of interaction with the task:\{HISTORY\}\# Action space:16 different types of actions are available\.noop\(wait\_ms: float = 1000\)Description: Do nothing, and optionally wait for the given time \(in milliseconds\)\.Examples:noop\(\)noop\(500\)send\_msg\_to\_user\(text: str\)Description: Sends a message to the user\.Examples:send\_msg\_to\_user\(’Based on the results of my search, the city was built in 1751\.’\)scroll\(delta\_x: float, delta\_y: float\)Description: Scroll horizontally and vertically\. Amounts in pixels, positive for right or down scrolling, negative for left or up scrolling\. Dispatches a wheel event\.Examples:scroll\(0, 200\)scroll\(\-50\.2, \-100\.5\)fill\(bid: str, value: str\)Description: Fill out a form field\. It focuses the element and triggers an input event with the entered text\. It works for <input\>, <textarea\> and \[contenteditable\] elements\.Examples:fill\(’237’, ’example value’\)fill\(’45’, ’multi\-line\\nexample’\)fill\(’a12’, ’example with "quotes"’\)select\_option\(bid: str, options: str \| list\[str\]\)Description: Select one or multiple options in a <select\> element\. You can specify option value or label to select\. Multiple options can be selected\.Examples:select\_option\(’a48’, ’blue’\)select\_option\(’c48’, \[’red’, ’green’, ’blue’\]\)click\(bid: str, button: Literal\[’left’, ’middle’, ’right’\] = ’left’, modifiers: list\[typing\.Literal\[’Alt’, ’Control’, ’Meta’, ’Shift’\]\] = \[\]\)Description: Click an element\.Examples:click\(’a51’\)click\(’b22’, button=’right’\)click\(’48’, button=’middle’, modifiers=\[’Shift’\]\)dblclick\(bid: str, button: Literal\[’left’, ’middle’, ’right’\] = ’left’, modifiers: list\[typing\.Literal\[’Alt’, ’Control’, ’Meta’, ’Shift’\]\] = \[\]\)Description: Double click an element\.Examples:dblclick\(’12’\)dblclick\(’ca42’, button=’right’\)dblclick\(’178’, button=’middle’, modifiers=\[’Shift’\]\)hover\(bid: str\)Description: Hover over an element\.Examples:hover\(’b8’\)press\(bid: str, key\_comb: str\)Description: Focus the matching element and press a combination of keys\. It accepts the logical key names that are emitted in the keyboardEvent\.key property of the keyboard events: Backquote, Minus, Equal, Backslash, Backspace, Tab, Delete, Escape, ArrowDown, End, Enter, Home, Insert, PageDown, PageUp, ArrowRight, ArrowUp, F1 \- F12, Digit0 \- Digit9, KeyA \- KeyZ, etc\. You can alternatively specify a single character you’d like to produce such as "a" or "\#"\. Following modification shortcuts are also supported: Shift, Control, Alt, Meta\.Examples:press\(’88’, ’Backspace’\)press\(’a26’, ’Control\+a’\)press\(’a61’, ’Meta\+Shift\+t’\)focus\(bid: str\)Description: Focus the matching element\.Examples:focus\(’b455’\)clear\(bid: str\)Description: Clear the input field\.Examples:clear\(’996’\)drag\_and\_drop\(from\_bid: str, to\_bid: str\)Description: Perform a drag & drop\. Hover the element that will be dragged\. Press left mouse button\. Move mouse to the element that will receive the drop\. Release left mouse button\.Examples:drag\_and\_drop\(’56’, ’498’\)upload\_file\(bid: str, file: str \| list\[str\]\)Description: Click an element and wait for a "filechooser" event, then select one or multiple input files for upload\. Relative file paths are resolved relative to the current working directory\. An empty list clears the selected files\.Examples:upload\_file\(’572’, ’my\_receipt\.pdf’\)upload\_file\(’63’, \[’/home/bob/Documents/image\.jpg’, ’/home/bob/Documents/file\.zip’\]\)go\_back\(\)Description: Navigate to the previous page in history\.Examples:go\_back\(\)go\_forward\(\)Description: Navigate to the next page in history\.Examples:go\_forward\(\)goto\(url: str\)Description: Navigate to a url\.Examples:goto\(’http://www\.example\.com’\)Only a single action can be provided at once\. Example:fill\(’a12’, ’example with "quotes"’\)\# Abstract ExampleHere is an abstract version of the answer with description of the content ofeach tag\. Make sure you follow this structure, but replace the content with youranswer:<think\>Think step by step\. If you need to make calculations such as coordinates, write them here\. Describe the effectthat your previous action had on the current content of the page\.</think\><memory\>Write down anything you need to remember for next steps\. You will be presentedwith the list of previous memories and past actions\.</memory\><action\>One single action to be executed\. You can only use one action at a time\.</action\>\# Concrete ExampleHere is a concrete example of how to format your answer\.Make sure to follow the template with proper tags:<think\>My memory says that I filled the first name and last name, but I can’t see anycontent in the form\. I need to explore different ways to fill the form\. Perhapsthe form is not visible yet or some fields are disabled\. I need to replan\.</think\><memory\>I clicked on bid 32 to activate tab 2\. The accessibility tree should mentionfocusable for elements of the form at next step\.</memory\><action\>fill\(’a12’, ’example with "quotes"’\)</action\>\# Instructions and GuidelinesYou must regenerate the assistant’s reasoning \(<think\>\) and short memory\(<memory\>\) for the next step\.\- The <think\> block is your internal reasoning about what to do next\.\- The <memory\> block is a very short summary \(1–2 sentences\) of important informationthat should be carried over to the next step\.\- The <memory\> block MUST NOT be empty\. Always write at least one sentence\.\- Do NOT copy the whole conversation into <memory\>\. Only keep what is useful later\.\- Use the action provided below verbatim inside <action\>\. Do not change or omit it\.\- The action is the next step to execute; assume it has NOT been done yet\.Reason about why this action should be taken next, rather than describingit as already completed\.Action to execute \(for your <action\> block\):\{action\_block\}Now, for the CURRENT input, respond in EXACTLY the following format, withno extra text before or after the tags:<think\>\[concise reasoning consistent with the context above\]</think\><memory\>\[short memory to carry over; at least one sentence\]</memory\><action\>\{action\_block\}</action\>

## Appendix GPruning experiment details

Target\-centered pruning\.We use a fixed window size w=60 for target\-centered pruning, and a larger window of w=120 for non\-node actions\. ForStaticnodes that do not have an index, we exclude them from the window\-size count\.

Semantic pruning\.We rank leaf nodes by semantic similarity to a query formed by concatenating thegoaland thegold answer\. Similarity is based on the BERTScore\(Zhanget al\.,[2020](https://arxiv.org/html/2605.20291#bib.bib27)\)using theparaphrase\-mpnet\-base\-v2encoder, and we retain the top 80 leaf nodes\. Each node is represented by concatenating its own text with its ancestor context \(i\.e\., the parent chain\)\.

Target\-centered \+ Semantic pruning\.We first select 20 leaf nodes via semantic pruning and, independently, select 60 nodes via target\-centered pruning with a window size of 30\. The final node set is taken as the union of the two selected sets\.

Across pruning methods, we tune the pruning hyperparameters to keep the dataset\-level average token count comparable\.

Similar Articles

Spokes: Optimizing for Diverse Pretraining Data Selection

arXiv cs.CL

This paper introduces Spokes, a probabilistic diversification framework using the G-Vendi score to optimize diversity in pretraining data selection, achieving significant improvements in downstream task performance on FineWeb and DCLM by jointly optimizing quality and diversity.

WebChallenger: A Reliable and Efficient Generalist Web Agent

arXiv cs.CL

WebChallenger is a new web agent framework that achieves strong performance across multiple benchmarks using open-weight models without fine-tuning, by replicating human cognitive advantages through architecture design rather than model scale.

WebWatcher: Breaking New Frontier of Vision-Language Deep Research Agent

Papers with Code Trending

WebWatcher is a multimodal agent for deep research that uses synthetic trajectories and reinforcement learning to achieve superior performance in complex visual and textual information retrieval tasks. The paper also introduces BrowseComp-VL, a new benchmark for evaluating multimodal agents.