[论文解读] Spam-T5: Benchmarking Large Language Models for Few-Shot Email Spam Detection
本文在三个家族(BERT 类、句子嵌入/Sentence Transformers、Seq2Seq)以及传统基线上对垃圾邮件检测进行基准评估,并引入 Spam-T5——一个对 Flan-T5 进行微调、在少样本场景中表现出色的模型。
This paper investigates the effectiveness of large language models (LLMs) in email spam detection by comparing prominent models from three distinct families: BERT-like, Sentence Transformers, and Seq2Seq. Additionally, we examine well-established machine learning techniques for spam detection, such as Naïve Bayes and LightGBM, as baseline methods. We assess the performance of these models across four public datasets, utilizing different numbers of training samples (full training set and few-shot settings). Our findings reveal that, in the majority of cases, LLMs surpass the performance of the popular baseline techniques, particularly in few-shot scenarios. This adaptability renders LLMs uniquely suited to spam detection tasks, where labeled samples are limited in number and models require frequent updates. Additionally, we introduce Spam-T5, a Flan-T5 model that has been specifically adapted and fine-tuned for the purpose of detecting email spam. Our results demonstrate that Spam-T5 surpasses baseline models and other LLMs in the majority of scenarios, particularly when there are a limited number of training samples available. Our code is publicly available at https://github.com/jpmorganchase/emailspamdetection.
研究动机与目标
- 动机:在邮件数据稀缺、分布漂移和对抗漂移的情境下,推动高效的垃圾邮件检测方法。
- 在四个公开的垃圾邮件数据集上,评估来自多个家族的LLMs相对于传统基线的表现。
- 开发 Spam-T5,一种针对电子邮件垃圾邮件检测进行微调的 Flan-T5 模型。
- 评估全量训练与少样本训练的性能,以理解数据效率与泛化能力。
提出的方法
- 将 RoBERTa(类似 BERT)、SetFit(Sentence Transformer)和 Flan-T5(Seq2Seq)与 Naïve Bayes、Logistic Regression、KNN、SVM、XGBoost 和 LightGBM 进行比较。
- 对每个模型微调超参数(批量大小、学习率、轮数),并通过分层的5折交叉验证对基于 tf-idf 的基线进行特征选择。
- 通过添加分类前缀“classify as ham or spam:”并对输出进行后处理为二值标签,将 Flan-T5 改造成 Spam-T5。
- 使用四个数据集(Ling-Spam, SMS Spam Collection, SpamAssassin Public Corpus, Enron)并以 F1、精确率和召回率进行评估。
- 进行全量训练(80% 的数据)和少样本实验,样本量 k 取 {4,8,16,32,64,128,256,Full}。
实验结果
研究问题
- RQ1在全量训练和少样本垃圾邮件检测设置下,领先的LLMs与传统基线的比较如何?
- RQ2在极少样本场景中,微调的 Seq2Seq 模型(Spam-T5)是否优于其他LLMs?
- RQ3使用 LLM 与传统模型进行垃圾邮件检测时,精度与计算效率之间的权衡是什么?
- RQ4不同的垃圾邮件/正常邮件分布数据集如何影响模型性能?
- RQ5Spam-T5 在不同的训练样本规模下是否仍保持鲁棒性?
主要发现
- LLMs 通常在全量训练设置下在 SMS 和 Enron 数据集上优于基线方法。
- Spam-T5 在全量训练结果中获得最高的整体 F1(平均 0.9742),RoBERTa 和 SetFit 距它很近(0.9670)。
- 在少样本设置中,Spam-T5 主导极少样本性能(4–16 个样本)并在不同大小下保持鲁棒性。
- 在所有数据集的平均表现中,基线中的 SVM 表现最好(平均 F1 0.9560),XGBoost 为最弱(0.8842)。
- Spam-T5 在标注数据稀缺时表现最强,突出其少样本数据效率。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。