FinQAPT: Empowering Financial Decisions with End-to-End LLM-driven Question Answering Pipeline

Kuldeep Singh, Simerjot Kaur, Charese Smiley · DOI

Introduction

Financial analysts are frequently tasked with extracting precise data points from massive, multi-page documents such as 10-Ks and annual earnings reports. While Large Language Models (LLMs) like GPT-4 have demonstrated remarkable reasoning capabilities, they often falter in the financial domain due to two primary challenges: retrieval (the difficulty of finding specific information in a "haystack" of hundreds of pages) and hallucination (the tendency to generate incorrect figures when context is missing or fragmented).

FinQAPT introduces an end-to-end pipeline designed to bridge this gap. By streamlining the process from raw PDF ingestion to final numerical answer, the system addresses the "context fragmentation" problem where relevant data is dispersed across various formats and pages. The pipeline achieves a new state-of-the-art (SOTA) performance on the FinQA benchmark by combining advanced retrieval techniques with dynamic reasoning strategies.

System Architecture

The FinQAPT pipeline is composed of three specialized modules that work in sequence to process a natural language query against a corpus of financial reports.

Overview of the FinQAPT pipeline, illustrating the flow from raw earnings reports to the final answer through three specialized modules.
  1. FinPrimary (The Filter): This initial stage uses GPT-3.5 to decompose complex, multi-step questions into simpler sub-queries. It then employs traditional sparse retrievers, such as TF-IDF and BM25, to identify the specific pages within a large report that are most likely to contain the necessary information.
  2. FinContext (The Retriever): Once relevant pages are isolated, this module extracts fine-grained context, such as specific sentences or table rows. To improve accuracy, the researchers implemented a novel Clustering-based Negative Sampling technique. By training the retriever (DeBERTa-v3) on "hard negatives"—segments that are semantically similar but factually irrelevant—the model learns to distinguish between nuanced financial terms and similar-looking data from different fiscal years.
  3. FinReader (The Reasoner): The final module takes the retrieved context and the original query to generate a numerical answer. It utilizes a Dynamic N-shot Prompting strategy, which identifies semantically similar questions from the training set and generates a "Chain-of-Thought" (CoT) explanation on the fly. This provides the LLM with a relevant logical framework for the specific calculation required.

Key Innovations and Insights

The "Hard Negative" Advantage

A significant finding of the study was the impact of training retrievers on hard negatives. In financial reporting, many segments appear nearly identical (e.g., "Operating expenses were X in 2018" vs. "Operating expenses were Y in 2019"). Standard random sampling fails to teach models these distinctions. The clustering-based approach forces the model to move beyond simple keyword matching, leading to a Recall@5 of 95.0% for the FinContext module.

Dynamic Contextual Reasoning

The researchers observed a 10–15% improvement in accuracy when LLMs were provided with dynamic, semantically similar examples rather than static ones. This suggests that in-context learning is most effective when the provided examples mirror the specific mathematical logic of the current query.

Experimental Results

The FinQAPT pipeline was evaluated using the FinQA benchmark and a collection of raw S&P 500 earnings reports from 1999 to 2019.

Performance comparison of FinQAPT against various baselines on the FinQA benchmark, showing the SOTA 80.6% accuracy.

As shown in the results, the FinReader module (using GPT-4 with Dynamic N-shot prompting) achieved a state-of-the-art accuracy of 80.6% on the FinQA test set. This significantly outperforms previous models like APOLLO (71%) and standard GPT-4 CoT (78%).

However, the study also revealed a "pipeline penalty." While the reasoning module is highly effective when given the correct context, the end-to-end performance drops to 62.0% when the system must retrieve information from raw documents. This highlights that the primary bottleneck in financial AI remains the retrieval of fragmented information across disparate pages rather than the mathematical reasoning itself.

Conclusion and Future Work

FinQAPT demonstrates that an integrated, modular approach can significantly enhance the reliability of LLMs in financial contexts. While the system sets a new benchmark for reasoning, future work will focus on improving multi-page context integration. Financial reports often repeat information across different sections, creating "noisy" environments that can mislead retrievers. Addressing these complexities will be essential for creating fully autonomous financial analysis tools.

Summary updated

BibTeX
@inproceedings{singh2024finqapt,
  author = {Kuldeep Singh and Simerjot Kaur and Charese Smiley},
  title = {{FinQAPT: Empowering Financial Decisions with End-to-End LLM-driven Question Answering Pipeline}},
  booktitle = {ICAIF},
  year = {2024},
  doi = {10.1145/3677052.3698682},
}
Figure