[论文解读] Large Language Models For Text Classification: Case Study And Comprehensive Review
本研究将多种大型语言模型(LLMs)与传统机器学习和 RoBERTa 进行对比,应用于两个文本分类任务(假新闻检测和员工位置分类),分析提示技术,并考察性能与时间的权衡。
Unlocking the potential of Large Language Models (LLMs) in data classification represents a promising frontier in natural language processing. In this work, we evaluate the performance of different LLMs in comparison with state-of-the-art deep-learning and machine-learning models, in two different classification scenarios: i) the classification of employees' working locations based on job reviews posted online (multiclass classification), and 2) the classification of news articles as fake or not (binary classification). Our analysis encompasses a diverse range of language models differentiating in size, quantization, and architecture. We explore the impact of alternative prompting techniques and evaluate the models based on the weighted F1-score. Also, we examine the trade-off between performance (F1-score) and time (inference response time) for each language model to provide a more nuanced understanding of each model's practical applicability. Our work reveals significant variations in model responses based on the prompting strategies. We find that LLMs, particularly Llama3 and GPT-4, can outperform traditional methods in complex classification tasks, such as multiclass classification, though at the cost of longer inference times. In contrast, simpler ML models offer better performance-to-time trade-offs in simpler binary classification tasks.
研究动机与目标
- 评估多种 LLM 相对于传统 ML 和 RoBERTa 在两个真实世界分类任务(二分类和多分类)上的性能。
- 研究提示技术如何影响 LLM 在文本分类中的性能。
- 评估模型在准确率(加权 F1-分数)与推理时间之间的权衡。
- 分析模型规模、量化效应以及不同任务复杂性下的实际适用性。
提出的方法
- 将解码器为主、编码器为主、以及编码器-解码器的 LLM(包括量化与 API 变体)与 RoBERTa、NB 与 SVM 在两个数据集上进行比较。
- 以加权 F1-分数为主要指标,对 RoBERTa 与 ML 模型使用 5 折交叉验证。
- 评估提示技术:Zero-shot、Few-shot、Chain-of-Thought、Emotional Prompting、Role-playing、Naming the Assistant,以及它们的组合。
- 衡量推理时间以分析性能-时间权衡(Pareto 分析)。
- 使用提示工程研究在不同模型与任务中的鲁棒性与变异性。
实验结果
研究问题
- RQ1LLMs 是否在二分类(FakeNewsNet)和多分类(Employee Reviews)文本分类任务上超越传统 ML 与 RoBERTa?
- RQ2提示技术(ZS、FS、CoT、RP、NA、EM)如何影响不同模型在不同任务上的性能?
- RQ3在这些任务中,大模型与小模型以及量化模型的性能-时间权衡如何?
- RQ4模型规模、架构与量化在提示下对分类准确性与稳定性有多大影响?
主要发现
- Llama3 70B 常提供顶尖 F1 分数,但推理时间较长;而 RoBERTa 提供强劲且时间高效的表现(例如 RoBERTa 在 FakeNewsNet 上约 93% F1,在 Employee Reviews 上约 84% 且推理快速)。
- 提示策略显著影响结果;CoT 与 FS 在许多模型与任务中能显著提升性能,尽管效果因模型和任务而异。
- 在 FakeNewsNet(二分类)上,Llama3 70B 在某些提示下可达到约 94.4% 的 F1,而传统 NB/SVM 的表现超过 88% 且推理极快;RoBERTa 在某些设置中达到 93.0%。
- 在 Employee Reviews(多分类)上,GPT-4-turbo 在最佳情形下约为 87.6% 的 F1,且 CoT 与 FS 提示带来较大提升;较小模型(如 Llama3 8B、Mistral OO)表现虽有竞争力但略低。
- 量化的 Mistral 模型可与非量化版本相比甚至超越(如 Mistral-OO 比 Mistral 高 4.5%),表明量化可以保持或提升性能。
- 总体而言,较大规模的 LLM 能在准确性上获得更高的收益,但推理时间更长;传统模型(NB/SVM)在延迟极低的情况下仍提供强基线。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。