TL;DR
This paper empirically investigates the "hallucination" problem in Large Language Models (LLMs) when applied to financial tasks. It finds that even advanced LLMs struggle with factual accuracy in finance, leading to potentially costly errors. The study also evaluates several methods to mitigate these hallucinations, highlighting Retrieval Augmented Generation (RAG) and prompt-based tool learning as promising solutions.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown remarkable capabilities in understanding and generating human-like text, making them attractive for various domains, including finance. However, a significant drawback is their tendency to "hallucinate" – generating plausible but factually incorrect or unsupported information. This is particularly problematic in finance, where inaccuracies can lead to substantial financial losses and erode trust. Despite growing concerns, there's been a lack of empirical investigation into how LLMs perform on specific financial tasks and how effectively we can mitigate their hallucinations in this critical domain. This paper aims to fill that gap by empirically examining LLM hallucination behaviors in finance and evaluating potential solutions.
Methods
The researchers designed an empirical framework to assess LLM performance on three core financial tasks:
- Financial Abbreviation Recognition: Evaluating the LLM's ability to correctly expand financial acronyms and identify company names from stock symbols.
- Financial Term Explanations: Assessing the LLM's capacity to accurately explain financial concepts and terminologies.
- Stock Price Query: Testing the LLM's ability to retrieve historical stock prices.
To address hallucinations, they evaluated four mitigation strategies:
- Few-shot prompting: Providing a few examples to guide the model's learning process.
- Decoding by Contrasting Layers (DoLa): A technique that leverages different layers of the model to improve factual accuracy.
- Retrieval Augmented Generation (RAG): Integrating external knowledge sources (like Wikipedia) into the generation process.
- Prompt-based tool learning: Enabling LLMs to generate correct function calls for external tools (like an API) to fetch up-to-date information.
Datasets
The study utilized publicly available data for its tasks:
- Financial Acronyms: 192 acronyms from Wikipedia.
- Stock Symbols: 1215 stock symbols from an online list (NASDAQ, NYSE, AMEX).
- Financial Terminologies: 160 infrequently-visited terms from Wikidata API, focusing on those with lower page views between 2021-01-01 and 2023-01-01.
- Stock Prices: 560 examples across 70 stock tickers, with data points from before September 2022.
No new benchmarks were introduced; instead, existing data sources were leveraged to create the evaluation tasks.
Key Insights and Ideas
- Finance is a Hallucination Minefield: Even state-of-the-art LLMs like GPT-4 exhibit significant hallucination issues in financial tasks, making them unreliable for direct deployment without careful validation.
- Outdated Knowledge is a Major Culprit: A key reason for hallucinations is the LLMs' reliance on potentially outdated training data, leading to incorrect information about delisted stocks or past events.
- Domain-Specific Fine-tuning Isn't a Silver Bullet: Surprisingly, a multi-task, domain-specific fine-tuned model (FinMA-7B) underperformed its base model in some tasks, suggesting that fine-tuning might sometimes degrade general instruction-following abilities.
- External Knowledge is Crucial: Integrating external data sources is vital. RAG significantly boosts factuality by grounding responses in real-world information.
- Tool Use is Powerful for Real-time Data: Prompt-based tool learning, enabling LLMs to call APIs, dramatically improves performance on time-sensitive tasks like stock price queries, achieving near-perfect accuracy.
- Cautious Models are Better than Wrong Ones: Some advanced models (GPT-3.5-turbo, GPT-4) showed restraint by abstaining from answering questions when they lacked confidence, which is a valuable trait for building user trust.
Key Results
- General LLMs Struggle: In zero-shot settings, Llama2 models showed low accuracy in acronym recognition (around 50-75%) and stock symbol identification (around 12-24%). GPT-4 achieved higher accuracy (82.5% and 90.4% respectively) but still had room for error.
- RAG is a Game Changer: For acronym recognition and term explanations, RAG significantly improved performance, with Llama2-7B-chat achieving 90.8% accuracy and 90.48% FactScore when using RAG.
- Tool Learning Excels at Stock Queries: Without tools, Llama2 models had negligible accuracy for stock price queries. With prompt-based tool learning, Llama2-7B+tool and Llama2-7B-chat+tool achieved 100% accuracy. GPT models also performed perfectly with tool integration.
- Few-Shot Learning's Limited Impact on Factuality: While few-shot learning improved question-answering format adherence, its impact on factual accuracy was less pronounced compared to other methods.
Limitations and Future Work
The authors acknowledge several limitations:
- Task Specificity: The chosen tasks, while representative, do not cover the entire spectrum of real-world financial applications. The effectiveness of mitigation strategies might vary across different financial contexts.
- Task-Specific Mitigation: The tested mitigation strategies are task-specific. Future research needs to explore how these strategies can be adapted or expanded for broader financial applications.
Future work should focus on:
- Refining hallucination mitigation techniques for diverse financial applications.
- Exploring ways to further enhance LLM accuracy and reliability in dynamic financial settings.
- Understanding the interplay between LLM outputs and financial decision-making processes.
Summary updated