zikaixiao1 commited on
Commit
d27c087
·
verified ·
1 Parent(s): 26ddada

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +257 -1
README.md CHANGED
@@ -25,4 +25,260 @@ base_model:
25
  - Qwen/Qwen3-8B
26
  datasets:
27
  - Qwen/WebWorldData
28
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  - Qwen/Qwen3-8B
26
  datasets:
27
  - Qwen/WebWorldData
28
+ ---
29
+
30
+ # WebWorld 🌐
31
+
32
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/LICENSE-2.0) [![GitHub](https://img.shields.io/badge/GitHub-WebWorld-4b32c3?logo=github)](https://github.com/QwenLM/WebWorld) [![Dataset](https://img.shields.io/badge/HF%20Dataset-WebWorldData-yellow?logo=huggingface)](https://huggingface.co/datasets/Qwen/WebWorldData) [![8B](https://img.shields.io/badge/Model-8B-green?logo=huggingface)](https://huggingface.co/Qwen/WebWorld-8B) [![14B](https://img.shields.io/badge/Model-14B-green?logo=huggingface)](https://huggingface.co/Qwen/WebWorld-14B) [![32B](https://img.shields.io/badge/Model-32B-green?logo=huggingface)](https://huggingface.co/Qwen/WebWorld-32B)
33
+
34
+ ## 📚 Introduction
35
+
36
+ **WebWorld** is a large-scale **open-web world model** series for training and evaluating web agents. It is trained on **1M+ real-world web interaction trajectories** via a scalable hierarchical data pipeline, supporting:
37
+
38
+ - **Long-horizon simulation** (30+ steps)
39
+ - **Multi-format state representations**: A11y Tree, HTML, XML, Markdown, and natural language
40
+ - **CoT-activated reasoning** for transition prediction
41
+ - **Cross-domain generalization** to code, GUI, and game environments
42
+
43
+ Agents trained on WebWorld-synthesized trajectories achieve **+9.9% on MiniWob++** and **+10.9% on WebArena**. When used for inference-time lookahead search, WebWorld **outperforms GPT-5** as a world model.
44
+
45
+ ## 🎯 Model Series
46
+
47
+ | Model | Base Model | Link |
48
+ |---|---|---|
49
+ | **WebWorld-8B** | [Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) | [🤗 HuggingFace](https://huggingface.co/Qwen/WebWorld-8B) |
50
+ | **WebWorld-14B** | [Qwen3-14B](https://huggingface.co/Qwen/Qwen3-14B) | [🤗 HuggingFace](https://huggingface.co/Qwen/WebWorld-14B) |
51
+ | **WebWorld-32B** | [Qwen3-32B](https://huggingface.co/Qwen/Qwen3-32B) | [🤗 HuggingFace](https://huggingface.co/Qwen/WebWorld-32B) |
52
+
53
+ **Dataset**: [Qwen/WebWorldData](https://huggingface.co/datasets/Qwen/WebWorldData)
54
+
55
+ 💡 **Recommendation**: Use 8B for fast simulation and data synthesis; use 14B/32B for higher-fidelity simulation and better long-horizon robustness. For best results in a specific environment, we recommend task-specific fine-tuning on in-domain trajectories.
56
+
57
+ ## 🛠️ Requirements
58
+
59
+ - `transformers` (recommended: latest version)
60
+ - `torch`
61
+ - Optional: `accelerate`, `vllm` for efficient serving
62
+
63
+ ## 🚀 Quick Start
64
+
65
+ **Key Notes:**
66
+ - WebWorld predicts the next page state given the current state and an action.
67
+ - It strictly preserves the input/output format (A11y / HTML / XML / Markdown / NL).
68
+ - Supports multi-turn trajectory simulation up to 30+ steps.
69
+
70
+ ### Single-Step Prediction
71
+
72
+ <details>
73
+ <summary>💻 Click to expand code</summary>
74
+
75
+ ```python
76
+ import torch
77
+ from transformers import AutoTokenizer, AutoModelForCausalLM
78
+
79
+ model_name = "Qwen/WebWorld-8B" # or WebWorld-14B, WebWorld-32B
80
+ tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
81
+ model = AutoModelForCausalLM.from_pretrained(
82
+ model_name,
83
+ device_map="auto",
84
+ torch_dtype=torch.bfloat16,
85
+ trust_remote_code=True,
86
+ ).eval()
87
+
88
+ system_prompt = (
89
+ "You are a web world model. I will provide you with an initial page state "
90
+ "and a sequence of actions. For each action, predict the resulting page state.\n"
91
+ "Strictly maintain the original format. Output only the full page state "
92
+ "without explanations, code, or truncation."
93
+ )
94
+
95
+ current_state = """RootWebArea 'Global Start - Your Daily Portal', focused
96
+ \t[1] banner 'Top Header', visible
97
+ \t\t[2] link 'Set as Homepage', clickable, visible
98
+ \t\t[3] link 'Feedback', clickable, visible
99
+ \t\t[5] region 'Weather Widget', visible
100
+ \t\t\tStaticText 'New York, USA'
101
+ \t\t\t[6] image 'Sunny', visible
102
+ \t\t\tStaticText '24°C'
103
+ \t\t[8] link 'Sign In', clickable, visible
104
+ \t[10] region 'Search Area', visible
105
+ \t\t[11] image 'Global Start Logo', visible
106
+ \t\tStaticText 'Search the entire web'
107
+ \t\t[12] tablist 'Search Engine Selector', orientation='horizontal'
108
+ \t\t\t[13] tab 'Google', selected=True, clickable
109
+ \t\t\t[14] tab 'Bing', selected=False, clickable
110
+ \t\t\t[15] tab 'DuckDuckGo', selected=False, clickable
111
+ \t\t[18] combobox 'Web Search', clickable, visible, autocomplete='both', expanded=False
112
+ \t\t\t[19] textbox 'Type keywords or URL...', clickable, visible, editable, value=''
113
+ \t\t[20] button 'Search', clickable, visible
114
+ \t[30] navigation 'Category Bar', visible
115
+ \t\t[31] link 'Home', clickable, selected=True
116
+ \t\t[32] link 'News', clickable
117
+ \t\t[33] link 'Video', clickable
118
+ \t\t[34] link 'Shopping', clickable
119
+ \t\t[35] link 'Social', clickable
120
+ \t[50] main 'Site Directory', visible
121
+ \t\t[51] region 'Top Recommended', visible
122
+ \t\t\t[52] heading 'Most Popular', visible
123
+ \t\t\t[53] list 'Top Sites Grid', visible
124
+ \t\t\t\t[54] link 'Facebook', clickable
125
+ \t\t\t\t[56] link 'YouTube', clickable
126
+ \t\t\t\t[58] link 'Amazon', clickable
127
+ \t\t\t\t[60] link 'Twitter / X', clickable
128
+ \t\t\t\t[62] link 'Instagram', clickable
129
+ \t\t\t\t[64] link 'Wikipedia', clickable
130
+ \t\t\t\t[66] link 'Netflix', clickable
131
+ \t\t\t\t[68] link 'LinkedIn', clickable
132
+ \t\t[80] region 'News & Media', visible
133
+ \t\t\t[81] heading 'Latest News', visible
134
+ \t\t\t[82] link 'CNN', clickable
135
+ \t\t\t[83] link 'BBC', clickable
136
+ \t\t\t[84] link 'The Verge', clickable
137
+ \t\t[90] region 'Shopping', visible
138
+ \t\t\t[91] heading 'E-Commerce', visible
139
+ \t\t\t[92] link 'eBay', clickable
140
+ \t\t\t[93] link 'Walmart', clickable
141
+ \t\t\t[94] link 'Best Buy', clickable
142
+ \t[200] complementary 'Ads', visible
143
+ \t\t[201] image 'Ad: Travel to Japan'
144
+ \t\t[202] link 'Book Now', clickable
145
+ \t[300] contentinfo 'Footer', visible
146
+ \t\tStaticText '© 2026 Global Start Inc.'"""
147
+
148
+ user_message = (
149
+ f"Initial Page State:\n{current_state}\n\n"
150
+ f"First Action: 'click([32])'\n\n"
151
+ f"Next Page State:"
152
+ )
153
+
154
+ messages = [
155
+ {"role": "system", "content": system_prompt},
156
+ {"role": "user", "content": user_message},
157
+ ]
158
+
159
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
160
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
161
+
162
+ with torch.no_grad():
163
+ outputs = model.generate(
164
+ **inputs,
165
+ max_new_tokens=4096,
166
+ do_sample=False,
167
+ )
168
+
169
+ response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
170
+ print(response)
171
+ ```
172
+
173
+ </details>
174
+
175
+ ### Multi-Turn Simulation
176
+
177
+ The first turn provides the initial state and first action. Each subsequent turn uses a fixed continuation prompt:
178
+
179
+ <details>
180
+ <summary>💻 Click to expand code</summary>
181
+
182
+ ```python
183
+ CONTINUE_PROMPT = (
184
+ "Continue the trajectory. Given the previous state, "
185
+ "predict the next page state after this action.\n\n"
186
+ "Action: '{action}'\n\nNext Page State:"
187
+ )
188
+
189
+ # Turn 1
190
+ messages = [
191
+ {"role": "system", "content": system_prompt},
192
+ {"role": "user", "content": f"Initial Page State:\n{state_0}\n\nFirst Action: '{action_0}'\n\nNext Page State:"},
193
+ ]
194
+ state_1 = generate(messages) # your generate function
195
+
196
+ # Turn 2
197
+ messages.append({"role": "assistant", "content": state_1})
198
+ messages.append({"role": "user", "content": CONTINUE_PROMPT.format(action=action_1)})
199
+ state_2 = generate(messages)
200
+
201
+ # Turn 3, 4, ... up to 30+ turns: repeat the same pattern
202
+ messages.append({"role": "assistant", "content": state_2})
203
+ messages.append({"role": "user", "content": CONTINUE_PROMPT.format(action=action_2)})
204
+ state_3 = generate(messages)
205
+ ```
206
+
207
+ </details>
208
+
209
+ ## 🎮 Action Space
210
+
211
+ WebWorld supports a unified action space as Python-style function calls:
212
+
213
+ | Category | Action | Description |
214
+ |---|---|---|
215
+ | **Element** | `click(bid, button, modifiers)` | Click a DOM element by its ID |
216
+ | | `fill(bid, text, press_enter)` | Type text into an input field |
217
+ | | `select_option(bid, options)` | Select from a dropdown / combobox |
218
+ | | `hover(bid)` | Hover over an element |
219
+ | **Mouse** | `mouse_move(x, y)` | Move cursor to coordinates |
220
+ | | `mouse_click(x, y, button)` | Click at coordinates |
221
+ | | `mouse_down(x, y)` / `mouse_up(x, y)` | Press / release (drag-and-drop) |
222
+ | **Keyboard** | `keyboard_press(key)` | Press a key (e.g., `Enter`, `Tab`) |
223
+ | | `keyboard_type(text)` | Type a string sequentially |
224
+ | **Browser** | `scroll(dx, dy)` | Scroll the viewport |
225
+ | | `goto(url)` | Navigate to a URL |
226
+ | | `go_back()` / `go_forward()` | Browser history navigation |
227
+ | | `tab_new()` / `tab_close()` / `tab_focus(index)` | Manage browser tabs |
228
+ | **Meta** | `send_msg_to_user(text)` | Send a message to the user |
229
+ | | `noop(wait_ms)` | Wait for a duration |
230
+ | | `infeasible(reason)` | Declare the task impossible |
231
+
232
+ ## 📊 Performance
233
+
234
+ ### Intrinsic Evaluation (WebWorld-Bench)
235
+
236
+ WebWorld-Bench evaluates models using **Factuality Score** (functional correctness) and **Web Turing Score** (perceptual realism) across nine dimensions:
237
+
238
+ | Model | Avg Factuality | Avg Turing |
239
+ |---|---|---|
240
+ | GPT-4o | 59.5 | 35.4 |
241
+ | Claude-Opus-4.1 | **71.3** | **47.4** |
242
+ | Gemini-3-Pro | 70.3 | 43.2 |
243
+ | Qwen3-8B (base) | 26.9 | 17.4 |
244
+ | **WebWorld-8B** | **70.1** | **42.2** |
245
+ | **WebWorld-14B** | 70.7 | 44.7 |
246
+ | **WebWorld-32B** | **71.0** | **45.6** |
247
+
248
+ ### Extrinsic Evaluation (Agent Training)
249
+
250
+ | Model | MiniWob++ SR | WebArena SR |
251
+ |---|---|---|
252
+ | GPT-4o | 64.3% | 26.6% |
253
+ | Qwen3-8B (base) | 49.4% | 9.8% |
254
+ | **Qwen3-8B + WebWorld** | **59.3%** (+9.9%) | **20.7%** (+10.9%) |
255
+ | Qwen3-14B (base) | 54.9% | 15.1% |
256
+ | **Qwen3-14B + WebWorld** | **63.2%** (+8.3%) | **24.3%** (+9.2%) |
257
+
258
+ ### Cross-Domain Generalization
259
+
260
+ | Environment | Qwen3-8B | WebWorld-8B | Gain |
261
+ |---|---|---|---|
262
+ | API Services | 0.088 | **0.299** | +0.211 |
263
+ | Code | 0.147 | **0.396** | +0.249 |
264
+ | Game | 0.253 | **0.473** | +0.220 |
265
+ | GUI Desktop | 0.322 | **0.705** | +0.383 |
266
+
267
+ ## ⚠️ Limitations
268
+
269
+ - **Sycophancy / optimism bias**: the model may generate outcomes that are overly favorable to the agent's intended action.
270
+ - **Content generation fidelity**: long-form, high-precision content (e.g., scientific articles) is not the primary target.
271
+ - **Text-only**: WebWorld does not simulate visual / pixel-level rendering.
272
+
273
+ ## 📝 Citation
274
+
275
+ ```bibtex
276
+ @article{WebWorld,
277
+ title = {WebWorld: A Large-Scale World Model for Web Agent Training},
278
+ author = {Xiao, Zikai and Tu, Jianhong and Zou, Chuhang and Zuo, Yuxin and Li, Zhi and Wang, Peng and Yu, Bowen and Huang, Fei and Lin, Junyang and Liu, Zuozhu},
279
+ journal = {arXiv preprint arXiv:YYMM.NNNNN},
280
+ year = {20YY},
281
+ eprint = {YYMM.NNNNN},
282
+ archivePrefix = {arXiv},
283
+ primaryClass = {cs.AI},
284
+ url = {https://arxiv.org/abs/YYMM.NNNNN