November 1, 2026
Should a Robot Think Harder When It's Unsure? Testing Uncertainty-Gated Compute
20 min read
Here’s an idea that sounds obviously right.
A robot plans its next move by imagining thousands of possible futures and picking the best one. Imagining futures costs compute. Most of the time the robot is in familiar territory and a few hundred imagined futures are enough. Sometimes it’s somewhere strange, and then it should imagine many more.
So: measure how unsure the robot is, and only spend big compute when it’s unsure. Save effort on easy steps, spend it on hard ones.
I spent several months testing this idea carefully, on six different GPUs, and the short version is: it didn’t work the way the intuition says. The reasons it didn’t work turned out to be more interesting than the idea itself.
The setup
The controller (MPPI). At every step, the controller samples K random variations of its current plan (“rollouts”), simulates each one using a learned model of the world, scores them, and blends the good ones into a new plan. More rollouts usually means a better plan, but each step costs more.
The uncertainty signal (ensemble disagreement). Instead of one learned model, we train five, each on a slightly different resample of the data. Where they all agree, the robot is probably on familiar ground. Where they disagree, it’s probably somewhere it hasn’t seen much. That disagreement is a standard, widely used “how unsure am I?” signal.
The gate. Before each step, a cheap pilot (25 short rollouts) measures
disagreement along the current plan. If it’s above a threshold, the step uses
K_max rollouts. Otherwise it uses just K_min = 100.
The uncertainty-gated controller. A cheap pilot decides, every step, whether this step deserves the big budget.
The tasks. A pendulum that has to swing itself upright (simple, but hard enough that planning matters), plus a two-link robot arm in the MuJoCo physics simulator as a second check.
I asked three questions:
- Does the gate spend rollouts more wisely than just using a fixed number every step?
- Is the gate faster in wall-clock time than always using the big budget? From which budget on?
- What kinds of “something is wrong” can the disagreement signal actually see?
Finding 1: The gate doesn’t spend rollouts more wisely
This is the main result, and getting the comparison right matters.
The tempting comparison is gated vs. always-K_max. The gated controller uses
far less compute, so if it’s nearly as good, it looks like a win. But that
comparison mixes two things together: how much compute you spend and how well
you allocate it.
The fair question is: if I give a plain fixed controller exactly the same average number of rollouts the gated one used, who wins? That’s the “matched budget” test. It’s the only test of the actual premise: that putting compute where uncertainty is high beats spreading it evenly.
Here’s what happened on the pendulum (40 paired seeds per condition):
Pendulum swing-up success (GTX 1650, 40 seeds). The blue bar gets exactly the same average compute as the orange one. It wins every time.
Two things jump out:
- Blue beats orange in every condition. A plain fixed controller with the same average budget matched or beat the gated one everywhere. Across seeds, the gated controller never had more wins than the fixed one.
- Orange is stuck at 82.5% no matter whether
K_maxis 3,000, 8,000 or 16,000. Making the big budget bigger doesn’t help it at all.
Why the gate is stuck
The gate fires on only 2–3% of steps. For the other 97%, the gated controller is just a 100-rollout controller. So its performance is pinned to whatever 100 rollouts can do, and the occasional big step doesn’t change the outcome.
Why so rare? The threshold is calibrated on random starting states, where the model is often unsure. But once the pendulum is actually being controlled, it quickly moves into the well-modelled region near upright, where the five models agree. The gate sees “familiar” and stays quiet.
Meanwhile the fixed controller spends its (modest) budget on every step, with its exploration tuned for that budget. Spreading the compute evenly simply works better here.
How sure are we?
Honestly: sure of the direction, less sure of any single number.
- On the first GPU, two conditions were significant (p = 0.016 and 0.031), but none survive a strict correction for testing four things at once.
- I reran everything on an RTX 5090. The direction held in all four conditions (fixed had more wins in each: 10/5, 7/1, 7/2, 11/4), but none reached p < 0.05 on their own.
- On the MuJoCo arm, the fixed controller at matched budget never lost a single seed on either GPU.
So the claim is: consistently, across conditions, GPUs and tasks, the gate does not beat a plain fixed budget. Not “it loses by exactly X%”.
Finding 2: A hidden knob almost fooled me
Before the result above came out cleanly, I had the opposite result. The gate looked better. Here’s why.
MPPI has a second setting besides K: the noise scale σ, which controls how far the random plan variations wander. I had left σ = 1 everywhere, which is a fine choice at K = 100.
It turns out that’s terrible at large K:
| Rollouts (K) | Success at σ = 1 | Success at tuned σ |
|---|---|---|
| 3,000 | 17.5% | 100% |
| 8,000 | 12.5% | 100% |
| 16,000 | 12.5% | 100% |
With tiny noise, adding thousands of rollouts just adds thousands of near-copies of the same plan. The controller never discovers the big torque it needs to swing up. More compute made it worse.
And that broke the comparison. The gated controller runs at K = 100 almost all the time, where σ = 1 happens to suit it. The fixed high-budget controller was stuck at a σ that suited nothing. So the gate “won”, by 8 seeds to 2.
Once both were given a properly tuned σ, the advantage vanished and reversed.
Rule of thumb: whenever you change the number of rollouts, retune the exploration noise. Otherwise you’re measuring bad tuning, not the value of compute.
Finding 3: Gating can be faster, but where depends on your machine
Even if gating doesn’t allocate compute better, it does use less of it than
always running K_max. Does that make it faster in real time?
On a GPU, not necessarily. The fixed controller can run all 20 test episodes as
one big batch, and its time grows in a straight line with K. The gated
controller has to run step-by-step with lots of small GPU calls. Its time is
dominated by the overhead of launching those calls, so it’s roughly flat no
matter what K_max is.
A straight rising line eventually crosses a flat line. That crossing point is the budget above which gating is faster. Below it, the fixed controller wins, often by 20× at small budgets.
Here’s where that crossing landed on every machine I tried:
The crossover budget on six machines. The H100 never crossed within the largest budget tested (64,000); the dashed part is an extrapolation.
That’s more than a 10× spread, for the same code. Two things set it:
- The GPU sets how steep the fixed controller’s line is. Two RTX 5090s in different computers had slopes within 0.5% of each other.
- The host CPU sets how high the gated controller’s flat line is, because it’s the CPU that issues all those small launches. Those same two RTX 5090s crossed at ~22,500 and ~31,000, purely because of the CPU they were plugged into.
The clearest example: an A100 and an RTX 4090 have almost identical GPU slopes, yet the A100’s crossover is 2.3× higher, because its server CPU makes the many-small-launches controller much slower.
On a dedicated machine, the crossover was repeatable to about 2%. On my laptop it was not: it halved between two measurement campaigns (the GPU was likely throttling), and varied by 41% between back-to-back runs on the same day.
Takeaway: there’s no universal “gating pays off above N rollouts” number. If you care, measure it on the machine you’ll deploy on. It takes minutes.
And remember Finding 1: even above the crossover, gating only beats always
using K_max. A fixed controller at the gate’s average budget is both
cheaper and at least as good.
Finding 4: “Uncertainty” sees novelty, not mistakes
The whole gating idea leans on disagreement meaning “the model might be wrong here.” So I tested that directly.
I trained the five models on a narrow slice of situations, then showed them situations shifted further and further away. How well does disagreement tell the shifted ones apart from normal ones? (AUC: 0.5 = coin flip, 1.0 = perfect.)
Disagreement as a "this is unfamiliar" detector. It only becomes reliable once the shift is large.
For small shifts, it’s no better than guessing. It only becomes reliable at a shift of about 3.5 and beyond.
But the surprising part was this: the models’ actual prediction error didn’t go up as the shift grew. It stayed between 0.7× and 1.1× its normal level, and was often lower on the shifted data. Disagreement rose because the inputs were new, not because the predictions were getting worse.
So in this task, disagreement means “I haven’t seen this before”, not “I’m about to be wrong.” Those are different things, and the gate needs the second.
What it can’t see at all
I also added an emergency fallback: if disagreement goes really high, ignore the planner and apply a safe damping action. Then I broke the world in two ways:
| What went wrong | Episodes that succeeded | Times the fallback fired |
|---|---|---|
| Pendulum 3× heavier (and weaker gravity) | 0% | 0% of steps |
| Pendulum suddenly kicked to high speed | 40% | 0% of steps |
Every episode failed under the heavy pendulum, and the “uncertainty” alarm never went off once. That makes sense in hindsight: all five models learned the same wrong physics from the same data, so they confidently agree with each other while all being wrong. Disagreement can’t catch a mistake everyone shares.
The kick is subtler. The detector was calibrated by shifting state and action together. A kick only changes the state, and the pilot keeps proposing ordinary actions, so it never reaches the region where the models disagree.
Takeaway: ensemble disagreement is a decent “unfamiliar input” detector. It’s not a “the world changed” detector, and not a “my model is wrong” detector. For those, something based on actual prediction error is a better bet.
Finding 5: One line of code moved results by 40 points
This is the finding I’d most like other people to take away, because it can bite anyone.
The pilot needs random numbers. In my original code it drew them from the same random stream as the main planner. That means every pilot run shifts which random numbers the planner gets next, even when the pilot’s decision changes nothing.
The cleanest test: set K_max = K_min = 100. Now the gated controller is
identical to a plain 100-rollout controller. It should score exactly the same.
| Pilot random numbers come from… | Success |
|---|---|
| The shared stream (original code) | 35% |
| Its own private stream (fixed code) | 75% (matches the plain controller seed for seed) |
Same algorithm, same compute, a 40-point difference. And it leaked further: in some experiments the pilot ran before the other methods, so it even changed the results of methods that never use a pilot.
Four results in my earlier write-up depended on this. The most important one: the gated controller appeared to beat the plain ensemble on the robot arm. With the fix, that lead disappeared.
Rule of thumb: any side computation inside a stochastic controller (pilots, calibration, diagnostics) should get its own random number generator.
Bonus: same code, same seeds, different GPU, different results
I reran the whole study on an RTX 5090 with identical code, library versions and random seeds. Training, calibration and the detection sweep came out bit-for-bit identical. But for closed-loop control with big batches, 8–18% of individual episode outcomes flipped.
The likely cause: different GPU architectures add floating-point numbers in slightly different orders inside large matrix operations. Tiny rounding differences get amplified by a pendulum balancing on a knife edge.
The practical upshot: a rerun on different hardware behaves like a fresh random draw of the experiment. That’s actually a useful robustness check. In my case, the borderline p-values didn’t survive it, but the overall direction did.
So, should a robot think harder when it’s unsure?
Not like this, at least. The summary:
- Gating didn’t allocate compute better. A plain fixed budget of the same average size matched or beat it everywhere. The gate fired too rarely (2–3% of steps) to matter.
- Retune exploration noise when you change the rollout count, or your comparisons will lie to you.
- Gating is faster than a big fixed budget only above a crossover that ranged from ~8,000 to beyond 64,000 rollouts, depending on GPU and CPU. Measure it, don’t quote it.
- Ensemble disagreement detects novelty, not error, and is blind to shared mistakes like wrong physical parameters.
- Give every side computation its own random stream.
Where it might still work
A gate needs to fire on the steps where extra samples actually change the outcome. Disagreement fires where the model is unfamiliar, which isn’t the same as where planning is hard. Two untested ideas that might do better:
- Gate on a planning-difficulty signal instead, such as how spread out the rollout scores are, or how few rollouts actually carry weight.
- Calibrate the threshold on states the controller actually visits, not on random starting states.
Caveats worth stating
These are small tasks (a pendulum and a two-link arm), each pendulum result uses one trained ensemble, and the statistical tests use 40 seeds or fewer. The latency study covers five GPU models in six machines, and the H100 crossover is an extrapolation. I’d treat the results as a strong caution about the intuition, not a final verdict on every possible gate.
Everything here, every table and number, is regenerated by a released Python
package (ua_mbrl) that was tested to reproduce the original experiment scripts
bit-for-bit. If you want to check a number or try your own gate, the code and
per-seed records are in the project repository.