Amortising Trajectory Optimisation for Residual MPC via Implicit Contact Differentiation
This paper introduces an efficient Implicit Function Theorem-based differentiable simulation method for contact-rich trajectory optimization that drastically reduces memory usage compared to unrolled automatic differentiation, and combines it with optimiser distillation to significantly improve the success rate of residual MPC in complex robotic tasks.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to teach a robot to walk, juggle, or play soccer. To do this, the robot needs a "brain" that can simulate the future in its head, trying out millions of different moves to see which one works best. This is called trajectory optimisation. The tricky part is contact. When a robot's foot hits the ground, a ball bounces off a wall, or a hand grabs a cup, the physics get messy and unpredictable. It's like trying to predict exactly how a pile of Jenga blocks will fall when you pull one out; tiny changes in force lead to huge changes in outcome.
To make these predictions, scientists use differentiable simulation. Think of this as a super-powered video game engine that doesn't just show you the next frame, but also tells you exactly how the game would change if you nudged the controls a tiny bit. This "nudge sensitivity" allows the robot to learn from its mistakes instantly. However, there's a catch: calculating these nudges for contact-heavy tasks is incredibly expensive. It's like trying to film a movie in slow motion, but every time the camera zooms in on a collision, the film reel gets longer and longer, eventually filling up your hard drive before you can finish the scene. This paper tackles that memory problem and shows how to make robots learn complex contact skills much faster and more reliably.
The Problem: The "Memory Monster" in Robot Brains
Imagine you are trying to solve a maze. The standard way to teach a robot to solve it is to let it walk through the maze, hit a wall, and then rewind the tape to see exactly where it went wrong. In the world of robot physics, this "rewinding" is called unrolled automatic differentiation.
The problem arises when the robot hits a wall (or a floor, or another object). To figure out the physics of that bounce, the computer has to run a complex calculation many times, like a detective checking and re-checking clues until the answer is perfect. If the computer needs to check the clues 10 times to get it right, the "rewind tape" has to store the memory of all 10 checks. If you want the answer to be even more perfect, you might need 100 checks. Suddenly, the memory tape becomes 100 times longer.
This creates a terrible trade-off. If you want the robot to be precise (check the clues 100 times), you can only run a few robots at once because your computer runs out of memory. If you want to run thousands of robots at once to learn faster, you have to cut the checks short (maybe only 5 times), which means the robot learns from a sloppy, inaccurate answer. It's like trying to learn a dance by only watching the first five seconds of the video; you might get the steps, but you'll miss the crucial spin at the end.
The Solution: The "Magic Snapshot"
The authors of this paper, working with the MuJoCo physics simulator (a popular tool for robot research), found a clever way to bypass the memory monster. Instead of rewinding the entire tape of the detective's 100 checks, they used a mathematical trick called the Implicit Function Theorem (IFT).
Think of it this way: Imagine a detective who has solved a mystery. Instead of showing you the 100 pages of notes they took to get there, they just hand you the final solved case file and a "magic snapshot" of the solution. This snapshot tells you exactly how the solution would change if you tweaked one tiny detail, without needing to see the messy notes.
In technical terms, the paper introduces a method that differentiates the stationarity residual (a fancy way of saying "the point where the math says we are done") rather than the steps taken to get there.
- The Old Way (Unrolled AD): Stores every single step of the solver. If you go from 1 step to 10 steps, your memory usage jumps by 10.6 times.
- The New Way (IFT): Stores a nearly constant amount of memory. Even if you increase the solver effort from 1 step to 10 steps, the memory usage only changes by less than 4%.
This is a game-changer. It means the computer can demand a super-precise answer (checking the clues 100 times) without running out of memory. In fact, when the paper tested this with 256 active contacts (like a robot with many fingers touching a table), the new method used 20 times less memory than the old way. With 16 contacts and a complex robot model, it used 6 times less memory.
The Result: Teaching Robots to "Distill" Wisdom
With this new, memory-efficient tool, the authors didn't just stop at making the math faster; they used it to teach robots better. They created a system they call Optimiser Distillation.
Imagine a master chef (the "teacher") who spends hours perfecting a complex recipe. This chef is slow but incredibly accurate. Then, you have a sous-chef (the "student" or policy) who is fast but needs guidance.
- The Teacher: The computer runs a full, long-horizon optimisation (like the master chef planning the whole meal) to find the perfect sequence of moves. This is done in batches, thanks to the new memory-saving trick.
- The Student: The robot learns from these perfect sequences, creating a "policy" (a set of instincts) that knows the general plan.
- The Hybrid: When the robot is actually doing the task, it doesn't just blindly follow the policy. It uses the policy for the big picture (the long-term plan) but adds a quick, local "residual" correction (a short-horizon optimiser) to handle sudden bumps or slips.
The paper tested this on three different robots:
- Finger: A small arm spinning a top.
- Franka: A large arm pushing a box.
- Unitree: A four-legged dog-like robot running.
The results were impressive. When the planning horizon (how far ahead the robot looks) was short (just 6 steps), the standard method (iLQR) often failed. But with the new "distilled" policy guiding the robot, the success rate jumped dramatically:
- Across all three tasks (Finger, Franka, and Unitree): Success increased by 28 to 98 percentage points compared to standard iLQR.
For the Franka robot pushing a box, the standard short-sighted robot barely succeeded at all, while the new hybrid robot succeeded with much less "lookahead," proving that the policy provided the long-term strategy while the local optimiser handled the tricky contact moments.
Why This Matters
This paper doesn't just suggest a theoretical idea; it provides a working, open-source tool that changes the rules of the game. By proving that you can get high-precision contact derivatives without the massive memory cost, the authors have removed a major bottleneck in robot learning. They showed that you don't have to choose between "fast but sloppy" and "slow but precise." You can have both.
The authors are confident in these findings, having validated them against standard numerical methods (finite differences) and showing that their new method matches the accuracy of the old methods while using a fraction of the resources. They have even released their code to the public, inviting others to build faster, smarter, and more dexterous robots that can handle the messy, real-world physics of contact without getting stuck in a memory loop.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.