Program of Thoughts for Financial Reasoning: Leveraging Dynamic In-Context Examples and Generative Retrieval
Subhendu Khatuya, Shashwat Naidu, Pawan Goyal, Niloy Ganguly
TL;DR
This work tackles financial numerical reasoning by introducing FINDER, a two-step framework that first retrieves relevant facts from unstructured text and tables using an instruction-tuned generative retriever, then computes the answer with context-aware, dynamic Program of Thought prompting. The approach leverages LoRA-tuned FLAN-T5 for fact retrieval and a dynamic in-context exemplar strategy (via clustering) to steer PoT-based Python code generation, executed by an external solver (SymPy). FINDER achieves state-of-the-art execution accuracy on FinQA and ConvFinQA, with notable improvements over prior methods and strong parameter efficiency compared to large retriever models. The results are supported by extensive ablations showing the importance of targeted retrieval, dynamic exemplars, and modular design, and point to future work in external knowledge integration and broader domain deployment.
Abstract
Despite continuous advancements in the capabilities of large language models (LLMs), numerical reasoning remains a challenging area. Techniques like chain-of-thought prompting, tree-of-thought prompting, and program-of-thought prompting guide LLMs through intermediate reasoning steps. Although in-context learning with few-shot prompting has improved performance, LLMs still lag behind state-of-the-art models on financial numerical reasoning datasets such as FinQA and ConvFinQA. In this work, we introduce FINDER, a novel two-step framework, to enhance LLMs' capabilities in financial numerical reasoning. The first step utilizes a generative retriever to extract relevant facts from unstructured data, including both text and tables. This is followed by context-aware Program of Thought prompting with dynamic selection of in-context examples. Our model FINDER achieves a new state-of-the-art performance on both the FinQA and ConvFinQA datasets, surpassing previous benchmarks with execution accuracy improvements of 5.98% and 4.05%, respectively.
