Solving Rubik’s Cube with a robot hand
# Solving Rubik's Cube with a Robot Hand OpenAI trained a human-like robot hand to solve a Rubik's Cube using neural networks trained entirely in simulation. The approach pairs the reinforcement learning code behind OpenAI Five with a new technique called Automatic Domain Randomization (ADR), which generates progressively harder simulated environments without human tuning. The resulting system transfers to the physical world and handles perturbations it never saw during training, showing that reinforcement learning can solve dexterous physical manipulation problems, not just virtual ones. ## Why Dexterous Manipulation Is Hard - Robotics has long required custom robots for each task, while general-purpose hands have struggled because of their many degrees of freedom. - The team's hardware, a robot hand that has existed for about 15 years, was not new. The novelty was in the software approach. - Solving the cube one-handed is difficult even for children, who take several years to develop the necessary dexterity. ## Training in Simulation with Automatic Domain Randomization - The system uses reinforcement learning in simulation, with Kociemba's algorithm choosing the solution steps. The networks learn the required face rotations and cube flips. - Manually randomizing physics parameters such as friction, elasticity, and dynamics is hard. Too little randomization fails to transfer to the real robot, and too much makes learning difficult. - ADR begins with a single nonrandomized environment. When the network exceeds a performance threshold, the randomization range expands automatically, such as the cube's size, mass, finger friction, or surface materials. The cycle repeats, so training never converges and always stays challenging. - In a block-flipping comparison, ADR initially performed worse than manual randomization on the real robot but eventually roughly doubled the baseline's transfer performance without human tuning. ## Robustness and Emergent Meta-Learning - The ADR-trained system handled perturbations it was never trained on, performing most flips and face rotations under all tested conditions, though not at peak performance. - The authors hypothesize that a memory-augmented network trained on unboundedly varied environments develops meta-learning, learning to adapt its behavior at deployment time. - In simulation, averaged over 10,000 trials, perturbations such as resetting memory, changing dynamics, or breaking a joint caused time-to-success spikes that recovered as the network re-adapted. - Non-negative matrix factorization of the network's memory revealed groups with semantic meaning. For example, the dominant memory group could indicate whether the network was about to spin the cube or rotate the top face clockwise. ## Current Limitations - The system solves a maximally difficult 26-rotation scramble 20% of the time, and a 15-rotation scramble 60% of the time. - Most failures occur during the first few rotations and flips, as the network balances solving with adapting to the physical world. - A dropped cube counts as a failure, though the network can resume solving from any state if the cube is returned to the hand. ## Prototypes Used Along the Way - The team built custom cube prototypes with increasing sensing capabilities, ranging from a locked cube with no internal sensors to a cube with built-in sensors (the Giiker cube), to benchmark progress before tackling a regular cube. - The only modification to the regular cube was cutting a small piece of each center sticker to break rotational symmetry, which allows the vision system to determine orientation. The authors see human-level dexterity as a step toward general-purpose robots. ADR offers a way to train physical-world policies without an accurate model of the real environment, and it removes the need for domain-specific tuning when applying the method to new tasks.