How Accurate Is AI for Financial Analysis?

Why AI invents financial numbers, and the structural fix that makes it stop

← Back to shibui.finance

AI assistants routinely fabricate financial data when they lack a data source. The fix is not better prompts, more specific instructions, or asking the model to be careful. The fix is structural: connect the AI to a real database so every number traces to an actual record. The hallucination does not disappear - it moves from the data layer to the query layer, where the impact is cosmetic instead of factual.

AI gets financial data wrong without a data source

When you ask Claude or ChatGPT for a company's P/E ratio, revenue growth, or earnings history without connecting a data source, the model generates numbers from its training data. These numbers look right. They are formatted correctly, in the right order of magnitude, and presented with confidence. But they are often wrong.

The FinanceBench study (Patronus AI, 2023) tested GPT-4 on 150 financial questions drawn from SEC filings. With the full filing loaded into context, the model scored 79% accuracy. Without any context - relying purely on training data - it scored 9%. The gap is not about model quality or prompting skill. It is about whether the model has access to real data.

The failure modes are predictable. The model invents P/E ratios that are plausible but wrong. It confuses fiscal years and calendar years. It fabricates quarterly growth rates. It reports EPS from two years ago as current. It produces technical indicator values that have no basis in actual price data. And it does all of this with the same tone and formatting it uses when it has real data - there is no signal in the output that tells you the numbers are made up.

Why prompts cannot fix this

A common first reaction is to ask the model to be more careful. "Only use real data." "If you are not sure, say so." "Do not make up numbers." These instructions do not work because the model does not know it is making up numbers. It generates the most likely next token based on patterns in its training data. When the most likely P/E ratio for a tech company is 28, it outputs 28 - whether the actual P/E is 28, 35, or 19.

Web search helps for single-ticker lookups but breaks down for anything involving multiple companies or historical data. Uploading CSVs works until the file is too large or the data is stale. These are workarounds, not fixes. For the detailed breakdown of why each workaround fails, see the tool-specific guides for Claude and ChatGPT.

The structural fix: move the hallucination

You cannot eliminate hallucination. It is inherent to how language models work - they generate probable outputs, and probability is not the same as truth. But you can move the hallucination to a part of the system where the impact is different.

Without a database, the model hallucinates the data. It invents a P/E ratio, fabricates a revenue growth number, or produces a technical indicator value from nothing. The output looks authoritative, but the numbers are wrong. This is the dangerous kind of hallucination - confident, plausible, and undetectable without independent verification.

With a database, the model hallucinates the query instead. It writes SQL to fetch the data, and the SQL might look slightly different each time - different column ordering, different whitespace, an extra join, a slightly different alias. But the data that comes back is always real, because it comes from actual database records. The hallucination has moved from where it is dangerous (data) to where it is harmless (query structure).

You ask

"What is Apple's P/E ratio, and how has it changed over the past 4 quarters?"

Without a database, you get a plausible P/E number that might be off by 20-50%, with a trend that reflects general market patterns rather than Apple's actual quarterly data. With a database, you get the real P/E from the valuation table for each date, joined against the actual quarterly earnings. The numbers are right. The SQL that produced them might have formatted the date differently than it did yesterday, but that does not affect the result.

What moved hallucination looks like in practice

In internal testing, we ran the same prompt 30 times. Each run, the SQL query looked slightly different - different whitespace, different columns included, slightly restructured joins. The queries were not identical. But every run returned the same number of rows, because they were all querying the same underlying data. The variation was in how the model chose to ask the question, not in what it asked for.

This is the key distinction. Without a database, running the same prompt multiple times produces different wrong numbers each time - the model samples differently and gets different fabricated figures. With a database, running the same prompt multiple times produces slightly different queries that hit the same tables and filters. The instability moves from the data to the query, where it does not matter.

This pattern is consistent with the broader research on grounding. When an LLM retrieves data from a verified source instead of generating from memory, the factual error rate drops because the numbers come from records, not from token probabilities. The model still generates - it still hallucinates in the technical sense - but the hallucination is constrained to structure and presentation rather than content.

Which AI tools work with a financial database?

The connection between an AI assistant and a database is called MCP (Model Context Protocol). Claude supports MCP natively, and ChatGPT supports it through developer mode apps. The concept is the same: instead of the model generating data from memory, it writes a query against a real database and works with the actual results.

Shibui Finance is a free MCP server that connects Claude and ChatGPT to a pre-loaded database with 64 years of US stock data: 31M+ daily price records, quarterly and annual financial statements, 56 technical indicators, daily valuations, and 6.4M SEC filing metadata records for nearly 10,000 companies. No API key, no rate limits.

For step-by-step setup instructions, see the guides for getting stock data into Claude and getting stock data into ChatGPT. For a deeper look at why each model hallucinates financial data and exactly how the database connection fixes it, see the dedicated guides for Claude and ChatGPT.

What connecting a database does not fix

A database fixes factual accuracy for data that is in the database. It does not fix everything.

Forward-looking predictions ("will this stock go up?") are not in any database. Qualitative judgments about management quality or competitive positioning require human analysis, not data retrieval. Real-time prices are not available in Shibui's end-of-day database. International stocks, options, forex, and cryptocurrency are not covered. And the model can still write a logically wrong query - asking for the wrong metric, joining tables incorrectly, or misunderstanding the question. The data will be real, but the answer can still be wrong if the question was translated incorrectly.

These are real limitations. For a full list of what the database covers and what it does not, see the data coverage page. You can also fact-check any result by asking Claude to show the SQL query it ran.

Frequently asked questions

How often does AI hallucinate financial data?

Without a data source, AI assistants frequently get financial data wrong. The FinanceBench study (Patronus AI) found GPT-4 achieved 79% accuracy on financial questions with full SEC filing context, but only 9% without it. The gap is about data access, not model quality.

Can I trust ChatGPT or Claude with stock analysis?

Not without a data source. Both models generate plausible but often fabricated financial figures from training data. Connected to a verified database via MCP, the same models return real data from real records. The model's analytical reasoning is strong - it is the data input that determines whether the output is trustworthy.

What is the best way to prevent AI hallucination in finance?

Connect the AI to a verified database rather than relying on prompts or workarounds. When Claude or ChatGPT queries a database, every number traces to a real record. Shibui Finance provides this connection for free, with no API key required. See the setup guides for Claude and ChatGPT.

Does connecting a database completely stop AI hallucination?

No. The AI still hallucinates, but in a different place. Without a database, it hallucinates the data (wrong numbers). With a database, it hallucinates the query (different SQL formatting, column order, join style). The numbers returned are always real because they come from the database. The hallucination moves from where it is dangerous to where it is harmless.

Connect Shibui to Claude in 2 minutes

Shibui is free. Connect it to Claude or ChatGPT and get real financial data instead of hallucinated numbers. No API key, no rate limits, 64 years of US stock data.

Connect to Claude →