Fortune: Formula-Driven Reinforcement Learning for LLM Reasoning over Complex Tables
Organizations: University of Illinois Urbana-Champaign · Nankai University · Tsinghua University · Shandong University ·
Abstract
Tables are a fundamental medium for organizing and analyzing data, making table reasoning an essential capability for intelligent systems. Although large language models (LLMs) exhibit strong general reasoning abilities, they still struggle with accurate numerical reasoning over tabular data, particularly in complex table settings that require more than simple relational lookup. Spreadsheet formulas provide a powerful and expressive interface for executable symbolic operations, enabling sophisticated reasoning patterns that remain largely underexplored by existing LLMs. In this paper, we introduce Formula Tuning (Fortune), a formula-driven reinforcement learning (RL) framework that trains LLMs to generate executable spreadsheet formulas for question answering over tabular data, using execution success and answer correctness as reward signals. Building upon Fortune, we train Formula-R1 and evaluate its performance across seven table reasoning benchmarks, demonstrating competitive performance, particularly on tasks involving complex tables and multi-step numerical computation. Furthermore, Formula-R1-Plus, which integrates textual and formula-based reasoning, achieves further performance improvements. Beyond these empirical results, we provide insights into the roles of reinforcement learning and executable formula representations in table reasoning, highlighting the broader potential of symbolic RL to enhance the reasoning capabilities of LLMs.
Figures & tables
| Method | Backbone | WikiTQ | TabFact | HiTab | FinQA | AIT-QA |
|---|---|---|---|---|---|---|
| Prompting-Based Methods | ||||||
| Binder ( Cheng et al., 2023 ) | CodeX | 64.60 | 85.10 | - | - | - |
| Dater ( Ye et al., 2023 ) | CodeX | 65.90 | 85.60 | - | - | - |
| API-Assisted ( Cao and Liu, 2025 ) | CodeX | 42.40 | - | 69.30 | - | - |
| ReAcTable ( Zhang et al., 2023 ) | CodeX | 68.00 | 86.10 | - | - | - |
| Chain-of-Table ( Wang et al., 2024 ) | PaLM 2 | 67.31 | 86.61 | - | - | - |
| Base Model | Method | In-Distribution | Out-of-Distribution | Overall | |||||
|---|---|---|---|---|---|---|---|---|---|
| WikiTQ | TabFact | FinQA | HiTab | MultiHiertt | AIT-QA | TableBench | |||
| Zero-Shot | |||||||||
| Llama-3.1 | Text | 50.46 | 67.84 | 42.37 | 29.92 | 18.77 | 59.61 | 21.29 | 41.47 |
| Formula | 12.58 | 15.77 | 22.67 | 6.57 | 4.23 | 20.00 | 10.31 | 13.16 | |
| Qwen2.5-Coder | Text | 55.53 | 78.26 | 55.54 | 50.38 | 26.11 | 73.60 | 24.12 | 51.93 |
| Formula | 38.96 | 52.52 | 34.44 | 32.60 | 15.90 | 52.43 | 26.05 | 36.13 | |
| Method | WikiTQ | TabFact | FinQA | TableBench | Overall |
|---|---|---|---|---|---|
| Zero-Shot | |||||
| SQL | 17.07 | 21.15 | 1.51 | 7.64 | 11.84 |
| Python | 30.96 | 60.39 | 34.87 | 16.33 | 35.64 |
| Formula | 38.96 | 52.52 | 34.44 | 26.05 | 37.99 |
| Reinforcement Learning (RL) | |||||
| SQL | 67.58 | 83.94 | 38.79 | 32.09 | 55.60 |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Evaluation Type | Dataset | # Train Data | # Test Data | Table Type | Domain | License | Source |
| In-Distribution | WikiTQ ( Pasupat and Liang, 2015 ) | 13,753 | 4,217 | Relational | Wikipedia | CC-BY-SA-4.0 | Link |
| TabFact ( Chen et al., 2020 ) | 10,000 | 2,024 | Relational | Wikipedia | CC-BY-4.0 | Link | |
| FinQA ( Chen et al., 2021b ) | 6,251 | 1,147 | Relational | Finance | MIT | Link | |
| HiTab ( Cheng et al., 2021 ) | 7,399 | 1,583 | Hierarchical | Statistical Reports | C-UDA 1.0 | Link | |
| MultiHiertt ( Zhao et al., 2022 ) | 7,795 | 1,038 | Multiple & Hierarchical | Finance | MIT | Link | |
| Out-of-Distribution | AIT-QA ( Katsis et al., 2021 ) | – | 515 | Hierarchical | Airline | CDLA-Sharing-1.0 | Link |
| Partial reward (exec-but-wrong) | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 |
| Accuracy | 57.98 | 70.64 | 72.32 | 72.04 | 70.53 |
| Method | HiTab | MultiHiertt | AIT-QA | Overall |
|---|---|---|---|---|
| Python | 28.46 | 8.36 | 45.22 | 27.35 |
| Formula | 32.60 | 15.90 | 52.43 | 33.64 |
| Method | WikiTQ | TabFact | FinQA | HiTab | MultiHiertt | AIT-QA | TableBench | |
|---|---|---|---|---|---|---|---|---|
| TabAF ( Wang et al., 2025 ) | Upper Bound | 80.13 | 94.02 | - | 82.07 | - | - | - |
| 5 Text | 61.42 | 81.47 | - | 74.24 | - | - | - | |
| 5 Formula | 64.20 | 67.54 | - | 74.87 | - | - | - | |
| 5 Text + 5 Formula | 74.72 | 83.99 | - | 78.41 | - | - | - | |
| Formula-R1 | Upper Bound | 77.35 | 96.49 | 72.01 | 79.91 | 58.86 | 88.93 | 43.26 |
| 10 Formula | 75.27 | 85.08 | 70.10 | 78.84 | 58.48 | 83.50 | 42.13 | |
| Method | WikiTQ | TabFact | FinQA | HiTab | MultiHiertt | AIT-QA | TableBench | Overall |
|---|---|---|---|---|---|---|---|---|
| Zero Shot | ||||||||
| w/o Reasoning | 42.14 | 57.76 | 33.13 | 38.35 | 15.99 | 58.45 | 28.88 | 39.24 |
| w/ Reasoning | 38.96 | 52.52 | 34.44 | 32.60 | 15.90 | 52.43 | 26.05 | 36.13 |
| Reinforcement Learning (RL) | ||||||||
| w/o Reasoning | 63.39 | 80.39 | 61.99 | 67.09 | 38.15 | 78.84 | 33.41 | 60.47 |
| w/ Reasoning | 67.80 | 84.19 | 62.16 | 71.19 | 41.72 | 81.17 | 35.45 | 63.38 |
| Dataset | Table Layout | Generated Formula | ||||
|---|---|---|---|---|---|---|
| Width | Height | Area Size | Length | # Operators | # Variables | |
| WikiTQ | 6.28 | 19.46 | 121.68 | 21.61 | 0.84 | 1.50 |
| TabFact | 6.28 | 14.04 | 87.42 | 44.85 | 3.11 | 2.85 |
| FinQA | 3.92 | 18.09 | 70.80 | 18.84 | 1.98 | 2.94 |
| HiTab | 6.16 | 21.32 | 171.40 | 12.20 | 0.49 | 1.34 |
| MultiHiertt | 7.25 | 46.59 | 339.30 | 22.64 | 2.10 | 3.21 |
| Method | Case |
|---|---|
| - | Question: rapper saigon has had at least () albums released in the U.S.? |
| Table: | |
| Groundtruth Answer: 4 | |
| Symbolic | Think: To compute how many unique albums Saigon has released, I examine column F (F2:F13), which lists album names. Some of these cells contain "nan", which I treat as missing values. I only count the unique non-missing values. A standard formula to count unique non-empty values is: =SUMPRODUCT(1/COUNTIF(F2:F13,F2:F13)) This formula works because COUNTIF returns the number of times each value appears; taking 1 over that and summing gives the count of distinct values. This will count duplicates only once and ignore empty cells or "nan" if treated as the same placeholder. |
| Generated Formula: =SUMPRODUCT(1/COUNTIF(F2:F13,F2:F13)) |
| Method | Case |
|---|---|
| - | Question: How many elections did the party win75 or more seats? |
| Table: | |
| Groundtruth Answer: 13 | |
| Textual | Think: - A2, 1927 (sep): 57 seats - A3, 1932: 72 seats - … - A26, 2002: 81 seats - A27, 2007: 77 seats - A28, 2011: 20 seats (less than 75) Counting the rows where the "seats" column is 75 or more: - 1927 (sep): 57 - 1932: 72 - … - 2002: 81 - 2007: 77 Counting these, we find 22 elections where the party won 75 or more seats. |
| Generated Answer: 22 |
| Method | Case |
|---|---|
| - | Question: What is the number of winning drivers that represented the U.S.? |
| Table: | |
| Groundtruth Answer: 15 | |
| SFT | Think: To determine the number of of winning States that represent, we need to count the occurrences of U.S. drivers in the range B1:B10. This will give us the total count of cells that contain the value "A1". |
| Generated Formula: =COUNTIF(B1:B10, A1) |
| Name | Symbol | Description | Example |
|---|---|---|---|
| PLUS | + | Adds two numbers together | =A1 + A2 |
| MINUS | – | Subtracts one number from another | =A1 - A2 |
| MULTIPLY | Multiplies two numbers together | =A1 * A2 | |
| DIVIDE | / | Divides one number by another | =A1 / A2 |
| SUM | SUM | Sums a range of numbers | =SUM(A1:A10) |
| AVERAGE | AVERAGE | Calculates the average of a range of numbers | =AVERAGE(A1:A10) |