Harnessing LLM Agents with Skill Programs
The paper introduces HASP, a modular framework that transforms advisory textual skills into executable Program Functions (PFs) to actively intervene in LLM agent loops, thereby significantly improving performance on complex tasks like web search, math reasoning, and coding through inference-time guidance, post-training supervision, or self-improvement.
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 sometimes clumsy, robot assistant. You ask it to solve a complex puzzle, like finding a specific fact on the internet or writing a piece of code. The robot tries its best, but it keeps making the same mistakes: it gives up too soon, searches for the wrong things, or gets confused by similar-sounding names.
Usually, when we try to fix this, we just give the robot a list of written instructions (like a manual) saying, "Remember to check your work!" or "Don't guess!" But the robot often ignores these notes because they are just passive text. It doesn't know exactly when to stop and listen, or how to change its action.
HASP (Harnessing LLM Agents with Skill Programs) is a new framework that changes the game. Instead of giving the robot a passive manual, the researchers give it a set of executable "Skill Programs" (PFs). Think of these not as a book, but as a smart safety harness or a co-pilot that sits right next to the robot's brain.
Here is how it works, using simple analogies:
1. From "Passive Advice" to "Active Guardrails"
- The Old Way (Textual Skills): Imagine a driving instructor sitting in the back seat shouting, "You should slow down!" The driver might hear it, might ignore it, or might not realize exactly when to hit the brakes. It's just advice.
- The HASP Way (Program Functions): Now, imagine the car has a smart safety harness. If the car starts to drift toward a cliff (a "failure-prone state"), the harness doesn't just shout advice. It physically intervenes. It might gently steer the wheel back to the center or inject a warning signal directly into the driver's view.
- In the Paper: These "Skill Programs" are small pieces of code that watch the robot's every move. If the robot is about to make a mistake (like finalizing an answer without reading the evidence), the Skill Program intervenes. It can either rewrite the robot's action (changing a bad search query into a good one) or inject a hint (telling the robot, "Wait, you haven't read the document yet!").
2. The Three Ways to Use the Harness
The paper shows that this "harness" can be used in three different ways, like training a student:
Mode A: The Instant Fix (Inference-Time Intervention)
- Analogy: You put the harness on the robot while it is working. The harness catches mistakes in real-time and fixes them immediately. The robot doesn't need to learn anything new; the harness just does the heavy lifting.
- Result: The robot solves problems much better right away, even without any extra training.
Mode B: The Study Guide (Post-Training)
- Analogy: After the harness fixes the robot's mistakes, the researchers take a video of the "corrected" path and show it to the robot as a lesson. The robot studies these examples and learns to make the right choices on its own next time.
- Result: The robot internalizes the skills. It starts to act like the harness is part of its own brain, needing less help over time.
Mode C: The Self-Improving Library (Evolution)
- Analogy: If the robot encounters a new type of mistake that the harness hasn't seen before, the system pauses. It asks a "Teacher" (a very smart AI) to write a new Skill Program specifically for that mistake. Before adding this new skill to the toolbox, the Teacher checks it to make sure it's safe and useful.
- Result: The robot's toolbox of skills grows smarter over time, learning from its own failures without needing humans to write every single rule.
3. Why It Works So Well
The paper tested this on three tough tasks:
- Web Search: Finding answers that require connecting multiple pieces of information (like a detective solving a mystery).
- Math: Solving complex equations.
- Coding: Writing computer programs.
The Results:
- The "harness" approach beat almost every other method the researchers compared it to.
- For web search, just using the harness (without training the robot) improved performance by 25% compared to standard methods.
- When they let the robot learn from the harness (Post-Training), it got even better.
- Crucially, the system is modular. It's like a Swiss Army knife; you can use just the tools, or you can use the tools to teach the robot, or you can let the robot build new tools.
The Bottom Line
HASP turns "reusable experience" from a vague idea into a concrete, executable tool. Instead of hoping a robot remembers a rule, HASP gives the robot a set of automatic safety checks that catch errors the moment they happen, fix them, and help the robot learn to avoid them in the future. It's the difference between giving a student a textbook and giving them a tutor who sits right next to them, correcting their work as they do it.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.