cellbot1

cellbot1 is Qwen3-0.6B post-trained to control a swarm of about 100 robots from text. At every step it reads an instruction and the current state of a 32×32 cellular grid, and outputs a distribution over 9 moves for every cell.

A swarm in MuJoCo given five instructions in turn

The run above is one swarm in MuJoCo given five instructions in turn: "eat the red cheese", "eat the green cheese", "stop", "move to the top right corner", "clear the board". Each instruction is replaced by the next while the swarm is still moving.

Live demo · Code · Training details

Model

The grid is encoded as 10 channels (robots, walls, a cheese mask and its RGB colour, a box mask and its RGB colour) and split into 64 patches of 4×4 cells. Each patch is linearly projected to the model's hidden size and given learned row and column embeddings. The instruction is tokenised normally and placed before the patch tokens. Text tokens attend causally to text only, as in pre-training, and patch tokens attend to all tokens. A linear layer maps each patch token's final hidden state to 16 cells × 9 moves, so one forward pass gives 9,216 logits. Each robot samples the move of the cell it occupies, with classifier-free guidance at scale 2.

This repository holds only the trained parameters: a rank-64 LoRA on every attention and MLP projection, the patch projection, the position embeddings and the readout, about 41M in total (cellbot1.safetensors, float16). The frozen base model is loaded from its own repository.

Training

Behaviour cloning on episodes from scripted experts over a generated suite of instruction families, mixed with play episodes captioned by Claude Haiku 5.5, and a KL loss toward the frozen base model on general text, instruction data and GSM8K. Held-out perplexity was 28.0 at the start of the last run and 28.2 at the end. Training used about 40 hours of Kaggle T4 time and stopped with validation loss still decreasing (0.40 to 0.31 over the last run).

Results

Each instruction was run on 8 fresh scenes. A run counts as a success if the task's checker is satisfied at the end and no cheese was eaten that the instruction did not ask for. The model was trained only on the grid.

instruction MuJoCo grid
eat the red cheese 8/8 7/8
eat either yellow or purple 7/8 7/8
clear the board of cheese 7/8 6/8
go into the blue box 7/8 8/8
move left 7/8 7/8

For the five-instruction sequence above, run on 24 fresh scenes, all five instructions were carried out in 12 runs and the last one in 21, both in MuJoCo and on the grid.

Use

pip install git+https://github.com/fringewidth/cellbot
import numpy as np
import torch

from cellbot.policy.inference import lm_sampler, load_policy, tokens
from cellbot.sim.world import observe, step
from cellbot.tasks import suite as T

device = torch.device("cuda")  # or "mps", "cpu"
policy, tokenizer = load_policy("fringewidth/cellbot1", device)
sample = lm_sampler(policy, guidance=2.0, n=T.SIZE // 4)

scene = T.sample_scene(np.random.default_rng(0), cheeses=(1, 4), boxes=(0, 2))
world, _ = T.stack([scene])
world = world.to(device)
cond = tokens(tokenizer, ["clear the board"], device)
with torch.no_grad():
    for _ in range(100):
        _, field = sample(observe(world), cond)
        world, info = step(world, field)

Limitations

Everything is simulated, on a 32×32 grid, and the model sees only the current frame. Cheeses in corners or narrow pockets are hard to surround. Pushing a cheese to a chosen place is weak: on 32 fresh tasks each, the model pushed a cheese into the nearest corner it was asked for in 4, and moved a cheese at least 2 cells in a named direction, without eating it, in 5.

Downloads last month
-
Video Preview
loading

Model tree for fringewidth/cellbot1

Finetuned
Qwen/Qwen3-0.6B
Adapter
(774)
this model