TL;DR
Rep2Skill is a novel framework that allows LLM agents to improve their own textual skills by reflecting on their internal hidden representations rather than just execution logs. By using a trajectory model to pinpoint exactly where internal states deviate from "successful" dynamics, the system generates fine-grained feedback that significantly outperforms traditional text-only self-improvement methods.
What Problem Does This Paper Address?
Large Language Model (LLM) agents typically use "skills"—reusable sets of textual instructions and strategies—to solve complex, multi-step tasks. To improve, these agents usually follow a "self-evolution" loop: they perform a task, look at the resulting text log (trajectory) and the final outcome (success/failure), and then try to rewrite their instructions to do better next time.
However, this text-only paradigm has a major flaw: the "credit assignment" problem. A failure at step 30 might actually be caused by a subtle mistake at step 5. Textual logs are often too sparse or ambiguous for an LLM to diagnose why it failed. Meanwhile, the model’s internal hidden states—the mathematical "thoughts" occurring under the hood—contain rich, high-resolution information about the agent's progress that never makes it into the text log. Rep2Skill asks: Can we use these internal signals to guide better skill evolution?
Methods
Rep2Skill introduces a four-stage pipeline to bridge the gap between latent mathematical representations and actionable textual skills:
- Grouped Rollout Sampling: Instead of looking at one failure, the agent runs the same task multiple times. Because LLMs are stochastic, this creates a "group" of trajectories that show different ways the agent might behave under the same skill.
- Turn-level Representation Attribution: The system extracts hidden states (specifically from layer 24 in the Qwen models tested) at every turn. These are projected into a lower-dimensional space using PCA. A Neural Controlled Differential Equation (Neural CDE), trained only on successful runs, predicts what the "successful" next state should look like. If the actual hidden state deviates sharply from this prediction, that turn is flagged as a "critical turn."
- Rep-to-text Verbalization: An "analyzer" LLM looks at these flagged critical turns alongside the text trajectory. It translates the mathematical deviation into natural language feedback (e.g., "The agent is stuck repeating a cabinet search instead of moving to the sink").
- Skill Revision & Validation: A "skill optimizer" LLM uses this targeted feedback to modify the textual skill. A validation gate ensures the new skill is only adopted if it actually improves performance on a small validation set.
Datasets
The authors evaluated Rep2Skill on two distinct agentic benchmarks:
- ALFWorld: A synthetic environment for embodied household tasks (e.g., "put a clean mug in the coffee machine"). It requires long-horizon planning and interaction with various objects.
- WebShop: A simulated e-commerce environment where agents must search, filter, and purchase products based on specific user requirements.
The experiments used two open-source models: Qwen3-4B and Qwen3.5-9B, testing the framework across different model scales and architectures.
Key Insights and Ideas
- Representations as an Early Warning System: Internal states often deviate from the "success path" well before the failure becomes obvious in the text. This allows for much more precise localization of errors.
- The Power of Grouping: By comparing multiple rollouts of the same task, the system can distinguish between a one-off fluke and a systematic failure caused by a bad skill rule.
- Latent-to-Text Bridge: The most critical component is the "Analyzer" LLM. Raw attribution scores (numbers) are useless to a skill optimizer; they must be grounded in the trajectory context to become actionable advice.
- Self-Evolution without a "Teacher": Unlike many methods that require a massive model (like GPT-4o) to teach a smaller one, Rep2Skill enables "self-improvement" where the same model serves as the executor, analyzer, and optimizer.
Key Results
Rep2Skill consistently outperformed state-of-the-art text-only baselines like SkillOpt and Trace2Skill:
- Performance Gains: On ALFWorld, Rep2Skill achieved a 69.90% success rate with Qwen3.5-9B, a 7.77% improvement over the strongest text-only baseline.
- Error Detection Accuracy: In identifying "non-progress" turns (steps that don't help solve the task), Rep2Skill achieved an AUROC of 0.838, compared to just 0.494 for methods relying on trajectory text alone. This suggests that text-only models are essentially guessing when trying to find the root cause of a failure.
Limitations and Future Work
- White-Box Requirement: The method requires access to the model's internal activations. This makes it difficult to apply to closed-source "black-box" APIs like GPT-4 or Claude without using a proxy model.
- Computational Overhead: Modeling the representation trajectory adds a lightweight training stage and requires extra rollouts, which increases the time and compute cost of the evolution process.
- Generalizability: While tested on the Qwen family, the authors note that extending this to a wider variety of architectures (like Mamba or different hybrid models) is a necessary next step to prove the method's universal applicability.
Summary updated