A Capsule Network for Recommendation and Explaining What You Like and Dislike

Chenliang Li, Cong Quan, Peng Li, Yunwei Qi, Yuming Deng, Libing Wu

Abstract

User reviews contain rich semantics towards the preference of users to features of items. Recently, many deep learning based solutions have been proposed by exploiting reviews for recommendation. The attention mechanism is mainly adopted in these works to identify words or aspects that are important for rating prediction. However, it is still hard to understand whether a user likes or dislikes an aspect of an item according to what viewpoint the user holds and to what extent, without examining the review details. Here, we consider a pair of a viewpoint held by a user and an aspect of an item as a logic unit. Reasoning a rating behavior by discovering the informative logic units from the reviews and resolving their corresponding sentiments could enable a better rating prediction with explanation. To this end, in this paper, we propose a capsule network based model for rating prediction with user reviews, named CARP. For each user-item pair, CARP is devised to extract the informative logic units from the reviews and infer their corresponding sentiments. The model firstly extracts the viewpoints and aspects from the user and item review documents respectively. Then we derive the representation of each logic unit based on its constituent viewpoint and aspect. A sentiment capsule architecture with a novel Routing by Bi-Agreement mechanism is proposed to identify the informative logic unit and the sentiment based representations in user-item level for rating prediction. Extensive experiments are conducted over seven real-world datasets with diverse characteristics. Our results demonstrate that the proposed CARP obtains substantial performance gain over recently proposed state-of-the-art models in terms of prediction accuracy. Further analysis shows that our model can successfully discover the interpretable reasons at a finer level of granularity.

Introduction

Most modern recommender systems utilize review text to enhance rating predictions, typically relying on attention mechanisms to identify "important" words. However, importance alone is a blunt instrument. Knowing that the word "battery" is important does not reveal whether the user liked the battery, why they cared about it (e.g., for long-distance travel vs. daily commuting), or how that specific sentiment contributed to the final rating.

The CARP (Capsule network-based model for Rating Prediction) framework addresses this by modeling "logic units"—pairs of user viewpoints and item aspects. By moving beyond simple keyword attention, CARP mimics a reasoning process to determine why a user liked or disliked specific features of a product, providing both high accuracy and fine-grained explainability.

The CARP Framework

CARP employs a multi-stage architecture to process user and item reviews into a final rating prediction:

  1. Viewpoint and Aspect Extraction: The model uses CNNs and self-attention to extract latent viewpoints from a user's past reviews and latent aspects from an item's collective reviews.
  2. Logic Unit Representation: It pairs every user viewpoint with every item aspect to form potential reasons for a rating (e.g., a "Pragmatic" viewpoint paired with a "Battery Life" aspect).
  3. Sentiment Capsules: These logic units are fed into a Positive Capsule and a Negative Capsule to determine the sentiment polarity of each unit.
The CARP architecture overview, illustrating the flow from review documents to logic units and sentiment capsules.

Routing by Bi-Agreement (RBiA)

The core algorithmic innovation of CARP is the Routing by Bi-Agreement (RBiA) mechanism. Standard capsule routing can be noisy in NLP tasks because many words are neutral or irrelevant. RBiA introduces a dual-check: it calculates agreement both between capsules (is this unit more positive or negative?) and within capsules (how important is this unit compared to others in the same pole?). This "sharpens" the signal, effectively filtering out non-informative logic units and ensuring only semantically plausible, sentiment-strong units reach the final prediction layer.

Experimental Evaluation

CARP was evaluated on seven real-world datasets, including Amazon 5-core categories, Yelp, and RateBeer. The model consistently outperformed state-of-the-art baselines like DeepCoNN, TransNet, and ANR.

Notably, on the sparse Beer dataset, CARP achieved a 39% relative improvement in Mean Squared Error (MSE) over competitive baselines. This suggests that the "logic unit" abstraction generalizes better than simple word-level attention, especially when data is limited. Furthermore, the model's performance remained stable across various values of the multi-task learning parameter $\lambda$, which balances rating prediction with a sentiment matching task.

Quantitative analysis showing (a) the effectiveness of RBiA in filtering informative units and (b) the model's performance stability across different multi-task weights.

Conclusion

CARP represents a significant step forward in interpretable recommendation. By explicitly modeling the interaction between user viewpoints and item aspects through capsule networks and RBiA, the framework provides a clear window into its "thought process." Future work includes extending these logic units to cross-domain recommendations and using them to generate natural language review summaries.

Summary updated

Abstract

User reviews contain rich semantics towards the preference of users to features of items. Recently, many deep learning based solutions have been proposed by exploiting reviews for recommendation. The attention mechanism is mainly adopted in these works to identify words or aspects that are important for rating prediction. However, it is still hard to understand whether a user likes or dislikes an aspect of an item according to what viewpoint the user holds and to what extent, without examining the review details. Here, we consider a pair of a viewpoint held by a user and an aspect of an item as a logic unit. Reasoning a rating behavior by discovering the informative logic units from the reviews and resolving their corresponding sentiments could enable a better rating prediction with explanation. To this end, in this paper, we propose a capsule network based model for rating prediction with user reviews, named CARP. For each user-item pair, CARP is devised to extract the informative logic units from the reviews and infer their corresponding sentiments. The model firstly extracts the viewpoints and aspects from the user and item review documents respectively. Then we derive the representation of each logic unit based on its constituent viewpoint and aspect. A sentiment capsule architecture with a novel Routing by Bi-Agreement mechanism is proposed to identify the informative logic unit and the sentiment based representations in user-item level for rating prediction. Extensive experiments are conducted over seven real-world datasets with diverse characteristics. Our results demonstrate that the proposed CARP obtains substantial performance gain over recently proposed state-of-the-art models in terms of prediction accuracy. Further analysis shows that our model can successfully discover the interpretable reasons at a finer level of granularity.
BibTeX
@misc{li2019capsule,
  author = {Chenliang Li and Cong Quan and Peng Li and Yunwei Qi and Yuming Deng and Libing Wu},
  title = {{A Capsule Network for Recommendation and Explaining What You Like and Dislike}},
  year = {2019},
  eprint = {1907.00687},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1907.00687},
}
Figure