TOM-SWE: User Mental Modeling For Software Engineering Agents
Xuhui Zhou, Valerie Chen, Zhiruo Wang, Graham Neubig, Maarten Sap, Xingyao Wang
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 persistent memory of the user, and provides user-related suggestions to the SWE agent, while preserving privacy and minimizing context window load. 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 better aligned with their intent and useful 86% of the time, underscoring the value of stateful user modeling for practical coding agents.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers2
- Asking What Matters: Reward-Driven Clarification for Software Engineering TasksSanidhya Vijayvargiya, Vijay Viswanathan, Graham NeubigICML 2026 · 3 citations
- MindZero: Learning Online Mental Reasoning With Zero AnnotationsShunchi Zhang, Jin Lu, Chuanyang Jin, Yichao Zhou et al.ICML 2026 · 1 citation
Builds on8
- SWE-bench: Can Language Models Resolve Real-world Github Issues?Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao et al.ICLR 2024 · 2,082 citations
- SWE-agent: Agent-Computer Interfaces Enable Automated Software EngineeringJohn Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret et al.NeurIPS 2024 · 2,059 citations
- Executable Code Actions Elicit Better LLM AgentsXingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang et al.ICML 2024 · 436 citations
- Theory of Mind for Multi-Agent Collaboration via Large Language ModelsHuao Li, Yu Quan Chong, Simon Stepputtis, Joseph Campbell et al.EMNLP 2023 · 57 citations
- Ambig-SWE: Interactive Agents to Overcome Underspecificity in Software EngineeringSanidhya Vijayvargiya, Xuhui Zhou, Akhila Yerukola, Maarten Sap et al.ICLR 2026 · 35 citations
Related papers
- Why AI Agents Still Need You: Findings from Developer-Agent Collaborations in the WildAayush Kumar, Yasharth Bajpai, Sumit Gulwani, Gustavo Soares et al.ASE 2025 · 1 citation
- Unified Software Engineering Agent as AI Software EngineerLeonhard Applis, Yuntong Zhang, Shanchao Liang, Nan Jiang et al.ICSE 2026
- Training Software Engineering Agents and Verifiers with SWE-GymJiayi Pan, Xingyao Wang, Graham Neubig, Navdeep Jaitly et al.ICML 2025
- Structurally Aligned Subtask-Level Memory for Software Engineering AgentsKangning Shen, Jingyuan Zhang, Chenxi Sun, Wencong Zeng et al.ICML 2026 · 9 citations
- SWE-Search: Enhancing Software Agents with Monte Carlo Tree Search and Iterative RefinementAntonis Antoniades, Albert Örwall, Kexun Zhang, Yuxi Xie et al.ICLR 2025
