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

Joint Embedding of Words and Labels for Text Classification

Guoyin Wang, Chunyuan Li, Wenlin Wang, Yizhe Zhang, Dinghan Shen, Xinyuan Zhang, Ricardo Henao, Lawrence Carin

Text classification is a fundamental task in natural language processing. Traditional approaches typically treat labels as categorical indices, ignoring the rich semantic information often contained within the label names themselves. The Label-Embedding Attentive Model (LEAM) addresses this by treating text classification as a joint embedding problem. By mapping words and labels into the same semantic space, LEAM uses label embeddings as "anchor points" to guide phrase-level attention, resulting in a model that is both highly accurate and computationally efficient.

Methods

The core innovation of LEAM lies in its architecture, which integrates label information directly into the representation learning process. The model operates in three primary stages:

  1. Joint Embedding ($f_0$): Both words and labels are projected into a shared $P$-dimensional vector space. If a label has a descriptive name (e.g., "Business & Finance"), its initial embedding can be initialized as the average of its constituent word embeddings.
  2. Label-Attentive Composition ($f_1$): Unlike simple averaging methods, LEAM calculates a compatibility matrix between word sequences and label embeddings using cosine similarity. To capture local context, a 1D convolution (phrase-level window) is applied over this matrix. Max-pooling across the label dimension identifies the highest relevance score for each word, which is then normalized via softmax to produce attention weights ($\beta$).
  3. Classification ($f_2$): The final document representation is a weighted average of word embeddings, which is then passed to a simple linear classifier.
Comparison between the traditional text classification pipeline and the proposed LEAM joint embedding method.

The authors also employ a regularization term to ensure label embeddings act as effective "anchors," penalizing the model if a label's own embedding cannot be correctly classified as that label.

Key Results

LEAM was evaluated against five large-scale benchmarks: AGNews, Yelp Binary, Yelp Full, DBPedia, and Yahoo! Answers. It was also tested on the MIMIC-III clinical dataset for multi-label medical code prediction.

The model achieved state-of-the-art accuracy on the largest datasets, specifically Yahoo (77.42%) and DBPedia (99.02%). Beyond raw accuracy, LEAM's efficiency is a standout feature: it utilizes approximately 1/10th the parameters of a standard LSTM and trains nearly 9x faster than complex self-attention models like Bi-BloSAN.

LEAM demonstrates faster convergence and superior performance on partially labeled data compared to standard baselines.

Furthermore, LEAM exhibits a significant advantage in low-data scenarios. As shown in the performance plots, the model's learning curve is much steeper than CNNs or LSTMs when only a small fraction of labeled data is available, suggesting that the joint embedding space provides a powerful inductive bias when data is scarce.

Discussion and Insights

  • Interpretability: Because attention is derived from label compatibility, the model's weights are inherently interpretable. Words most similar to a specific label (e.g., "coaches" for "Sports") receive higher attention.
  • Phrase-Level Context: The use of a convolutional window allows the model to capture local phrases, helping disambiguate polysemous words based on their immediate context (e.g., "bank" in a financial vs. river context).
  • Limitations: The effectiveness of LEAM is tied to the quality of label descriptions. In datasets with abstract or numerical labels, the benefits of joint embedding are reduced. Additionally, the choice of window size is a critical hyperparameter; topic classification often benefits from larger windows, while sentiment analysis requires smaller ones to capture local modifiers.

LEAM represents a shift toward more integrated representation learning in NLP, demonstrating that labels should be treated as semantic entities rather than mere indices. Future work may involve enriching these label embeddings with external knowledge sources like knowledge graphs.

Summary updated

BibTeX
@inproceedings{wang2018joint,
  author = {Guoyin Wang and Chunyuan Li and Wenlin Wang and Yizhe Zhang and Dinghan Shen and Xinyuan Zhang and Ricardo Henao and Lawrence Carin},
  title = {{Joint Embedding of Words and Labels for Text Classification}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/p18-1216},
}
Figure