TRANSMISSION // 2505.23667v4
Teaching AI to reason with spreadsheet formulas
Source published
Fortune trains language models to answer table questions by writing executable spreadsheet formulas, then uses execution and answer correctness to guide learning.

Tables invite questions that require more than finding a matching row: a model may need to count, compare, or combine values across several steps. Fortune turns spreadsheet formulas into a tool for that work, training language models to generate formulas and learn from what happens when those formulas run.
Turning table questions into executable steps
A question such as “How many entries meet this condition?” sounds simple, but answering it reliably can require locating the right column, applying a rule to each row, and counting the results. Language models can make mistakes in arithmetic or in keeping track of table structure. The researchers behind Fortune ask whether spreadsheet formulas can give models a more dependable way to reason over tables.
A formula is more than a string of text: it refers to cells and applies operations that a spreadsheet engine can execute. Fortune, short for Formula Tuning, trains a language model to produce such formulas in response to questions about a table. The system runs each candidate formula on the table and checks the resulting answer against the known answer used in training.
How the training works
The researchers frame formula generation as reinforcement learning. In this approach, a model tries possible outputs and receives rewards that shape what it produces later. Fortune gives no reward when a formula cannot be executed, a partial reward when it runs but returns the wrong answer, and full credit when the result is correct. The partial reward is intended to help the model learn to produce valid formulas before it consistently reaches the right answer.
The study also tests a supervised fine-tuning stage before reinforcement learning. In this “cold start,” examples provide a starting set of formula-writing skills. The main models use Qwen2.5-Coder 7B and Llama 3.1 8B backbones. Tables are converted into a text representation that includes cell addresses and values, and formulas are run using a spreadsheet engine.
The team evaluates on seven table-question-answering benchmarks, covering tasks such as factual verification, financial calculations, and hierarchical tables. They compare formula-based answers with text-based reasoning, and also compare formulas with SQL and Python in experiments restricted to flat tables. The paper reports exact-match accuracy, with numerical tolerance where appropriate. For some headline results, the models generate multiple candidate answers and select one by voting, so those results reflect more than a single attempt.
What the authors report
Across the experiments, the authors report that reinforcement learning improves formula-based reasoning compared with supervised fine-tuning alone. They also find that starting reinforcement learning from a supervised model generally gives stronger results than starting from the base model. In their analysis, formula reasoning is particularly useful for tasks involving multi-step numerical work or complex table structure. Textual reasoning remains competitive on some more direct lookup or verification questions.
The authors’ combined system, Formula-R1-Plus, uses both textual and formula-based candidates. It reports 84.22% accuracy on FinQA and 95.06% on TabFact in the paper’s benchmark comparison. These figures are results on particular datasets under the authors’ evaluation setup; they do not establish how the system would perform on arbitrary spreadsheets or in everyday use. The paper also reports that combining the two reasoning styles performs better than either alone across the benchmarks in its ablation analysis.
A useful tool, not a guarantee
Execution makes part of the process checkable: a formula either runs in the chosen engine or it does not, and its output can be compared with a target answer during training. But successful execution is not proof that the formula reflects the question correctly. A formula can run perfectly while referring to the wrong cells or embodying a mistaken interpretation. The paper’s examples illustrate that formulas can also mishandle awkward values, such as text placeholders for missing data.
The authors list important limits. Their experiments use single training runs without estimates of variation, so the statistical significance of the measured gains is uncertain. Training data could be more diverse, and formula generation has practical challenges: useful formulas may be hard to discover, rewards can be sparse, and training can be unstable. The paper also notes substantial gaps between the best answer available among generated candidates and the answer selected by simple voting in some settings.
The article reports that the work appeared in Transactions on Machine Learning Research in November 2026. Its findings concern benchmark tests, not a demonstration of safe use in high-stakes financial, medical, or policy decisions. The authors themselves recommend checking generated formulas and retaining human review in high-stakes settings. More broadly, a formula-driven approach offers a way to expose some computational steps, but the model’s interpretation of a question and the quality of its output still need scrutiny.
- large language models
- spreadsheet formulas
- reinforcement learning
- table reasoning
- numerical reasoning
- AI evaluation
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
A spreadsheet map can help AI ask for less data
Source published
Shared keywords: large language models, spreadsheet formulas
When an AI Queries a Database, How Does It Know What You Mean?
Source published
Shared keywords: ai evaluation, large language models, reinforcement learning
When an AI’s training score rises but its answers get worse
Source published
Shared keywords: ai evaluation, reinforcement learning
A ranking-based reward for training language models
Source published
Shared keywords: ai evaluation, reinforcement learning
Training visual agents to look, not guess
Source published
Shared keywords: ai evaluation, reinforcement learning