SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.31270 · 2026

Learning from Failure: Inference-Time Self-Improvement for Computer-Use Agents

Ludwig Schmidt, Yuhui Zhang, Xiaohan Wang, Serena Yeung-Levy, Xueqiao Sun

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 0 no recorded run), measured 2026-11-21; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2606.31270.json · badge: /api/ran/2606.31270.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
snow10072740/Learning_from_Failure canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
distribute_tasks Ran
ran; our contract draft was wrong, not the code
snow10072740/Learning_from_Failure/run_multienv.py
code served (permissive licence) · get_code("25d7710f87084250")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from typing import List

torch.manual_seed(0)

# Construct valid arguments for distribute_tasks
# The function expects test_all_meta: dict
# It iterates over items() where each value is iterable of example_ids

test_all_meta = {
    "domain_1": ["example_001", "example_002", "example_003"],
    "domain_2": ["example_101", "example_102"],
    "domain_3": ["example_201"]
}

ARGS = {
    "test_all_meta": test_all_meta
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
distribute_tasks Ran
ran; our contract draft was wrong, not the code
snow10072740/Learning_from_Failure/run_multienv_agi.py
code served (permissive licence) · get_code("c19e80e262dabe06")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct test_all_meta: a dict mapping domain names to lists of example IDs
test_all_meta = {
    "domain_a": [1, 2, 3],
    "domain_b": [10, 20],
    "domain_c": [100, 101, 102, 103]
}

ARGS = {
    "test_all_meta": test_all_meta
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
distribute_tasks Ran
ran; our contract draft was wrong, not the code
snow10072740/Learning_from_Failure/run_multienv_aguvis.py
code served (permissive licence) · get_code("516d9479491e0425")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

# Construct test_all_meta: a dict mapping domain names to lists of example IDs
test_all_meta = {
    "domain_a": [1, 2, 3],
    "domain_b": [10, 11],
    "domain_c": [100, 101, 102, 103]
}

# Construct num_envs: number of environments to distribute tasks across
num_envs = 3

ARGS = {
    "test_all_meta": test_all_meta,
    "num_envs": num_envs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
distribute_tasks Ran
ran; our contract draft was wrong, not the code
snow10072740/Learning_from_Failure/run_multienv_aworldguiagent.py
code served (permissive licence) · get_code("0159b2b8554be28f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Analyze the function: distribute_tasks takes test_all_meta (dict) where:
# - Keys are domains (strings)
# - Values are collections of example_ids that can be iterated
# The function iterates over domain-example_id pairs

torch.manual_seed(0)

# Create a test_all_meta dict with multiple domains and example IDs
test_all_meta = {
    "domain_a": [0, 1, 2],
    "domain_b": [10, 11],
    "domain_c": [100, 101, 102, 103]
}

ARGS = {
    "test_all_meta": test_all_meta
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_domain_from_path Ran
ran; our contract draft was wrong, not the code
snow10072740/Learning_from_Failure/lib_results_logger.py
code served (permissive licence) · get_code("91170927d6273dd6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from pathlib import Path

ARGS = {
    "result_path": "results/discrete/image/ppo/cartpole/task_001/"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_result Ran
ran, honoured the contract we drafted
snow10072740/Learning_from_Failure/run_autoglm.py
code served (permissive licence) · get_code("fa90c9947264141c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_base = tempfile.mkdtemp()

# Create the nested directory structure that get_result expects
action_space = "discrete"
observation_type = "image"
use_model = "dqn"
result_dir = temp_base

target_dir = os.path.join(result_dir, action_space, observation_type, use_model)
os.makedirs(target_dir, exist_ok=True)

# Create sample domain and example directories with result files
domain_name = "domain_1"
domain_path = os.path.join(target_dir, domain_name)
os.makedirs(domain_path, exist_ok=True)

for example_id in ["example_1", "example_2"]:
    example_path = os.path.join(domain_path, example_id)
    os.makedirs(example_path, exist_ok=True)
    
    # Create a result.txt file with a success rate value
    result_file = os.path.join(example_path, "result.txt")
    with open(result_file, 'w') as f:
        f.write("0.85")

# Create another domain with examples
domain_name_2 = "domain_2"
domain_path_2 = os.path.join(target_dir, domain_name_2)
os.makedirs(domain_path_2, exist_ok=True)

for example_id in ["example_3", "example_4"]:
    example_path = os.path.join(domain_path_2, example_id)
    os.makedirs(example_path, exist_ok=True)
    
    result_file = os.path.join(example_path, "result.txt")
    with open(result_file, 'w') as f:
        f.write("0.92")

ARGS = {
    "action_space": action_space,
    "use_model": use_model,
    "observation_type": observation_type,
    "result_dir": result_dir,
    "total_file_json": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_result Ran
ran, honoured the contract we drafted
snow10072740/Learning_from_Failure/run_autoglm_v.py
code served (permissive licence) · get_code("50f980bbd7348dea")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure that mimics the expected layout
temp_base = tempfile.mkdtemp()

# Create the nested directory structure
action_space = "discrete"
observation_type = "image"
use_model = "dqn"
result_dir = temp_base

target_dir = os.path.join(result_dir, action_space, observation_type, use_model)
os.makedirs(target_dir, exist_ok=True)

# Create a domain directory with example subdirectories
domain_name = "domain_1"
domain_path = os.path.join(target_dir, domain_name)
os.makedirs(domain_path, exist_ok=True)

# Create example directories with result.txt files
for example_id in ["example_0", "example_1", "example_2"]:
    example_path = os.path.join(domain_path, example_id)
    os.makedirs(example_path, exist_ok=True)
    
    # Create result.txt with different values
    result_file = os.path.join(example_path, "result.txt")
    if example_id == "example_0":
        with open(result_file, 'w') as f:
            f.write("true")
    elif example_id == "example_1":
        with open(result_file, 'w') as f:
            f.write("true")
    else:
        with open(result_file, 'w') as f:
            f.write("0.75")

# Create another domain with mixed results
domain_name_2 = "domain_2"
domain_path_2 = os.path.join(target_dir, domain_name_2)
os.makedirs(domain_path_2, exist_ok=True)

for example_id in ["example_3", "example_4"]:
    example_path = os.path.join(domain_path_2, example_id)
    os.makedirs(example_path, exist_ok=True)
    
    result_file = os.path.join(example_path, "result.txt")
    if example_id == "example_3":
        with open(result_file, 'w') as f:
            f.write("false")
    else:
        with open(result_file, 'w') as f:
            f.write("0.5")

ARGS = {
    "action_space": action_space,
    "use_model": use_model,
    "observation_type": observation_type,
    "result_dir": result_dir,
    "total_file_json": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_unfinished Ran
ran; our contract draft was wrong, not the code
snow10072740/Learning_from_Failure/run_autoglm.py
code served (permissive licence) · get_code("f3d6789ba3daef88")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Set up directory structure: result_dir/action_space/observation_type/use_model/domain/example_id
result_dir = temp_dir
action_space = "discrete"
observation_type = "image"
use_model = "policy_net"
target_dir = os.path.join(result_dir, action_space, observation_type, use_model)

# Create some domain directories with example_ids
os.makedirs(target_dir, exist_ok=True)

domain1 = "kitchen"
domain2 = "bedroom"
os.makedirs(os.path.join(target_dir, domain1), exist_ok=True)
os.makedirs(os.path.join(target_dir, domain2), exist_ok=True)

# Create example directories for domain1
example1_path = os.path.join(target_dir, domain1, "example_1")
example2_path = os.path.join(target_dir, domain1, "example_2")
os.makedirs(example1_path, exist_ok=True)
os.makedirs(example2_path, exist_ok=True)

# Create result.txt in example_1 (finished)
with open(os.path.join(example1_path, "result.txt"), "w") as f:
    f.write("result")

# Leave example_2 without result.txt (unfinished)
with open(os.path.join(example2_path, "temp_file.txt"), "w") as f:
    f.write("temp")

# Create example directories for domain2
example3_path = os.path.join(target_dir, domain2, "example_3")
os.makedirs(example3_path, exist_ok=True)
with open(os.path.join(example3_path, "result.txt"), "w") as f:
    f.write("result")

# Skip "onboard" directory
onboard_path = os.path.join(target_dir, domain2, "onboard")
os.makedirs(onboard_path, exist_ok=True)

# Create total_file_json
total_file_json = {
    "kitchen": ["example_1", "example_2", "example_3"],
    "bedroom": ["example_3", "example_4"],
    "bathroom": ["example_5"]
}

ARGS = {
    "action_space": action_space,
    "use_model": use_model,
    "observation_type": observation_type,
    "result_dir": result_dir,
    "total_file_json": total_file_json
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
setup_logger Ran
ran; our contract draft was wrong, not the code
snow10072740/Learning_from_Failure/lib_run_single.py
code served (permissive licence) · get_code("7222d802b397cc6d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Logger. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging
import os
import tempfile

# Create a temporary directory for the example result
example_result_dir = tempfile.mkdtemp()

# Create a minimal example dict with an 'id' key
example = {
    'id': 'test_example_001'
}

ARGS = {
    'example': example,
    'example_result_dir': example_result_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
extract_domain_from_path 1 other paper
1 dated earlier
2404.07972 (2024-04)
OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments
setup_logger 1 other paper
1 dated earlier
2404.07972 (2024-04)
OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Computer-use agents, which leverage multimodal large language models (MLLMs) to operate computers and complete tasks, have attracted significant attention for their utility and versatility. A major challenge in developing these agents is collecting large-scale, high-quality trajectories. The standard approach generates synthetic data through a self-improving loop: an agent is placed in a verifiable environment and iteratively fine-tuned on its successful trajectories. Despite its effectiveness, this paradigm exploits only successful trajectories and discards the failed ones, even though failures carry rich information about a model's weaknesses. In this work, we explore a complementary failure-driven selfimprovement loop, a data-centric paradigm that turns failed trajectories into agent improvements. Specifically, we employ an LLM to diagnose failure modes, propose inference-time solutions, and generate code patches-lightly verified by humans-that upgrade the agent. We validate this approach with the state-of-the-art OpenCUA-72B model on the OSWorld benchmark, improving the success rate from 42.3% to 48.9%, a gain of 6.6 percentage points, without any additional training cost and with only modest inference overhead. Our results demonstrate that failure-driven self-improvement is a viable complement to success-based pipelines, enabling more efficient agent improvement. Code is available at https://github.com/snow10072740/Learning_from_Failure.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2606.31270")
get_code_for_paper("2606.31270")
have("2606.31270")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2606.31270.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2606.31270.svg)](https://syntology.ai/paper/2606.31270)

Connect an agent — have() is free.