File size: 5,990 Bytes
c2dd28a
 
4f52212
 
 
 
 
 
 
 
 
 
 
c2dd28a
4f52212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
license: mit
task_categories:
  - reinforcement-learning
tags:
  - reinforcement-learning
  - physics
  - offline-rl
  - behaviour-cloning
  - jax
  - procedural-generation
size_categories:
  - 1B<n<10B
---

# Kinetix-Offline

**3 billion expert transitions across 11 million unique physics-based tasks.**

<p align="center">
  <a href="https://arxiv.org/abs/2410.23208"><img src="https://img.shields.io/badge/arxiv-2410.23208-b31b1b" /></a>
  <a href="https://github.com/FLAIROx/Kinetix"><img src="https://img.shields.io/badge/code-FLAIROx%2FKinetix-black" /></a>
  <a href="https://kinetix-env.github.io/dataset"><img src="https://img.shields.io/badge/blog-Kinetix%2010M-blue" /></a>
</p>

## Overview

This dataset contains offline expert trajectories collected in [Kinetix](https://kinetix-env.github.io/), a JAX-based 2D rigid-body physics environment where tasks are procedurally generated. Every task shares the same goal: make the **green** and **blue** objects touch, without **green** touching **red**. The agent acts by applying torques via motors and forces via thrusters.

Specialist PPO agents were trained independently per procedurally generated task (i.e., level), and only successful trajectories from solvable levels are included (~50% of all generated levels are solvable).

We have ~3B transitions from over 11M unique tasks.
## Dataset Splits

Datasets are named `{policy_steps}/{size}`, where `policy_steps` is the number of RL training steps used per specialist agent and `size` is the environment complexity (`s`mall, `m`edium, `l`arge).

| Expert Training Steps | Size | Unique Levels | Transitions | Size on Disk |
|---|---|---|---|---|
| `1M` | `s` | 5.98M | 1.53B | 123 GB |
| `1M` | `m` | 3.45M | 884M | 98 GB |
| `1M` | `l` | 1.05M | 268M | 82 GB |
| `10M` | `s` | 637k | 163M | 12 GB |
| `10M` | `m` | 422k | 108M | 11 GB |
| **Total** | | **11.5M** | **~3B** | **326 GB** |

## Data Format

Data is stored as [zarr](https://zarr.readthedocs.io/) archives. Each batch has shape `(batch_size, T, *dims)` with T=256 and is returned as an `ActionEnvStateMask` object:

| Field | Shape | Description |
|---|---|---|
| `action` | `(B, T, A)` | Expert action at each timestep |
| `env_state` | `(B, T, ...)` | Full simulator state (use to re-render in any modality) |
| `action_mask` | `(B, T, A)` | Which action dimensions are active (motors/thrusters present in this level) |
| `done` | `(B, T)` | Episode termination flags |
| `mask` | `(B, T)` | Always `True` — dataset contains only successful trajectories |

Because the full `env_state` is stored, you can render observations at training time in any modality (symbolic graph or pixels) without storing raw frames.

## Usage

### Downloading

```bash
# Entire dataset (~326 GB)
hf download mbeukman/Kinetix-Offline --repo-type dataset --local-dir ./data

# Single split, e.g. medium-size 1M-step experts (~98 GB)
hf download mbeukman/Kinetix-Offline --repo-type dataset --local-dir ./data --include "1M/m/*"

# Single split, e.g. medium-size 10M-step experts (~11 GB)
hf download mbeukman/Kinetix-Offline --repo-type dataset --local-dir ./data --include "10M/m/*"
```

Replace `1M/m` with any `{policy_steps}/{size}` combination from the table above.

### Loading Data

```python
from kinetix.data import TrajectoryDatasetManager

traj_manager = TrajectoryDatasetManager(
    dataset_dir="/path/to/traj_data",
    batch_size=64,           # number of trajectories per batch
)
batch = traj_manager.load_next_batch()  # shape (64, T, *dims)
```

See [`examples/example_data_loading.py`](https://github.com/FLAIROx/Kinetix/blob/main/examples/example_data_loading.py) for a full runnable example including GIF rendering.

### Rendering Pixel Observations

Because the raw environment state is stored, you can render frames in any observation modality at training time without storing raw pixels:

```python
import jax
from kinetix.environment import EnvParams, static_env_params_from_size
from kinetix.render import make_render_pixels

static_env_params = static_env_params_from_size("m")  # match your downloaded split
renderer = jax.jit(make_render_pixels(EnvParams(), static_env_params))

# Render a full batch of trajectories: (B, T, H, W, C)
frames = jax.vmap(jax.vmap(renderer))(batch.env_state)
```

### Behaviour Cloning

A full BC training script is included in the Kinetix repository:

```bash
python3 experiments/offline_bc.py dataset_dir=/path/to/data env_size=m
```

Configuration lives in [`configs/offline_bc.yaml`](https://github.com/FLAIROx/Kinetix/blob/main/configs/offline_bc.yaml).

## Why Use This Dataset?

**Massive task diversity**: With 10M+ unique levels, this dataset makes it possible to study how offline agent performance scales with task diversity, and what challenges emerge when learning across millions of tasks.

**Dynamic rendering**: Raw environment state is stored rather than pre-rendered frames, so the full 3B-transition dataset fits in 326 GB. The rendering function is specified at runtime, meaning the same data can train symbolic or pixel-based agents simply by swapping the renderer.

**White-box evaluation**: Stored environment states allow online evaluation from any point in a trajectory, on training levels, unseen levels from the same distribution, or the hand-designed benchmark set.

## Citation

If you use this dataset, please cite the Kinetix paper:

```bibtex
@article{matthews2024kinetix,
  title={Kinetix: Investigating the Training of General Agents through Open-Ended Physics-Based Control Tasks},
  author={Michael Matthews and Michael Beukman and Chris Lu and Jakob Foerster},
  booktitle={The Thirteenth International Conference on Learning Representations},
  year={2025},
  url={https://arxiv.org/abs/2410.23208}
}
```

## Acknowledgements

Compute for this work was provided by the Isambard-AI National AI Research Resource under the project "FLAIR 2025 Moonshot Projects". Thanks to Alex Goldie and Jarek Liessen for useful discussions.