A LoRA adapter that enables DART-GUI-7B to jointly generate GUI actions and adaptive post-action waiting times.
AutoSleep addresses a practical problem in desktop agents: a fixed delay after every action can waste time on immediate interactions and still be too short for slow operations. The adapter adds a Sleep prediction to the existing Thought and Action response. A desktop runner can use this prediction to decide when to take the next screenshot.
This release contains the natural-prior, 10-epoch adapter. It requires the original DART base model and retains the adapter separately during inference. The adapter file is 40,403,560 bytes; the 7b in the repository name describes the base model.
Release validation status: static checks and two standalone GPU inference cases passed on 2026-10-18 using one NVIDIA H20. The tested paths cover a two-image history and a first-turn screenshot. See the smoke-test record. The research evaluation tables below remain historical results, separate from this integration check.
Use Python 3.12 and a CUDA-compatible PyTorch installation. The release test used Python 3.12.3 and NVIDIA's PyTorch 2.7.0a0+79aa17489c.nv25.04 build, with the dependencies pinned in requirements.txt. A standard PyPI PyTorch wheel has not been independently validated.
Download this repository, then run these commands from its directory:
python -m pip install -r requirements.txt
# Check the adapter checksum and example input without loading the model.
python inference.py --messages examples/messages.json --check-input
# Select an available physical GPU before running inference.
# For example, after setting CUDA_VISIBLE_DEVICES to the selected device:
python inference.py --messages examples/messages.json --gpu 0
--gpu is an index within the devices visible to the process. The script requires an explicit selection. Its output is JSON containing the generated response and a basic output-protocol check. It does not execute GUI actions.
The base model is downloaded from PengxiangLi/dart-gui-7b at revision e2d1956fcf7fdc328a36af4677ede8ad38a671b5. Downloading the base requires approximately 33.17 GB of disk space. Inference defaults to BF16 with a separate LoRA adapter, the slow image processor, SDPA attention, and greedy generation. These choices follow the historical Transformers evaluation path; they do not reproduce vLLM execution timing.
The tested examples peaked at 16.42 GiB of PyTorch-allocated memory and 17.20 GiB of reserved memory. The GPU-wide sampled maximum was 18.02 GiB, including the test supervisor's CUDA context. These are measurements for one- and two-image prompts, not a memory guarantee for the full context window. The release test used the locally cached matching base with networking disabled; a fresh Hub download is a separate distribution check.
An existing copy of the same base can be used with --base-model /path/to/dart. The script verifies its small configuration/tokenizer files and shard sizes against base_provenance.json; this local check does not rehash all base tensor bytes.
For a first-turn request using your own screenshot:
python inference.py --image /path/to/screenshot.png \
--instruction "Open the Extensions panel in VS Code." --gpu 0
For subsequent turns, pass a JSON message list through --messages. Start with the system message and task prompt, retain the observation/action history, and end with the current screenshot. Include at most five screenshots and 35 historical assistant replies, matching the research context limits. Image paths are relative to the JSON file. Do not include the desired next answer or images captured after that answer's action.
The bundled example contains two benchmark-VM screenshots and one historical assistant reply. examples/reference.json holds the supervised reference separately. It is a training example useful for checking integration, not a generalization test or a guaranteed model output.
Thought: The search field is focused. I will enter the extension name and wait for the results.
Action: type(content='autoDocstring')
Sleep: 2
This is an illustrative response. Allowed Sleep values, in seconds, are 0, 0.2, 0.5, 0.8, 1.2, 2, 3, and 5.
Execute the complete action block, apply its predicted Sleep once, then capture the next observation. Several actions can share one action block. Adding another fixed post-action delay changes the waiting policy. wait() is a separate recovery action for a screen that is already not actionable; it also consumes a model decision. A finished(...) response ends the task and should use Sleep: 0.
Use prompt_template.txt to preserve the trained instruction format. It includes the original OSWorld VM's default-password sentence for fidelity to the experiment. Adapt that sentence when integrating another environment. The inference script only generates text and does not use that password.
A runner must parse actions and convert DART coordinates using the same image-resizing/coordinate convention as its GUI integration. The protocol_valid field only checks block structure and the Sleep value; it does not certify valid action arguments or successful execution. Historical GUI runs used a 5-second fallback for missing/invalid Sleep values. Integrators should handle malformed outputs explicitly.
The goal was to teach a consistent output format and action-dependent waiting while retaining the base model's GUI behavior. Thought and Action targets came from the base model's own trajectories. Annotation mainly changed the output format and added a waiting label; a stronger teacher was not used to supply new action solutions.
The training set contains 1,200 decision examples: 600 replay examples from 67 tasks and 600 additional examples from 234 other tasks, covering 301 tasks across ten application domains. The additional examples preserve the candidate data's natural frequency distribution, hence the name natural-prior. The 0- and 0.2-second labels together account for 63.25% of training examples.
Labels approximate visual stabilization. After an action, screenshots were sampled at nominal delays from 0 to 2 seconds in 0.1-second increments, then at 3, 4, and 5 seconds. Grayscale images, resized to a maximum side of 640 pixels, were compared with the final frame. Pixels differing by more than 25 grayscale levels were counted. The earliest point whose changed-pixel fraction and all subsequent fractions were below 0.1% was rounded up to the next allowed waiting bucket. This procedure measures visual similarity under a bounded observation window; it does not establish semantic task completion. Post-action frames were used for labels, not model inputs.
| Setting | Value |
|---|---|
| Architecture | DART-GUI-7B, based on Qwen2.5-VL |
| Adapter | LoRA, rank 16, alpha 32, dropout 0 |
| Target modules | Language attention q_proj, k_proj, v_proj, o_proj |
| Vision tower | Frozen |
| Training data | 1,200 decision examples |
| Training duration | Initially 5 epochs, resumed to 10 total epochs / 12,000 updates |
| Batch / gradient accumulation | 1 / 1 |
| Configured learning rate | 1e-4 |
| Maximum sequence length | 32,768 tokens |
| Loss | Response cross-entropy plus Sleep-value emphasis and an asymmetric under-wait distance term |
| Sleep value / distance weights | 5 / 1; under-wait multiplier 3 |
| Training seed | 42 |
The distance term uses first-token groups for numerical labels, so it does not independently distinguish all decimal buckets. Full-value cross-entropy still supervises the complete Sleep value. The final release keeps the original natural-prior adapter; no merged or quantized variant is substituted.
This repository provides the adapter, inference example, prompt, and evaluation summaries. The complete training dataset and training pipeline are not bundled.
The table reports means over repeated runs on a selected 67-task OSWorld subset. These tasks overlap the replay data. This is not a full OSWorld leaderboard score or an unseen-task success evaluation.
| Strategy | Success (%) | Mean complete task time (s) | Model calls / task | Explicit waits / 67-task run |
|---|---|---|---|---|
| Base, fixed 0.5 s | 82.84 | 51.14 | 10.51 | 33.5 |
| Base, fixed 1 s | 82.84 | 58.15 | 10.87 | 25.5 |
| Base, fixed 3 s | 85.07 | 75.49 | 10.05 | 13.0 |
| Base, fixed 5 s | 88.81 | 94.26 | 9.69 | 8.0 |
| AutoSleep (natural-prior) | 85.07 | 54.30 | 11.17 | 12.0 |
AutoSleep's observed mean time lies between fixed 0.5 and 1 second. It has fewer explicit waits and a higher mean success score than those two settings. Compared with fixed 3 seconds, it has the same mean success score and 28.08% lower mean complete task time. Fixed 5 seconds achieves higher success at a longer runtime. Fewer explicit waits do not imply fewer total model calls.
The full set of fixed-delay settings is in evaluation/gui_results.csv. Success is based on the benchmark evaluator's scores. Complete task time is the research report's wall-clock task metric, not model inference latency. Historical runs were collected across different sessions; backend, hardware load, and environment timing can affect results. These comparisons are descriptive, without a claim of statistical significance or an isolated causal effect.
| Split | Examples | Exact Sleep match | Full output format valid |
|---|---|---|---|
| Training examples | 1,200 | 95.17% (1,142) | 99.83% (1,198) |
| Task-disjoint development set | 1,075 | 48.47% (521) | 99.35% (1,068) |
The development set covers 59 tasks excluded from training. It was consulted during model development and is not an untouched final test set. Its results show that the learned output format and some waiting predictions transfer to new tasks. They do not measure successful execution of those tasks.
The model has a strong short-wait preference. Always predicting 0.2 seconds achieves 45.67% (491/1,075) exact match on the development set; AutoSleep adds 30 correct predictions, a 2.79-percentage-point improvement. Long-wait prediction remains limited. The base-model panels are retained from the original research figures; their counts were checked against the figures, while the original base prediction files were unavailable in the local archive.
Use the pinned base revision, original processor, exact prompt, and separate adapter when reproducing this release. Small changes to precision, merging, history construction, or serving software may change generated actions and waits. The historical GUI service used vLLM 0.17.0, BF16, rank-16 LoRA, a 32,768-token context, greedy decoding, and a maximum of 500 generated tokens. Offline evaluation used Transformers and up to 512 generated tokens. See evaluation/README.md for the distinction.
Waiting labels depend on the VM, application, network, and screenshot-sampling setup. A 5-second label may reflect the sampling limit rather than completion. The model can choose a wait that is too short, generate an invalid response, or make an incorrect GUI action. The research did not establish broad gains across other base models or environments, nor unchanged general reasoning ability.
The adapter was trained by Zihao Zhang (aizyeee) as part of a PRP project on building VLA-based desktop agents. Thanks to advisors Mingyu Wu and Hongtao Lv, and to project collaborators Zhixi Hu and Shixing Yan.
The research base was originally downloaded from dart-gui/dart-gui-7b at revision c52f802fe2ae175d15d801608a9f309d9534b65b. The public base selected here, PengxiangLi/dart-gui-7b, explicitly declares Apache-2.0. Its seven published weight-shard hashes match the original repository, and all 12 checked configuration/tokenizer files match the locally used base byte for byte. Details are recorded in base_provenance.json.
The release uses Apache-2.0; see NOTICE for attribution. The base model is required separately. We acknowledge DART-GUI, UI-TARS, and OSWorld.
Please reference this repository and the revision you used, and cite the original DART paper when using its base model. No separate peer-reviewed publication is claimed for this adapter.
PengxiangLi/dart-gui-7b