Find where your robot breaks before your customers do. BULLY picks on a robot policy in simulation until it fails, checks that the failure is actually the policy's fault, tells you how often it would happen in the field, and turns the failures into training data.
Left and middle: failures and distinct failure modes found in 1,024 policy episodes, 5 seeds. Right: field failure rate after retraining with 200 extra demonstrations, chosen three different ways.
- The gap is real. A pick-and-place policy that works 88% of the time in the conditions it was trained in fails in 67% of realistic field scenarios in the pilot run (200 of 300; different object mass and size, camera calibration error, control latency, someone bumping the table).
- Guided search finds failures about 2.7x faster than random testing. Against a policy that fails 11.6% of the time, 1,024 episodes of random testing find 115 failures. MAP-Elites finds 319 and the cross-entropy method 311. MAP-Elites also finds the most distinct failure modes (10.8 vs 8.4).
- Where you put the training data matters more than how much. 200 more demos at random scenarios cut field failures from 12.1% to 7.0%. 200 demos at scenarios where the policy failed cut them to 3.7-4.5%.
- Every failure is checked for fairness. A failure counts only if a scripted controller with exactly the same information succeeds in the same scenario. Otherwise the scenario is impossible, and nobody learns anything from it.
- This was pre-registered, and my own method lost. The search method I designed and named the repo after (
bully, adaptive importance sampling) beat random testing by only 1.16x; I had predicted at least 1.5x. Three of my eight predictions failed. They are all in the table below.
You cannot test a learned robot policy in every situation it will meet. Self-driving companies handle this with scenario-based testing: generate the nasty cases on purpose instead of waiting for them. Robot manipulation mostly still reports "success rate over N random trials", which has two problems. Failures that happen 1% of the time need thousands of trials to show up, and a number like "88%" says nothing about what breaks or how to fix it.
BULLY is the loop around that: search for failures, verify each one is the policy's fault, estimate how common they are in the field, explain them, and harden the policy on them.
Scenarios live in quantile space (bully/space.py). Every knob of the world has a field distribution: how it is actually distributed where the robot will work. A scenario is a point in the unit cube, and each coordinate goes through that knob's inverse CDF. So a uniform random point is a draw from the field, the search can never leave the spec, and for any sampling scheme the importance weight is just 1 / q(u).
The pick-and-place world has 18 knobs:
| Family | Knobs | Field distribution |
|---|---|---|
| layout | cube position and yaw, goal position, gripper start | uniform over the mat |
| object | mass 20-80 g, friction 0.6-1.4x, half-size 17-23 mm | uniform |
| robot | servo stiffness 0.8-1.2x, control latency 0 / 20 / 40 ms | uniform; 60% / 30% / 10% |
| perception | camera offset (3 mm std, cut at 10 mm), yaw error (3 deg std, cut at 10) | truncated normal |
| bump | someone bumps the table in 20% of episodes: when, how hard, which way | uniform when it happens |
The oracle filter (bully/targets/pick.py). A search will happily find scenarios nobody could solve. So every policy failure is re-run with an information-matched oracle: a scripted controller that sees exactly what the policy sees (calibration error included) in the same physics. The policy is blamed only if the oracle succeeds. In a first check the oracle solved 58 of 60 random field scenarios; in the 4,000-scenario ground-truth run, 24 failures were thrown out as infeasible.
Four ways to search (bully/search.py). All spend the same currency, policy episodes.
| Method | Idea |
|---|---|
random |
draw from the field distribution; what everyone does |
cem |
cross-entropy method: one Gaussian chasing the worst scenarios |
map_elites |
quality-diversity: keep the worst scenario per (failure stage, most unusual knob family) cell, mutate those |
bully |
adaptive importance sampling with a defensive mixture: half of each batch from the field, half from Beta distributions fitted to the failures so far. Its proposal density is known and bounded, so it also gives an unbiased failure rate |
Explain (bully/report.py). A shallow decision tree over the physical knob values turns failures into rules a person can read.
Harden (bully/harden.py). The oracle demonstrates the task at chosen scenarios, and the policy is retrained from scratch on old plus new demos with the same number of gradient steps.
Everything below was pre-registered in PREREG.md and committed (e4b77bf) before the runs. Target: a behavior-cloned policy trained on 200 nominal and 200 domain-randomized demos. Its true field failure rate, from 4,000 fresh random scenarios, is 11.6% (95% interval 10.6-12.6%).
Finding failures (1,024 policy episodes per run, 5 seeds):
| Method | Failures found (per seed) | Mean | vs random | Distinct modes (mean) |
|---|---|---|---|---|
| random | 115, 120, 128, 102, 112 | 115 | 1.00x | 8.4 |
| bully | 137, 141, 134, 122, 134 | 134 | 1.16x | 8.8 |
| cem | 214, 348, 417, 303, 274 | 311 | 2.70x | 8.2 |
| map_elites | 386, 257, 256, 432, 265 | 319 | 2.77x | 10.8 |
The guided methods also cost more oracle checks, because every failure triggers one: 1,366 simulated episodes for MAP-Elites against 1,145 for random. Per simulated episode MAP-Elites still finds 2.3x more.
Failure-rate estimates (truth: 11.6%):
| Method | Estimates over 5 seeds | Intervals containing the truth | Mean standard error |
|---|---|---|---|
| random testing | 11.2, 11.7, 12.5, 10.0, 10.9% | 5 of 5 | 0.99 points |
| bully (importance sampling) | 13.0, 11.4, 11.7, 11.5, 12.5% | 5 of 5 | 1.09 points |
Hardening (200 extra demos, retrain, evaluate on the same 1,000 fresh field scenarios, 3 seeds):
| Where the 200 new demos come from | Failures per 1,000 (per seed) | Field failure rate |
|---|---|---|
| nothing added | 121 | 12.1% |
| 200 more random field scenarios | 67, 74, 68 | 7.0% |
| failures found by random testing (about 115, padded with random scenarios) | 25, 42, 45 | 3.7% |
failures found by bully |
29, 40, 65 | 4.5% |
What actually breaks. Of the 464 ground-truth failures, 399 never lift the cube, 55 are still holding it when time runs out, 9 drop it and 1 puts it in the wrong place. The one rule the tree found: when the cube and the goal are both on the far side of the mat (cube_x > 0.434 m and goal_x > 0.391 m and cube_y > -0.056 m), the policy fails 31% of the time, 2.7x the average, and that region holds a third of all failures.
| Prediction | Verdict | |
|---|---|---|
| H1 | bully finds at least 1.5x more failures than random, in every seed |
Failed. Every seed is higher, but the ratio is 1.16x |
| H2 | MAP-Elites finds at least as many modes as random | Held (10.8 vs 8.4) |
| H2 | bully finds at least as many modes as random |
Held, barely (8.8 vs 8.4) |
| H2 | CEM finds fewer modes than random | Held, barely (8.2 vs 8.4) |
| H3a | bully's interval contains the true rate in at least 4 of 5 seeds |
Held (5 of 5) |
| H3b | bully's estimate is tighter than random testing's |
Failed. 1.09 vs 0.99 points |
| H4 | Order of field failure rates: bully-failures < random-failures < more-random | Failed. Random-testing failures did best (3.7% vs 4.5%) |
| H4 | Demos at bully's failures beat more random demos in all 3 seeds |
Held (29, 40, 65 vs 67, 74, 68; the third seed by 3 failures) |
- Use MAP-Elites to find failures. It was the best finder and the most varied one, and it was the baseline, not my idea.
bullyis the honest-estimate method, not the fast one. Spending half of every batch on plain field samples is what keeps its estimate unbiased, and it is also why it barely beats random at finding things. On the toy world with two sharp failure corners it does beat random by more than 1.5x (that is a test); on a real policy with diffuse failures it does not.- Train on failures, wherever they come from. Demos at failure scenarios roughly halved the failure rate compared with the same number of random demos. The difference between the two failure sources (3.7% vs 4.5%) is within seed-to-seed spread with 3 seeds:
bully's runs ranged from 2.9% to 6.5%. - At an 11.6% failure rate, random testing is a decent baseline. Guided search should matter more when failures are rare. That was not tested here.
pip install git+https://github.com/nonberw/bullyA toy world with a known answer, instant:
bully toy --method bullyPick on the shipped pick-and-place policy (a few minutes on a laptop CPU):
bully hunt --method map_elites --budget 1024 --out hunt.npzPick on your own SPUD behavior-cloning policy:
bully hunt --policy my_bc.pt --method random --budget 2000From Python, hardening included:
import numpy as np
from bully import harden
from bully.search import map_elites
from bully.targets.pick import PickTarget
target = PickTarget("my_bc.pt", workers=3)
hunt = map_elites(target, budget=1024, rng=np.random.default_rng(0))
demos = harden.collect(hunt.U[hunt.failures][:200]) # the oracle demonstrates at the failures
harden.train(harden.load_demos("old_demos.npz") + demos, "hardened.pt")Your own robot: a target is a Space plus an evaluate(U) that returns outcomes with success, valid, rho and stage. bully/targets/toy.py is the 60-line template.
Reproduce the paper-style numbers (about 5 hours on a laptop CPU, restartable):
python -m spud.cli demos --episodes 200 --noise 0 --seed 10000 --overwrite --out data/demos_nominal.hdf5python scripts/run_main.pypython scripts/analyze.py- One known bug in the scenario decoder, left in on purpose. When the goal cannot be pushed 12 cm away from the cube inside the mat, it stays closer. This affects 4.7% of scenarios and only makes them easier, the same for every method. The published runs used it, so v0.1 pins it with a test instead of quietly fixing it.
- The run crashed once (out of memory, another project was training on the same laptop) during the hardening stage and was resumed from its done-markers. No finished result was recomputed.
- One task, one policy family, simulation only. A behavior-cloned MLP on state observations, not a vision policy and not a real robot.
- Small sample sizes where it matters. 5 seeds for search, 3 for hardening, and the hardening runs share one evaluation set.
- The table bump barely matters. Friction stops a 4 cm cube within millimeters, so that knob family is weaker than it sounds.
- The oracle is not perfect. It fails about 3% of field scenarios itself, so a few genuinely hard-but-possible scenarios get discarded as infeasible.
- Not run: hardening on MAP-Elites' failures (
scripts/run_exploratory.pyexists, the run was cut short), and the rare-failure regime.
The ideas here are not new; the combination and the honest scoreboard are the point.
- Uesato et al., Rigorous Agent Evaluation: An Adversarial Approach to Uncover Catastrophic Failures, ICLR 2019: adversarial evaluation with unbiased failure-rate estimates.
- Corso et al., A Survey of Algorithms for Black-Box Safety Validation of Cyber-Physical Systems, JAIR 2021: falsification, most-likely failure and failure-probability estimation.
- Mouret and Clune, Illuminating search spaces by mapping elites, 2015: MAP-Elites.
- Recent red-teaming of manipulation policies: RoboFail (arXiv 2412.02818), Geometric Red-Teaming for Robotic Manipulation (CoRL 2025), Embodied Red Teaming for Auditing Robotic Foundation Models (arXiv 2411.18676).
bully/
space.py knobs, field distributions, quantile space
search.py random, cem, map_elites, bully
report.py Wilson and importance-sampling estimates, failure modes, decision-tree rules
harden.py oracle demos at chosen scenarios, retraining
targets/pick.py SPUD pick-and-place with 18 knobs and the information-matched oracle
targets/toy.py a world with a known answer; also the template for your own target
cli.py bully hunt | toy
assets/ pick_bc.pt (nominal-only policy), pick_p1.pt (the target of the experiment)
scripts/ run_main.py (the pre-registered experiment), analyze.py, pilot.py
results/ results.json: every number in this README
tests/ 17 tests: field distributions, unbiasedness on the toy, rules recover planted failures,
the scenario env matches SPUD step for step, knobs do what they say, oracle bookkeeping
PREREG.md hypotheses and thresholds, committed before the runs
ARMageddon (IK) · YOINK (vision pick-and-place) · COPYCAT (imitation learning) · ZOOMIES (RL locomotion) · LISTEN, SUSS, VIBES (research) · SPUD (simulation on weak hardware) · BULLY (breaking robots on purpose)
Why is it called BULLY if the bully method lost?
Because the name was picked before the results, and renaming the repo after the winner would be rewriting history. The tool bullies robots. The method named bully turned out to be the polite one.
Is bullying robots ethical? It is a 6-DoF arm in MuJoCo and it has it coming.
