Skip to main content
QUICK REVIEW

[Paper Review] Attention-based model for predicting question relatedness on Stack Overflow

Jiayan Pei, Yimin Wu|arXiv (Cornell University)|Mar 19, 2021
Topic ModelingComputer Science34 references6 citations
TL;DR

This paper proposes an Attention-based Sentence pair Interaction Model (ASIM) that leverages self-attention mechanisms to capture semantic interactions between question pairs on Stack Overflow, significantly improving question relatedness prediction. The model achieves state-of-the-art performance on both the Stack Overflow Knowledge Unit dataset and the AskUbuntu duplicate question detection task, outperforming prior SOTA models with a Micro-F1 of 0.892 and accuracy of 0.9625.

ABSTRACT

Stack Overflow is one of the most popular Programming Community-based Question Answering (PCQA) websites that has attracted more and more users in recent years. When users raise or inquire questions in Stack Overflow, providing related questions can help them solve problems. Although there are many approaches based on deep learning that can automatically predict the relatedness between questions, those approaches are limited since interaction information between two questions may be lost. In this paper, we adopt the deep learning technique, propose an Attention-based Sentence pair Interaction Model (ASIM) to predict the relatedness between questions on Stack Overflow automatically. We adopt the attention mechanism to capture the semantic interaction information between the questions. Besides, we have pre-trained and released word embeddings specific to the software engineering domain for this task, which may also help other related tasks. The experiment results demonstrate that ASIM has made significant improvement over the baseline approaches in Precision, Recall, and Micro-F1 evaluation metrics, achieving state-of-the-art performance in this task. Our model also performs well in the duplicate question detection task of AskUbuntu, which is a similar but different task, proving its generalization and robustness.

Motivation & Objective

  • To address the inefficiency and inaccuracy of manual identification of related or duplicate questions on Stack Overflow.
  • To improve semantic relatedness prediction between questions by capturing inter-sentence interactions, which existing methods often overlook.
  • To develop domain-specific word embeddings tailored for software engineering to enhance model performance.
  • To evaluate the model's generalization capability on a different but related software engineering task—duplicate question detection on AskUbuntu.

Proposed method

  • The ASIM model uses a dual-encoder architecture with self-attention mechanisms to learn contextual representations of individual questions.
  • Inter-sentence attention is applied to capture semantic interactions between two questions by computing word-level similarity matrices.
  • The model employs a multi-head attention mechanism to align semantically relevant words and phrases across question pairs.
  • Domain-specific word embeddings are pre-trained on a large-scale software engineering corpus derived from Stack Overflow data dumps.
  • The final classification is performed using a feedforward neural network on the attended representations, with cross-entropy loss for multi-class classification.
  • The model is trained end-to-end on the Knowledge Unit dataset, which classifies question pairs into four relatedness levels: duplicate, direct, indirect, and isolated.

Experimental results

Research questions

  • RQ1Can an attention-based model effectively capture semantic interactions between question pairs to improve relatedness prediction on Stack Overflow?
  • RQ2Does the use of domain-specific word embeddings enhance performance on software engineering question relatedness tasks?
  • RQ3How does ASIM compare to existing SOTA models like SOFTSVM and DOTBILSTM in terms of precision, recall, and F1 score?
  • RQ4Can ASIM generalize to other software engineering tasks, such as duplicate question detection on AskUbuntu?

Key findings

  • ASIM achieves a Micro-F1 score of 0.892 on the Stack Overflow Knowledge Unit dataset, outperforming the previous SOTA model DOTBILSTM (0.87) and SOFTSVM (0.85).
  • The model achieves an accuracy of 0.9625 on the AskUbuntu duplicate question detection dataset, surpassing the SOTA SOFTSVM model.
  • Attention visualization confirms that ASIM successfully aligns semantically similar words and phrases, even in cases with minimal lexical overlap.
  • The use of domain-specific word embeddings contributes to improved performance, particularly in capturing technical terminology and syntactic patterns in software development questions.
  • The model demonstrates strong robustness and generalization, performing well across different but related software engineering NLP tasks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.