Abstract
This paper explores the challenge of learning a sequence of sentiment classification tasks where knowledge from each task is retained to assist in both future and past task learning. Traditional lifelong learning methods often focus solely on forward transfer—using past knowledge to improve new tasks—and require original training data to perform backward transfer (improving past tasks with new knowledge). We present Lifelong Naïve Bayes (LNB), a generative model-based approach that achieves both forward and backward knowledge transfer without the need to store or retrain on raw data from previous tasks.
Introduction
Sentiment classification is a critical task in natural language processing, yet it faces significant hurdles when applied to specific product domains. Training data for a niche domain is often sparse, imbalanced, and lacks a comprehensive vocabulary. Lifelong learning (or continual learning) addresses these issues by sharing knowledge across a sequence of tasks.
However, a major limitation in current lifelong learning research is the asymmetry of knowledge transfer. While forward transfer is well-studied, backward transfer—where a model improves its performance on an older task based on insights from a newer one—typically requires access to the original training data. In many real-world scenarios, storing raw data is prohibited by privacy regulations or storage constraints. This paper introduces a method to overcome this by leveraging the unique properties of generative models.
The Lifelong Naïve Bayes (LNB) Framework
The proposed Lifelong Naïve Bayes (LNB) model utilizes the mathematical structure of the Naïve Bayes (NB) classifier to facilitate seamless knowledge integration. Unlike discriminative models that require iterative optimization over raw data to update decision boundaries, LNB can be updated by simply adjusting its probability parameters using aggregated statistics.
As shown in the architecture above, the system consists of three main components:
- Knowledge Miner (KM): For every new task $T_{n+1}$, the KM extracts "base-knowledge," which includes word frequencies per class and document counts. This avoids the need to store raw text.
- Knowledge Base (KB): This component stores the extracted statistics from all past tasks, serving as a repository of "retained knowledge."
- Knowledge-Based Learner (KBL): When evaluating a target domain, the KBL retrieves past knowledge and combines it with new knowledge to revise the probability distributions of the classifier.
Methodology: Knowledge Extraction and Revision
LNB distinguishes between two types of vocabulary to prevent "negative transfer," where irrelevant information from one domain harms performance in another:
- Domain-dependent words: These are terms that have specific sentiment meanings within a particular domain (e.g., "quiet" is positive for a car but potentially negative for an alarm clock).
- Domain-reliable words: These are terms that consistently convey the same sentiment across most domains (e.g., "excellent," "disappointing").
The model uses a voting mechanism across non-target domains in the KB to identify reliable words. It then revises the multinomial distribution parameters of the target domain's NB classifier. This allows the model to instantly update a classifier for a past task using the global statistics of all subsequent tasks, effectively achieving backward transfer without retraining.
Experimental Evaluation
The LNB model was evaluated using a benchmark dataset of Amazon product reviews spanning 20 distinct domains. The researchers tested the model on two variations: a balanced set (100 positive and 100 negative reviews per domain) and a natural, imbalanced distribution.
The natural distribution (as seen in the table above) presents a significant challenge, with negative reviews comprising as little as 10.86% of the data in some domains (e.g., Movies TV). This imbalance often leads standard classifiers to perform poorly on the minority class.
Key Results and Insights
LNB demonstrated superior performance across multiple metrics:
- Accuracy and F1-Score: LNB significantly outperformed baselines such as standard SVM, NB, and existing lifelong learning models like LSC and LLV. On the imbalanced natural distribution, LNB achieved an average F1-score of 64.96%, compared to 56.62% for the next best model (LSC).
- Evidence of Backward Transfer: A key finding was that as the model encountered more future domains, its accuracy on the very first domain learned continued to improve. For example, on the balanced set, accuracy on the first task rose from approximately 78.7% to 84.0% after learning 19 subsequent tasks.
- Computational Efficiency: Due to its non-iterative nature, LNB is highly efficient. It processed the entire sequence of tasks in just 11.4 seconds, whereas competing lifelong learning models took between 45 and 300 seconds.
Conclusion
Lifelong Naïve Bayes provides a robust framework for sentiment classification that mimics the human ability to refine past understanding through new experiences. By focusing on generative parameter updates rather than raw data retraining, LNB offers a scalable and privacy-preserving solution for continual learning. Future research may explore applying these "parameter-revision" principles to more complex neural architectures to further enhance the capabilities of lifelong learning systems.
Summary updated