Hera: Learning Long-Horizon Coordination for Device-Cloud Collaborative LLM Agents
Hera is a novel step-level device-cloud coordinator for long-horizon LLM agents that employs a two-stage training paradigm of imitation learning and cost-aware reinforcement learning to optimize the trade-off between task success and computational cost, achieving near cloud-only performance with significantly reduced cloud usage.
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 have a very smart but expensive assistant (the Cloud) and a quick, cheap, but sometimes forgetful assistant (the Device). You need them to work together to solve a long, complicated puzzle, like planning a week-long vacation or navigating a maze.
The problem is:
- If you let the Device do everything, it's fast and free, but it might get lost or make mistakes on the hard parts of the puzzle.
- If you let the Cloud do everything, it's perfect, but it costs a lot of money and takes a long time to talk to because it's far away.
Most existing systems try to decide: "Should we use the Cloud for this whole task?" If the task looks hard, they pay for the Cloud. If it looks easy, they use the Device. But this is like hiring a master chef to chop every vegetable for a whole week just because the menu is complex, even though the chef only needs to help with the tricky garnish.
Enter Hera.
Hera is a new "Team Captain" that doesn't decide for the whole task. Instead, it watches the work step-by-step and makes split-second decisions: "Is this specific move easy? Let the Device do it. Is this move tricky? Call the Cloud for help."
How Hera Learns to Be a Great Captain
Hera learns to be this captain through a two-stage training process, like a sports coach training an athlete:
Stage 1: The "Shadowing" Phase (Imitation Learning)
First, Hera watches the Cloud do the whole task perfectly. Then, it asks the Device to try the exact same steps using the Cloud's answers as a guide.
- If the Device gets the step right on its own, Hera learns: "Okay, the Device is capable here. No need to call the expensive Cloud."
- If the Device gets confused or makes a different choice, Hera learns: "Ah, this step is too hard for the Device. We need the Cloud's help here."
This gives Hera a basic rulebook of where the Device struggles.
Stage 2: The "Strategy" Phase (Reinforcement Learning)
Now, Hera gets to play the game itself. It tries to solve tasks by mixing Device and Cloud steps. It gets a score based on two things:
- Did we win? (Did the task get done?)
- Did we spend too much? (Did we call the Cloud too often?)
Hera learns that it doesn't need the Cloud for every hard step. It learns that sometimes, calling the Cloud for just one critical step in the middle of a long journey is enough to keep the whole plan on track. It learns to save money by only calling the Cloud when it's absolutely necessary to avoid failure.
The Results: The Best of Both Worlds
The researchers tested Hera on three different "puzzles":
- ALFWorld: A robot trying to tidy up a house.
- WebShop: An agent trying to buy specific items on a website.
- AppWorld: An agent trying to write code to manage apps.
The Magic Numbers:
- Success Rate: Hera achieved 92.5% of the success rate of using the Cloud all the time. It almost never fails.
- Cost Savings: It only used the expensive Cloud for 46.3% of the steps. The Device handled the rest.
- Speed: Because it used the local Device so much, the whole process was much faster than waiting for the Cloud every single time.
The Takeaway
Think of Hera as a smart manager who knows exactly when to let the junior employee (Device) handle the routine work and when to bring in the senior expert (Cloud) for the tough problems. By doing this, the team finishes the job almost as well as if the expert did everything, but at half the cost and twice the speed.
The paper claims this is the first system to make these decisions step-by-step rather than for the whole task, proving that you don't need a supercomputer for every single move to solve a complex problem.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.