Detecting Semantically Equivalent Questions in Online User Forums
Paper · 2015 · Dasha Bogdanova, Cícero dos Santos, Luciano Barbosa et al.
Summary
A forum can already have the answer someone needs even when a search for the words they used fails to find it. One Ask Ubuntu user described an error encountered while trying to open a Windows installer. Another asked more directly about installing Windows programs on Ubuntu. An explanation of why those installers do not ordinarily run on Ubuntu, and what a compatibility layer can do, addresses the issue that connects the posts. The paper asks whether a system can recognize that connection from the questions themselves. Its criterion is practical: both questions must be adequately served by the same answer.
The authors join each post’s title and body and turn its words into vectors, known as word embeddings. A convolutional neural network scans short stretches of adjacent words, produces local features, and adds those features to form a single vector for each question. It then scores how closely the directions of the two question vectors agree. During training, the authors use forum duplicate links as positive examples and randomly generated pairs as negative examples. The network learns to bring the scores for genuine matches closer to the positive label. At prediction time, it uses a cutoff chosen on held-out data to decide whether to flag a pair.
With the full 24K labeled training pairs from Ask Ubuntu, the network initialized with Ask Ubuntu word vectors reaches 92.9% accuracy on the test set. The strongest baseline, a support vector machine given both phrase features and measures of shared wording, reaches 82.4% on the same test set. In a separate Ask Ubuntu validation comparison with equally sized word vectors, pretraining on forum text yields 92.4% accuracy, compared with 85.5% for pretraining on a much larger Wikipedia corpus. The forum vectors also give the convolutional system an advantage across the labeled training sizes examined.
The distinction between labeled pairs and ordinary forum text matters when the system moves to another community. On Meta Stack Exchange, the CNN trained on 20K Meta pairs and initialized with Meta vectors reaches 92.68% test accuracy. When all 24K labeled training pairs come from Ask Ubuntu, switching from Ask Ubuntu to Meta word vectors raises Meta test accuracy from 80.0% to 83.35%. The target forum’s unlabeled text helps even when its duplicate labels are unavailable for training. These scores characterize a balanced test of already assembled pairs. Finding the relevant old post among all the questions in a forum is the next task the authors identify.
Deep dive: Detecting Semantically Equivalent Questions in Online User Forums
How a convolutional network detects forum questions that can share an answer, and how its accuracy depends on domain vocabulary and training data. · about 33 minutes to read
The problem and its context
What makes the same answer fit?
A community built around question answering has an incentive to keep earlier solutions easy to find. As the paper describes it, sites such as Yahoo! Answers, Quora, and Stack Exchange encourage users to look for an existing answer before opening a new thread. That advice depends on a connection between the words a person uses to describe a problem and the words someone else used when asking about it earlier. Sometimes the connection is obvious. A copy of an old question is a straightforward moderation case. A report written by a person who has yet to identify the source of an error can look quite different from a question that names the technical issue directly.
The paper’s example about Windows software makes the gap concrete. The longer post describes a failed attempt to use a Skype installer and reproduces part of an error from a program that treated the download as an archive. It also brings up trouble watching videos. The other post is short and explicitly asks about running or installing software distributed for Windows. The suggested answer explains the incompatibility of Windows executables with Ubuntu and mentions Wine as a way to run such software. The example shows how an answer can address the same underlying issue in posts that differ in what they explicitly ask, how much background they provide, and how clearly they identify the problem. A method keyed to phrases from the short question could miss the longer one, even though the installer details in that post point toward the shared solution.
For the authors, the defining condition is the adequacy of a common answer. The two users can give different accounts of their circumstances. A question that names a general issue and a question that describes a particular manifestation can still qualify if the same explanation or remedy serves both. Conversely, posts may concern the same product or describe a similar operation while requiring distinct answers. A shared topic is evidence a detector can use. Whether an answer transfers is the condition the detector is supposed to predict.
The answer criterion defines the target, while the inputs have a narrower form. An example consists of two problem descriptions, each made by concatenating a post title and body. The paper uses the word question for that entire text. A brief title can point to an operation while the body names a constraint or reproduces an error. In another post, the title may already express the essential request and the remaining text may mostly supply background. Concatenation allows either part to contribute. It also leaves the detector with the job of finding the useful evidence inside a post whose sections can differ considerably in purpose and detail.
This is a decision about a supplied pair. The same forum policy that motivates the decision also supplies examples of it: when a question is linked as a duplicate, the authors treat the link as evidence of answer equivalence. In the study’s design, the classifier sees the two texts and predicts the kind of relationship expressed by the link. It has no answer in front of it to test against either post. That separation between the reason for the label and the material used to predict it runs through the experiment.
Neighboring tasks and earlier approaches
Earlier work on duplicate documents gave the authors a natural comparison. A method can split a document into shingles, contiguous stretches of text, and estimate how much of one document’s set of stretches appears in the other. Fingerprinting gives another way to look for close copies. The paper discusses these techniques in the context of web search and crawling, where redundant documents are an important concern and the cost of comparing documents also matters. The assumptions are intuitive when one page copies much of another. In a forum, the text describing the problem may share little wording with the old post that already has its solution. Detecting Near-Duplicates for Web Crawling.
Paraphrase identification asks whether two sentences express the same meaning. A pair of genuine rephrasings of a question satisfies the authors’ criterion, since an adequate answer to one should serve the other. The Windows-installer example illustrates a broader relationship. The detailed post includes claims about what happened to a particular user that the short post never makes. A paraphrase comparison would have to account for those differences in content. A duplicate decision under the forum criterion can focus on the answerable problem the accounts have in common. In its discussion of previous approaches to paraphrase identification, the paper includes work that uses scores originally developed to evaluate machine translation and work that learns neural representations of sentences. Machine Translation Metrics for Paraphrase Identification.
The related task of semantic similarity assigns a degree of resemblance to a pair of texts. The paper describes a shared task that grades resemblance from 0 to 5, with 5 associated with paraphrases. Answer equivalence gives the score a different purpose. A pair can qualify even with differences that would lower a judgment of how closely the texts match in overall meaning. As a consequence, the paper uses a continuous similarity score as an intermediate calculation and evaluates a binary decision. The question is whether the pair crosses a cutoff appropriate to the forum labels. Semantic Textual Similarity shared task.
The authors also discuss earlier work on topical near-duplicates in social media question collections. That study used relatively simple lexical and syntactic indicators and compared classifiers, reporting logistic regression as its best option. The authors of the present paper say the earlier experimental procedure lacks enough detail to support a direct comparison. The distinction in target matters as well. An approach can successfully group posts about a related subject while leaving open whether the same response would resolve both requests. The forum’s duplicate relation supplies a more specific target for this study.
Convolutional networks already had precedents in adjacent language tasks. The paper points to a sentence-classification study that builds on pretrained word vectors, including a variant that keeps one set of vectors fixed while adjusting another during supervised learning. It also discusses work that uses convolution for sentence completion, response matching, and paraphrase identification, with a training objective that ranks candidate matches. These precedents made learned features over adjacent words a plausible alternative to enumerating exact phrases. The earlier sentence-classification results in particular motivated the use of word vectors acquired from text before training on task labels. Sentence Classification with Convolutional Networks.
Another precedent used convolutional representations in factual question answering. As the paper describes it, one component linked part of a question to an entity in a database and another associated its relational phrasing with a database relation. The system combined that evidence to infer an answer entity. The forum task uses a different prediction target and different inputs: it compares the text of two requests under a common-answer criterion. The authors also cite short-text sentiment research as evidence that convolution can build representations from language at different granularities. They report knowing of no prior application of convolution to the particular forum task they define. Semantic Parsing for Single-Relation Question Answering.
The method, step by step
From post text to a duplicate decision
The architecture makes the same calculation for each question. It starts with the sequence of words in the title and body. Each word is replaced by a list of real-valued features taken from an embedding matrix. A small window then moves through the sequence. At every position, a learned transformation reads the vectors inside that window together. Its output describes properties of that local stretch of text. Applying the same transformation at different positions lets a useful expression contribute whether it occurs in the title, near the beginning of the body, or farther into the post.
Next, the network adds the local feature vectors component by component and applies a nonlinear transformation. This gives the question vector a fixed width regardless of the length of the question. A post with a long error description and a short question about installing Windows software can therefore be compared in the same vector space. The score measures whether the question vectors point in similar directions. The last step of prediction is a comparison with a cutoff selected using held-out pairs.
How the network decides whether two questions match
The steps in order.
The training signal enters after the vectors have been compared. If a forum link identifies a pair as duplicates, the desired score is the positive label. The target score for a pair generated as a negative example is its negative label. The system adjusts the components that produced its score. It learns from the success or failure of the comparison as a whole. The duplicate link supplies no separate indication of which word, window, or part of the post accounts for the relationship.
Looking up a word vector
The paper starts from tokenization, which turns a text string into the items the network can process in order. The authors use NLTK for this step. For a question with N words, the token at position n is written wₙ. The vocabulary V is a fixed set of known words, and |V| is its size. Each vocabulary entry has a column in the embedding matrix. The size of a column, written d, is a choice made before the network is trained on pairs.
r_w = W₀ v_w
Here w is the input word and r_w is its d-dimensional vector. W₀ is the matrix with d rows and |V| columns. v_w is a vector of length |V| containing a 1 at the vocabulary index for w and zero everywhere else. Multiplication by v_w selects exactly the column of W₀ assigned to that word. The subscript ₀ identifies the embedding matrix, which precedes the convolutional transformation.
The authors initialize the columns using skip-gram in word2vec. The idea is to learn the word representations from patterns of neighboring words in ordinary text. This kind of pretraining is unsupervised in the sense relevant here: questions and answers can contribute vocabulary evidence without anyone identifying a duplicate pair for the training objective. The resulting vectors give the supervised stage a starting point for recognizing vocabulary used in similar contexts. The paper treats the embedding matrix as a learnable parameter of the question network. Efficient Estimation of Word Representations in Vector Space.
The authors make corpus choice an experimental variable. For the general-domain initialization, they reuse vectors from a short-text sentiment study, trained on the December 2013 snapshot of English Wikipedia. For the forum initializations, they use questions and answers from Stack Exchange dumps. Their description of embedding preparation names a May 2014 dump. The forum text is tokenized, images are removed, URLs are replaced, and tokens are lower-cased. When the experiment calls for code removal or a prefix marking code, the pretraining material receives the same treatment as the task input. The resulting corpus sizes are reported as about 121 million tokens for Ask Ubuntu and 19 million for Meta Stack Exchange. Deep Convolutional Neural Networks for Short-Text Sentiment.
Using questions and answers in this stage has a specific consequence for how to read the experiment. Text written by people answering forum posts can shape the learned vocabulary. The supervised duplicate detector still receives only the two questions when making a decision. The answer material in pretraining and the answer implicit in a duplicate label therefore enter in different ways. One helps establish word representations from text. The other motivates the target the network learns from linked pairs.
Combining nearby words and pooling across the post
A list of embeddings still has the length of the question. To handle that variability, the convolution first turns a window around each position into a feature vector of the same size. The authors write the input to the transformation as a concatenation of neighboring word vectors.
zₙ = (r_{w_{n−(k−1)/2}}, …, r_{w_{n+(k−1)/2}})ᵀ
zₙ is the window vector centered at token position n. k is the number of token positions in the window, and r_{w_i} denotes the embedding of the word at position i. The lower and upper indices give the left and right endpoints of the centered window. The ellipsis includes the intervening embeddings in their original order. The superscript ᵀ indicates that the concatenated result is written as a column. Its length is d multiplied by k, since each token contributes a vector of length d. The paper specifies a shared padding embedding for positions beyond the text boundary.
Concatenation makes a token’s place inside the window available to the next calculation. A feature can respond differently to a word before an operation and the same word after it. This is more informative than taking an unordered set of the words in the window. At the same time, the position of the whole window in the post does not change the transformation applied to it. The feature weights that respond to a useful local pattern early in one question can respond to it late in another.
[r_q]ⱼ = f(∑_{n ∈ I_q} [f(W₁ zₙ + b₁)]ⱼ)
r_q is the fixed-width vector for question q, and [r_q]ⱼ selects its component j. I_q denotes the word windows included in the sum, described by the authors as the windows across the question. W₁ is the learned convolution weight matrix. It has clᵤ rows and d times k columns, where clᵤ is the number of convolutional units. b₁ is a learned bias vector with one entry per unit. At each position n, the product with zₙ and the addition of the bias give the raw local features. f is the hyperbolic tangent, applied component by component. The inner brackets select the local feature at index j, the summation adds its values over positions, and the outer f transforms that sum. The paper’s displayed summation prints strict position bounds, while its description refers to summing the windows and separately specifies boundary padding. The window-set notation here expresses the stated pooling operation without resolving that boundary convention.
A convolutional unit is one learned local feature. Its weights determine which combinations of word-vector coordinates elicit a response. Pooling collects the responses from around the post to form a feature of the question as a whole. A cue can therefore contribute from anywhere the network encounters it. Repeated cues can contribute repeatedly before the outer hyperbolic tangent is applied. At the pooling stage, the locations of the windows cease to be explicit. The vector retains signals of the local configurations the network found and aggregates them into the same set of coordinates for every question.
The context width k controls how many neighboring tokens the transformation sees at once. The number of convolutional units clᵤ controls both the size of the feature vector produced at each position and the size of the final question representation. These settings have separate roles from d, the number of coordinates for each word. In the initial Ask Ubuntu validation comparison, the CNN settings reported in the paper include d=200, k=3, and clᵤ=300. The authors also report λ=0.005 in the settings table, without defining λ in the architecture or training equations.
Comparing the questions
The authors use cosine similarity to compare the question vectors. The dot product is large when corresponding coordinates contribute in compatible directions. Dividing by the product of the vector lengths makes the calculation a measure of orientation. This matters because the number of windows contributing to a pooled vector can differ considerably across questions. The calculation compares the vectors produced by the network, including the nonlinear transformation after pooling.
s(q₁, q₂) = (r_{q₁} · r_{q₂}) / (‖r_{q₁}‖ ‖r_{q₂}‖)
s(q₁, q₂) is the similarity score for the first question q₁ and the second question q₂. r_{q₁} and r_{q₂} are their respective question vectors. The centered dot denotes their dot product, which sums products of corresponding coordinates. The double bars denote the Euclidean length of the vector inside them. The slash divides the dot product by the product of those lengths.
Swapping the questions leaves the cosine score unchanged. The symmetry fits the study’s definition, since the suitability of a common answer does not depend on which question is presented first. It also identifies the specific prediction being made. A forum duplicate link may point from a newer question to an older one, but the network scores whether the two requests match. The score alone supplies no choice of which thread should be the destination of a link.
At prediction time, a pair is flagged if its score exceeds the threshold selected on held-out data. This threshold turns a graded number into the yes-or-no outcome used to calculate accuracy. The cosine value is a comparison between vectors. The paper evaluates the resulting decision at the chosen cutoff and supplies no calibration procedure to interpret the value as a probability of equivalence.
Learning from linked and randomly paired questions
The labeled examples come from Stack Exchange duplicate links. The authors take a link to indicate that a common answer serves the posts involved, and use such linked pairs as positives. They randomly generate negatives from the corpus and construct separate sets for training, validation, and testing. The method thus uses an existing moderation decision as a proxy for the answer criterion. Training learns the mapping from question text to that decision. Validation supports choices such as settings and the cutoff. Testing measures accuracy after those choices are made.
For a given training pair, the difference between its label and its predicted similarity is squared. Squaring gives a greater penalty to a larger discrepancy and treats errors of the same magnitude alike regardless of their sign. The authors describe the training criterion as mean-squared error. Their displayed objective is a sum of half the squared error for each training example.
θ ↦ ∑_{(x, y) ∈ D} ½ (y − s_θ(x))²
θ is the collection of network parameters. The arrow maps those parameters to the value of the objective. D is the training set, and each element (x, y) consists of a question pair x and its label y. The pair x contains q₁ and q₂. The label is 1 for an equivalent pair and 0 for a negative pair. s_θ(x) is the similarity produced for x by the network with parameters θ. The superscript ² squares the prediction error, ½ scales each term, and the summation collects the terms over the training set. Dividing the whole sum by the fixed number of examples would leave the parameters that minimize it unchanged.
The authors use stochastic gradient descent, which updates parameters using gradients from training examples, and back-propagation, which computes how changes in earlier operations affect the loss. The gradient reaches the word and convolutional representations through the cosine calculation. Positive training pairs provide pressure towards a score near 1, and negative pairs towards a score near 0. The latter target matters: the training objective asks for a score around zero on negatives, rather than explicitly seeking vectors that point as far away from each other as the cosine permits. The authors implemented the network and gradient calculation in Theano. Their embedding initialization uses word2vec, and the comparison classifier described below uses LibSVM.
Experiments and results
How the forum tests were assembled
The main experiments use the May 2014 Ask Ubuntu dump. Ask Ubuntu serves users and developers of Ubuntu, and its duplicate links can connect a new question with a thread judged to cover the same problem. The authors found 15,277 linked pairs in the dump. They selected a balanced training set of 24K question pairs, a validation set of 1K pairs, and a test set of 6K pairs, with no reported overlap among the pair sets. Half of each split consists of positives and half of randomly generated negatives. The text used for matching includes the title and body, and links are replaced by a common string.
The other forum, Meta Stack Exchange, hosts questions about the community itself, including rules, features, and possible bugs. The authors use a September 2014 dump for its labeled data. They report 67746 questions in the dump, with 19,456 marked as duplicates. The counting units matter: the Ask Ubuntu figure is a count of linked pairs, while the Meta figures count questions and questions marked as duplicates. The Meta experiment uses disjoint balanced sets of 20K training pairs, 1K validation pairs, and 4K test pairs. The authors say they prepared the Meta examples in the same manner as the Ask Ubuntu examples.
The reported metric is accuracy, the proportion of pair decisions that agree with the labels. With positive and negative pairs equally represented, both types of decision contribute equally to the overall score. The metric is easy to read when comparing systems on the same set. It leaves the directions of their mistakes open: a classifier that misses genuine duplicates and one that falsely flags unrelated pairs can receive the same accuracy. The tables also need to be read with their split names. An accuracy measured on validation data used for setting choices has a different role from accuracy measured on the test set.
The overlap baseline and the classifier baselines
The simplest comparison represents each question by a set of shingles. A shingle is a contiguous n-gram, which here means a stretch containing a chosen number of adjacent tokens. The set removes repeated occurrences of the same stretch. The authors test lengths from one to four and compare two sets with the Jaccard coefficient. This version of overlap gives each distinct shingle in a question equal standing. Its denominator accounts for how much wording appears across the pair, so the same number of shared shingles can lead to different scores for pairs with different amounts of distinct text.
J(S(d₁), S(d₂)) = |S(d₁) ∩ S(d₂)| / |S(d₁) ∪ S(d₂)|
d₁ and d₂ are the first and second question documents. S(d₁) and S(d₂) are their sets of shingles. J names the Jaccard coefficient. The intersection symbol ∩ selects the shingles present in both sets, and the union symbol ∪ selects the shingles present in either. The vertical bars count the elements in the resulting set. The slash divides the shared count by the combined count. The baseline returns a positive decision above a threshold T, with T chosen using training data.
A support vector machine, or SVM, provides the learned comparison. It uses a feature vector for the pair, constructed from n-grams up to length four. For each n-gram, one feature indicates presence in the first question, one indicates presence in the second, and another gives the normalized count over both questions. These features allow the SVM to give different importance to particular expressions in a way that the raw shingle-set comparison cannot. They still depend on the literal identities of the expressions supplied to the classifier. Support-Vector Networks.
The SVM uses a radial basis function, or RBF, kernel, which compares examples by how close their feature vectors are. The authors use grid search for C, the SVM penalty setting, and γ, the setting controlling how rapidly kernel similarity falls with distance. They reduce the feature inventory with a frequency cutoff, selecting 5 by cross-validation from values that also included 2, 35, and 100. The strongest baseline extends that SVM input with the Jaccard coefficients for the different shingle lengths. It can therefore use both the identities of particular phrases and a direct measurement of how much wording the two questions share at each length.
This combination makes the comparison more informative than a contest with simple word overlap alone. The supplied overlap values give the SVM a summary of common wording without requiring it to reconstruct that summary from individual features. The CNN instead learns which windows produce similar representations and how the resulting question vectors compare. If it does better, the experiment shows an advantage over the available combination of exact lexical features and overlap. The embedding and training comparisons then help distinguish some of the ingredients within the convolutional approach.
The reduced Ask Ubuntu comparison
The authors start with a balanced 4K-pair subset of the Ask Ubuntu training set to make the initial experiments faster. They tune and compare settings on the 1K-pair validation set. One choice concerns code tags. Around 30% of the posts in the Ask Ubuntu dump use these tags. They may surround actual code or other material such as package names, commands, paths, and error output. The experiment compares preserving the tagged material as text, removing it, and attaching a prefix so that marked tokens are distinguished from the same tokens in ordinary prose. The CNN embeddings follow the same code treatment as the examples used to train the detector.
With code removed, the plain RBF SVM reaches 66.53% on Ask Ubuntu validation. The shingling baseline reaches 72.65% for size 1, 66.83% for size 2, and 62.93% for size 3 under the same code treatment. The SVM augmented with shingle features reaches 77.4%, and the CNN with Ask Ubuntu embeddings reaches 92.4%. These scores all use the reduced labeled training pool. The best shingling result in the initial table uses individual words. Longer exact runs of tokens are less effective in the comparisons that table reports, a pattern consistent with forum duplicates sharing subject vocabulary while being phrased differently.
The treatment of code also affects the choice of baseline. The augmented SVM reaches 74.0% Ask Ubuntu validation accuracy when tagged material is kept as ordinary text and 73.6% when it is prefixed. The corresponding CNN scores are 91.3% with code kept and 91.4% with it prefixed. Both classifiers attain their highest reported validation score with that material removed. The authors adopt removal in subsequent experiments. Because the initial comparison varies the representation of code alongside the input it permits, its scores describe those complete preprocessing choices.
The full Ask Ubuntu test
The full comparison uses 24K training pairs and retains the SVM with shingle features as the strongest baseline. The CNN uses Ask Ubuntu word vectors. With the full training set, validation accuracy is 85.5% for the SVM and 93.4% for the CNN. On the 6K-pair test set, the corresponding numbers are 82.4% and 92.9%.
CNN and strongest baseline on Ask Ubuntu test accuracy
The convolutional network with forum word vectors classifies more test pairs correctly than the SVM with shingle features.
The numbers
| System or setting | accuracy % |
|---|---|
| SVM with shingle features | 82.4 |
| CNN with Ask Ubuntu word vectors (this paper) | 92.9 |
The ordering from validation carries over to the held-out test set. The comparison also clarifies which Ask Ubuntu number answers which question. The 92.4% validation result belongs to the smaller training experiment. The 92.9% test result belongs to training with the full Ask Ubuntu set. In the discussion of domain adaptation, the paper calls 92.4% the Ask Ubuntu test accuracy while pointing to its full-training table. That table explicitly lists 92.9 for the CNN in the test column, and its validation column lists 93.4. The full-training test result here follows the table’s labeled column.
Changing the embedding corpus
In a separate Ask Ubuntu validation comparison, both sets of embeddings have 200 dimensions. The general-domain vectors come from Wikipedia, whose token count is listed as ≈1.6B. The forum vectors come from Ask Ubuntu, listed at ≈121M tokens in the comparison. The CNN obtains 85.5% validation accuracy with the Wikipedia initialization and 92.4% with the Ask Ubuntu initialization. These numbers compare different vector sources within the CNN. The 85.5% also reported for the SVM in the full-training experiment refers to a different comparison.
Word vector sources on Ask Ubuntu validation accuracy
Forum-trained vectors yield higher validation accuracy than Wikipedia-trained vectors of the same dimension.
The numbers
| System or setting | accuracy % |
|---|---|
| CNN with Wikipedia word vectors | 85.5 |
| CNN with Ask Ubuntu word vectors (this paper) | 92.4 |
Corpus size and relevance point in different directions in this comparison. Wikipedia supplies far more tokens, while the smaller corpus consists of posts and answers from the community where the detector is evaluated. The authors interpret the accuracy ordering as evidence for domain-specific pretraining. Because both sets of vectors have the same width, the difference in validation performance cannot be explained by the forum vectors giving each word more coordinates. The experiment measures the effect of choosing these two particular sets of vectors, which also differ in the text from which the coordinates were learned.
Training and testing on Meta Stack Exchange
The Meta results ask whether the method works in another forum and how it behaves when training pairs and test pairs come from different communities. In the first comparison, the labeled training pairs come from Meta and the initialization comes either from Meta itself or from Wikipedia. With 4K Meta training pairs, Meta vectors produce 91.1% validation accuracy and 89.97% test accuracy. Wikipedia vectors give 86.9% on validation and 86.27% on test. This repeats the direction of the Ask Ubuntu corpus comparison on a community whose subject is different.
With 20K Meta training pairs, Meta vectors give 92.8% on validation and 92.68% on the 4K-pair Meta test set. Wikipedia vectors give 90.6% on validation and 90.52% on test. The higher scores with more labels occur for both sources of vectors. With the same number of labeled examples, the configuration initialized from the evaluation forum’s own text gives the higher accuracy at each of the reported Meta training sizes.
The transfer comparison uses 24K labeled pairs from Ask Ubuntu and evaluates on Meta. With Meta vectors, the classifier reaches 83.9% Meta validation accuracy and 83.35% Meta test accuracy. With Ask Ubuntu vectors, it reaches 76.8% on Meta validation and 80.0% on Meta test. The best test setting among the reported Meta comparisons uses both target-forum labels and target-forum vectors. When the source of pair supervision is fixed to Ask Ubuntu, access to Meta text for the embeddings gives the system the better transfer result.
Training and embedding sources on Meta Stack Exchange test accuracy
Training and pretraining on Meta gives the strongest result, while Meta vectors also help when pair labels come from Ask Ubuntu.
The numbers
| System or setting | accuracy % |
|---|---|
| Meta labels 4K, Wikipedia vectors | 86.27 |
| Meta labels 4K, Meta vectors | 89.97 |
| Meta labels 20K, Wikipedia vectors | 90.52 |
| Meta labels 20K, Meta vectors (this paper) | 92.68 |
| Ask Ubuntu labels 24K, Ask Ubuntu vectors | 80.0 |
| Ask Ubuntu labels 24K, Meta vectors | 83.35 |
The rows with 24K labeled pairs are transfer results even though the detector has access to Meta text through its embeddings in one of them. A forum can provide enough ordinary text for skip-gram training while providing no duplicate pairs for fitting the detector. The authors use that distinction to test a specific form of adaptation. Their validation values also make clear that Meta labels still have a role in the reported evaluation procedure, even when the gradient updates for the pair classifier use Ask Ubuntu pairs.
What the ablations show
How exact phrasing and code affect the comparison
The shingle experiment changes the span over which the baseline requires an exact match. At size 1, words can be shared even if they occur in different orders or neighborhoods. Increasing the size makes an intersection depend on common runs of adjacent tokens. That can help detect a copied passage. It also makes common evidence disappear when people arrange the same vocabulary differently. In the reduced Ask Ubuntu comparison, the decline from size 1 through size 3 with code removed shows that stricter phrase matching makes this shingling decision less accurate. The authors read the advantage of single words as evidence that linked questions frequently share topic cues without sharing much phrasing.
Adding shingle scores to the SVM helps in the same experiment. The result shows that an overall overlap measurement contributes once supplied directly to the classifier along with n-gram indicators and counts. It also clarifies why the authors retain the combined baseline for the larger run. The plain SVM’s results alone would give an incomplete account of how effective an approach centered on shared wording can be. The comparison concerns the tested feature construction and classifier. It does not isolate a general property of every method that uses n-grams.
The code experiment operates on a different feature of the input. Keeping code expands the evidence the detector can use. Prefixing it also marks the context in which a token appears, so ordinary language and technical expressions can be represented distinctly. The authors use the example of a word that can be a preposition in prose and a loop keyword in code. In practice, removing code yields the highest reported accuracy for the CNN and augmented SVM on the reduced Ask Ubuntu validation split. The authors suggest that inconsistent tagging and lengthy error messages contribute noise. For the CNN, preprocessing changes both the question input and the forum corpus used to acquire word vectors, so the experiment estimates their combined effect.
Most of the apparent benefit comes from comparing complete alternatives on the same validation set. A marked block can carry a crucial package name in one post and a large amount of incidental output in another. An aggregate preference for removal is compatible with both cases. There is also variation among the classifiers. For example, the size 2 shingling baseline has its best reported validation result with code kept, at 69.24%, compared with 66.83% with it removed. The authors’ preprocessing decision follows the stronger systems and the overall comparison. Accuracy on posts needing a particular command, path, or error string is not reported separately.
How much capacity the word vectors need
The authors vary the dimension of Ask Ubuntu word vectors and plot validation accuracy against training time in epochs, where an epoch is a pass over the training set. The figure shows improvement when dimension rises from 50 to 100 and again from 100 to 200. The increase from 200 to 400 yields no further improvement in the reported comparison. This changes the width of the representation for each word, which in turn changes the input width of the convolutional transformation. It measures the practical effect of making the embeddings wider in this setup.
The authors interpret the lack of further gain in relation to the roughly 121M tokens available for training the Ask Ubuntu vectors. Their account is that a wider representation can take advantage of a sufficiently large pretraining corpus, and the available corpus gives no improvement at the largest width they tried. The experiment varies vector width for the available corpus. Establishing how much text would be needed to benefit from 400 dimensions would require varying the amount of pretraining text as well. The result identifies a plateau for the conditions tested.
There is also a brief architectural comparison in the paper. The authors say that pooling with a maximum produces results very similar to pooling with a sum. A maximum retains the strongest local response on a feature. A sum allows responses at different positions to contribute together, including contributions that offset each other. The paper gives no accuracy values for the maximum variant. The observation suggests that the reported system is tolerant of this change, while leaving the size and consistency of any difference unspecified.
Where the gains from more labels appear
The learning-curve experiment varies the number of labeled Ask Ubuntu training pairs. The sizes are 100, 1000, 4000, 12,000, and 24,000. The plots report validation accuracy for the combined SVM baseline and for the CNN initialized with either Ask Ubuntu or Wikipedia word vectors. The authors report better accuracy with more training examples. They also describe different patterns of dependence on the amount of labeled supervision for the SVM and the CNN.
Between the 4K subset and the full 24K Ask Ubuntu training set, the authors describe the validation accuracy gain as about 9% for the SVM and about 1% for the CNN. The reported CNN change is small for either initialization over that part of the curve. With both embedding sources, the architecture begins supervised training with word representations derived from text outside the duplicate-label objective. The SVM builds its decision from phrase features, counts, and shingle overlap. The learning curves compare how these complete approaches respond to more labeled examples. They do not establish how a CNN initialized without pretrained vectors would behave.
The forum initialization stays ahead of the Wikipedia initialization across the reported Ask Ubuntu training sizes. This result gives the single embedding-source comparison a broader scope. If the advantage appeared only with very few labeled pairs, one possible account would be that additional supervision makes the choice of starting vocabulary unimportant. Within the tested range, the ranking persists. The method benefits from paired supervision and from domain text, and the learning curves show that the supply of one did not erase the observed value of the other.
The Meta transfer runs offer another way to separate those resources. Both transfer rows train on the same amount of Ask Ubuntu pair data. The vector source changes to Meta in the better-performing row. Since the test domain is Meta in both cases, the comparison supports the authors’ conclusion that target-domain representations can help even with source-domain pair supervision. The higher performance of the runs trained on Meta pairs identifies a remaining advantage for supervision from the target forum under the reported conditions. The experiments vary corpus source, label source, and amount of labeled data through particular combinations. A complete map of how those choices interact would require comparisons beyond the rows in the paper.
What the error examples explain
The authors report that the CNN is better than the vocabulary baselines at recognizing equivalent questions whose wording differs. They also identify the reverse type of mistake, in which similar phrasing makes genuinely different requests look alike. One pair asks about installing Ubuntu while keeping Windows and about changing from x86 to x64 while retaining existing settings. The SVM gives the positive decision, whereas the CNN correctly gives the negative one. Both questions describe a technical change under a preservation constraint. The things being changed and the things being preserved differ, so the common shape of the request is insufficient for a common solution.
The example makes the value of a learned local comparison easier to see. A system can benefit from responding to a pattern of related terms, and it can also distinguish phrases that use similar constructions for different operations. The paper reports the decision made by each classifier on the pair. It does not trace the CNN’s decision to individual units or tell which window was decisive. The example demonstrates the behavior reached by the network rather than a direct explanation of its internal feature use.
Another class of errors involves posts where the crucial information appears in a screenshot. The paper reports failures for both systems when an image containing essential evidence has been removed. This is a different mechanism from vocabulary mismatch. The evidence needed to resolve the question can be absent from the text passed to either detector. Word embeddings help compare expressions that the system actually receives. The screenshot examples show a boundary set by the content available for comparison.
Limitations
Limits the authors identify
The authors draw a boundary between classifying a supplied pair and retrieving equivalent questions from a corpus. Their experiments begin with two texts ready to be compared. They describe corpus-wide retrieval as future work and suggest using a related convolutional architecture. Retrieval would require assembling or ranking candidates for a newly submitted question. The reported accuracy measures the final kind of yes-or-no judgment on sampled pairs. It supplies no measurement of how many relevant old threads a retrieval system would recover or where they would rank.
The error analysis identifies missing input as a source of mistakes. A screenshot may carry the detail that lets a reader connect one problem to another. With the image removed, a body that refers to it can have too little information to distinguish between plausible readings. The authors also recognize noise from material in code tags and use the validation results to choose a preprocessing policy. Their preference for removing code reflects what happens on the tested Ask Ubuntu sets. It gives limited guidance for a post whose precise error or package name is available only inside the removed block.
The authors explain why they cannot directly compare their results with the earlier work on topical near-duplicates. The earlier experimental methodology is described too sparsely for the comparison they would need. That limits the relative claim to the baselines and datasets they run. The paper establishes how its CNN compares with shingling and its SVM configurations on the selected examples, alongside comparisons within the CNN family. It has no matched evaluation against the earlier social-media classifier.
Limits of the experimental design
The positives are forum links interpreted through the duplicate policy. That is a source of supervision at a scale useful for the experiment, but a link supplies the moderators’ decision rather than a separately recorded judgment that an identified answer resolves every relevant detail. The paper’s illustrative pair already shows why such a judgment can require care. The longer user report contains a difficulty with video as well as the installer error. The common answer presented by the authors is about the installer issue. How to handle a secondary request in a composite post is an annotation question. The experiment inherits the forum’s decisions about such cases.
Random negatives create a parallel issue. An unlinked pair can still share a usable answer, and the paper motivates its study by observing that some duplicate questions remain in the forum. Random sampling can also pair posts whose unrelated subjects make them easy negatives. A search system, by contrast, may pass a classifier mostly candidates that already share vocabulary or subject matter with the new post. The accuracy reported here establishes performance against randomly generated negatives in balanced sets. It does not show how often the classifier rejects high-overlap alternatives drawn from an actual candidate list.
Balance is valuable for comparing algorithms on the same problem, but the prevalence of duplicates among real candidate pairs is left unspecified. With the same accuracy, errors can be distributed differently between missed duplicates and false duplicate flags. A false flag can direct a user to a thread that leaves their question unresolved. A missed duplicate can leave equivalent discussions disconnected. Since the paper reports overall accuracy at the selected thresholds, readers cannot use its aggregate numbers to determine these error rates separately or to choose between thresholds for different moderation costs.
The description assures disjointness of the sampled sets of pairs. It does not describe a question-level or thread-level holdout. Distinct pairs can contain a common question, for instance when several posts are linked to a single older thread. Accordingly, the reported design establishes that the same pair is kept out of another split, while leaving the extent of shared individual questions unspecified. The experiments also draw word-vector training material from forum dumps. They demonstrate the benefit of domain text as assembled by the authors, without establishing performance on a strictly later stream of questions whose wording was unavailable during pretraining.
Cross-domain accuracy has a similarly bounded interpretation. Both communities are part of Stack Exchange and use a common idea of duplication. The transfer shown is from Ask Ubuntu labels to Meta evaluation. The study includes Meta text for the successful target-vector initialization and reports Meta validation performance, with validation used in the method to choose settings and thresholds. It therefore demonstrates transfer without Meta pair supervision in the training set. An operational setting with no labeled target pairs even for development, or with a different community’s moderation conventions, lies outside the design described in the paper.
Finally, the best baseline comparison changes several ingredients together. The CNN uses pretrained word vectors, learned local transformations, pooled question representations, and a cosine score. The augmented SVM uses indicators and counts of exact n-grams with shingle overlap values. The controlled comparisons show how embedding source, vector width, labeled training size, and code handling affect the configurations investigated. They leave open the individual contribution of convolution relative to other ways of composing the same vectors. The error examples show the kinds of decisions the architecture can make. They do not quantify how frequently each example type accounts for the aggregate advantage.
What came after
Semantic Equivalence Detection: Are Interrogatives Harder than Declaratives? (2018) cites the forum study and brings sentence form to the foreground. Its title poses a comparison between equivalence judgments for questions and for declarative statements. The earlier study provides a concrete instance of the interrogative side of that comparison. Its question pairs can include a direct request, a description of a symptom, or a mixture of the two, and its criterion is whether an answer fits both. That makes the difficulty of judging question equivalence a question about the relationship between requests and possible answers as well as about comparing word sequences.
The later work’s stated question is narrower in one respect and broader in another. It isolates a distinction between interrogatives and declaratives, while the forum study concentrates on variation among interrogative posts from communities with duplicate policies. The citation and the later title establish that connection in scope. They leave open which datasets, methods, or findings the later study used, and whether it reused the convolutional architecture or the forum pairs. For the earlier paper, the demonstrated result remains a pairwise one: with duplicate links as supervision, representations learned from a forum’s vocabulary help a classifier recognize when differently worded posts can share an answer.
Cite
Cite as Dasha Bogdanova, Cícero dos Santos, Luciano Barbosa and Bianca Zadrozny. 2015. Detecting Semantically Equivalent Questions in Online User Forums. Proceedings of the Nineteenth Conference on Computational Natural Language Learning.
@inproceedings{bogdanova2015detecting,
title = {{Detecting Semantically Equivalent Questions in Online User Forums}},
author = {Dasha Bogdanova, Cícero {dos Santos}, Luciano Barbosa and Bianca Zadrozny},
booktitle = {Proceedings of the Nineteenth Conference on Computational Natural Language Learning},
year = {2015},
doi = {10.18653/v1/k15-1013},
url = {https://doi.org/10.18653/v1/k15-1013}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bogdanova-2015-detecting-semantically-equivalent-questions-online/