Introduction
Interactive Fiction (IF) games represent a significant challenge for artificial intelligence, requiring agents to process natural language observations, maintain a coherent state of the world, and execute multi-step plans to achieve goals. Unlike traditional games with visual inputs, IF games demand a high degree of linguistic reasoning and "common sense" to navigate. This paper explores a framework for enhancing AI agents in these environments by injecting external domain knowledge and internal task history.
The Grounding and Memory Challenge
Current AI agents, whether based on Reinforcement Learning (RL) or Large Language Models (LLMs), often suffer from a lack of "functional grounding." They may understand the word "box" but fail to realize its functional property as a container. Furthermore, agents frequently struggle with temporal consistency, failing to learn from successful actions within an episode, which leads to repetitive or illogical behavior.
Methodology: Knowledge Injection Framework
The researchers propose a dual-pronged approach to knowledge injection, focusing on two specific types of information:
- Memory of Correct Actions (MCA): Instead of relying solely on the immediate previous action, the agent maintains a history of all actions that yielded a positive reward during the current episode. This provides a roadmap of "what worked" to guide future decisions.
- Object Affordances: Drawing from ConceptNet, the framework provides agents with "common sense" data regarding what an object is capable of (e.g., a "thermometer" is capable of "measuring temperature").
Injection Strategies
The framework adapts its delivery method based on the agent's architecture:
- Textual Augmentation: For Language Models like RoBERTa and Swift (an instruction-tuned Flan-T5), knowledge is appended directly to the input string.
- Separate Encoders: For the DRRN (Deep Reinforcement Relevance Network), dedicated Gated Recurrent Units (GRUs) process the knowledge independently before merging it with the state representation.
- Knowledge Graph (KG) Integration: For KG-A2C, affordance relations are integrated as triples directly into the agent’s dynamic mental map, allowing for structured reasoning.
Experimental Setup: ScienceWorld
The framework was evaluated using ScienceWorld, a sophisticated benchmark featuring 10 distinct scientific tasks (e.g., boiling water, building circuits). ScienceWorld is notably more difficult than previous benchmarks because it requires agents to understand the functional properties of objects to progress through complex, multi-step scientific processes.
Key Insights and Results
The study yielded several critical findings regarding the intersection of knowledge and agent performance:
- Broad Performance Gains: The injection strategies improved performance in 34 out of 40 tested scenarios.
- The Power of Affordances: Knowing what an object can do (affordances) generally proved more valuable than simply remembering past successes (MCA). For the RoBERTa model, the addition of affordance knowledge led to a 13x improvement in specific tasks.
- Language Models as Knowledge Consumers: Instruction-tuned models like Swift demonstrated a superior ability to leverage injected knowledge compared to pure RL agents. Swift achieved the highest overall scores, particularly when focused on "correct" historical actions.
- Structured Knowledge for RL: For RL-based agents, integrating affordances into a Knowledge Graph was more effective than providing raw text. This suggests that structured representations help prevent information overload in non-transformer architectures.
- Efficiency and Scaling: In a "finding objects" task, the knowledge-enhanced Swift model reached the goal in just 5 steps, compared to 63 steps for the baseline RoBERTa model.
Limitations and Future Directions
While the results are promising, the study identified limitations in the depth of general-purpose knowledge bases. For instance, ConceptNet lacked the specific biological detail required for advanced tasks like animal life cycles. Additionally, while agents improved significantly, they still fall short of human-level performance in ScienceWorld.
Future research will likely focus on hybrid approaches that combine the policy-driven strengths of RL with the flexible, knowledge-rich reasoning of LLMs, potentially utilizing few-shot prompting to reduce training overhead.
Conclusion
By providing agents with a "memory" of success and a "common sense" understanding of object functionality, this research demonstrates a clear path toward more capable and grounded AI. The significant performance jumps, particularly in complex environments like ScienceWorld, underscore the importance of external knowledge in solving the grounding problem in interactive text-based worlds.
Summary updated