← Latest papers
🤖 AI

TOM-SWE: User Mental Modeling For Software Engineering Agents

The paper introduces ToM-SWE, a dual-agent architecture that pairs a software engineering agent with a theory-of-mind partner to model user intent and maintain persistent memory, significantly improving task success rates and user satisfaction in both benchmark evaluations and a real-world study with professional developers.

Original authors: Xuhui Zhou, Valerie Chen, Zora Zhiruo Wang, Graham Neubig, Maarten Sap, Xingyao Wang

Published 2026-02-02
📖 4 min read☕ Coffee break read

Original authors: Xuhui Zhou, Valerie Chen, Zora Zhiruo Wang, Graham Neubig, Maarten Sap, Xingyao Wang

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Problem: The "Forgetful" Coding Robot

Imagine you hire a brilliant but amnesiac robot assistant to help you build a website.

  • The Robot: It's incredibly smart at writing code, fixing bugs, and running tests.
  • The Problem: Every time you start a new conversation, the robot has no memory of who you are. It doesn't know that you hate long explanations, that you prefer using specific tools, or that you always want to test your code before you deploy it.
  • The Result: You have to repeat yourself constantly. "Make it shorter," "Use this library," "Don't ask me so many questions." The robot keeps guessing, often getting it wrong, which wastes time and frustrates you.

Current AI coding agents are like this robot: they are great at the technical work but terrible at understanding you.

The Solution: The "Mind-Reader" Partner (ToM-SWE)

The authors of this paper created a new system called ToM-SWE. Instead of just one robot, they built a two-person team:

  1. The Builder (SWE Agent): This is the original coding robot. It focuses 100% on writing code, running tests, and fixing errors. It doesn't worry about your personality; it just does the heavy lifting.
  2. The Mind-Reader (ToM Agent): This is a new, lightweight partner. Its only job is to study you. It watches how you talk, what you like, and what you've done in the past. It builds a "mental model" of your preferences.

How they work together:
Before the Builder starts coding, it asks the Mind-Reader: "Hey, what does this user like? Do they want short answers? Do they use Python or JavaScript? Did they mention a specific tool last week?"
The Mind-Reader checks its notes and says, "This user is a professor who likes concise answers and prefers using Vercel for hosting. Don't ask them too many questions."
The Builder then adjusts its plan and writes code that fits your style perfectly.

The "Mental Model" Analogy

Think of the Mind-Reader like a very attentive personal assistant who keeps a diary of your habits.

  • Session 1: You tell the system, "Make me a website." The Mind-Reader notes: User is a professor, likes academic styles, prefers Vercel.
  • Session 2 (Next week): You say, "Make me a website" again.
    • Old Robot: "Okay, I'll guess a generic website."
    • ToM-SWE: The Builder asks the Mind-Reader. The Mind-Reader says, "Remember last time? This is for a university project. Use academic fonts and host on Vercel."
    • Result: The code is exactly what you wanted, even though you didn't say it again.

How They Tested It

The researchers didn't just guess this would work; they ran two types of tests:

  1. The "Simulation" Test (Benchmarks):
    They created a fake world where the AI had to talk to a "simulated user" (another AI acting like a human). They gave the simulated user different personalities (e.g., one who is very chatty, one who is very brief).

    • The Result: The ToM-SWE team solved 59.7% of the tasks successfully. The best previous robot (OpenHands) only solved 18.1%.
    • The "Satisfaction" Score: The simulated users rated the ToM-SWE team much higher (3.62 out of 5) because the team "listened" better and didn't annoy them with unnecessary questions.
  2. The "Real Life" Test (Human Study):
    They let 17 real professional developers use the system for three weeks on their actual, daily work.

    • The Result: The developers found the Mind-Reader's suggestions useful 86% of the time.
    • What they liked: The system would say things like, "You usually add tests for new functions, so I added them here," or "You prefer minimal code edits, so I kept the changes small."

Why This Matters

The paper claims that for AI to be truly helpful in software engineering, it can't just be a code generator. It needs to be a collaborator that understands human intent.

  • Old Way: You tell the AI what to do, and it guesses the rest.
  • New Way (ToM-SWE): The AI remembers who you are, what you like, and how you work, so it can anticipate your needs before you even ask.

Summary in One Sentence

ToM-SWE is a two-agent system where one agent writes the code and a second "mind-reading" agent remembers your personal preferences and habits, allowing the team to work with you much more efficiently and with less frustration.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →