Sharpness-Aware Minimization for Topic Models with High-Quality Document Representations

Tung Nguyen, Tue Le, Hoang Tran Vuong, Quang Duc Nguyen, Duc Anh Nguyen, Linh Ngo Van, Sang Dinh, Thien Huu Nguyen

Abstract

Neural Topic Models (NTMs) often struggle with "rugged" loss landscapes, leading to sharp minima that hinder generalization. This paper introduces DREAM (Document Representations via Sharpness-Aware Minimization), a novel optimization strategy that leverages Pre-trained Language Models (PLMs) to guide NTMs toward flatter, more robust minima. By adaptively adjusting the optimization neighborhood using Optimal Transport (OT) distance between model outputs and high-quality document clusters, DREAM significantly enhances document representation and topic coherence, particularly in challenging short-text and noisy environments.

Introduction

Modern Neural Topic Models have evolved to incorporate complex architectures and contextual embeddings. However, they frequently converge to "sharp" minima—narrow regions in the loss landscape where small parameter perturbations lead to significant loss increases. Such models often fail to generalize well to unseen data. While Sharpness-Aware Minimization (SAM) has seen success in computer vision, its application to topic modeling remains largely unexplored. This work addresses the gap by introducing an optimization-level improvement tailored for NTMs.

Methodology: The DREAM Framework

The proposed DREAM framework integrates three core components to refine the optimization process:

  1. Sharpness-Aware Minimization (SAM): Unlike standard gradient descent, SAM seeks regions where the loss is consistently low within a defined neighborhood, favoring "flat" minima.
  2. Adaptive Neighborhood via Optimal Transport (OT): DREAM employs a pre-trained language model to generate initial document clusters. It then calculates the OT distance between the topic model's predicted distributions and these clusters. This distance dynamically scales the SAM neighborhood radius ($\rho$), using the PLM's semantic knowledge to guide the search for stability.
  3. Robust Integration (F-SAM and ASAM): To handle gradient noise and parameter scaling issues, DREAM incorporates Friendly-SAM (F-SAM) and Adaptive SAM (ASAM).
The DREAM architecture integrates PLM-guided clustering and Optimal Transport distance to guide the model toward flat minima.

The training process involves a warm-up phase with standard gradients followed by the DREAM optimization phase to converge toward flatter minima.

Experimental Setup

The effectiveness of DREAM was evaluated across five datasets, including standard benchmarks (20 News Groups, AGNews, YahooAnswers) and short/noisy datasets (SearchSnippets, GoogleNews). The method was applied to four state-of-the-art NTM baselines: ETM, ECRTM, NeuroMax, and FASTopic.

Results and Discussion

Experimental results demonstrate that DREAM consistently improves model performance across various metrics.

Document Representation and Coherence

DREAM-enhanced models showed marked improvements in Purity and Normalized Mutual Information (NMI). For instance, on the AGNews dataset ($K=50$), the ETM model's NMI increased from 0.224 to 0.303.

Performance comparison of various NTMs with and without DREAM on standard benchmarks (K=50).

Furthermore, improvements in Cv coherence suggest that the resulting topics are more semantically meaningful.

Robustness to Noisy Data

A key strength of DREAM is its performance on short and noisy datasets like SearchSnippets. By acting as a powerful regularizer, the optimization strategy helps the model learn meaningful representations even when word co-occurrence data is sparse.

Trade-offs and Limitations

While DREAM improves coherence and representation, it occasionally leads to a slight decrease in Topic Diversity (TD), indicating that topics may become more similar as they align with document clusters. Additionally, the computational cost is higher; training with DREAM takes roughly twice as long due to the additional gradient calculations required by SAM.

Conclusion

DREAM represents a significant step forward in NTM optimization. By treating the geometry of the loss landscape as a first-class citizen and leveraging PLMs as optimization guides, it enables models to find flatter minima that generalize better across diverse and noisy text corpora. Future work will explore extending this approach to dynamic topic modeling environments.

Summary updated

BibTeX
@inproceedings{nguyen2025sharpness,
  author = {Tung Nguyen and Tue Le and Hoang Tran Vuong and Quang Duc Nguyen and Duc Anh Nguyen and Linh Ngo Van and Sang Dinh and Thien Huu Nguyen},
  title = {{Sharpness-Aware Minimization for Topic Models with High-Quality Document Representations}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.231},
}
Figure