[Paper Review] GPT-FinRE: In-context Learning for Financial Relation Extraction using Large Language Models
This paper proposes GPT-FinRE, a few-shot in-context learning framework using GPT-3.5 Turbo and GPT-4 for financial relation extraction on the REFinD dataset. It employs two retrieval strategies—KNN with OpenAI embeddings and a learning-based EPR retriever—to select relevant demonstrations, achieving an F1-score of 0.718, ranking 3rd overall in the shared task.
Relation extraction (RE) is a crucial task in natural language processing (NLP) that aims to identify and classify relationships between entities mentioned in text. In the financial domain, relation extraction plays a vital role in extracting valuable information from financial documents, such as news articles, earnings reports, and company filings. This paper describes our solution to relation extraction on one such dataset REFinD. The dataset was released along with shared task as a part of the Fourth Workshop on Knowledge Discovery from Unstructured Data in Financial Services, co-located with SIGIR 2023. In this paper, we employed OpenAI models under the framework of in-context learning (ICL). We utilized two retrieval strategies to find top K relevant in-context learning demonstrations / examples from training data for a given test example. The first retrieval mechanism, we employed, is a learning-free dense retriever and the other system is a learning-based retriever. We were able to achieve 3rd rank overall. Our best F1-score is 0.718.
Motivation & Objective
- To address the challenge of low-resource financial relation extraction using few-shot in-context learning with large language models.
- To improve relation extraction performance on the REFinD dataset by selecting high-quality in-context demonstrations.
- To evaluate the effectiveness of different retrieval strategies—learning-free and learning-based—on few-shot LLM prompting.
- To compare the performance of GPT-3.5 Turbo and GPT-4 under the in-context learning paradigm for financial NLP tasks.
- To achieve state-of-the-art results on the REFinD benchmark using prompt engineering and retrieval-augmented few-shot learning.
Proposed method
- Formulates the relation extraction task as in-context learning, where the LLM generates predictions based on a prompt containing task description, predefined relation classes, and K-shot demonstrations.
- Employs a KNN-based retriever using OpenAI text-embedding-ada-002 to retrieve the most similar training examples in embedding space for each test input.
- Uses an EPR (Efficient Prompt Retrieval) method trained on GPT-Neo-2.7B to learn to retrieve optimal in-context examples based on likelihood scores.
- Combines retrieved examples with randomly sampled examples per relation class to diversify the prompt and reduce hallucination.
- Constructs prompts with structured components: task definition, relation classes, K retrieved demonstrations, and the test input for generation.
- Utilizes FAISS for efficient similarity search in the dense embedding space during inference.
Experimental results
Research questions
- RQ1How effective is in-context learning with GPT models for financial relation extraction on the REFinD dataset?
- RQ2Does a learning-based retriever (EPR) outperform a learning-free retriever (KNN with OpenAI embeddings) in few-shot relation extraction?
- RQ3How does the choice of LLM (GPT-3.5 Turbo vs. GPT-4) affect performance in in-context learning for financial NLP?
- RQ4What is the impact of combining retrieved examples with random examples per relation class on model generalization and F1-score?
- RQ5Can retrieval-augmented in-context learning achieve competitive results without fine-tuning on low-resource financial relation extraction?
Key findings
- GPT-4 outperforms GPT-3.5 Turbo in in-context learning for financial relation extraction, achieving a higher F1-score of 0.697 compared to 0.643.
- The learning-based EPR retriever significantly outperforms the learning-free KNN with OpenAI embeddings, achieving an F1-score of 0.718 when combined with GPT-4.
- The best-performing configuration uses 5 retrieved examples via EPR and 4 random examples per relation class, yielding the highest F1-score of 0.718.
- The combination of EPR and GPT-4 achieves the highest performance, placing the method in 3rd position overall in the SIGIR 2023 shared task.
- Adding random examples per relation class improves performance over purely retrieved examples, suggesting benefits in prompt diversity and robustness.
- The results demonstrate that retrieval quality is a critical factor in in-context learning, with better examples leading to reduced hallucination and improved generalization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.