I paid my robot to walk. It learned to stand still.

My reward paid a robot that never moved 0.956 of the maximum. Tuning it was a patch; giving the robot a walk to copy was the fix.

What the optimizer picked

Stand still

Matching the speed
0.956
Cost of moving
0.000
Paid per step
0.956

Walk perfectly

Matching the speed
1.000
Cost of moving
≈ −0.27
Paid per step
≈ 0.73
What my reward paid on Sep 16, per step, when asked to walk at 0.15 m/s. The robot can read a receipt.

1What I was trying to do

In September Kartikeya only existed in simulation. I was training its walking policy with reinforcement learning: thousands of copies of the robot try things in parallel, and a reward tells them what was good.1

  1. 1Reinforcement learning: the policy is a small neural network. It tries actions, the reward scores them, and the network is nudged toward whatever scored well.

I had two goals. The robot should walk in a way that looks like walking, not a shuffle. And whatever it learned had to survive a second simulator that runs the real motor loop, 500 times a second with a 2 ms delay, because that is the robot it will actually be.

The reward I started from is the standard one: tell the robot a speed, and pay it for matching that speed. Ask for 0.15 m/s, walk at 0.15 m/s, collect the full reward.

2The number to beat

Before any learning, I already had a walk: a hand-written gait, an open-loop pattern of joint angles I tuned myself. It covered 1.058 m in the motor-faithful check. The bar for a learned policy was simple: at least 1.0 m, in all 8 test cells, without falling.

3First try: it stood there

Run 3 trained for hours. The reward climbed to about 11 and then went flat. Episodes lasted about 950 of 1,000 steps, so it was not falling. It was not walking either. The reward term for lifting a foot read 0.003.

The robot stood, and slid. Sliding its feet along the floor collected 0.74 of the speed reward without ever taking a step.

My first move was the usual one: turn the knobs. Pay more for lifting feet (1.5 → 5.0), punish sliding harder, ask for faster speeds so standing would look worse. It still stood.

4Doing the arithmetic

So I stopped turning knobs and did the math on the reward itself. The speed term is a bell curve around the command: reward = exp(−(command − speed)² / σ), with σ = 0.5.2

  1. 2σ sets the width of the bell. A wide bell forgives being off the target speed; a narrow one does not.

Plug in a robot that does not move. For a 0.15 m/s command, standing still earns exp(−0.0225 / 0.5) = 0.956 of the maximum.

00.5100.150.30.45robot speed, m/sasked for 0.15standing still: 0.956
Fig. 1. The reward for matching a commanded speed. A robot that never moves sits on the left edge. With the width I trained with, it collects 0.956 of the most it could ever earn. The tighter width cuts that, but for a slow command standing still still pays 0.835.

Walking perfectly is worth 0.044 more than standing. Moving costs about 0.27 per step in the other terms. The optimizer did exactly what I asked: standing still was the best policy on offer.

There were two more bugs hiding under it. The foot-lift term had no floor, so a short hop counted as a cost; over an episode it summed to −6.5. And the total reward was clipped at zero, so every step of a fall scored the same. A robot that was falling got no signal about which way was up.

5A patch, and then a different question

The obvious fix is to narrow the bell. At σ = 0.125, standing’s income across the commands I was training on drops from 0.66 to 0.22.3 I made that one of six variants. But it is still a number I picked, and Fig. 1 shows the problem with picking: for a slow command, standing still still pays 0.835. Any reward I write by hand has a cheapest way to collect it, and the robot will find it before I do.

  1. 3Averaged over commands from 0.3 to 0.6 m/s, the range I had moved training to. Both numbers are from the formula, not a run.

So I changed what the reward asks for. Instead of “go this fast”, it became “move like this”. Three things went in on Sep 16:

A clock. A phase signal with a 1.20 s period tells each leg when it should be in the air: the right foot leaves at the start of the cycle, the left halfway through.4

  1. 4The period is 2 × (0.40 s swing + 0.20 s double support), from my hand gait. The robot sees the clock as a sine and a cosine, so the end of a cycle looks like its start.

A walk to copy. A term that pays the robot for matching joint angles from my own hand gait: hip pitch swinging 18.8° peak to peak, the knee 13°.5 I deliberately left out a reward for feet touching the ground in phase, because standing with both feet down collects it for free.

  1. 5Similar in spirit to DeepMimic (Peng et al., 2018), which trains characters to imitate motion clips. My clips were my own hand-tuned gait, not motion capture.

A mirror. Every experience is also learned flipped left to right, so the two legs do not drift into two different gaits.

6Before and after

A policy trained this way was the walker of record by Sep 17.

Sep 16, paid for speed

stood still

Sep 17, paid for copying a walk

2.98 m, 8 of 8

It walked 2.98 m in all 8 test cells, leaning 7.0° at worst, well past the 1.0 m bar.

7What this does not show

It is not a clean A/B. On Sep 17 I also switched the simulator to the correct body: the old model weighed 44 kg, the real design 68.5 kg.6 The run that stood and the run that walked were not the same robot.

  1. 6The 44 kg model came from a redesign that had been retired for the hardware, but the simulator was still using it. Every walking number before Sep 17 was measured on it.

The loopholes did not stop. Five days later a policy put its feet down 184 times in a walk the plan does in 14 steps: a shuffle. In October, a walker stopped at the lip of an 8° downhill ramp, because nothing in training made stopping cost anything. Each fix was right. Each one was another hand-written number.

And all of this is simulation. Kartikeya has not taken a powered step yet.

8Where this goes next

If copying a walk works better than describing one, the end of that road is a policy that does nothing but copy: a tracker that follows reference motions, with no speed reward left to game. That is SuperMimic, a recent method that learns a model of the physics and uses it to train exactly that kind of tracker.7

  1. 7I am going from the paper and two MIT-licensed reproductions, not my own run. The reproduction I read reports matching the paper’s motion-tracking score in about 1.9 hours on one GPU.

I planned it in October and dropped it on Nov 1. Part of my case for it was wrong: I thought only about 30% of my policies survived the motor-faithful check because of the training simulator. That turned out to be a bug in the check itself, two hip motors with their commands swapped. What is left of the case is the part this entry is about. The references would come from my own walking generators, the same ones that wrote the hand gait.

It has never run on this robot. The authors released no code; the open reproductions only cover Unitree’s G1, and only motion tracking. They run on MuJoCo Warp, which needs an NVIDIA GPU. I want to train it locally, and my Mac has none, so the first number to measure is how fast it trains on the Jetson in Kartikeya’s frame. That number decides whether this happens at home or not at all.

9What I’d tell someone starting this

Before you train anything, plug “the robot does nothing” into your reward and read the number. It is one line of arithmetic. Mine said 0.956, and I learned it the slow way, on rented GPUs.

← Writing