Abstract
Attentive Pooling (AP) is a novel two-way attention mechanism that allows neural networks to jointly learn representations for pairs of inputs, such as questions and answers. By making the pooling layer context-aware, AP enables the relationship between inputs to influence feature extraction. This approach achieves state-of-the-art performance in answer selection tasks while demonstrating superior efficiency and robustness to long texts compared to standard Siamese architectures.
Introduction
Many machine learning tasks, particularly in Natural Language Processing (NLP), involve matching pairs of information—such as finding the best answer for a question or determining sentence paraphrases. Traditional "Siamese" architectures process each input independently using Convolutional Neural Networks (CNNs) or Recurrent Neural Networks (RNNs). In these models, max-pooling typically extracts the most prominent global features from each input separately before comparing them.
However, independent max-pooling is "blind" to the relationship between the pair. It may select features that are globally important within a single sentence but irrelevant to the matching task. Attentive Pooling addresses this by allowing the question to influence feature extraction from the answer, and vice versa, creating a context-aware representation.
Methodology
The Attentive Pooling framework can be integrated with both CNNs and bi-directional Long Short-Term Memory (biLSTM) networks. The process involves four primary stages:
- Feature Extraction: A CNN or biLSTM generates feature matrices $Q$ (question) and $A$ (answer).
- Similarity Matrix Construction: A "soft alignment" matrix $G$ is computed as $G = \tanh(Q^T U A)$, where $U$ is a learnable parameter. Each entry in $G$ represents the similarity between segments of the question and answer.
- Two-Way Attention: Max-pooling is applied across the rows and columns of $G$ to identify the most relevant segments for each input relative to the other. These scores are normalized via softmax to produce attention vectors.
- Weighted Pooling: The final representations, $r_q$ and $r_a$, are derived by multiplying the original feature matrices by their respective attention vectors.
This mechanism ensures that the final vector for an answer highlights only the components most relevant to the specific question.
Experimental Setup
The models were evaluated on three benchmark datasets for answer selection:
- InsuranceQA: A large-scale insurance domain dataset characterized by long answers.
- TREC-QA: A classic factoid question-answering benchmark.
- WikiQA: An open-domain dataset derived from Wikipedia.
Results and Discussion
The AP-enhanced models consistently outperformed baseline architectures and established new state-of-the-art results across all benchmarks.
On the InsuranceQA dataset, the AP-biLSTM model achieved an accuracy of 71.7% on the first test set, a significant improvement over the previous best of 68.1%. For TREC-QA, the AP-CNN reached a Mean Average Precision (MAP) of 0.7530, surpassing complex models that rely on handcrafted linguistic features.
Key Insights
- Efficiency: AP-CNNs require approximately 10x fewer convolutional filters than standard CNNs. By offloading the "matching" logic to the attention mechanism, the network capacity is used more effectively.
- Robustness to Length: Unlike standard CNNs, which suffer performance degradation as input length increases due to signal loss in global max-pooling, AP remains stable. It effectively ignores irrelevant noise in long paragraphs by focusing on matched segments.
- Speed: Despite the additional computation for the similarity matrix, AP-CNNs trained twice as fast as standard QA-CNNs because the reduction in filters significantly decreased the overall model size.
Conclusion
Attentive Pooling provides a powerful, general-purpose framework for learning joint representations of input pairs. By enabling mutual influence during the pooling stage, it overcomes the limitations of independent feature extraction. While currently focused on NLP, the authors suggest potential applications in computer vision and bioinformatics. Future research may explore more complex similarity measures or apply two-way attention to generative tasks like machine translation.
Summary updated