[论文解读] A Comparison of LSTM and BERT for Small Corpus
本文在一个小数据集上比较 LSTM 和 BERT 进行对话系统的意图分类,结果显示一个简单的 LSTM 能超越 BERT,训练更快。
Recent advancements in the NLP field showed that transfer learning helps with achieving state-of-the-art results for new tasks by tuning pre-trained models instead of starting from scratch. Transformers have made a significant improvement in creating new state-of-the-art results for many NLP tasks including but not limited to text classification, text generation, and sequence labeling. Most of these success stories were based on large datasets. In this paper we focus on a real-life scenario that scientists in academia and industry face frequently: given a small dataset, can we use a large pre-trained model like BERT and get better results than simple models? To answer this question, we use a small dataset for intent classification collected for building chatbots and compare the performance of a simple bidirectional LSTM model with a pre-trained BERT model. Our experimental results show that bidirectional LSTM models can achieve significantly higher results than a BERT model for a small dataset and these simple models get trained in much less time than tuning the pre-trained counterparts. We conclude that the performance of a model is dependent on the task and the data, and therefore before making a model choice, these factors should be taken into consideration instead of directly choosing the most popular model.
研究动机与目标
- 评估一个大型预训练模型(BERT)是否在小数据集上优于一个简单的 LSTM。
- 评估模型在不同数据规模(25%–100%)下的性能。
- 确定在对话/意图分类任务中最简单的有效 LSTM 架构。
提出的方法
- 在一个包含 150 个 intents 的小型聊天机器人意图分类数据集上训练并比较 BERT 和 LSTM。
- 将数据拆分为 25%–100% 的子集以模拟小数据情形。
- 使用学习率为 2e-5 对 BERT 进行微调并微调;使用 Glove 嵌入、Adam,学习率 0.01 从头训练 LSTM。
- 使用总体准确率和 In-scope(在范围内)准确率进行评估,优先考虑总体准确率。
- 尝试多种 LSTM 架构,包括 50 或 100 个神经元的 1 个双向层 + 1 个单向层的组合。
实验结果
研究问题
- RQ1在小型语料上,预训练的 BERT 模型是否能在意图分类任务中优于 LSTM?
- RQ2在对话领域中,数据集规模(从 25% 到完整数据)的变化如何影响模型性能?
- RQ3简单的 LSTM 架构是否足以在小数据集上优于 BERT?
主要发现
- 在所有数据分区中,最简单的 LSTM 架构(1 个双向层 + 1 个单向层,每层 50 个神经元)优于 BERT。
- 在测试集上,LSTM 实现了 70.08% 的总体准确率(69.65% 的 in-scope),而 BERT 实现了 67.15% 的准确率。
- 统计检验显示 LSTM 与 BERT 的差异具有显著性(p < 0.008)。
- 对于较小的数据集,准确率差距更大(在 25% 数据时相对差异为 16.21%),随着数据量增加而缩小(在 80% 数据时为 2.25%)。
- 采用最简单架构的 LSTM 在验证集上也表现最好,为最终测试比较提供了指导。
- BERT 的性能优势在小数据集上往往因过拟合而减弱。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。