SheetAlign: Grounded Interaction and Stage-Isolated Learning for Spreadsheet Agents

Yuxiang Wang, Junhao Gan, Jianzhong QiarXiv 2026 · arXiv

TL;DR

SheetAlign is a new framework that significantly boosts the performance of spreadsheet agents by grounding their actions in specific workbook observations and using "stage-isolated" learning. By training separate policies for generating and reviewing code using edit-level rewards, it enables compact, open-weight models like Qwen3-4B to outperform much larger closed-source systems on complex data tasks.

What Problem Does This Paper Address?

Spreadsheets are the backbone of modern data analysis, but automating them with AI agents is surprisingly tricky. Current Large Language Model (LLM) agents face two major hurdles:

  1. Task-to-Edit Grounding: An LLM might generate a Python script that runs perfectly but modifies the wrong cells because it didn't truly "understand" the workbook's layout. For example, it might calculate a total in column C when the user expected it in column D.
  2. Sparse Training Feedback: Most training methods use a binary "pass/fail" reward. If a task requires ten cell edits and the model gets nine right, it still gets a reward of zero. This makes it incredibly hard for models to learn from partial successes.
Figure 1: Motivations for SheetAlign. Upper: Exe- cutable programs may modify unintended cells without task-to-edit grounding. Lower: Whole-task rewards overlook partially completed edits.

Methods

The authors introduce SheetAlign, which breaks the spreadsheet manipulation process into three distinct, grounded components:

  • Grounded Task Interface: Before writing any code, the model must first "inspect" the task. It fills out a template identifying where to operate, what to read, and how to implement the change. This forces the model to anchor its plan in the actual workbook state and relevant API documentation (like openpyxl).
  • Stage-Isolated Policy Learning: Instead of one giant model, SheetAlign uses two specialized policies—one for Generation ($M_{gen}$) and one for Review ($M_{rev}$). They are trained independently using Group Relative Policy Optimization (GRPO).
  • Edit-Progress Rewards: To solve the "sparse feedback" problem, the authors use an F1-score-based reward. This measures how many of the required cell edits were performed correctly, providing a much denser signal for the model to learn from.
  • Execution Consistency: At inference time, the system generates multiple candidate programs. It doesn't just pick the most likely code; it executes them all and selects the result where the final workbook states (values, formulas, and formatting) agree the most.
Figure 2: Overview of SheetAlign, integrating task grounding, stage-isolated learning, and execution consistency.

Datasets

The framework was evaluated on two primary benchmarks:

  • SpreadsheetBench: 912 complex, real-world spreadsheet tasks.
  • Domain-Spreadsheet: 1,660 tasks spanning seven domains like finance, supply chain, and HR.
  • Training Data: The models were fine-tuned on a sample of ~6,000 real-world Excel tasks.

Key Insights and Ideas

  • Grounding is the Biggest Lever: Simply adding the grounded task interface (without any extra training) improved the base model's accuracy on SpreadsheetBench from 13.5% to 29.2%. This suggests that "where to look" is often more important than "how to code."
  • Specialization Beats Generalization: Training the generation and review policies separately prevents them from interfering with each other. The generation policy learns to be bold and complete edits, while the review policy learns to be a skeptical critic.
  • Workbook Agreement > Code Agreement: Traditional "self-consistency" often looks at how similar the generated code is. SheetAlign looks at the resulting workbook state. Two different pieces of code might produce the exact same spreadsheet result, and that agreement is a much stronger signal of correctness.
Figure 6: Table 3 showing that task-guided inspection has the largest impact on correctness.

Key Results

SheetAlign turns compact models into powerhouses. Using Qwen3-4B-Thinking as a backbone:

  • SpreadsheetBench: Accuracy jumped from 13.5% (base) to 32.8% (SheetAlign). This outperforms specialized agents like TabClaw (28.8%) and SheetAgent (22.3%) which use much larger models.
  • Domain-Spreadsheet: It achieved 30.1% accuracy, nearly doubling the performance of the previous state-of-the-art RL-based baseline (17.2%).
  • Reliability: The execution success rate (how often the code actually runs without crashing) reached a staggering 98.6%.
Figure 4: Table 1 main results on SpreadsheetBench, showing SheetAlign outperforming comparable baselines.

Limitations and Future Work

  • Inference Cost: Generating multiple candidates and running a review pass increases the computational cost per task.
  • Context Windows: For exceptionally large workbooks, the "bounded" inspection might still miss distant but relevant context.
  • Specialized Features: The current system relies on openpyxl, which may not support every niche Excel feature or external integration.

Future work could involve more sophisticated "workbook fingerprints" for consistency selection and adapting the grounding mechanism for even larger, multi-sheet workbooks.

Summary updated

Abstract

Spreadsheets are widely used for data analysis and supporting decision-making. Automating spreadsheet analysis while protecting sensitive data and controlling deployment costs motivates locally deployed open-weight large language models (LLMs). Meanwhile, complex spreadsheet tasks require both task reasoning and workbook understanding, while predefined operation interfaces impose additional tool-selection and invocation demands. We introduce SheetAlign, a spreadsheet manipulation framework with stage-isolated policy learning, organized around where to operate, what to change, and how to implement transformations. Task-guided inspection and API grounding anchor code generation in workbook observations and available operations, while stage-isolated learning optimizes program generation and review using edit-progress rewards. At inference, execution consistency selects programs through agreement among workbook states. On SpreadsheetBench, our grounded task interface improves Qwen3-4B's accuracy from 13.5% to 29.2% on average without training. With learning and execution consistency, SheetAlign achieves 32.8% accuracy on average on SpreadsheetBench and 30.1% on Domain-Spreadsheet, outperforming comparable baselines. The code will be made publicly available upon publication.
BibTeX
@misc{wang2026sheetalign,
  author = {Yuxiang Wang and Junhao Gan and Jianzhong Qi},
  title = {{SheetAlign: Grounded Interaction and Stage-Isolated Learning for Spreadsheet Agents}},
  year = {2026},
  eprint = {2611.26069},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.26069},
}
Figure