Abstract
SheetCopilot is an LLM-powered agent framework designed to automate complex spreadsheet tasks via natural language instructions. By abstracting software functionalities into a set of "atomic actions" and employing a state machine-based planning loop, the system bypasses the fragility and syntax errors common in traditional code-generation approaches. Evaluated on a newly introduced benchmark of 221 real-world spreadsheet problems, SheetCopilot achieves a 44.3% success rate, significantly outperforming VBA-generation baselines (16.3%). This work demonstrates the potential for LLMs to serve as reliable controllers for feature-rich software interfaces.
1. Introduction
Spreadsheet software like Microsoft Excel remains a cornerstone of modern data processing, yet its advanced features often remain inaccessible to users who lack programming expertise in languages like VBA. While Large Language Models (LLMs) have shown promise in reasoning and code generation, they struggle to interact reliably with complex software due to challenges in state representation, hallucination of non-existent functions, and a lack of robust error recovery. SheetCopilot addresses these hurdles by shifting the paradigm from raw code generation to a structured, agentic interaction model.
2. Methodology
The core innovation of SheetCopilot is the abstraction of spreadsheet control into a manageable and reliable interface for LLMs.
2.1 Atomic Actions
Rather than asking the LLM to write complex scripts, the researchers defined a set of "atomic actions" (e.g., Write, Filter, CreateChart). These virtual APIs provide a clean interface that limits the LLM's search space and prevents it from becoming entangled in the specific syntax of a programming language. This abstraction layer ensures that the model focuses on the logic of the task rather than the mechanics of the software.
2.2 State Machine-based Planning
SheetCopilot utilizes an Observe-Propose-Revise-Act loop. Unlike "open-loop" systems that generate an entire plan at once, this framework allows the agent to:
- Observe the current state of the spreadsheet.
- Propose the next logical action.
- Revise the action based on external documentation or error feedback.
- Act by executing the command and receiving the updated state.
2.3 Mitigating Hallucinations through Disambiguation
To prevent the model from relying on biased priors from its training data, the authors introduced Atomic Action Disambiguation. By replacing standard function names with synonyms (e.g., using RangeInputValue instead of Write), the model is forced to consult the provided documentation rather than assuming it already knows how a function works. This counter-intuitive approach significantly reduces "self-delusion" and improves instruction following.
3. The SheetCopilot Benchmark
To rigorously evaluate the agent, the authors introduced a new benchmark consisting of 221 representative spreadsheet tasks curated from superuser.com. These tasks span six critical categories:
- Entry & Manipulation
- Management
- Formatting
- Charts
- Pivot Tables
- Formulas
Evaluation is conducted via a Task Evaluation by Execution pipeline. A solution is only marked as correct if the final state of the spreadsheet—not just the command sequence—matches the ground truth requirements.
4. Results and Key Insights
SheetCopilot (powered by GPT-3.5-Turbo) achieved a 44.3% Pass@1 rate, nearly tripling the performance of a baseline that attempted to generate and run VBA code (16.3%). The agent demonstrated high robustness, generating executable command sequences for 87.3% of the problems.
4.1 The "Synonym Paradox"
A key finding was that using unfamiliar synonyms for action names actually improved performance. This suggests that LLMs are prone to ignoring specific instructions when they believe they have pre-existing knowledge of a function's behavior. Forcing the model to rely on provided documentation via disambiguation mitigates this effect.
4.2 Granularity and Feedback
The research found that "finer-grained" actions—simple, single-purpose functions—are more effective than high-level, integrated actions. While high-level actions require fewer steps, they are harder for the LLM to parameterize correctly. Furthermore, the inclusion of closed-loop feedback (state and error reporting) was found to be essential; without it, the model's success rate on multi-step tasks drops exponentially.
5. Conclusion and Future Work
SheetCopilot represents a significant step toward autonomous software interaction. However, several challenges remain. The current system is token-intensive due to the need for detailed documentation in every prompt. Additionally, the current "observation" stage primarily captures cell data, often missing the state of visual elements like charts or complex filters. Future work will focus on improving state representation and developing safety safeguards to prevent unintended operations in critical financial or administrative environments.
Summary updated