Pointing at Cells: Program Generation Over a Table-Graph Index for Financial QA

Questions over financial reports, such as "what was the percentage change in operating income from 2018 to 2019?", are answered by writing a small arithmetic program and filling it with numbers taken from a table. The program skeleton is rarely the hard part. The hard part is choosing the right operands, because the 2018 and 2019 operating income figures sit side by side in the same row, share the same row label, and look almost identical to a model that reads the table as a flat string. In TAT-QA, 55% of model failures come from this evidence-extraction step rather than from the arithmetic (TAT-QA). On FinQA, the FinQANet program generator jumps from 70.00% to 75.43% execution accuracy when it is handed gold cells instead of gold rows (Bin Wang et al.), even though its end-to-end score is only 61.24% (FinQA).

We propose to treat operand selection as retrieval. Each table cell becomes a node in a graph linked to its row headers, column headers, and the caption that carries units such as "in millions". A graph encoder gives every cell an embedding that encodes where the cell sits in the table, not just what it says. The decoder that writes the program then copies operands with a pointer, a mechanism that lets the model output an item from its input instead of generating it from a vocabulary. Here the pointer scores candidate cells by an inner product between the decoder's current state and those cell embeddings. That scoring is exactly the dual-encoder setup used in dense search, where queries and candidates are encoded separately and compared by dot product. One set of cell embeddings therefore serves both as the first-stage evidence retriever and as the copy target. We pre-train these embeddings on unlabeled financial tables, using objectives that force the model to tell apart sibling cells that differ only in their header path.

Core Claim

The claim is that structure-aware cell embeddings, pre-trained on domain tables, close most of the gap between end-to-end FinQA accuracy and gold-cell accuracy. Two properties should drive this. First, the same embeddings act as a cell-level dense retriever and as the pointer vocabulary of the program decoder. Second, the copy target is a cell node rather than a token position in a flattened string.

The decisive prediction is narrow and checkable. Gains should concentrate on questions whose correct operand has a "sibling distractor", meaning another cell with the same row label and a numerically plausible value. Gains should also survive row and column shuffling. If gains instead spread evenly across question types, or vanish once a strong cell retriever is placed in front of an ordinary decoder, the claim is wrong.

Relation to Prior Work

Two papers motivate the proposal by locating the failure.

  • Same-row noise. Bin Wang et al. show that row-level retrieval is noisy because cells in one row share surface text. They fix this with a BERT cell classifier that scores each cell independently, without message passing between cells and without coupling to the decoder.
  • Extraction bottleneck. TAGOP (TAT-QA) tags evidence spans in a linearized table and then picks one of ten fixed operators. It is capped at 58.0% F1, and most of its errors are tagging errors.

Three lines of work supply the methods we reuse.

  • Pointer over retrieved evidence. FiD-PGN adds a 1,537-parameter pointer to a Fusion-in-Decoder reader by reusing its cross-attention over flat passage tokens. It reports 51.4 vs. 48.5 exact match on Natural Questions and a 9.6-point gain on questions with no train/test answer overlap. The pointer itself follows Get To The Point. Our pointer points at graph nodes instead of token positions.
  • Graph encodings of tables. HeGTa builds heterogeneous table/row/header/cell graphs and pre-trains them with a cell-matching objective. TUTA encodes hierarchical headers as two coordinate trees and pre-trains with cell cloze. Both pre-train on general web tables. Both serve as input encoders for an LLM or a classifier, and HeGTa's authors report a persistent weakness on multi-step arithmetic. We reuse their graph construction and pretext tasks, but on financial tables. The cell embeddings become the decoder's output space rather than a soft prompt.
  • Graph-enriched dual encoders. GNN-encoder enriches offline passage vectors with graph attention over a query–passage graph while keeping online latency near 1.9 ms. It shows that offline graph propagation can sharpen a dual encoder. Its graph connects text passages across a corpus, whereas ours links cells within a table.

Two results constrain the design.

  • Domain text alone does not help. FinBERT gave FinQANet no meaningful gain over RoBERTa (FinQA). So "domain pre-training" here must mean pre-training on domain table structure, and the experiments must separate the domain contribution from the structure contribution.
  • Itemizing a table loses context. ITR retrieves rows and columns with a dual encoder inside a table. It reports 92.1% denotation accuracy on WikiSQL, but the items are disconnected and lack multi-level header context.
  • Permutation robustness is attainable. TABGR shows that graph-based table prompts lose only 0.1–1.3% under shuffling, versus up to 18.7% for linearized baselines. We adopt that robustness as a requirement.

Research Program

Graph construction. Each table becomes a heterogeneous graph with four node types: table, header path, data cell, and caption/unit. Edges connect each cell to its row-header chain, its column-header chain, and the table's caption node. TAT-QA's scale labels (thousand, million, billion, percent) attach to the caption node. Accompanying text sentences become their own nodes, linked to the table node, so that text operands live in the same pointer space as cell operands.

Encoder. A RoBERTa-large backbone encodes each node's text. Two to three heterogeneous graph-attention layers refine the cell embeddings. These embeddings are computed once per document and cached; this is the offline side of the dual encoder.

Retrieval. The question is encoded separately. The top-$k$ cells and sentences are retrieved by dot product, with $k$ matched to FinQANet's retrieval budget.

Decoding. The program decoder follows FinQANet's domain-specific language (DSL), including its step-memory tokens. At each step a gate chooses among three actions: emit an operator, refer back to a previous step, or copy an operand. When copying, the probability of choosing cell $c$ is

