Introduction
Current Large Language Model (LLM) agents often suffer from a "flood irrigation" approach to training, where gold trajectories, external feedback, and domain knowledge are indiscriminately injected. This strategy leads to high inference costs and fragile performance, as models function as "unconscious pattern-fitters" rather than strategic decision-makers. To address this, we introduce KnowSelf, a framework that endows agents with agentic knowledgeable self-awareness. This allows agents to autonomously decide when to act quickly, when to stop and reflect, and when to seek external knowledge.
The KnowSelf Framework
KnowSelf adopts a human-like cognitive principle: the ability to dynamically assess situational demands and strategically employ resources. The framework categorizes agent actions into three situational types:
- Fast Thinking: The agent provides the correct action directly based on internal weights.
- Slow Thinking: The agent recognizes an initial error and self-corrects through internal reflection.
- Knowledgeable Thinking: The agent identifies a lack of internal capability and queries an external knowledge base.
Training Pipeline
The KnowSelf pipeline consists of three primary stages:
- Situation Labeling: Self-explored trajectories are heuristically marked with special tokens (
ReflectionandKnowledge) based on success, the need for a "rethink," or the requirement for external assistance. - Two-Stage Learning:
- Stage 1 (SFT): Supervised Fine-Tuning on curated self-awareness data to establish initial planning patterns.
- Stage 2 (RPO): Relative Preference Optimization (a variant of DPO) to sharpen the agent's ability to distinguish between situational demands using positive and negative samples.
- Inference: During execution, the agent generates these special tokens to trigger internal reflection or external knowledge retrieval only when necessary, avoiding the overhead of constant querying.
Experimental Results
The framework was evaluated on simulated planning benchmarks, including ALFWorld (household manipulation) and WebShop (online shopping), using Llama-3.1-8B-Instruct and Gemma-2-2B-it as backbones.
Key Findings
- Superior Performance: KnowSelf (Llama-8B) achieved an average reward of 84.33% on ALFWorld, outperforming GPT-4o using standard ReACT (76.12%) and Reflexion (85.07%) methods despite the significant difference in model scale.
- The Knowledge Paradox: Injecting knowledge 100% of the time can actually degrade performance. KnowSelf outperformed "full knowledge" baselines while only querying external knowledge 15–26% of the time.
- Robust Generalization: In out-of-distribution (OOD) tests, KnowSelf maintained high success rates on challenging tasks where traditional baselines dropped to near 0% success due to pattern overfitting.
- Emergent Awareness: Probing internal states revealed that the decision to invoke knowledge or reflection emerges in the final few layers of the Transformer, suggesting the model internally determines its own uncertainty just before action generation.
Conclusion and Future Work
KnowSelf demonstrates that agentic self-awareness significantly improves efficiency and robustness in LLM agents. By avoiding unnecessary computational steps and database queries, it achieves state-of-the-art performance with lower overhead than "flood irrigation" methods. Future work will explore larger model scales (30B+), multimodal self-awareness (incorporating vision and audio), and testing on real-world software engineering or robotics tasks.
Summary updated