Context-Aware Recommendations for Televisions Using Deep Embeddings with Relaxed N-Pairs Loss Objective

Miklas S. Kristoffersen, Sven Ewan Shepstone, Zheng-Hua Tan

Introduction

Recommending television content is a complex task due to the highly contextual nature of viewing habits. A user's preference can shift dramatically based on the time of day, their age, or whether they are watching alone or with family. This paper introduces Joint Context-Content Embeddings (JCCE), a framework designed to map these diverse viewing situations and program metadata into a shared latent space. The core contribution is a novel "Relaxed N-Pairs Loss" objective that better accommodates the overlapping patterns inherent in broadcast television data.

The Challenge of Contextual TV Recommendations

Traditional Context-Aware Recommender Systems (CARS) often treat context as a simple post-filtering step. While deep learning offers more sophisticated modeling, it faces two primary hurdles in the TV domain:

  1. Implicit Feedback: Systems typically only record what was watched, providing no explicit "negative" signals about what users disliked.
  2. Metric Learning Constraints: Standard loss functions like N-pairs loss enforce a strict one-to-one mapping between a context and an item. In reality, a single show may be appropriate for many different contexts, making these rigid constraints counterproductive for the overlapping patterns of broadcast television.

Methodology: Joint Context-Content Embeddings (JCCE)

The authors propose a "two-tower" neural network architecture to address these challenges. One tower, the Context Encoder, processes features such as User ID, time, and social context (e.g., group viewing). The second tower, the Content Encoder, vectorizes program metadata like genre and duration.

The JCCE framework maps context and content features into a shared 50-dimensional latent space for relevance scoring.

Both encoders map inputs into a shared 50-dimensional latent space. Relevance is determined by the cosine similarity between the resulting context and content vectors. This architecture allows for efficient real-time serving, as content embeddings can be pre-computed.

Innovation: Relaxed N-Pairs Loss (R-JCCE)

The standard N-pairs loss assumes that each context in a training batch corresponds to exactly one "correct" item, treating all others as negatives. However, TV viewing often involves multiple users watching the same popular content. The proposed Relaxed N-Pairs Loss acknowledges this by allowing multiple similar contexts to be pulled toward the same content embedding simultaneously.

Comparison between standard N-Pairs and the proposed Relaxed N-Pairs loss, which accounts for content overlap in training batches.

This "loosening" of constraints makes training more efficient and better reflects real-world viewing habits where content consumption is not mutually exclusive across different contexts.

Experimental Setup and Datasets

The framework was evaluated on two large-scale datasets:

  • BARB: A proprietary UK dataset featuring 2.7 million viewing events from 13,000 panel members. Crucially, it includes social context (co-viewing data), which is rare in public datasets.
  • Polimi: A public dataset with 20.5 million events, primarily focused on user-item interactions without detailed social or demographic features.

Key Results and Insights

The experimental results highlight several strengths of the R-JCCE approach:

  • Superior Accuracy at Top-1: R-JCCE excels at providing the single most relevant recommendation. On the BARB dataset, it achieved a Hit Rate@1 (HR@1) of 0.338, significantly outperforming Bayesian Personalized Ranking (0.209) and Wide & Deep (0.264).
  • The Value of Social Context: Incorporating co-viewing data improved model accuracy by approximately 7%. Group dynamics provide a strong signal for predicting viewing patterns that individual-only models miss.
  • Emergent Semantic Hierarchies: t-SNE visualizations of the latent space revealed that the model naturally clusters related genres (e.g., History and Science) without explicit supervision, demonstrating that it captures meaningful relationships between content types.
  • Efficiency: Serving a recommendation only requires one forward pass through the context encoder, making it fast enough for real-time systems.

Conclusion

By relaxing the constraints of traditional metric learning, the R-JCCE framework provides a more flexible and accurate approach to context-aware TV recommendations. While currently focused on genre-level suggestions to mitigate "cold start" issues, the authors suggest these embeddings can serve as a powerful pre-filter for more granular, item-based recommendation engines.

Summary updated

BibTeX
@misc{kristoffersen2020context,
  author = {Miklas S. Kristoffersen and Sven Ewan Shepstone and Zheng-Hua Tan},
  title = {{Context-Aware Recommendations for Televisions Using Deep Embeddings with Relaxed N-Pairs Loss Objective}},
  year = {2020},
  eprint = {2002.01554},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.01554},
}
Figure