$$ P_{\text{copy}}(c \mid s_t) = \frac{\exp(s_t^\top W e_c)}{\sum_{c'} \exp(s_t^\top W e_{c'})} $$

where $s_t$ is the decoder state at step $t$, $e_c$ is the graph-refined embedding of cell $c$, and $W$ is a learned matrix. Copying a cell also copies its unit from the attached caption node, which handles scale without a separate classifier. The retriever's dot-product score and the pointer share the cell embeddings $e_c$, so the decoder's training signal flows back into the retrieval embeddings.

Pre-training. We gather unlabeled tables from public company filings. We found no such corpus listed on Lacuna, so it must be built, and FinQA/TAT-QA source documents must be excluded from it. The encoder is pre-trained on three objectives:

  • TUTA-style cell cloze;
  • HeGTa-style cell–text matching;
  • a sibling-contrastive objective. Given a cell's value and the text of one header, the model must pick that cell's full header path from among its row and column siblings. This objective directly targets the confusion described by Bin Wang et al.

To isolate the domain effect, the identical pre-training is run on a size-matched sample of general web tables.

Baselines

Naive reference. FinQANet with RoBERTa-large: a row-level retriever over linearized tables plus an LSTM program decoder. It reports 61.24% execution accuracy on FinQA (FinQA). We re-run it with our tuning budget.

Strongest existing FinQA system. The fine-grained cell retriever with an ensemble of generators from Bin Wang et al.. It reports 69.79% execution accuracy on the private test set and 75.43% with gold cells.

  • Why it is the main competitor: it already attacks the same failure, sibling-cell confusion, without graphs or pointers. If it matches us, our mechanism is unnecessary.
  • Fair comparison: we compare against its single-generator configuration, since the ensemble adds about 2.5 points. Both systems use the same backbone, the same top-$k$ evidence, the same DSL, and an equal hyperparameter search budget. We report an ensemble of our own model only alongside their ensemble.
  • What counts as beating it: exceeding their single-generator score by a margin larger than seed variance, with the gain concentrated on the sibling-distractor subset.

TAT-QA reference. TAGOP, at 58.0% F1 on the test set (TAT-QA).

Large-model reference. A prompted large language model given a linearized table and asked to write the same DSL program. We found no reported result on Lacuna for large prompted LLMs on FinQA or TAT-QA, so we run this baseline ourselves with a fixed prompt budget.

Ablations of the key ingredient.

  • Flat pointer: replace node pointing with FiD-PGN-style pointing over flattened table tokens.
  • Decoupled embeddings: keep node pointing but give the retriever and the pointer separate embeddings.
  • No graph: drop graph layers, so each cell embedding is its text plus concatenated header strings.
  • Pre-training regimes, all on the same architecture: none, text-only domain (FinBERT-style), general-table structural, and domain-table structural.

Why not just…?

Why not just put a strong cell retriever in front of an ordinary decoder? This is the most serious threat, and Bin Wang et al.'s gold-cell result shows the size of the prize. Even with clean evidence, though, the decoder must still choose which of several retrieved same-row cells fills each operand slot, and it does so by reading flat tokens. The "no graph" and "flat pointer" ablations, run on top of the same cell retriever, settle the question. If node pointing adds nothing once retrieval is fixed, we will report that the contribution is retrieval alone.

Why not just linearize the table and prompt a large model to write code? Linearized models lose up to 18.7% under shuffling (TABGR). Flat models also collapse on deep header hierarchies: 14.1% at nesting depth five or more on HiTab. Neither result is on FinQA itself, and we have no LLM number on FinQA. We therefore run this baseline directly and report it unshuffled, shuffled, and on HiTab. If it wins on unshuffled FinQA, our argument narrows to robustness and cost.

Why not just continue pre-training on financial text? FinBERT gave no gain on FinQA (FinQA). Our four-way pre-training comparison tests whether domain structural pre-training differs from both text-only domain pre-training and general structural pre-training. A null result here would mean the domain component should be dropped from the claim.

Why not just classify fixed operators and tag spans, as TAGOP does? TAGOP's tagging is precisely where its errors live. Fixed operators also cannot express FinQA's multi-step programs. Its 58.0% F1 is the reference our TAT-QA model must clear.

Proposed Experiments and Decisive Checks

Main evaluation. We train and evaluate on FinQA, measuring execution and program accuracy, and on TAT-QA, measuring exact match and F1. We report means over at least three seeds.

Diagnostic subsets. We annotate the sibling-distractor subset automatically: an operand counts as having a sibling distractor if another retrieved cell shares its row header and has the same unit. We report operand-selection accuracy separately from program-skeleton accuracy. The prediction is that our gain on this subset exceeds our gain on the rest by a clear margin.

Robustness. We shuffle rows and columns of the test tables. The target is degradation in the 0–2% range reported for graph methods, compared with the large drops expected of linearized baselines.

Transfer to hierarchical tables. We fine-tune on HiTab QA and compare against the 45.1% hierarchy-aware MAPO result (HiTab). This checks whether pointing at header paths transfers to tables outside finance.

Retrieval quality. We report cell-level recall@$k$ of the shared embeddings against the independent cell classifier.

Stopping rule. If the decoupled-embedding ablation equals the shared model, we drop the claim about sharing embeddings. If general-table pre-training equals domain-table pre-training, we drop the domain claim. Whatever survives these two ablations is the actual finding.