TOM-SWE: User Mental Modeling For Software Engineering Agents

📅 2025-10-24
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing code-generation agents achieve notable progress on complex tasks but struggle to accurately infer and continuously track ambiguous or context-dependent user intentions. This paper introduces ToM-Agent, the first Theory-of-Mind–enabled agent for software engineering, featuring a dual-agent collaborative architecture: a lightweight Theory-of-Mind (ToM) agent dynamically models user goals, constraints, and preferences while maintaining a persistent, stateful memory of user context; the primary SWE agent then generates intent-driven code decisions grounded in this model. Our approach integrates interaction history analysis, probabilistic intention inference, and context-aware prompt generation. On the state-aware SWE benchmark, ToM-Agent achieves a 59.7% task success rate—surpassing OpenHands (18.1%). In a three-week deployment with real developers, it was rated useful 86% of the time. The core contribution is the systematic integration of theoretical Theory-of-Mind capabilities into coding agents, enabling long-term, dynamic, and interpretable modeling of user intent.

Technology Category

Application Category

📝 Abstract
Recent advances in coding agents have made them capable of planning, editing, running, and testing complex code bases. Despite their growing ability in coding tasks, these systems still struggle to infer and track user intent, especially when instructions are underspecified or context-dependent. To bridge this gap, we introduce ToM-SWE, a dual-agent architecture that pairs a primary software-engineering (SWE) agent with a lightweight theory-of-mind (ToM) partner agent dedicated to modeling the user's mental state. The ToM agent infers user goals, constraints, and preferences from instructions and interaction history, maintains a extbf{persistent memory} of the user, and provides user-related suggestions to the SWE agent. In two software engineering benchmarks (ambiguous SWE-bench and stateful SWE-bench), ToM-SWE improves task success rates and user satisfaction. Notably, on the stateful SWE benchmark, a newly introduced evaluation that provides agents with a user simulator along with previous interaction histories, ToM-SWE achieves a substantially higher task success rate of 59.7% compared to 18.1% for OpenHands, a state-of-the-art SWE agent. Furthermore, in a three-week study with professional developers using ToM-SWE in their daily work, participants found it useful 86% of the time, underscoring the value of stateful user modeling for practical coding agents.
Problem

Research questions and friction points this paper is trying to address.

Software engineering agents struggle to infer user intent from ambiguous instructions
Existing systems lack persistent memory of user goals and preferences
Current coding agents fail to track context-dependent user requirements
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dual-agent architecture with user mental modeling
Persistent memory tracks user goals and preferences
Stateful user modeling improves task success rates
🔎 Similar Papers
No similar papers found.