微调LLaMA可显著减少法律文档实体抽取中的幻觉问题。
The impact of fine tuning in LLaMA on hallucinations for named entity extraction in legal documentation
- 用嵌入向量分割文档,再对关键段落用LLM提取实体。
- 微调后LLaMA-2 70B准确率达79.4%,远超原始版61.7%。
- 新模型LLaMA-3 8B已接近微调版LLaMA-2 70B表现。
从法律文档中提取交通事故信息对量化保险公司成本至关重要。识别伤残比例、心理或身体伤害程度及赔偿金额等实体极具挑战性,因判决书论证微妙。本文提出两步法:先通过嵌入向量(text-embedding-ada-002/MiniLM-L12-v2)将文档分块并筛选相关段落,再用大模型(LLaMA-2 7b/70b、LLaMA-3 8b、GPT-4 Turbo)进行实体抽取。对LLaMA模型采用LoRA微调。结果显示,未微调的LLaMA-2 7b在零温度下存在大量幻觉;微调后显著降低。基于向量分块的方法准确率达79.4%(微调版LLaMA-2 70B),远超传统正则方法的39.5%。基线版LLaMA-3 8B已达76.6%,接近微调版LLaMA-2 70B;GPT-4 Turbo表现最佳,达86.1%。
原文摘要 · Abstract (English)
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 the selected segments for entity extraction. For the LLaMA models, fine-tuning is performed using LoRA. LLaMA-2 7b, even with zero temperature, shows a significant number of hallucinations in extractions which are an important contention point for named entity extraction. This work shows that these hallucinations are substantially reduced after finetuning the model. The performance of the methodology based on segment vectorization and subsequent use of LLMs significantly surpasses the classic method which achieves an accuracy of 39.5%. Among open-source models, LLaMA-2 70B with finetuning achieves the highest accuracy 79.4%, surpassing its base version 61.7%. Notably, the base LLaMA-3 8B model already performs comparably to the finetuned LLaMA-2 70B model, achieving 76.6%, highlighting the rapid progress in model development. Meanwhile, GPT-4 Turbo achieves the highest accuracy at 86.1%.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。