Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<tools: list<item: struct<type: string, function: struct<name: string, description: string, parameters: string>>>, task_id: string, rollout_id: string, source_rollout_id: string, sample_id: string, branch_id: int64, parent_branch_id: null, segment_type: string, agent_type: string, message_count: int64, assistant_turns: int64, tool_turns: int64, reward: double, possible_compaction: bool, n_model_calls: int64, source_stage: string, repo: string, layer: string, total_tokens: int64, trainable_tokens: int64, trainable_ratio: double, dataset_version: string, split: string>
to
{'tools': List({'type': Value('string'), 'function': {'name': Value('string'), 'description': Value('string'), 'parameters': Json(decode=True)}}), 'task_id': Value('string'), 'repo': Value('string'), 'layer': Value('string'), 'source_rollout_id': Value('string'), 'reward': Value('float64'), 'segment_type': Value('string'), 'dataset_stage': Value('string'), 'environment_source': Value('string'), 'assistant_turns': Value('int64'), 'total_tokens': Value('int64'), 'trainable_tokens': Value('int64'), 'trainable_ratio': Value('float64'), 'reminder_tokens': Value('int64'), 'system_prompt_tokens': Value('int64'), 'tool_schema_tokens': Value('int64'), 'protocol_valid': Value('bool'), 'sft_excluded_reason': Value('null'), 'usage': {'input': Value('int64'), 'output': Value('int64'), 'calls': Value('int64'), 'elapsed': Value('float64')}}
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1827, in _prepare_split_single
                  for key, table in generator:
                                    ^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 613, in wrapped
                  for item in generator(*args, **kwargs):
                              ~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2312, in cast_table_to_schema
                  cast_array_to_feature(
                  ~~~~~~~~~~~~~~~~~~~~~^
                      table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      feature,
                      ^^^^^^^^
                  )
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1861, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                                           ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2158, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<tools: list<item: struct<type: string, function: struct<name: string, description: string, parameters: string>>>, task_id: string, rollout_id: string, source_rollout_id: string, sample_id: string, branch_id: int64, parent_branch_id: null, segment_type: string, agent_type: string, message_count: int64, assistant_turns: int64, tool_turns: int64, reward: double, possible_compaction: bool, n_model_calls: int64, source_stage: string, repo: string, layer: string, total_tokens: int64, trainable_tokens: int64, trainable_ratio: double, dataset_version: string, split: string>
              to
              {'tools': List({'type': Value('string'), 'function': {'name': Value('string'), 'description': Value('string'), 'parameters': Json(decode=True)}}), 'task_id': Value('string'), 'repo': Value('string'), 'layer': Value('string'), 'source_rollout_id': Value('string'), 'reward': Value('float64'), 'segment_type': Value('string'), 'dataset_stage': Value('string'), 'environment_source': Value('string'), 'assistant_turns': Value('int64'), 'total_tokens': Value('int64'), 'trainable_tokens': Value('int64'), 'trainable_ratio': Value('float64'), 'reminder_tokens': Value('int64'), 'system_prompt_tokens': Value('int64'), 'tool_schema_tokens': Value('int64'), 'protocol_valid': Value('bool'), 'sft_excluded_reason': Value('null'), 'usage': {'input': Value('int64'), 'output': Value('int64'), 'calls': Value('int64'), 'elapsed': Value('float64')}}
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1880, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

