Skip to main content

Bean Labs research log

TAT-LLM: Fine-Tuned 7B LLaMA 2 Beats GPT-4 on Financial QA

Published Last updated 5 min readMike ThriftMike Thrift
TAT-LLM: Fine-Tuned 7B LLaMA 2 Beats GPT-4 on Financial QA

Paper: https://arxiv.org/abs/2401.13223

On this page

After a week focused on retrieval and knowledge injection, I wanted to look at the other side of the question: what does targeted fine-tuning actually deliver when the task is well defined? TAT-LLM (arXiv:2401.13223, ICAIF 2024) is one of the clearer answers: fine-tune LLaMA 2 with a structured pipeline on financial table-text QA benchmarks and beat GPT-4. The crux, as usual, is in the details.

The paper​

Fengbin Zhu, Ziyang Liu, Fuli Feng, Chao Wang, Moxin Li and Tat-Seng Chua of NExT++ at NUS present TAT-LLM, a LLaMA 2 model fine-tuned for discrete reasoning over hybrid tabular and textual data. The core problem is answering numerical questions about financial reports — the kind of question where you have to find a specific row in a table, extract two numbers, and carry out a multi-step arithmetic operation to reach an answer. This is exactly what people do when reading 10-K filings.

Instead of driving a large model end-to-end, the authors decompose the task into three explicit steps: an Extractor that identifies relevant numerical evidence in the document, a Reasoner that writes an arithmetic expression, and an Executor that evaluates the expression deterministically. Training data is generated automatically from existing expert-annotated datasets — FinQA, TAT-QA and TAT-DQA — by annotating each instance with the intermediate extraction and reasoning steps. Fine-tuning uses LoRA across three LLaMA 2 scales: 7B, 13B and 70B.

Key ideas​

  • Pipeline decomposition beats end-to-end: The external Executor (deterministic arithmetic) alone adds +16.66 EM points on FinQA for the 7B model. Arithmetic is not harder for the model to do — it is simply catastrophically unreliable when it happens in natural language.
  • 7B beats GPT-4 on all three benchmarks: TAT-LLM 7B scores 64.60% EM on FinQA (vs GPT-4's 63.91%), 74.56% EM on TAT-QA (vs 71.92%) and 69.45% EM on TAT-DQA (vs 64.46%). The gap on TAT-DQA is the most convincing, at nearly 5 points.
  • Extraction is the limiting failure mode: Error analysis shows that 48% of errors trace to incorrect evidence extraction — the model picks the wrong row, the wrong column, or misreads a number because of unfamiliar financial terminology. Only 19% are wrong operators.
  • Scale helps, to a limited extent: The jointly trained 70B variant (TAT-LLM-All) raises FinQA to 76.81% EM and TAT-QA to 81.42% F1, which are meaningful improvements. But the 7B model already beats GPT-4, which suggests the pipeline structure matters more than the parameter count.
  • Human experts remain far ahead: On TAT-QA, human performance is 90.8% F1; TAT-LLM's best result is 81.42% F1. The gap is real and is acknowledged in the paper.

What holds up — and what doesn't​

The core technical contribution is solid: outsourcing arithmetic to a deterministic executor is clearly the right choice, and the ablation proves it convincingly. This is a known lesson from PAL and similar work, but seeing it quantified (+16.66 points) on a specifically financial benchmark is a valuable confirmation.

Where I am more skeptical is the headline claim about "outperforming GPT-4". The margin on FinQA is 0.69 EM points — effectively within the margin of error, and the GPT-4 numbers reflect zero-shot or lightly prompted evaluation, not GPT-4 with chain-of-thought, few-shot examples or its own code interpreter. A prompted GPT-4 with Python tool use would almost certainly beat these numbers. The comparison is not wrong, but it is not quite the "specialization wins" story the abstract suggests.

There is also a significant concern about evaluation leakage. The model is fine-tuned on the training splits of FinQA, TAT-QA and TAT-DQA and evaluated on their test splits. That is a narrow in-distribution setting. The paper includes no held-out financial QA task the model never saw in training, so generalization to new document types or new arithmetic patterns remains unproven.

The 4,096-token context limit is a practical showstopper for real financial reports. A typical 10-K runs to more than 100 pages; even a single quarterly report often exceeds 4,096 tokens. The model as described cannot handle the inputs it is designed for without chunking, and the paper does not address how extraction degrades when the evidence is spread across multiple chunks.

Why this matters for finance AI​

The Extractor-Reasoner-Executor decomposition applies directly to Beancount agents. When a user asks "what were my total food expenses in Q1 2025 compared with Q1 2024?", the natural structure is: find the relevant transactions (Extract), build an aggregation expression (Reason), run it against the ledger (Execute). TAT-LLM's error analysis makes a concrete prediction: the extraction step is where a Beancount agent will fail most often — wrong account categories, missed transactions, misread amounts — not the arithmetic.

The LoRA fine-tuning approach is also relevant to anyone building a Beancount-specific model. The training-data generation strategy — take expert-annotated QA pairs and annotate them with intermediate steps — is exactly how you would build a ledger-specific reasoning dataset. You have the source data of the ledger entries; you can generate (question, extraction, expression, answer) tuples automatically.

The context limit is the biggest blocker. A production-grade Beancount agent has to reason over years of entries. The paper's model does not; it is a strong baseline for short-document QA that needs to be extended with chunking, retrieval or a larger context window to become practically usable.

  • FinQA (arXiv:2109.00122, EMNLP 2021) — the original benchmark TAT-LLM is evaluated on; reading it makes clear exactly what "discrete reasoning over financial data" means and what the earlier state of the art looked like before LLMs.
  • TAGOP (part of the TAT-QA paper, arXiv:2105.07624, ACL 2021) — the table-aware operator model that defined the TAT-QA task; understanding what rule-based operator selection looks like gives a reference point for what the LLM-based Reasoner step replaces.
  • AuditCopilot (arXiv:2512.02726) — benchmarks LLaMA and Gemma on journal entry test anomaly detection over real ledger data; the natural follow-up question after TAT-LLM is whether the same fine-tuning approach transfers to anomaly detection instead of QA.

Source: https://beancount.io/bean-labs/research-logs/2026/05/21/tat-llm-specialized-language-model-discrete-reasoning-tabular-textual

Published: May 21, 2026

Last updated: November 14, 2026