asaverren's picture
5k resolved OpenHands trajectories, tool-call arguments deserialized, Qwen3-Coder-template-verified
b3e698c verified
|
Raw History Blame Contribute Delete
4.39 kB
---
license: cc-by-4.0
task_categories:
- text-generation
tags:
- agent-trajectories
- tool-calling
- sft
- openhands
- swe-bench
- qwen3-coder
size_categories:
- 1K<n<10K
configs:
- config_name: default
data_files:
- split: train
path: data/train-00000-of-00001.parquet
---
# openhands-train-ready
**SFT-ready normalization** of
[nebius/SWE-rebench-openhands-trajectories](https://huggingface.co/datasets/nebius/SWE-rebench-openhands-trajectories)
— 5,000 resolved OpenHands (v0.54.0) agent trajectories on real GitHub issues,
bootstrapped by `Qwen/Qwen3-Coder-480B-A35B-Instruct`, with **tool-call
arguments deserialized to objects** so chat templates just work.
## What was fixed
The upstream parquet stores `tool_call.function.arguments` as a serialized
JSON *string* "for storage efficiency" (per the Nebius README). Chat templates
that iterate `arguments|items` — including the Qwen3-Coder family — emit
empty/broken tool calls if you train on the raw rows. Every record here has:
- `arguments` deserialized `str → dict` (double-encoded JSON and Python-repr
dicts handled),
- canonical per-role fields (`system`/`user`/`assistant`/`tool`),
- the per-trajectory `tools` list kept on the record — pass it straight to
`apply_chat_template`.
## Usage
```python
from datasets import load_dataset
from transformers import AutoTokenizer
ds = load_dataset("asaverren/openhands-train-ready", split="train")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-Coder-30B-A3B-Instruct")
ex = ds[0]
text = tok.apply_chat_template(ex["messages"], tools=ex["tools"], tokenize=False)
```
TRL/axolotl: point your chat-template mapping at the `messages` column;
`tools` is a per-row column for templates that accept it.
## Qwen3-Coder tool-call format (verified)
- Assistant calls render as `<tool_call><function=NAME><parameter=KEY>VALUE
</parameter></function></tool_call>` inside the `<|im_start|>assistant` turn.
- `arguments` must be a mapping — the template iterates `arguments|items`.
(This is the upstream storage bug this dataset fixes.)
- Tool results render as `<tool_response>...</tool_response>` inside a `user`
turn; `name`/`tool_call_id` are kept for provenance but unused by the template.
## Counts (see `meta.json`)
| | |
|---|---|
| upstream rows scanned | 67,074 |
| upstream resolved | 32,161 |
| this shard (resolved, seed-0 sample) | 5,000 |
| tool-call arguments deserialized | 295,524 |
| unparseable arguments | 0 |
| unknown tools / missing required params | 0 / 0 |
| trajectories dropped | 0 |
| avg tokens (Qwen3-Coder tokenizer) | ≈ 49k / trajectory |
Tool calls validated against upstream `tools.json` (soft; all calls match the
5-tool OpenHands v0.54.0 set). All 5,000 records render through the real
Qwen3-Coder chat template with zero errors.
## Rebuild / extend
`run_normalize.py` (+ the `traj_normalize` package, both in this repo) reproduces this shard and can emit the full 32k resolved
set (or failure trajectories via `--include-failures`):
```bash
pip install pyarrow huggingface_hub
python run_normalize.py --input nebius/SWE-rebench-openhands-trajectories \
--out-dir out --max-success 5000 --seed 0 --shuffle
```
`sft_success.jsonl.gz` is the raw tool output; `data/` is the same content as
parquet for `load_dataset` + viewer support.
## Honest limitations
- `resolved` is upstream's SWE-bench-style judgment — **no re-execution
verification** was performed downstream.
- Trajectories are long (~49k tokens avg); filter/truncate to your context
budget.
- Single bootstrap model (Qwen3-Coder-480B) and single scaffold
(OpenHands v0.54.0) — behavior/diversity is bounded accordingly.
- Same-instance duplicates are possible (upstream samples multiple attempts
per issue); dedupe on `instance_id` if that matters to you.
## Attribution & license
Upstream data: [Nebius](https://nebius.com/blog/posts/openhands-trajectories-with-qwen3-coder-480b),
**CC-BY-4.0**. This derivative shard redistributes normalized data under the
same license — please attribute Nebius.
```bibtex
@article{trofimova2025openhandstrajs,
title={OpenHands Trajectories with Qwen3-Coder-480B-A35B-Instruct},
author={Trofimova, Maria and Shevtsov, Anton and Ibragim, Badertdinov and Pyaev, Konstantin and Karasik, Simon and Golubev, Alexander},
year={2025},
journal={Nebius blog},
}
```