File size: 4,962 Bytes
9b36f26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
license: other
language:
- en
task_categories:
- text-generation
tags:
- agentic
- software-engineering
- tool-use
- code
- distillation
- gasai
- slm
size_categories:
- 1K<n<10K
source_datasets:
- togethercomputer/CoderForge-Preview
pretty_name: Gasai-Agent-CoderForge
configs:
- config_name: default
  data_files: train.jsonl
---

# Gasai-Agent-CoderForge

**5,205 verified-resolved agentic software-engineering trajectories, re-authored into the Gasai harness
format for pretraining small language models.** Derived from `togethercomputer/CoderForge-Preview`
(`reward==1`, Python). Each row is one complete tool-use trace serialized as a single Gasai control-token
sequence in the **`gasai`** field.

> Sister dataset to [`GasaiAI/Gasai-Agent-5k`](https://huggingface.co/datasets/GasaiAI/Gasai-Agent-5k)
> (from nvidia/Open-SWE-Traces) — **byte-identical format**, same pipeline.

## What it is

| | |
|---|---|
| Traces | **5,205** |
| Unique problems (instances) | **2,704** (≤2 rollouts kept per instance) |
| Total tokens (StarCoder-2 tok) | **~312M** |
| Tokens / trace | median ~60K |
| File | `train.jsonl` (~1.0 GB) |
| Code language | **Python** |
| Natural language | **English** |

### Format (Gasai harness)
```
<|bos|><|system|>{system}<|tools|>[{read,bash,edit,write}]
<|user|>{structured task}
<|assistant|><think>{dense reasoning}</think><|tool_use|>{"name","input"}<|eos|>
<|tool_result|>{"tool_use_id":"tc_001","name","content"}<|eos|>
… (tool loop) …
<|assistant|><think>{reasoning}</think>{final answer}<|eos|>
```
One `<think>` per assistant turn; `<|tool_use|>``<|tool_result|>` paired by positional `tc_NNN`.
Schema: `{"trajectory_id": "...", "gasai": "<|bos|>…<|eos|>"}`.

### Pipeline
1. **Tool remap** — CoderForge's OpenHands tools (`execute_bash`, `str_replace_editor`, `finish`, `think`)
   → the fixed Gasai 4-tool vocab `read` / `bash` / `edit` / `write`.
2. **Constitution `<think>`** — the teacher's verbose reasoning re-written per turn into a dense, source-bound
   `<think>` (every line a restated fact / grounded decision; no meta-narrative). Median ~42 tokens/think,
   ~0.01% task-restatement.
3. **Structured prompts** — first user turn restructured into a clean XML prompt (role/`<context>`, data in
   tags, request last, embedded data in `{{ }}`). **80%** restructured; 20% keep the verbatim original
   (fidelity fallback, never lossy).
4. **Deterministic polish** — directory `read`s → `bash find`; dropped persistent-shell artifacts
   (`C-c`/empty bash, hung "command is still running" steps); coerced object-typed edit/write args; stripped
   emoji from finals (arrows kept); kept (incomplete) empty-final traces.
5. **Dedup** — ≤2 rollouts per base instance (the source has up to 8 reward==1 rollouts per problem).

## ⚠️ Known limitations (read before training)

This dataset was deep-audited (multi-agent semantic review). It is **pretrain-grade as one ingredient**, not a
clean SFT set. Honest caveats:

- **Benchmark contamination — NOT decontaminated.** Built from SWE-bench evaluation-harness images
  (`sweb.eval.x86_64.*`); upstream mixes SWE-smith / SWE-rebench / R2E-Gym (the latter two are live
  leaderboards). The 2,704 instances were **not** filtered against SWE-bench Verified/Lite or SWE-Gym test.
  **Do not benchmark a model trained on this against those suites without first intersecting & removing
  overlapping `instance_id`s** (it would be train-on-test).
- **`<think>` result-reading defect (~20–35% of traces, in-loss).** Some `<think>` blocks state "the previous
  test failed" right after a *passing* run — the pytest `N passed` summary is buried in walls of `=` and the
  distiller mis-read it. Affects the result-reading skill; fixable by regenerating the affected think blocks.
- **Oracle-test reliance (inherent).** Agents read the failing test, then implement exactly to it — valid
  TDD, reward is honest, but the in-loss think leans on a test oracle that won't exist on real tasks, so the
  *apparent* problem-solving capability is inflated.
- **Limited diversity.** ~312M tokens come from only **2,704 unique problems** (×≤2 rollouts); volume ≠
  problem diversity. Mix with other sources for breadth.
- **Minor:** ~7% of traces edit test files (a "fix the test" anti-pattern); first step is uniformly
  `bash find /testbed -maxdepth 2`; observations carry OpenHands wrappers (`[exit code]`, `cat -n` numbering)
  and `/testbed` paths (conditioning only — tool observations are not in loss).

## Source & license
Derived from [`togethercomputer/CoderForge-Preview`](https://huggingface.co/datasets/togethercomputer/CoderForge-Preview),
config `filtered_reward1` (the curated `reward==1` union of SWE-smith / SWE-rebench / R2E-Gym tasks).
Underlying repositories carry their own permissive licenses (MIT / Apache-2.0 / BSD; see the per-row
`license` in the source). Please cite CoderForge-Preview and the upstream task sets.