Skip to main content Startseite Ersteller adu2021 skillxiv synthagent-web-adaptation
synthagent-web-adaptation Adapt web agents to new domains through targeted synthetic data generation and quality-aware refinement—identifying and correcting hallucinations while preserving task consistency to enable efficient adaptation with minimal human supervision.
Zur Installation springen Skills Marktplatz Entdecken und erkunden Sie KI-Skills, die von der Community erstellt wurden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Prompt kopierenPrompt-Details anzeigen Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
npx skills add https://github.com/ADu2021/skillXiv --skill synthagent-web-adaptationDer Befehl bleibt in einer Zeile. Scrollen Sie horizontal, um ihn vor dem Kopieren vollständig zu prüfen.
Sie bevorzugen eine lokale Kopie? Laden Sie die Dateien herunter, die SkillsMP derzeit vorliegen.
ZIP herunterladen Herunterladen... Mehr aus diesem Repository meaningful-kebab-case-name Convert arXiv papers into ready-to-use agent skills using category-aware extraction. First classifies the paper into one or more of 11 research categories, then applies a specialized extraction pipeline for each category — because different types of papers produce different types of usable knowledge. A single paper can yield multiple skills if it spans categories. Use this skill whenever the user wants to turn a paper into a skill, extract practical techniques from research, build a skill library from papers, convert arXiv papers into reusable agent instructions, or batch-process multiple papers into skills. Also trigger when someone asks about extracting actionable knowledge from papers, making research practical for LLM agents, or systematically converting academic contributions into structured agent capabilities.
action-quantization-behavior-cloning Establish regret bounds for behavior cloning with discretized actions combining statistical error and quantization error terms. Prove smoothness requirements for safe quantizer design, show that learning-based quantizers fail these requirements, and propose model-based augmentation to reduce error dependence from H² to H.
adaptive-lora-personalized-ranks Dynamically allocate LoRA ranks per-layer during fine-tuning instead of using fixed uniform ranks. Learn optimal rank for each layer and subject via variational framework with discretized exponential distribution, reducing memory footprint while maintaining fidelity and text-alignment.
Verwandte Berufe SOC
Basierend auf der SOC-Berufsklassifikation
name synthagent-web-adaptation title Adapting Web Agents with Synthetic Supervision version 0.0.2 engine skillxiv-v0.0.2-claude-opus-4.6 license MIT url https://arxiv.org/abs/2511.06101 keywords ["Web Automation","Synthetic Data","Domain Adaptation","Data Quality","LLM Agents"] description Adapt web agents to new domains through targeted synthetic data generation and quality-aware refinement—identifying and correcting hallucinations while preserving task consistency to enable efficient adaptation with minimal human supervision.
Adapt Web Agents Through Quality-Focused Synthetic Data
Adapting language model agents to new websites typically requires collecting human demonstrations for each new domain. SynthAgent (Synthetic Supervision) automatically generates task examples through exploratory interactions with target websites, then applies quality-aware refinement to fix hallucinations and inconsistencies. The approach targets two critical failure modes: hallucinated tasks (tasks never tested against actual website) and noisy trajectories (incorrect action sequences).
By separating data generation from quality control, the system achieves efficient domain adaptation without expensive human labeling.
Core Concept
SynthAgent implements a three-stage pipeline:
Task Synthesis - Explore website UI systematically to generate diverse task examples
Conflict-Driven Refinement - When task descriptions conflict with observed behavior, correct them
Global Trajectory Refinement - Post-hoc cleanup ensuring action sequences match tasks
This approach treats synthetic data generation as exploration with implicit labels, then applies targeted corrections only where conflicts appear—reducing false positives while fixing genuine errors.
Architecture Overview
Exploratory Agent : Navigates website discovering UI elements and interactions
Task Generator : Creates task descriptions from observed interactions
Conflict Detector : Identifies discrepancies between tasks and actual website behavior
Online Refinement : Corrects tasks when conflicts detected
Trajectory Validator : Verifies action sequences match task descriptions
Offline Polish : Final refinement using global context
Implementation Steps
Step 1: Systematic Web Exploration and Task Synthesis
Discover website structure and generate task examples through structured exploration.
from typing import List , Dict , Set , Tuple
import json
class WebExplorer :
"""
Systematically explores website and generates task examples.
"""
( ):
.browser = browser
.base_url = base_url
.max_pages = max_pages
.explored_pages = ()
.discovered_tasks = []
.ui_elements = {}
( ) -> [ ]:
to_explore = [ .base_url]
visited_urls = ()
to_explore (visited_urls) < .max_pages:
url = to_explore.pop( )
url visited_urls:
visited_urls.add(url)
:
.browser.get(url)
._extract_page_info(url)
links = ._extract_links(url)
link links:
link visited_urls (visited_urls) < .max_pages:
to_explore.append(link)
Exception e:
( )
.discovered_tasks
( ):
page_source = .browser.page_source
current_url = .browser.current_url
forms = .browser.find_elements( , )
form forms:
task = ._form_to_task(form, current_url)
task:
.discovered_tasks.append(task)
buttons = .browser.find_elements( , )
button buttons:
task = ._button_to_task(button, current_url)
task:
.discovered_tasks.append(task)
inputs = .browser.find_elements( , )
input_elem inputs:
task = ._input_to_task(input_elem, current_url)
task:
.discovered_tasks.append(task)
( ) -> :
:
form_id = form.get_attribute( )
labels = form.find_elements( , )
task_desc =
task_desc += .join([l.text l labels[: ]])
{
: ,
: task_desc,
: url,
: form_id,
: [l.text l labels]
}
:
( ) -> :
:
button_text = button.text
(button_text) < :
{
: ,
: ,
: url,
: button_text
}
:
( ) -> :
:
input_type = input_elem.get_attribute( )
placeholder = input_elem.get_attribute( )
name = input_elem.get_attribute( )
placeholder:
{
: ,
: ,
: url,
: input_type,
: placeholder
}
:
( ) -> [ ]:
links = []
:
elements = .browser.find_elements( , )
elem elements:
href = elem.get_attribute( )
href href.startswith( ):
links.append(href)
:
links
def
__init__
self, browser, base_url: str , max_pages: int = 100
"""
Args:
browser: Selenium WebDriver or equivalent
base_url: Starting URL
max_pages: Maximum pages to explore
"""
self
self
self
self
set
self
self
def
explore_website
self
List
Dict
"""
Systematically explore website and extract tasks.
Returns:
tasks: Generated task examples
"""
self
set
while
and
len
self
0
if
in
continue
try
self
self
self
for
in
if
not
in
and
len
self
except
as
print
f"Error exploring {url} : {e} "
continue
return
self
def
_extract_page_info
self, url: str
"""Extract interactive elements and generate tasks."""
self
self
self
"tag name"
"form"
for
in
self
if
self
self
"tag name"
"button"
for
in
self
if
self
self
"tag name"
"input"
for
in
self
if
self
def
_form_to_task
self, form, url: str
Dict
"""Convert form to task example."""
try
"id"
or
"form"
"tag name"
"label"
f"Complete the form on {url} : "
", "
for
in
3
return
'type'
'form_fill'
'description'
'url'
'target'
'elements'
for
in
except
return
None
def
_button_to_task
self, button, url: str
Dict
"""Convert button interaction to task."""
try
if
len
50
return
'type'
'click'
'description'
f"Click '{button_text} ' button"
'url'
'target'
except
pass
return
None
def
_input_to_task
self, input_elem, url: str
Dict
"""Convert input field to task."""
try
"type"
"placeholder"
"name"
if
return
'type'
'input'
'description'
f"Enter {placeholder} in input field"
'url'
'input_type'
'placeholder'
except
pass
return
None
def
_extract_links
self, url: str
List
str
"""Extract navigable links from page."""
try
self
"tag name"
"a"
for
in
"href"
if
and
'http'
except
pass
return
Step 2: Conflict Detection and Online Refinement
Identify discrepancies between generated tasks and actual website behavior.
class ConflictDetector :
"""
Detects conflicts between task descriptions and actual website behavior.
"""
def __init__ (self, browser ):
self .browser = browser
def detect_conflicts (self, task: Dict ) -> Tuple [bool , str ]:
"""
Check if task description matches actual website behavior.
Args:
task: Task example with description and target
Returns:
has_conflict: Whether conflict detected
reason: Explanation if conflict found
"""
try :
self .browser.get(task['url' ])
target = task['target' ]
if task['type' ] == 'form_fill' :
form = self .browser.find_element("id" , target)
if not form:
return True , f"Form {target} not found"
elif task['type' ] == 'click' :
buttons = self .browser.find_elements("tag name" , "button" )
found = False
for btn in buttons:
if btn.text == target:
found = True
if not btn.is_displayed():
return True , f"Button '{target} ' not visible"
break
if not found:
return True , f"Button '{target} ' not found"
elif task['type' ] == 'input' :
inputs = self .browser.find_elements("tag name" , "input" )
found = False
for inp in inputs:
placeholder = inp.get_attribute("placeholder" )
if placeholder == task.get('placeholder' ):
found = True
break
if not found:
return True , f"Input field not found"
return False , ""
except Exception as e:
return True , str (e)
def refine_task (self, task: Dict ) -> Dict :
"""
Correct task description to match actual website.
Args:
task: Original task
Returns:
refined_task: Corrected task
"""
has_conflict, reason = self .detect_conflicts(task)
if has_conflict:
if "not found" in reason:
return None
elif "not visible" in reason:
task['conditional' ] = True
task['condition' ] = "Element must be unhidden first"
return task
Step 3: Trajectory Validation and Refinement
Verify that action sequences correspond to task descriptions.
class TrajectoryValidator :
"""
Validates and refines action trajectories against tasks.
"""
def __init__ (self, llm_api ):
self .llm = llm_api
def validate_trajectory (self, task: Dict , trajectory: List [str ] ) -> Tuple [bool , List [str ]]:
"""
Check if trajectory actually accomplishes task.
Args:
task: Task description
trajectory: List of action descriptions
Returns:
is_valid: Whether trajectory achieves task
corrected: Corrected action sequence if invalid
"""
prompt = f"""Does this action sequence accomplish the task?
Task: {task['description' ]}
Actions:
{chr (10 ).join(trajectory)}
Respond with yes/no and explain."""
response = self .llm.generate(prompt, max_tokens=200 )
is_valid = "yes" in response.lower()
if not is_valid:
correction_prompt = f"""The above trajectory doesn't achieve the task.
Generate corrected actions:
Task: {task['description' ]}
Corrected action sequence:"""
corrected_str = self .llm.generate(correction_prompt, max_tokens=300 )
corrected = corrected_str.strip().split('\n' )
else :
corrected = trajectory
return is_valid, corrected
def refine_trajectories (self, tasks_with_trajectories: List [Tuple [Dict , List [str ]]],
batch_size: int = 10 ) -> List [Dict ]:
"""
Batch validate and refine trajectories.
Args:
tasks_with_trajectories: (task, trajectory) pairs
batch_size: Batch processing size
Returns:
refined_examples: Validated task-trajectory pairs
"""
refined = []
for task, trajectory in tasks_with_trajectories:
is_valid, corrected = self .validate_trajectory(task, trajectory)
if is_valid:
refined.append({
'task' : task,
'trajectory' : trajectory,
'validated' : True
})
else :
if len (corrected) > len (trajectory) * 1.5 :
continue
refined.append({
'task' : task,
'trajectory' : corrected,
'validated' : True ,
'corrected' : True
})
return refined
Step 4: Integrated Adaptation Pipeline
Combine exploration, refinement, and validation into domain adaptation pipeline.
def adapt_agent_to_new_domain (base_agent, target_website_url: str ,
browser, llm_api,
max_synthetic_examples: int = 100 ):
"""
Adapt web agent to new domain using synthetic supervision.
Args:
base_agent: Pre-trained web agent
target_website_url: URL of target website
browser: Browser instance
llm_api: LLM for reasoning
max_synthetic_examples: Target number of examples
Returns:
adapted_agent: Fine-tuned agent for new domain
"""
print ("=== Synthetic Supervision Adaptation ===" )
print ("Exploring website..." )
explorer = WebExplorer(browser, target_website_url)
synthetic_tasks = explorer.explore_website()[:max_synthetic_examples]
print (f"Generated {len (synthetic_tasks)} task candidates" )
print ("Detecting and correcting conflicts..." )
conflict_detector = ConflictDetector(browser)
refined_tasks = []
for task in synthetic_tasks:
refined = conflict_detector.refine_task(task)
if refined:
refined_tasks.append(refined)
print (f"Retained {len (refined_tasks)} after conflict removal" )
print ("Generating and validating trajectories..." )
validator = TrajectoryValidator(llm_api)
refined_examples = []
for task in refined_tasks:
trajectory = base_agent.predict_trajectory(task['description' ])
is_valid, corrected = validator.validate_trajectory(task, trajectory)
if is_valid:
refined_examples.append({
'task' : task['description' ],
'trajectory' : corrected,
'domain' : 'new_domain'
})
print (f"Final training set: {len (refined_examples)} examples" )
print ("Fine-tuning agent..." )
import torch.optim as optim
optimizer = optim.Adam(base_agent.parameters(), lr=1e-5 )
for epoch in range (3 ):
total_loss = 0
for example in refined_examples:
logits = base_agent.forward(example['task' ])
trajectory_ids = base_agent.tokenize_trajectory(example['trajectory' ])
loss = compute_trajectory_loss(logits, trajectory_ids)
optimizer.zero_grad()
loss.backward()
optimizer.step()
total_loss += loss.item()
print (f"Epoch {epoch} : Loss {total_loss / len (refined_examples):.4 f} " )
return base_agent
Practical Guidance
Adapting web agents to new website domains
Scenarios where human demonstration collection is expensive
Situations where target website changes require re-adaptation
Domains requiring high-precision behaviors (synthetic data may be noisy)
Websites with complex JavaScript rendering (difficult to explore)
Tasks without clear success/failure signals
Hyperparameters and Configuration:
Exploration depth: 100-500 pages (balance coverage with time)
Conflict threshold: Discard if multiple conflicting elements found
Trajectory length budget: 5-15 steps (longer sequences harder to learn)
Refinement iterations: 1-2 passes over generated data
Stale website snapshots - Website layout changes between exploration and use; re-validate periodically
Over-filtering - Discarding all tasks with minor conflicts removes valuable data
LLM hallucination - Trajectory generation may hallucinate actions; validate against actual website
Domain shift - Synthetic distribution may not match test distribution; monitor performance on real tasks