D-HAN: Dynamic News Recommendation with Hierarchical Attention Network

Qinghua Zhao, Xu Chen, Hui Zhang, Shuai Ma

Abstract

News recommendation is a vital solution for information dissemination in modern society. While many promising models exist, they often capture user-news interactions at a static document level. However, news content is complex, and user preferences are highly dynamic. We propose D-HAN (Dynamic Hierarchical Attention Network), a novel recommender model that represents news at the sentence, element, and document levels. By incorporating continuous absolute and relative time information into a hierarchical attention framework and utilizing a dynamic negative sampling method, D-HAN effectively captures evolving user interests. Extensive experiments on three real-world datasets demonstrate the model's superior performance over state-of-the-art baselines.

Introduction

Most existing news recommendation systems treat user-news interactions as static events, ignoring the crucial temporal dynamics of reading habits. For instance, a user's interest might shift from financial news in the morning to entertainment at night. Furthermore, standard models often treat news articles as flat text, ignoring the inherent journalistic structure—specifically the "5W1H" elements (who, when, where, what, why, how) and the varying importance of different sentences.

Finally, the authors identify a flaw in traditional training: uniform negative sampling. By randomly picking unclicked articles as negative examples, models often encounter samples that are too easy to distinguish, preventing them from learning the fine-grained features necessary for high-quality personalized recommendations.

Methodology: The D-HAN Architecture

D-HAN addresses these challenges through three main architectural innovations designed to capture both content structure and temporal context.

The D-HAN architecture, illustrating the hierarchical attention layers and time-aware sequence modeling.

1. Hierarchical Attention Network

The model processes information at three distinct levels:

  • Sentence-level Layer: Learns which sentences within an article are most relevant to a user's specific interests.
  • Element-level Layer: Extracts specific news elements (person, organization, time, location, keywords) using Named Entity Recognition (NER) tools and applies self-attention to weigh their importance.
  • Sequence-level Layer: Analyzes the user's historical interaction sequence to understand how their preferences evolve over time.

2. Time-Aware Sequence Modeling

Instead of using standard discrete positional encodings, D-HAN injects continuous time embeddings. This includes absolute time (the exact timestamp of the click) and relative time (the time elapsed since the last click), allowing the model to distinguish between different reading contexts based on when they occur.

3. Dynamic Negative Sampling (DNS)

During training, instead of picking random negative samples, the model actively searches for "hard" negatives—unclicked articles that are highly similar to the positive (clicked) article. This forces the model to learn highly discriminative features to tell them apart, leading to better real-world accuracy.

Experimental Setup

The authors evaluated D-HAN on three real-world datasets containing user reading logs and timestamps. Notably, the popular MIND dataset was excluded because it lacks the click timestamp information required to test the model's time-aware components.

Statistics of the three real-world datasets used for evaluation.
  • Adressa: A Norwegian news dataset (15 days of logs, ~66k users).
  • Cert: A large-scale Chinese news dataset from major portals like people.com.
  • Caing: A dataset from a Chinese news portal (~10k users).

Key Results and Insights

D-HAN was compared against a wide array of baselines, including collaborative filtering (BPR, GRU4Rec) and dynamic models (NAML, TiSASRec).

Performance Highlights

  • Adressa Dataset: D-HAN achieved a Hit Ratio (HR@1) of 0.6355, beating the strongest baseline (Si-News) by roughly 3.79%.
  • Cert Dataset: D-HAN outperformed all models in broader metrics like HR@5 (0.9346) and HR@10 (0.9774).
  • Caing Dataset: D-HAN led across almost all metrics, achieving an HR@1 of 0.7244.

Qualitative Findings

  • The "Inverted Pyramid" in AI: Visualization of sentence-level weights revealed that the network naturally focuses on the first three sentences of an article, aligning with professional journalistic styles where core facts are front-loaded.
  • Entities Drive Clicks: Element-level visualizations showed that "person" and "location" elements heavily influence user decisions, proving that extracting specific entities is more effective than processing raw text alone.
  • Time Context is Critical: Ablation studies confirmed that removing either absolute or relative time information degraded performance, verifying that when a user reads is just as important as what they read.

Conclusion and Future Work

D-HAN demonstrates that a hierarchical, time-aware approach significantly enhances news recommendation. While the model leads in most metrics, future work may address its ranking accuracy for items further down the recommendation list (NDCG@10) and reduce its dependency on external NLP pipelines for entity extraction, which can introduce cascading errors.

Source code and pre-trained representations are available at https://github.com/lshowway/D-HAN.

Summary updated

Abstract

News recommendation is an effective information dissemination solution in modern society. While recent years have witnessed many promising news recommendation models, they mostly capture the user-news interactions on the document-level in a static manner. However, in real-world scenarios, the news can be quite complex and diverse, blindly squeezing all the contents into an embedding vector can be less effective in extracting information compatible with the personalized preference of the users. In addition, user preferences in the news recommendation scenario can be highly dynamic, and a tailored dynamic mechanism should be designed for better recommendation performance. In this paper, we propose a novel dynamic news recommender model. For better understanding the news content, we leverage the attention mechanism to represent the news from the sentence-, element- and document-levels, respectively. For capturing users' dynamic preferences, the continuous time information is seamlessly incorporated into the computing of the attention weights. More specifically, we design a hierarchical attention network, where the lower layer learns the importance of different sentences and elements, and the upper layer captures the correlations between the previously interacted and the target news. To comprehensively model the dynamic characters, we firstly enhance the traditional attention mechanism by incorporating both absolute and relative time information, and then we propose a dynamic negative sampling method to optimize the users' implicit feedback. We conduct extensive experiments based on three real-world datasets to demonstrate our model's effectiveness. Our source code and pre-trained representations are available at https://github.com/lshowway/D-HAN.
BibTeX
@article{zhao2024d,
  author = {Qinghua Zhao and Xu Chen and Hui Zhang and Shuai Ma},
  title = {{D-HAN: Dynamic News Recommendation with Hierarchical Attention Network}},
  journal = {Expert Systems with Applications},
  year = {2024},
  url = {https://openreview.net/forum?id=Do8nPf7Hme},
}
Figure