[论文解读] A Comparative Study of Text Embedding Models for Semantic Text Similarity in Bug Reports
本研究评估了五种文本嵌入模型——TF-IDF、FastText、Gensim、BERT 和 ADA(GPT-3.5)——在缺陷报告重复检测中的语义文本相似度表现。基于 Software Defects Dataset 数据集,BERT 在多个代码库中均取得了最高的召回率,优于 ADA、Gensim、FastText 和 TF-IDF,表明上下文感知嵌入在该任务中的优越性。
Bug reports are an essential aspect of software development, and it is crucial to identify and resolve them quickly to ensure the consistent functioning of software systems. Retrieving similar bug reports from an existing database can help reduce the time and effort required to resolve bugs. In this paper, we compared the effectiveness of semantic textual similarity methods for retrieving similar bug reports based on a similarity score. We explored several embedding models such as TF-IDF (Baseline), FastText, Gensim, BERT, and ADA. We used the Software Defects Data containing bug reports for various software projects to evaluate the performance of these models. Our experimental results showed that BERT generally outperformed the rest of the models regarding recall, followed by ADA, Gensim, FastText, and TFIDF. Our study provides insights into the effectiveness of different embedding methods for retrieving similar bug reports and highlights the impact of selecting the appropriate one for this task. Our code is available on GitHub.
研究动机与目标
- 评估不同文本嵌入模型在利用语义文本相似度识别重复缺陷报告方面的有效性。
- 比较传统模型(TF-IDF、FastText、Gensim)与前沿模型(BERT、ADA)在真实世界缺陷报告数据集中的性能表现。
- 为软件工程工作流中高效重复缺陷报告检测提供模型选择与评估方法的实际洞见。
- 指出仅限制搜索空间为父报告或唯一报告的局限性,倡导在评估中包含所有相关报告。
提出的方法
- 使用包含 Firefox、Eclipse、MozillaCore、JDT 和 Thunderbird 项目缺陷报告的 Software Defects Dataset 数据集。
- 应用五种嵌入模型:TF-IDF(基线)、FastText、Gensim(基于 LDA)、BERT 和 ADA(GPT-3.5),生成缺陷报告摘要和描述的稠密向量表示。
- 使用余弦相似度计算查询报告与数据库中所有现有报告之间的语义相似度。
- 通过在多个代码库中使用召回率@k(k=5)评估模型性能,包括有无基于日期的约束条件。
- 通过消融研究分析搜索空间大小与基于年龄的过滤对检索效率的实际影响。
- 使用哈希表将子报告与其父报告关联,以实现真实标签和评估。

实验结果
研究问题
- RQ1不同文本嵌入模型在重复缺陷报告检测中的召回率@5 表现如何比较?
- RQ2在搜索空间中同时包含父报告和唯一报告,是否比仅使用父报告能带来更真实的性能评估?
- RQ3通过创建日期限制搜索空间,对检索性能和模型排名有何影响?
- RQ4大型语言模型如 BERT 和 ADA 是否能在缺陷报告的语义相似度任务中超越传统模型如 TF-IDF 和 FastText?
- RQ5将 top-k 推荐结果限制在特定范围内,对提升排错工程师效率有何实际影响?
主要发现
- BERT 在所有代码库中均取得最高召回率,Firefox 和 Eclipse 的最大召回率@5 达到 35,显著优于其他模型。
- ADA(GPT-3.5)表现强劲,排名第二,召回率@5 达 32–38,表明其在语义相似度任务中具备强大泛化能力。
- Gensim 和 FastText 表现弱于 BERT 和 ADA,Gensim 最高召回率@5 为 25,FastText 在某些情况下仅略高于 TF-IDF 基线。
- TF-IDF 表现为弱基线,召回率@5 范围为 9 至 19,表明其语义理解能力有限。
- 将搜索空间限制在特定日期范围内的报告,可减少无关结果,并提升实际父报告的排序表现。
- 若从搜索空间中排除唯一报告,会导致性能被高估,因为现实中的排错工作涉及搜索所有现有报告,而不仅限于父报告。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。