The impact of fine tuning in LLaMA on hallucinations for named entity extraction in legal documentation
Francisco Vargas, Alejandro Gonz\'alez Coene, Gaston Escalante, Exequiel Lob\'on, and Manuel Pulido

TL;DR
This paper investigates how fine-tuning LLaMA models reduces hallucinations in extracting named entities from legal documents, significantly improving accuracy over base models and classic methods.
Contribution
It demonstrates that fine-tuning LLaMA models with LoRA substantially decreases hallucinations and enhances extraction accuracy in legal text analysis.
Findings
Fine-tuning LLaMA-2 70B improves accuracy from 61.7% to 79.4%.
Base LLaMA-3 8B performs comparably to fine-tuned LLaMA-2 70B.
GPT-4 Turbo achieves the highest accuracy at 86.1%.
Abstract
The extraction of information about traffic accidents from legal documents is crucial for quantifying insurance company costs. Extracting entities such as percentages of physical and/or psychological disability and the involved compensation amounts is a challenging process, even for experts, due to the subtle arguments and reasoning in the court decision. A two-step procedure is proposed: first, segmenting the document identifying the most relevant segments, and then extracting the entities. For text segmentation, two methodologies are compared: a classic method based on regular expressions and a second approach that divides the document into blocks of n-tokens, which are then vectorized using multilingual models for semantic searches (text-embedding-ada-002/MiniLM-L12-v2 ). Subsequently, large language models (LLaMA-2 7b, 70b, LLaMA-3 8b, and GPT-4 Turbo) are applied with prompting to…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Authorship Attribution and Profiling · Text Readability and Simplification
MethodsAbsolute Position Encodings · Layer Normalization · Byte Pair Encoding · Label Smoothing · Softmax · Dropout · Dense Connections · Transformer · Balanced Selection · GPT-4
