NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bayes-enhanced Lifelong Attention Networks for Sentiment Classification

Hao Wang, Shuai Wang, Sahisnu Mazumder, Bing Liu, Yan Yang, Tianrui Li

Introduction

Standard deep learning models for sentiment classification are typically optimized for single-domain tasks. When transitioned to new domains, these models often fail to utilize generalizable knowledge, such as the fact that "excellent" is universally positive. The challenge in Lifelong Learning (LL) for sentiment analysis lies in identifying what knowledge to retain and how to distinguish between domain-specific and universal sentiment indicators—for instance, "heavy" might be negative for a laptop but positive for a dumbbell.

Methodology

The proposed Bayes-enhanced Lifelong Attention Network (BLAN) architecture utilizes a hierarchical structure with Bi-GRUs to process words into sentences and documents. The core innovation lies in its attention mechanism, which is augmented by a Knowledge Base (KB) of sentiment priors derived from Naive Bayes.

The architecture of the Bayes-enhanced Lifelong Attention Network (BLAN), showing the integration of the Knowledge Base (KB) with hierarchical attention layers.

As shown in the architecture diagram, the model extracts generative parameters from Naive Bayes and converts them into sentiment ratios. These ratios represent the likelihood of a word appearing in a positive versus a negative context, providing a robust prior for the attention mechanism.

Examples of word parameters and their corresponding sentiment ratios used as attention priors in the BLAN model.

To handle domain specificity, BLAN employs Frequent Pattern Mining (FPM). This process identifies words that consistently exhibit strong sentiment across multiple domains, filtering out noise and domain-specific anomalies. The final attention score is a fusion of learned self-attention and the "lifelong attention" retrieved from the KB, allowing the model to perform well even on new tasks with limited training data.

Datasets

The model was rigorously evaluated on two multi-domain Amazon review datasets:

  1. Amazon(20): Comprising 20 product domains (e.g., Alarm Clock, Baby, Graphics Card) with 1,000 reviews each.
  2. SNAP(24): A larger corpus with 24 domains (e.g., Automotive, Beauty, Video Games) and 10,000 reviews per domain.

Both datasets present a challenge due to significant class imbalance, with negative reviews being the minority class.

Key Results and Discussion

BLAN demonstrated superior performance across all metrics compared to classic Naive Bayes, standard Deep Learning (HAN, LSTM-GRNN), and existing Lifelong Learning methods (LSC, SRK).

  • Superior Accuracy: On the Amazon(20) dataset, BLAN achieved an average accuracy of 92.38%, outperforming the standard Hierarchical Attention Network (HAN) at 91.17% and the best lifelong learning baseline (LNB) at 88.69%.
  • Robustness on Minority Classes: The impact was most notable in the F1-score, where BLAN reached 74.78 compared to HAN's 68.90, highlighting its robustness in handling imbalanced data.
  • Ablation Success: A variant called nBLAN (without the Bayes-enhanced attention) performed worse across the board, confirming that the lifelong knowledge injection is the primary driver of success.

Conclusion

BLAN bridges the gap between interpretable generative models and powerful neural architectures. By treating attention as the medium for knowledge transfer, it provides a scalable solution for lifelong sentiment classification. Future work will focus on extending the model to multi-class sentiment problems and integrating advanced anti-forgetting techniques like Elastic Weight Consolidation (EWC).

Summary updated

BibTeX
@inproceedings{wang2020bayes,
  author = {Hao Wang and Shuai Wang and Sahisnu Mazumder and Bing Liu and Yan Yang and Tianrui Li},
  title = {{Bayes-enhanced Lifelong Attention Networks for Sentiment Classification}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.coling-main.50},
}
Figure