Preferred Answer Selection in Stack Overflow: Better Text Representations ... and Metadata, Metadata, Metadata

Steven Xu, Andrew Bennett, Doris Hoogeveen, Jey Han Lau, Timothy Baldwin

Abstract

Identifying the most helpful response in community Question Answering (cQA) platforms remains a significant challenge due to the lexical gap between queries and answers. This paper explores the integration of sophisticated neural text representations with a diverse array of forum metadata. By combining a decompositional attentional model with features such as user reputation and comment activity, the researchers achieved a new state-of-the-art in answer selection on Stack Overflow datasets. The findings highlight that while text analysis is crucial, social and structural metadata are often more predictive of the "preferred" answer.

Introduction

Community Question Answering sites like Stack Overflow serve as massive repositories of technical knowledge. However, the abundance of responses for a single question makes it difficult for automated systems to identify the most authoritative or "preferred" answer. This difficulty stems from two primary issues: the lexical gap, where users describe problems and solutions using different terminology, and the historical underutilization of the rich metadata inherent in forum structures.

Methodology

The researchers framed answer selection as a classification task, evaluating three distinct modeling approaches:

  1. Text-Only (decatt): An adaptation of the Decompositional Attentional Model. This model uses an attention mechanism to align words between the question and answer, helping to bridge the lexical gap by identifying relevant semantic relationships.
  2. Metadata-Only: A model relying solely on non-textual features, including question/answer view counts, community-assigned tags, user profiles (reputation, account age, and 86 distinct badges), and comment thread dynamics.
  3. Combined Model: A hybrid architecture that concatenates neural text embeddings with metadata vectors into a final feed-forward network for classification.

Datasets

The study utilized three primary benchmarks:

  • Stack Overflow SMALL & LARGE: Two new datasets containing 10,000 and 70,000 questions respectively, sampled from a 2009 Stack Overflow data dump.
  • SemEval 2017 Task 3A: A standard cQA dataset used to validate the competitiveness of the decatt text model against existing state-of-the-art systems.

Results and Performance

The primary metric for evaluation was P@1 (Precision at 1), measuring how frequently the model's top-ranked answer matched the asker's "accepted" answer. The results demonstrated a clear hierarchy of performance, with the combined model significantly outperforming individual components.

Main performance results (P@1) comparing text-only, metadata-only, and combined models across datasets.

On the LARGE dataset, the metadata-only model (0.463) notably outperformed the text-only model (0.363), suggesting that community signals are highly reliable indicators of quality. The combined model achieved the highest performance at 0.527 P@1.

Analysis of Metadata Impact

A key insight from the study is that metadata and text provide complementary information. While the text model identifies technical relevance, metadata captures community trust and validation. An ablation study was conducted to determine which metadata features were most influential.

Ablation study showing the impact on P@1 when specific metadata features are removed.

As shown in the ablation results, "Comments" proved to be the most critical metadata feature. The presence of interaction between the asker and answerer in the comments serves as a strong signal of answer validation. Conversely, generic gamification markers like "Badges" were found to be less impactful, and in some cases, their removal slightly improved performance, indicating they may introduce noise.

Conclusion

This research underscores the importance of multi-modal approaches in cQA answer selection. By fusing attentional neural networks with structural forum data, the authors demonstrated that social signals are often as important as the technical content itself. Future work may involve modeling entire discussion threads as graphs and extending these techniques to cross-thread retrieval tasks.

Summary updated

BibTeX
@inproceedings{xu2018preferred,
  author = {Steven Xu and Andrew Bennett and Doris Hoogeveen and Jey Han Lau and Timothy Baldwin},
  title = {{Preferred Answer Selection in Stack Overflow: Better Text Representations ... and Metadata, Metadata, Metadata}},
  booktitle = {NUT @ EMNLP},
  year = {2018},
  doi = {10.18653/v1/w18-6119},
}
Figure