Introduction
While self-attention mechanisms have become the standard for capturing long-range dependencies in natural language processing, they often struggle with two fundamental aspects of text: temporal order and distance sensitivity. Standard self-attention typically treats sentences as unordered sets of words, ignoring the specific sequence and the inherent importance of local context.
The Multiple Positional Self-Attention Network (MPSAN) addresses these challenges by introducing specialized positional masks and an efficient fusion layer. This architecture allows the model to better understand word order and local semantics while maintaining high computational efficiency.
Methods and Architecture
The core of MPSAN consists of two primary innovations designed to inject positional awareness into the attention mechanism without the heavy parameter cost of previous methods.
1. Positional Self-Attention Layer
Instead of a single attention head, MPSAN applies multiple masks simultaneously to view the sentence from different perspectives:
- Faraway Mask: Focuses on a specific $(2m+1)$-gram neighborhood to capture local phrase structures.
- Scaled-Distance Mask: Implements a "soft" logarithmic penalty ($-\log|i-j|$) based on the distance between words. This reflects the intuition that the exact distance is critical for nearby words but matters less as words get further apart.
- Directional Masks: Standard Forward and Backward masks are included to capture the temporal flow of the sentence.
2. Position-Fusion Layer
To integrate these diverse masked views, the authors developed a Tokens-Position-Weighting (TPW) mechanism. Unlike complex sigmoid-based fusion gates, this layer uses a softmax-based approach to adaptively weight the different masked representations and the original word embeddings, creating a unified and robust sentence representation.
3. Parameter Efficiency
By reducing the dimensionality of self-attention compatibility functions from multi-dimensional to 1D, the authors significantly cut the parameter count. This design choice prevents overfitting and ensures the model remains scalable for large-scale classification tasks.
Key Results
MPSAN was evaluated across six diverse NLP benchmarks, including sentiment analysis (SST) and sentence classification (TREC, CR, MPQA, SUBJ). The model consistently outperformed previous attention-based architectures while being more efficient.
- State-of-the-Art Accuracy: MPSAN achieved a test accuracy of 52.53% on the SST dataset, outperforming models like DiSAN (51.72%) and Bi-BloSAN (51.49%).
- Efficiency and Speed: The model utilizes only 1.1M parameters, significantly fewer than its competitors. Furthermore, it is faster to train, requiring only 359 seconds per epoch on SST, compared to 485 seconds for DiSAN and 1704 seconds for Bi-LSTM-SAN.
- Ablation Insights: Removing the positional masks led to a 3.34% drop in accuracy, confirming that the specialized masks are essential for the model's performance.
Discussion and Insights
A key finding of this research is that logarithmic distance punishment is superior to linear penalties. This suggests that the "semantic decay" of a word's influence is non-linear; the distinction between immediate neighbors is far more impactful than the distinction between distant tokens.
By combining fixed, pre-tuned positional information (masks) with trainable adaptive fusion (TPW), MPSAN captures both structural linguistic rules and task-specific nuances. Future work may involve integrating these positional logic layers into larger pre-trained transformer architectures or testing the model on generative tasks like machine translation.
Summary updated