Dynamic Hashtag Recommendation in Social Media With Trend Shift Detection and Adaptation

Riccardo Cantini, Fabrizio Marozzo, Alessio Orsino, Domenico Talia, Paolo Trunfio

Abstract

Social media platforms are characterized by rapid shifts in topics and trends, a phenomenon known as concept drift. Static hashtag recommendation models quickly become obsolete as new events emerge. This paper introduces H-ADAPTS, a framework that integrates real-time stream processing with trend-shift detection to dynamically update recommendation models. By utilizing Apache Storm for real-time monitoring and a Ranked Jaccard Distance (RJD) metric to trigger efficient fine-tuning, H-ADAPTS maintains high recommendation accuracy with significantly lower computational costs than full model retraining.

Introduction

Social media is a highly dynamic environment where the "ground truth" of conversations can change overnight due to global events, such as pandemics or elections. Traditional hashtag recommendation models are typically "static," trained on fixed snapshots of data. Consequently, their accuracy degrades rapidly as new hashtags emerge (e.g., #Election2024) and existing ones shift in context. While frequent retraining could mitigate this, it is computationally expensive and often redundant if trends remain stable. The challenge lies in building a system that is adaptive (knowing when to change), efficient (minimizing resource waste), and scalable (handling massive data velocity).

The H-ADAPTS Framework

The H-ADAPTS system addresses these challenges through a multi-layered approach to dynamic adaptation. At its core, the system monitors social media streams for "trend shifts" in real-time.

Trend-Shift Detection

Instead of retraining on a fixed schedule, H-ADAPTS employs a metric called Ranked Jaccard Distance (RJD). This metric compares the top-$n$ hashtags in a current "tumbling window" (e.g., the last 24 hours) against a reference set of trending hashtags. If the RJD exceeds a predefined threshold ($\omega$), it signals a significant conversation shift, triggering a model update. Unlike standard Jaccard distance, RJD accounts for the relative importance (ranking) of hashtags, providing a more sensitive indicator of emerging trends.

Model and Adaptation Strategy

The system utilizes the HASHET base model, which features a DistilBERT encoder for text embeddings and a Multi-Layer Perceptron (MLP) for hashtag mapping. When a shift is detected, H-ADAPTS performs an efficient adaptation:

  1. Embedding Updates: Word2Vec hashtag embeddings are updated to include novel tags.
  2. Transfer Learning: The MLP mapper undergoes transfer learning to accommodate new patterns.
  3. Progressive Fine-Tuning: The DistilBERT encoder is fine-tuned using only a small window of recent posts, drastically reducing training time compared to full-model retraining.

System Architecture

The entire pipeline is implemented on Apache Storm, a distributed real-time computation system. This architecture ensures low-latency processing of high-velocity data streams. The system is designed for asynchronous updates, allowing it to continue serving recommendations using the current model while a new version is trained in the background, ensuring zero downtime.

Experimental Evaluation

The researchers evaluated H-ADAPTS using two high-volatility datasets from X (formerly Twitter): a COVID-19 dataset (~685,000 posts) and a 2020 US Presidential Election dataset (~523,000 posts).

Key Results

H-ADAPTS significantly outperformed static models and traditional unsupervised methods (such as LDA) once a trend shift occurred. In the COVID-19 study, the system successfully detected shifts corresponding to major news events, such as the 75th UN General Assembly.

As shown in the results, the proposed adaptation strategies maintain high recall (~0.90) across multiple weeks. Notably, the combination of Transfer Learning and Progressive Fine-Tuning was nearly twice as fast as retraining on a full sliding window while maintaining identical performance levels. The system also demonstrated resilience, learning and recommending entirely new hashtags within 24 hours of a detected shift.

Conclusion

H-ADAPTS provides a robust solution for real-time hashtag recommendation in volatile environments. By combining sensitive trend-shift detection with efficient model adaptation strategies, the framework ensures that recommendations remain relevant without the prohibitive costs of constant retraining. Future work may explore the framework's applicability to other social platforms and its compatibility with different recommendation architectures.

Summary updated

BibTeX
@article{cantini2026dynamic,
  author = {Riccardo Cantini and Fabrizio Marozzo and Alessio Orsino and Domenico Talia and Paolo Trunfio},
  title = {{Dynamic Hashtag Recommendation in Social Media With Trend Shift Detection and Adaptation}},
  journal = {IEEE Trans. Comput. Soc. Syst.},
  year = {2026},
  doi = {10.1109/tcss.2025.3621724},
}
Figure