arXiv:2610.03524cs.AIOct 2026

Manuscript Offprint

arXiv:2610.03524

From Benchmarks to Production: A Text-to-SQL System for Complex Financial Data

Arijit Sehanobish, Bruno Gomes Coelho, Guillaume Michel, Sophia Zhi, Valerie Faucon-Morin, Kristen Howell

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

General-purpose Text-to-SQL systems achieve strong performance on academic benchmarks like Spider and BIRD, where schemas are relatively shallow and column values are often human readable. In production financial databases, where concepts are stored as opaque integer keys rather than human-readable strings, these methods fall below 50%, as even simple queries require multiple joins and filter predicates reference opaque IDs. We present Financial LINKing Text-to-SQL (FLINT), a domain-specialized Text-to-SQL system that closes this gap through three key components: (1) a lookup agent that dynamically resolves natural-language concepts to question-specific reference table constraints, (2) embedding-based retrieval of structurally similar query templates from a compact, expert-authored bank, and (3) schema linking that prunes a large table schema to the relevant subset by traversing foreign-key chains, rather than relying on name similarity alone. We evaluate on two datasets totaling 359 questions over production financial schemas. FLINT outperforms various state-of-the-art baselines using the same LLM. The system is deployed in production as part of a financial data retrieval service. 1^{1}

1 Introduction

Text-to-SQL, translating natural language questions into executable database queries, has emerged as a useful interface for non-technical users to access structured data. Recent systems have achieved 70-85% accuracy on academic benchmarks such as Spider (Yu et al., 2018) and BIRD (Li et al., 2023b) through advances in schema linking, multi-agent architectures, and prompt engineering.

However, these results do not transfer to real-world database schemas in the financial sector. Questions about these databases (e.g., a company's quarterly revenue, the largest M&A deals in a sector) are straightforward to express in natural language, but difficult to translate into production-ready SQL. Commercial financial databases optimize for storage efficiency, not human readability, so financial metrics, period types, and currencies are encoded as integer foreign keys across dozens of normalized reference tables. A single time-series question requires traversing a six-table join chain, and the filters that distinguish “annual revenue” from “quarterly net income” are opaque integers that cannot be inferred from column names alone (detailed examples in App. A.2 and A.3).

This setting exposes a gap that academic benchmarks do not measure. In Spider (Yu et al., 2018) and BIRD (Li et al., 2023b), the column values are self-describing (e.g. country = 'USA'), the joins are shallow (1-2 on average), and the schemas fit into a single prompt. We evaluate seven state-of-the-art methods on two production financial datasets and find that none exceeds 50% accuracy, despite generating SQL with over 99% execution success. While the queries run, they often return the wrong data due to incorrect reference table filter values.

We present Financial LINKing Text-to-SQL (FLINT), a domain-specialized Text-to-SQL system that targets this through three components: (1) a lookup agent that dynamically resolves natural-language concepts to question-specific reference table constraints, (2) embedding-based retrieval over a compact, expert-authored query bank for structural templates, and (3) schema linking that prunes large schemas to relevant subsets, including the bridge tables needed for foreign-key traversal.

This design decouples domain knowledge from model weights. When schemas evolve, new metrics are added, or coverage gaps are identified, domain experts update the configuration artifacts directly without retraining or ML engineering involvement. Our architecture addresses normalized schemas that are common across industries, and while we

∗^{*}Equal Contribution

1^{1}https://kensho.com/solutions/adaptive-retrieval focus on financial data, we validate the generalizability of this approach in additional scientific and industrial domains in App. G.

To summarize, our contributions are:

• Bottleneck diagnosis. On normalized production-style schemas, value grounding and not SQL generation is the dominant failure mode: 76–96% of errors are wrong reference-table filter IDs.

• A lightweight value-grounding method. We introduce a model-independent configuration layer that targets this bottleneck. On four public benchmarks, it outperforms CHESS and ReFoRCE on three datasets at 5×5 \times lower generation cost.

• Semantic evaluation. We introduce a three-tier evaluation pipeline (AST canonicalization → column-aligned comparison → LLM judge) that distinguishes semantically equivalent queries from genuine errors.