arXiv:2609.06117cs.CLSep 2026

Manuscript Offprint

arXiv:2609.06117

STQA: A Benchmark for Stock-Focused Tabular Question Answering over Historical and Forecasted Data

Baoxu An, Wenmian Yang, Zhensheng Wang, Weijia Jia

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

Abstract

Stock market analysis inherently requires composite reasoning over historical records and future projections, yet existing benchmarks remain fragmented across isolated tasks. We introduce STQA (Stock-focused Tabular Question Answering), an end-to-end benchmark designed to systematically evaluate natural-language question answering over historical data, numerical forecasts, and forecast-based reasoning. Built on a large-scale financial dataset, STQA covers 4,417 stocks and contains 31,400 question-answer pairs derived from expert-crafted templates, accompanied by fine-grained intent and slot annotations. To operationalize this benchmark, we present SQFRS (Stock Query–Forecast–Reasoning System), an agent-based unified framework that orchestrates SQL retrieval and time-series forecasting tools. Experiments demonstrate that while current large language models perform well on historical queries, forecast-based reasoning poses a substantial challenge, revealing critical bottlenecks in tool coordination and reasoning under uncertainty. The dataset and code are available at https://github.com/xuxubaobaoan/STQA_Project.

1 Introduction

Stock market analysis is driven by structured, timestamped numerical data such as daily open, close, high, and low prices, trading volumes, and technical indicators. Around this data, three technical paradigms have emerged: structured data retrieval, including semantic parsing and Text-to-SQL interfaces for querying stock databases (Pourreza and Rafiei, 2023); time-series forecasting, from classical ARIMA models to Transformer-based architectures (Vaswani et al., 2017; Lu et al., 2025); and large language model (LLM)-based financial analysis for macroeconomic understanding and financial document reasoning (Nie et al., 2024; Hussain, 2025; Yuan et al., 2025b; Zhang et al., 2024).

These paradigms, however, have largely been studied in isolation. Real-world financial analysis is composite: users pose natural-language questions that implicitly require querying historical tables, invoking forecasting models, and then drawing conclusions based on predicted values. Existing systems typically treat these steps as separate tasks, leaving users to decompose questions, run tools in the right order, and integrate partial results by themselves. This paradigm fragmentation limits the usability of language-based financial assistants and makes it hard to systematically study LLMs that must coordinate multiple tools over structured data.

We consider three representative types of questions in this setting. (1) Historical query reasoning (e.g., “Last Friday, which stock, NVIDIA or AMD, had the highest price increase?”) requires factual retrieval and deterministic computation over historical tables (Wang et al., 2025). (2) Numerical forecasting (e.g., “Please forecast NVIDIA’s closing prices for the next five trading days.”) requires modeling future trends from historical time-series data (Lu et al., 2025). (3) Forecast-based reasoning (e.g., “Will NVIDIA’s highest closing price next month exceed 1,000 USD?”) requires logical judgment and threshold comparison over forecasted quantities (Zhu et al., 2025). Among these, forecast-based reasoning is crucial in practice, yet rarely evaluated: most existing benchmarks and systems focus on factual historical reasoning and do not test whether a model can invoke a forecaster, interpret its outputs, and reason over them to answer high-level natural-language questions.

Building an end-to-end system that handles all three question types from natural language raises three core challenges. First, accurate interpretation of complex queries: the system must identify the underlying task (historical query, numerical forecasting, or forecast-based reasoning) and extract arguments such as tickers, time ranges, aggregation operations, comparison operators, and thresholds, mapping diverse questions to precise executable specifications. Second, adaptive planning and execution of analytical workflows: different questions require different toolchains and execution orders, potentially combining SQL queries with time-series forecasting in a single workflow that the system must plan and execute autonomously. Third, faithful, evidence-based answer generation: after invoking tools, the system must generate answers strictly grounded in returned evidence—database records or probabilistic forecasts—rather than hallucinated content. In finance, where errors are costly and conclusions must be verifiable, controlling hallucination and ensuring traceable reasoning is crucial (Wang et al., 2023; Es et al., 2024; Min et al., 2023).

There has been rapid progress on tabular question answering and Text-to-SQL, on time-series forecasting, and on tool-augmented LLM agents. Yet, to our knowledge, there is no benchmark that systematically evaluates natural-language to multi-tool workflows combining historical queries, forecasting, and forecast-based reasoning in a unified setting (Yuan et al., 2025a). Existing tabular QA datasets mainly test factual reasoning over static tables, forecasting benchmarks rarely involve natural-language interfaces, and agent benchmarks seldom require precise coordination of database querying and numerical forecasting. This gap makes it difficult to rigorously study how LLMs can understand complex user questions, decide which tools to call and with what arguments, and reason over the resulting outputs within a single environment.

To address this gap, we contribute on both the data and method fronts, with an emphasis on establishing a benchmark rather than a new algorithmic paradigm. On the data side, we construct and release STQA (Stock-focused Tabular Question Answering), a benchmark for language-based agents in stock analysis. Built upon the large-scale FN-SPID financial dataset (Dong et al., 2024), STQA samples historical tables for 4,417 stocks, each with six daily fields: date, opening price, closing price, high price, low price, and trading volume. We design 72 question templates (42 historical query reasoning, 16 numerical forecasting, and 14 forecast-based reasoning), instantiate them with real data, and rewrite them into natural language, yielding 31,400 question-answer pairs. The forecast-based reasoning questions require logical inference over forecasted values, going beyond traditional factual QA. We additionally provide semantic annotations—intent labels and slots such as ticker, time range, and operations—offering supervision for mapping natural-language questions to structured analytical specifications.

On the method side, we introduce SQFRS (Stock Query–Forecast–Reasoning System) as a unified baseline framework for STQA. SQFRS adopts an agent-based paradigm with an LLM controller: a natural-language understanding module parses questions into intents and slots; a planner routes each parsed task to a predefined workflow that invokes SQL databases and time-series forecasting models; and an answer generator aggregates tool outputs and performs reasoning strictly based on this evidence. SQFRS is not intended as a novel algorithmic contribution, but as a strong, transparent baseline that operationalizes STQA's three task types in a single system.

Our main contributions are summarized as follows:

  • We introduce STQA, a benchmark for end-to-end stock analysis QA that unifies three core task types from natural-language questions, providing data resources and evaluation protocols for composite, tool-grounded QA.

  • We propose SQFRS, an agent-based unified analysis framework that interprets complex questions and orchestrates multi-step workflows across databases and forecasting models, providing a strong baseline on STQA with evidence-grounded answers.

  • We conduct extensive experiments on STQA that quantify task difficulty and show that SQFRS improves the performance of existing LLMs on this benchmark.