EnsLM: Ensemble Language Model for Data Diversity by Semantic Clustering

Zhibin Duan, Hao Zhang, Chaojie Wang, Zhengjue Wang, Bo Chen, Mingyuan Zhou

Introduction

Natural language is inherently diverse. A technical manual, a casual product review, and a news report each possess distinct linguistic styles, vocabularies, and thematic structures. Standard Language Models (LMs) often struggle with this "data diversity" because they typically attempt to learn a single, averaged representation across all domains. This "one-size-fits-all" approach can lead to sub-optimal performance when the model encounters niche or highly specialized text.

EnsLM (Ensemble Language Model) addresses this challenge by automatically discovering semantic clusters within data and adapting a backbone model to these specific groups. By combining a novel autoencoding topic model (mATM) with an efficient weight modulation technique, EnsLM achieves superior performance without the need for manual domain labels.

Unsupervised Semantic Clustering with mATM

Traditional approaches to handling data diversity often rely on "data selection," where separate models are trained for pre-defined domains. However, this requires high-quality ground-truth labels, which are often unavailable. Furthermore, human-defined categories may not align with the actual semantic nuances that benefit language modeling.

EnsLM introduces the mATM (Autoencoding Topic Model with Mixture Prior) to perform unsupervised semantic clustering. Unlike standard topic models, mATM utilizes a mixture of Dirichlet priors (approximated by Logistic-Normal distributions) to infer soft clustering assignments. This allows the model to recognize that a single document might belong to multiple semantic clusters simultaneously.

Comparison of t-SNE visualizations between LDA and mATM clustering.

As shown in the t-SNE visualizations above, mATM provides significantly clearer separation of semantic domains compared to traditional methods like Latent Dirichlet Allocation (LDA). This improved clustering is foundational to the model's ability to specialize its language representations.

EnsLM and Weight Modulation

Training $N$ separate models for $N$ clusters is computationally expensive and ignores shared linguistic knowledge. EnsLM solves this by using a shared backbone (e.g., BERT or GPT-2) and adapting it through weight modulation.

The model maintains small dictionaries of modulation parameters. Based on the cluster assignments from mATM, it generates a modulation matrix ($\Gamma$) that is applied to the backbone weights via an element-wise product. This allows the backbone to retain "shared knowledge" while the modulated weights capture "cluster-specific features."

The weight modulation mechanism in EnsLM.

The mATM and EnsLM are trained jointly. This end-to-end approach allows the language modeling loss to refine the clustering process, ensuring that the discovered clusters are those most useful for the LM task.

Key Results and Insights

The researchers evaluated EnsLM across document clustering, sentiment analysis, language generation, and summarization, yielding several key insights:

  • Superior Clustering: mATM achieved 46.44% accuracy on the 20News dataset, significantly outperforming the 37.4% achieved by LDA+K-means.
  • Outperforming Human Labels: In multi-domain sentiment classification, BERT-EnsLM-mATM reached 93.5% accuracy. Remarkably, this outperformed a BERT model trained using ground-truth domain labels (92.9%), suggesting that unsupervised discovery can find more relevant semantic boundaries than human categorization.
  • Enhanced Generation: When applied to GPT-2 on the APNEWS dataset, the ensemble approach reduced perplexity from 35.78 to 23.67, indicating a massive improvement in predictive confidence.
  • Parameter Efficiency: EnsLM provides the benefits of an ensemble of specialized models without the massive memory overhead, requiring only a single backbone and small modulation matrices.

Conclusion

EnsLM demonstrates that explicitly modeling data diversity through unsupervised clustering and weight modulation significantly improves LM performance across a variety of tasks. By moving away from "hard" domain assignments and human-defined labels, the framework allows models to adapt more fluidly to the complex semantic landscape of natural language. Future work may explore applying these techniques during the initial pre-training phase of large-scale models to create even more robust general-purpose LMs.

Summary updated

BibTeX
@inproceedings{duan2021enslm,
  author = {Zhibin Duan and Hao Zhang and Chaojie Wang and Zhengjue Wang and Bo Chen and Mingyuan Zhou},
  title = {{EnsLM: Ensemble Language Model for Data Diversity by Semantic Clustering}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.230},
}
Figure