Introduction
In natural language processing (NLP), the semantic importance of specific words within a sentence often shifts depending on the objective. For instance, in the sentence "The infantile cart is easy to use," a domain classifier might prioritize "infantile cart" to categorize the text under baby products, whereas a sentiment analyzer would focus on "easy to use" to determine a positive polarity. Traditional multi-task learning (MTL) frameworks attempt to capture these nuances by partitioning model parameters into shared and private spaces. However, researchers from Fudan University propose a more efficient alternative: a fully shared representation layer coupled with task-specific attention mechanisms.
The Shared-Private Dilemma
Conventional MTL architectures typically follow one of two patterns: Stacked Shared-Private (SSP) or Parallel Shared-Private (PSP). In these models, a "shared" space captures features common to all tasks, while "private" spaces handle task-specific details. While effective, this approach often results in parameter-heavy models that struggle to learn a truly invariant, generic sentence representation. The authors argue that a robust representation should be entirely shareable, with the task-specific "focus" managed by an external selection mechanism rather than separate architectural branches.
Task-Attentive Sentence Encoding
The proposed framework introduces two primary architectures: Static Task-Attentive Sentence Encoding (SA-MTL) and Dynamic Task-Attentive Sentence Encoding (DA-MTL). Both models utilize a single Bidirectional Long Short-Term Memory (BiLSTM) layer as a shared encoder to process input sentences into a sequence of hidden states.
Static vs. Dynamic Attention
In the SA-MTL model, each task is assigned a unique, learnable query vector ($q$). This vector acts as a filter, extracting the most relevant hidden states from the shared BiLSTM to create a task-specific summary.
The DA-MTL model takes this a step further by using an auxiliary domain classifier to identify the sentence's context. Instead of a fixed vector, it generates a query vector dynamically based on that context, providing greater flexibility for sentences from diverse sources. To further ground the shared encoder, the researchers also experimented with auxiliary linguistic tasks like Part-of-Speech (POS) tagging and Chunking.
Experimental Evaluation
The models were evaluated on a comprehensive suite of 16 text classification tasks, including 14 product review datasets and two movie review datasets (IMDB and MR). The results demonstrated significant improvements over existing methods:
- Superior Accuracy: The DA-MTL model achieved an average accuracy of 88.2%, outperforming the single-task BiLSTM baseline (83.7%) and the traditional PSP-MTL model (86.2%).
- Parameter Efficiency: The SA-MTL model proved remarkably lean, achieving state-of-the-art performance with only 668k parameters, compared to the ~16 million parameters required by the SSP model.
- Faster Convergence: The attentive models reached peak performance on development sets significantly faster than parallel shared-private models, which often suffer from training instability.
Conclusion
By treating attention as a filter rather than partitioning the neural network's internal representation, the authors have developed a framework that is both more accurate and more parameter-efficient. Visualizations of the attention weights confirmed that the model successfully focuses on different keywords for different tasks within the same sentence. This approach not only improves performance on existing tasks but also creates more transferable representations for unseen domains, marking a significant step forward in multi-task sentence encoding.
Summary updated