[论文解读] Comparative Study of Domain Driven Terms Extraction Using Large Language Models
本文 compares GPT-3.5、Llama-2-7B 与 Falcon-7B 在使用提示进行关键词/术语提取方面的表现,基于 Inspec 和 PubMed 的 Jaccard 相似度进行评估,并讨论提示工程、幻觉问题,以及一个配套的 Python 包。
Keywords play a crucial role in bridging the gap between human understanding and machine processing of textual data. They are essential to data enrichment because they form the basis for detailed annotations that provide a more insightful and in-depth view of the underlying data. Keyword/domain driven term extraction is a pivotal task in natural language processing, facilitating information retrieval, document summarization, and content categorization. This review focuses on keyword extraction methods, emphasizing the use of three major Large Language Models(LLMs): Llama2-7B, GPT-3.5, and Falcon-7B. We employed a custom Python package to interface with these LLMs, simplifying keyword extraction. Our study, utilizing the Inspec and PubMed datasets, evaluates the performance of these models. The Jaccard similarity index was used for assessment, yielding scores of 0.64 (Inspec) and 0.21 (PubMed) for GPT-3.5, 0.40 and 0.17 for Llama2-7B, and 0.23 and 0.12 for Falcon-7B. This paper underlines the role of prompt engineering in LLMs for better keyword extraction and discusses the impact of hallucination in LLMs on result evaluation. It also sheds light on the challenges in using LLMs for keyword extraction, including model complexity, resource demands, and optimization techniques.
研究动机与目标
- 评估三个大型语言模型(GPT-3.5、Llama-2-7B、Falcon-7B)在领域驱动关键词提取方面的有效性。
- 使用统一指标将模型输出与 Inspec 和 PubMed 的参考关键词进行对比评估。
- 展示一个与 LangChain 集成的 Python 包,实现基于大型语言模型的关键词提取。
- 考察提示工程的作用以及幻觉对评估的影响。
- 提供关键词提取的模型性能、需求和局限性的实用洞见。
提出的方法
- 通过一个使用 LangChain 构建的自定义 Python 包,对三种 LLM(Llama-2-7B、GPT-3.5、Falcon-7B)进行接口。
- 使用真实标签与 Inspec 与 PubMed 关键词的并集作为参考,评估关键词提取。
- 使用 Jaccard 相似度来衡量模型输出与参考关键词集之间的重叠。
- 探索提示工程技术,包括零-shot 提示以及带 [MASK] 占位符的正式 f_KewwordExtraction(P,L) 提示构造。
- 报告推理时间,并讨论特定模型行为(幻觉、额外术语、定义)及其对精确度的影响。
实验结果
研究问题
- RQ1当以 Inspec 和 PubMed 参考参考时,GPT-3.5、Llama-2-7B 与 Falcon-7B 在领域驱动关键词提取中的表现如何?
- RQ2提示设计和温度对关键词提取质量的影响是什么?
- RQ3幻觉和领域术语如何影响如 Jaccard 相似度等评估指标?
- RQ4三种模型在关键词提取任务中的实际权衡(准确性、速度、资源使用)是什么?
主要发现
| LLM | Avg Inference Time | Hardware Specifications | Remarks |
|---|---|---|---|
| Falcon-7B | 7-12 secs | T4 GPU | 在不同输入长度时推理时间的微小变动 |
| Llama2-7B | 4-8 secs | T4 GPU | 在不同输入长度时推理时间的微小变动 |
| GPT 3.5 | 3-5 secs | CPU | 几乎没有因不同输入长度而变化的推理时间变动 |
- GPT-3.5 在 Inspec(0.64)和 PubMed(0.21)上达到最高的平均 Jaccard 分数。
- Llama-2-7B 达到 0.40(Inspec)和 0.17(PubMed)。
- Falcon-7B 达到 0.23(Inspec)和 0.12(PubMed)。
- 将温度降至 0.2 会提高确定性,并影响关键词的多样性及潜在的幻觉。
- Llama-2-7B 可能生成参考文献中未出现的额外关键词或定义,降低 PubMed 的 Jaccard 相似度。
- GPT-3.5 生成简洁、良好对齐的关键词,几乎没有多余术语,尽管可能由于幻觉出现一些新术语。
- 推测运行时间:Falcon-7B 7–12s,Llama-2-7B 4–8s,GPT-3.5 3–5s(CPU)。
- 一个与 LangChain 集成的专用 Python 包通过标准化提示框架实现多 LLM 的关键词提取。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。