Abstract
Duplicate Question Detection (DQD) is a critical task for maintaining the quality of Community Question Answering (CQA) forums, which serve as primary data sources for training Large Language Models (LLMs). Traditional methods often struggle with "background noise"—contextual details like code snippets that obscure the user's core intent. We present Intent-DQD, a framework that isolates user intent for more accurate duplicate detection. By utilizing the inherent structure of forums for annotation-free training, Intent-DQD achieves state-of-the-art performance across 15 domains and outperforms general-purpose LLMs like ChatGPT.
Introduction: The Problem of Background Noise
In the current landscape of AI, high-quality instruction-tuning data is essential. CQA platforms like Stack Overflow are gold mines for this data, but they are frequently cluttered with duplicate questions. The challenge in detecting these duplicates lies in the distinction between "intent" and "background."
A user's intent is the specific goal or problem (e.g., "How do I fix a null pointer error?"), while the background consists of the specific context, such as project details or code snippets. Standard DQD methods often treat a post as a single block of text, leading to errors where models are distracted by similar backgrounds in questions with different intents, or fail to recognize identical intents buried in different contexts.
Methodology: The Intent-DQD Framework
Intent-DQD addresses these challenges through a modular architecture designed to separate and match intents explicitly.
1. Intent Recognition
The model first identifies specific sentences within a post that represent the user's goal. This module uses transformer-based embeddings enhanced with structural features, including Part-of-Speech (POS) tags, sentence position, and forum-specific keywords or tags. This allows the system to filter out "background" noise and focus on the core query.
2. Annotation-free Intent Matching
The "secret sauce" of this framework is its ability to train without expensive human-labeled data. The authors leverage the natural behavior of forum users to create training signals:
- Intra-links: The model assumes the intent expressed in a question's title matches the intent found within its body.
- Inter-links: The model uses titles of questions already marked as duplicates by the community as matching pairs.
Using Supervised Contrastive Learning, the model is trained to pull these related intents together in a low-dimensional space while pushing mismatched intents apart.
3. Duplicate Question Detection
Since a single post may contain multiple intents, the model constructs a similarity matrix ($S$) to compare every intent in Question A against every intent in Question B. These intent-level relations are then aggregated to produce a final "Duplicate" or "Neutral" classification.
Datasets and Evaluation
The researchers evaluated Intent-DQD across 15 distinct domains using two primary datasets:
- CQADupStack: A benchmark containing data from 12 diverse Stack Exchange sites, including Android, English, Physics, and Math.
- SODup (Stack Overflow Duplicate): A new, larger dataset created by the authors from the Stack Overflow data dump, focusing on the three most popular programming languages: JavaScript, Python, and Java.
Key Results and Performance
Intent-DQD demonstrated superior performance across the board, proving that intent is a more robust signal for duplication than general semantic similarity.
Superiority Over Baselines
The framework outperformed all baseline models, including SRoBERTa and specialized models like MFAE. In the Math domain, the F1-score saw an improvement of 4.8%. The contrastive learning approach was shown to create much sharper distinctions between matched and mismatched intents compared to standard pre-trained models.
Outperforming ChatGPT
In a head-to-head comparison on 200 question pairs, Intent-DQD achieved F1-scores between 0.90 and 0.92, significantly higher than ChatGPT (GPT-3.5-turbo), which scored between 0.85 and 0.86. This result highlights that specialized, intent-aware models still hold a significant advantage over general-purpose LLMs for niche, domain-specific tasks.
Conclusion and Future Directions
Intent-DQD provides a scalable and effective method for cleaning CQA data by focusing on user intent. While the model excels when intents are explicitly stated, its performance may vary in forums dedicated to open-ended or subjective discussions. Future research will focus on extending this intent-based approach to the coarse-grained retrieval stage, enabling more efficient identification of potential duplicates within massive databases of millions of questions.
Summary updated