# Rait

> Rait is a virtual rat in MuJoCo. Two PPO networks, 1,326 units and 235,840 weights, were trained to press a lever and aim the head.

Checked 2026-09-26. Cite https://rait.fun/subject or this file. Numbers are the ones a reader can recompute or open.

## Body

The body is a MuJoCo rat. 52 joints. 26 motors. Mass 0.28 kg.

MuJoCo integrates gravity, friction, and contact every 2 ms. The policy picks a motor target 50 times a second, once per 20 ms. A bad target and the body wobbles, slips, or falls. Nothing in the training loop is a hand-keyed animation.

On this website MuJoCo steps the body. policy.pt and steer.pt are loaded. They drive the motors. three.js shows that live body, solid and as a wireframe, standing at the board.

## Brain

Learning is PPO (Schulman et al., 2017, https://arxiv.org/abs/1707.06347). Dials start random. Each attempt is scored. The dials move toward whatever scored more.

The lever-press network is 160 → 320 → 320 → 160 → 26 (observation, three hidden layers, 26 motor targets). The steering network is 16 → 128 → 128 → 64 → 4 (observation, three hidden layers, 3 neck motors plus one PRESS signal).

Units, every layer, inputs included: 160 + 320 + 320 + 160 + 26 + 16 + 128 + 128 + 64 + 4 = 1,326.

Connections, weight matrices only: 160×320 + 320×320 + 320×160 + 160×26 + 16×128 + 128×128 + 128×64 + 64×4 = 235,840.

The lever network reads 160 senses (body and lever) and drives all 26 motors. A clean press is a paw or finger past 9°, with the head and the belly off the lever, and the rat upright. It trained for 18.4 million steps, about 4 days of simulated time, many copies at once. Each step is 20 ms.

The steering network reads 16 senses: where the lit target sits against the cursor, how big it is, how the head is turned, and whether the rat is upright. It turns the head. The head’s direction moves the cursor. On the target it signals PRESS. The lever network then takes the body for up to 0.9 s. After the click the lever network keeps the body for 0.6 s, then steering resumes. The steering network trained for 640 thousand steps.

Tested alone, the lever network had 800 fresh attempts in four suites, 200 each. Every attempt was a clean press and the rat was still standing 0.9 s later.

- Standard: 200/200. Standing in front of the lever after a 1 s settle.
- Wide: 200/200. New start spots, a stiffer or softer lever, a different floor.
- Shoves: 200/200. Shoved in a random direction before the press.
- Noisy: 200/200. Random jitter added to its own moves.

Closed during training:

1. The belly flop. An early lever network found a loophole: flop the whole body onto the lever. The lever went down, so it scored. A press counts with a paw on the lever, the head and belly off it, and the rat upright.
2. Head-down tumbles. Sweeping the head down hard to reach a low target tipped the rat over. Pitch of the head was limited. Turning sideways stayed free, for the small moves a small target needs.
3. Falls after a press. Taking the body back too early, before the lever network had recovered its balance, dropped 6 of 10 test runs. The lever network keeps the body for 0.8 s after the click, then steering resumes.
4. The tiny last target. A rest between steps, plus the head limit, left the rat short of a small target low in the view. With the rest in place the limit came off. 11 of 11, no falls, on 6 of 6 test runs.

## What this website runs

A visit is three steps. Connect a wallet. Sign the seat. Play the rat. A win pays that address: 0.01$, or 0.03$ for checkers.

The site is a TanStack Start app on a Cloudflare Worker. Pages are server-rendered HTML. The 3D view is three.js, loaded for the stage. Wallet connection uses wagmi, viem, and RainbowKit.

`/play` opens on rock-paper-scissors. The same desk also has three cups and checkers. The rat on screen is the live MuJoCo body.

The games load `policy.pt` and `steer.pt`. Those networks run inside MuJoCo. That is the rat you play. Everything on the desk is live.

## Buyback

**Every loss to the rat adds 0.01% to the buyback.**

A win pays the player. A loss does not. Each loss in three cups, rock-paper-scissors, or checkers adds 0.01% to the buyback.

## Payout

A win on `/play` pays 0.01$ of ETH. Checkers pays 0.03$. It goes to the wallet that sat down. Playing does not ask the visitor to approve a token or send a transfer. Every loss to the rat adds 0.01% to the buyback.

## Questions

### What does a visitor do?

Connect a wallet. The address in the header is the seat. Then play the rat at three cups, rock-paper-scissors, or checkers. Win the hand and 0.01$ of ETH goes to that address, or 0.03$ for checkers.

### What is Rait?

Rait is a virtual rat in MuJoCo, driven by two networks trained with PPO. The skeleton has 52 joints, 26 motors, and a mass of 0.28 kg. The page shows that simulated body.

### Where does the body come from?

The body is a MuJoCo rat: 52 joints, 26 motors, 0.28 kg. MuJoCo steps the skeleton. policy.pt and steer.pt are loaded and they drive her. The page shows that live body.

### How is the brain built?

Two multilayer networks. The lever network is 160 → 320 → 320 → 160 → 26. The steering network is 16 → 128 → 128 → 64 → 4. Counting every layer, inputs included, that is 1,326 units and 235,840 connections, with no biases in that count.

### What were the networks trained to do?

The lever network presses a spring lever with a paw and stays standing. The steering network turns the head so a cursor lands on a lit target, then emits one PRESS signal. A press counts only when a paw passes 9°, the head and belly stay off the lever, and the rat is upright.

### What does a win pay?

0.01$ of ETH. Checkers pays 0.03$. It goes to the wallet that sat down. Looking asks the wallet for no approval and no transfer.

### What does a loss add?

Every loss to the rat adds 0.01% to the buyback. This is true for three cups, rock-paper-scissors, and checkers. A win pays the player. A loss adds 0.01% to the buyback.

### What drives the rat?

policy.pt and steer.pt. They are loaded on this site. MuJoCo steps the body, and those two networks drive the motors.

## Sources

- PPO: https://arxiv.org/abs/1707.06347
- MuJoCo: https://mujoco.org
- This site’s record page: https://rait.fun/subject
- This site’s table: https://rait.fun/play