messages
list
metadata
dict
[ { "role": "system", "content": "x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-cli;\nYou are a Claude agent, built on Anthropic's Claude Agent SDK.\n\nYou are an interactive agent that helps users with software engineering tasks.\n\nIMPORTANT: Assist with authorized security testing, ...
{ "tools": [ { "type": "function", "function": { "name": "Agent", "description": "Launch a new agent to handle complex, multi-step tasks. Each agent type has specific capabilities and tools available to it.\n\nAvailable agent types are listed in <system-reminder> messages in the conver...
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
[{"role":"system","content":"x-anthropic-billing-header: cc_version=2.1.258.33d; cc_entrypoint=sdk-c(...TRUNCATED)
{"tools":[{"type":"function","function":{"name":"Agent","description":"Launch a new agent to handle (...TRUNCATED)
End of preview.

Claude-Code-native Coding Agent Teacher Trajectories (GLM-5.3 × SWE-smith)

English | 简体中文

A private research archive of execution-verified, multi-turn coding-agent trajectories. A strong teacher (GLM-5.3) drives a real coding-agent harness (Claude Code) inside verified Docker environments derived from SWE-smith tasks; every trajectory is graded in a clean verifier container against the task's exact FAIL_TO_PASS / PASS_TO_PASS tests.

⚠️ PRIVATE dataset. Raw wire traces contain Claude Code harness-generated system/tool context and excerpts from the source repositories — see docs/LICENSE_NOTES.md before any redistribution or public release.

Dataset Summary

Teacher model GLM-5.3 (zhipu Anthropic-compatible endpoint)
Harness Claude Code 2.1.258 (multi-turn tool use: Read/Edit/Bash/Grep/…)
Task source SWE-smith (snapshot ea6d7173829c)
Target student Qwen3-4B trained with slime v0.3.2 (3778dbf)
Verifier clean Docker container, exact F2P/P2P + cheating checks

Core statistics (from data/metadata/, not hand-written)

Statistics dashboard

Metric Value
Task pool 59,136 tasks / 222 repos (SWE-smith full train split)
Sampled & terminal tasks 1,597 (deterministic seeds 20260915, 40/40/20 E/M/H, repo ≤ 5%)
Teacher attempted 1,207 (after environment gate)
Teacher solve rate 93.9% (1,134 solved / 1,207 attempted)
Usable SFT trajectories 1,003
Context-length excluded 131 (> 32,768 tokens; raw kept, never truncated)
Unique repos in SFT set 99 (max single-repo share 1.99%)
Difficulty (usable) Easy 469 / Medium 392 / Harder 142
Cheating / timeout 0 / 0
Teacher API cost 12.87M input + 2.95M output tokens / 15,360 calls
Raw archive ~2.0 GB (1,208 trajectories, 14 deterministic .tar.zst shards)
Median trajectory 23,389 total tokens / 1,598 trainable tokens (6.8% trainable)

Note the three distinct counts — 1,597 terminal tasks ≠ 1,134 teacher-solved ≠ 1,003 usable SFT — the funnel (environment gate → solve → context gate) is in docs/DATA_PIPELINE.md.

Where does the data come from?

  1. SWE-smith provides the software-engineering tasks: problem statements, injected-bug patches, repository/environment definitions (official conda-pinned envs, rebuilt locally as repo-level Docker images).
  2. Claude Code harness orchestrates the agent loop: tool invocation, context management, runtime reminders (<system-reminder>, <total_tokens>).
  3. GLM-5.3 (Teacher) generates all assistant content: reasoning, text, tool calls.
  4. Docker executes the real code operations (Read/Edit/Bash on the actual repository).
  5. Clean verifier (separate Docker B) replays the bug baseline, applies only the agent's git diff, runs exact FAIL_TO_PASS / PASS_TO_PASS tests and cheating checks → execution-verified trajectories (every usable row has reward = 1.0).

Uses

  • Coding-agent SFT (primary; see usage below)
  • Tool-use behavior modeling / harness behavior analysis
  • Agent trajectory research: multi-turn credit assignment, failure mining (all failed/oversized trajectories are archived in raw)
  • Agent data flywheel seeding

Not recommended: feeding raw wire JSONL directly as generic instruction-tuning data. Use data/sft/teacher_v2_candidates.jsonl for training — it is the derived, schema-stable training view.

How to train with slime (validated on slime v0.3.2)

python train.py \
   --rollout-function-path slime.rollout.sft_rollout.generate_rollout \
   --prompt-data /path/to/data/sft/teacher_v2_candidates.jsonl \
   --input-key messages \
   --loss-type sft_loss \
   --calculate-per-token-loss \
   --disable-compute-advantages-and-returns \
   --loss-mask-type qwen3 \
   ... # your model/parallel/optimizer args, e.g. scripts/run-qwen3-4B-base-sft.sh

Loss-mask semantics (generated at training time, this dataset ships no pre-tokenized ids): system / user / tool observations (incl. harness reminders) → masked; assistant reasoning / text / tool_call / EOS → trainable. This exact configuration passed a full pipeline dry-run (forward → backward → optimizer step → checkpoint save → restart → resume) on Qwen3-4B.

Reading the data with plain Python (no slime required)

import json

with open("data/sft/teacher_v2_candidates.jsonl") as f:
    row = json.loads(f.readline())

msgs, meta = row["messages"], row["metadata"]
print("task_id:", meta["task_id"])
print("repo:", meta["repo"], "| difficulty:", meta["layer"])
print("reward:", meta["reward"], "| total_tokens:", meta["total_tokens"])
print("num messages:", len(msgs), "| num tools:", len(meta["tools"]))
for m in msgs[:6]:
    extra = f" tool_calls={[t['function']['name'] for t in m['tool_calls']]}" if m.get("tool_calls") else ""
    print(f"  {m['role']:9s} {str(m.get('content'))[:60]!r}{extra}")

# locate this trajectory's raw wire archive
idx = [json.loads(l) for l in open("data/metadata/raw_index.jsonl")]
hit = next(r for r in idx if r["task_id"] == meta["task_id"])
print("raw shard:", hit["raw_shard"], "path:", hit["raw_internal_path"])

Trajectory visualization

Trajectory viewer

Open examples/example_trajectory.html (static, self-contained) to walk one reward=1 trajectory: Task → Teacher reasoning → tool call → tool result → Edit → Test → Verifier → Reward, including a per-message SFT mask view (gray = masked context, green = trainable assistant spans).

Regenerate for any trajectory with tools/trajectory_viewer.py (see tools/README.md).

Repository layout

data/sft/        teacher_v2_candidates.jsonl (1,003 rows) + pilot_train/val_v1 (59-row pilot split)
data/raw/        raw-000NN.tar.zst (14 shards, deterministic, byte-identical to source)
data/metadata/   raw_index.jsonl · candidate_manifest.json · production summaries/results
tools/           raw_to_sft.py · validate_sft_data.py · trajectory_viewer.py · build_sft_v1.py (+ config_example)
docs/            DATA_FORMAT.md · DATA_PIPELINE.md · LICENSE_NOTES.md
examples/        example_trajectory.html
publication_audit.json · RELEASE_MANIFEST.json

Limitations

  • Teacher = GLM-5.3: the data carries the teacher's behavior/style bias.
  • Harness = Claude Code 2.1.258: trajectories are native to this harness version (incl. its runtime reminders and repeated system/tool context).
  • Success-biased: official SFT candidates are execution-verified successes and do not represent the natural failure distribution (failures are archived in raw for mining).
  • Trajectories longer than 32,768 tokens are excluded from the SFT view (131 rows; kept in raw) — long-horizon behavior is under-represented.
  • Harder-difficulty retention is lower than the 20% sampling target (14.2% of usable) due to environment failures and context exclusions concentrating there.
  • Source-repository licenses are heterogeneous (docs/LICENSE_NOTES.md).
  • This dataset is not a benchmark; do not use it to claim agent rankings.
  • A repo-level held-out evaluation pool was frozen separately and is not included in this release (no task answers, teacher solutions, or gold patches of those tasks are present anywhere in this repository).

V2 Compact Addon (2026-09-24)

What is V2?

V2 is a set of compact-aware successful Coding Agent trajectories: full GLM-5.3 teacher sessions on SWE-smith tasks in which Claude Code's native context compaction actually fired (1 or 2 times) and the agent then continued and solved the task (execution-verified). Goal: train models to faithfully preserve agent working state across compaction and finish the task.

Teacher

GLM-5.3 (via Claude Code 2.1.258 harness, CC-visible 40k context, native compaction on).

Collection

  • Same 1003-task pool as V1 (train910 / val93 split inherited — see v2_compact/manifest.jsonl).
  • Collection protocol: v2_40k only (CC-visible context 40960 == teacher backend headroom; single protocol, no pilot mixing).
  • Each trajectory contains the real CC native compact request, the compact-fix forwarded shape, and the GLM summary response followed by a real post-compact continuation.

V2 filtering

Only kept: execution-verified SUCCESS · exactly 1 or 2 compactions · every summary passes quality (text non-empty, no tool_use, no thinking-only, no truncation, sentence-level negation-aware fabrication checks) · no verbatim transcription · no Autocompact thrashing · converter-valid.

Final counts: 189 trajectories (138 × 1-compact, 51 × 2-compact; train 173 / validation 16; 77 repos).

Why exclude 3+ compactions?

Repeated summary-on-summary rewriting compounds state distortion; we keep compaction as a long-context safety net, not an every-task behavior.

Important: state preservation supervision

The supervised signal emphasizes: completed-vs-not-completed state, actual file modifications, actual test execution/results, current hypothesis, pending work, next action, and anti-verbatim compression (summaries that merely copy tool output are filtered out).

Relationship with V1

V1 = 1003 execution-verified successful trajectories (no compaction). V2 = same-task / different-trajectory supervision collected under compaction. V1 + V2 do not mean more unique SWE tasks — the task pool is identical by design.


SFT-v2 Combined (2026-09-24)

sft_v2_combined/ = all of V1 (910/93) plus the clean V2 addon (173/16), one JSON per sample in the same slime message schema (messages + tools + metadata). Same task may appear twice (<task>::v1 and <task>::v2_compact) — this is by design (different supervision targets). Exact-duplicate trajectories are deduplicated by content hash; no silent truncation is applied (length statistics in stats/). aux/ holds compact-summary-only sub-samples for future ablation; the main combined split does not duplicate compact events as separate rows.

Format

Each line: {"messages": [...slime manager-schema messages...], "tools": [...25 CC tools], "metadata": {...}}. Tokenization/masking (Qwen3, slime qwen3 loss-mask): system/user/tool_result → mask 0; assistant reasoning/text/tool_calls → mask 1; compact request context → mask 0; GLM compact summary response → mask 1 (verified by token-level audit, 24/24 sampled).


Context-Correct Training View (2026-09-25) — RECOMMENDED

sft_v2_context_correct/ supersedes sft_v2_combined/ for training.

Why the change: the earlier full-session concatenation (sft_v2_combined/, kept as LEGACY_FULL_CONCAT_VIEW) preserved whole source trajectories but did not reproduce Claude Code's post-compaction visibility boundary — post-compact targets could attend to pre-compact history that the real runtime had already trimmed (audit: post-c1 targets saw on average ~9.9k leaked pre-compact tokens = 66% of their prefix; post-c2 ~28.9k = 81%).

The context-correct release splits training examples at native compact boundaries so that post-compact targets only condition on inference-visible state:

  • compact_summary_* segments: input = the real forwarded compact request (tools stripped, thinking disabled, flattened history, summary guard), target = the GLM summary (mask 1).
  • post_compact_* segments: start exactly from the real first post-compact model request (context reset; prefix equivalence with the wire request verified 20/20), then accumulate normally to the next boundary.
  • pre_compact_* segments: optional (RECIPE FULL_CORRECTED); the RECIPE COMPACT_FOCUSED files here drop them since V1 already covers normal agent policy.
  • Every assistant response is a loss-bearing target in at most one segment (audited: 0 duplicates).

Recommended training mix (RECIPE COMPACT_FOCUSED): V1 1003 full trajectories + V2 compact-summary segments (240) + V2 post-compact continuation segments (403) — loss-token shares: V1 56.5%, compact summaries 20.5%, post-compact continuation 23.0%.


SFT-v2 Compact-Aware Data — Final Structure (2026-09-25)

Three data concepts (do not conflate)

1. V1 — Normal Agent Trajectories

1003 execution-verified successful Coding Agent trajectories (train 910 / val 93). This is the base normal coding policy supervision.

2. V2 Full Source Trajectories — Provenance Only

189 eligible compact-aware successful sessions (1-compact=138, 2-compact=51). Preserved for provenance, compaction research, and converter reproduction. DO NOT TRAIN WITH NAIVE FULL CONCAT: native compaction resets the model-visible context; naively concatenating a whole session leaks pre-compaction history into post-compact SFT targets (audit: post-c1 targets saw ~9.9k leaked tokens = 66% of prefix; post-c2 ~28.9k = 81%).

3. V2 Context-Correct Split Data — RECOMMENDED for training

Sessions split at real native compact boundaries; each training prefix reconstructed from the actual model-visible wire request. Segments:

  • compact_summary (240): real CC forwarded compact request → GLM faithful summary (target, mask=1)
  • post_compact (403): real post-compact visible context → continuation agent behavior (mask=1)
  • pre_compact (247, optional recipe only; dropped in COMPACT_FOCUSED since V1 already covers normal policy)

V2 specifically targets failure modes observed in SFT-v1 native compaction: fabricated completion state · confusing planned with completed actions · losing actual file modifications · losing test execution/results · losing current hypothesis / next action · verbatim transcription instead of compression · failure to continue correctly after compaction.

Deployment-aligned 40k training-ready release

Target deployment: Qwen3-8B at REAL context 40960.

sft_v2_context_correct/compact_focused_40k/ = RECOMMENDED training mix:

  • train 1475 rows = V1 1003 + compact-summary 239 + post-compact 233
  • validation 154 rows = V1 93 + compact-summary ~1 + post-compact ~60 (per task split inherited from V1 910/93)
  • loss-token shares: V1 56.9% · compact summaries 20.7% · post-compact continuation 22.4%
  • all samples ≤ 40960 tokens; no silent truncation

sft_v2_context_correct/long_context_aux/: 17 segments > 40960 tokens (real wire long samples: 16 post-compact continuations + 1 large compact request). Valid source data, excluded from the deployment-aligned 40k main recipe. Preserved for future >40k training.

Legacy

sft_v2_combined/ = LEGACY full-concat view. NOT RECOMMENDED FOR TRAINING (context leakage). sft_v2_context_correct/ = the corrected release. Within it, compact_focused_40k/ is the deployment-aligned training-ready subset.

Downloads last month
657

Models trained or fine-tuned on liangzhidanta/claude-code-glm53-swesmith-trajectories