Enhancing Interpretability and Effectiveness in Recommendation with Numerical Features via Learning to Contrast the Counterfactual samples

Xiaoxiao Xu, Hao Wu, Wenhui Yu, Lantao Hu, Peng Jiang, Kun Gai

TL;DR

Researchers from Kuaishou Technology have introduced CCSS (Contrastive learning with Counterfactual Samples Synthesizing), a model-agnostic framework that forces recommendation models to respect "monotonicity"—the logical rule that increasing a positive numerical feature (like a video's like count) should generally increase its predicted score. By synthesizing and contrasting "what-if" scenarios during training, CCSS significantly improves both the interpretability and the prediction accuracy of deep learning models in large-scale industrial settings.

What Problem Does This Paper Address?

In industrial recommender systems, models process two types of data: categorical (e.g., User ID) and numerical (e.g., "how many times has this video been watched?"). While deep neural networks (DNNs) are powerful, they are often "black boxes" that lack a basic sense of logic.

Specifically, they often fail at monotonicity. For example, if all other factors are equal, a video with 1,000 likes should logically be ranked higher than the same video with only 10 likes. However, due to complex non-linear interactions, a standard DNN might actually predict a lower score for the higher-quality item. This lack of consistency makes models hard to trust (poor interpretability) and hurts their ability to generalize (poor effectiveness).

Existing solutions usually restrict the model architecture to be "monotone-only," which limits the model's expressive power. The authors sought a way to enforce this logic without hamstringing the model's complexity.

Methods

The authors propose CCSS, a two-stage, "plug-and-play" framework that can be added to almost any existing recommendation backbone (like DeepFM or DCN).

  1. Counterfactual Sample Synthesizing:
    • For every real training sample (the Original), the system creates two "what-if" versions.
  2. It uses Shapley Values (a technique from game theory) to identify which numerical features are most important. It then "disturbs" one of these features.
  3. A Factual Sample is created by moving the feature value to a "better" bucket (e.g., increasing the click rate).
  4. A Counterfactual Sample is created by moving it to a "worse" bucket.
  5. Learning to Contrast:
    • The model is trained using a Contrastive Loss (specifically a hinge loss). It is forced to rank the samples in a logical order: $Score(Factual) > Score(Original) > Score(Counterfactual)$.
  6. Additionally, the Factual samples are used as Data Augmentation, providing the model with more high-quality examples to learn from.

This approach allows the model to learn the underlying "physics" of the features (more is better) while maintaining its ability to model complex, non-linear relationships.

Datasets

The researchers evaluated CCSS on two major datasets:

  • KuaiRand-Pure: A publicly available dataset from Kuaishou containing user behavior logs and numerous numerical features.
  • Real Industrial Dataset: A massive internal dataset from Kuaishou’s production environment, consisting of 1.29 billion video play records from nearly 44 million users over 8 days. This dataset includes 14-dimensional numerical features covering user activity and video popularity.

Key Insights and Ideas

  • Monotonicity as Regularization: Enforcing logical constraints acts as a powerful form of regularization. Instead of just memorizing noise, the model is forced to learn the semantic meaning behind numerical values.
  • Importance-Based Disturbance: Not all features are equally important. By using Shapley values to decide which feature to "disturb," the framework focuses its learning effort on the variables that actually drive model decisions.
  • The "Mono_rate" Metric: The authors introduced a specific metric to quantify interpretability. It measures the percentage of pairs that follow the expected monotonic trend. Standard models often hover around 50% (no better than a coin flip), while CCSS pushes this to 80-90%.
  • Model Agnostic: Because CCSS happens at the data and loss-function level, it doesn't require changing the internal architecture of the recommendation model, making it highly practical for engineering teams.

Key Results

The results demonstrate that CCSS provides a "free lunch"—improving both logic and performance:

  • Offline Gains: Across various backbones (DNN, Wide & Deep, PNN, DCN, DeepFM), CCSS improved AUC (Area Under the Curve) by at least 6.0% and GAUC (Group AUC) by up to 48.7% on industrial data.
  • Interpretability: The "Mono_rate" (the consistency of the model's logic) jumped from roughly 50% in baseline models to over 80-90% with CCSS.
  • Online Impact: When deployed in Kuaishou’s live recommender system serving hundreds of millions of users, CCSS achieved a 3.93% gain in the "collect_rate" (users adding videos to favorites), a significant margin in the world of high-scale industrial AI.

Limitations and Future Work

  • Single Feature Disturbance: Currently, the framework only disturbs one numerical feature at a time to keep the samples "realistic." Future work could explore multi-feature disturbances to capture more complex monotonic interactions.
  • Computational Overhead: Synthesizing two extra samples for every training instance triples the input data volume during training. While the authors mention it is adoptable in online schemes, this increased training cost might be a hurdle for organizations with limited compute.
  • Feature Selection: The method relies on the assumption that the chosen numerical features should be monotonic. If a feature has a "U-shaped" relationship with the target (where more is not always better), CCSS might inadvertently hurt performance.

Summary updated

BibTeX
@inproceedings{xu2024enhancing,
  author = {Xiaoxiao Xu and Hao Wu and Wenhui Yu and Lantao Hu and Peng Jiang and Kun Gai},
  title = {{Enhancing Interpretability and Effectiveness in Recommendation with Numerical Features via Learning to Contrast the Counterfactual samples}},
  booktitle = {The Web Conference},
  year = {2024},
  doi = {10.1145/3589335.3648345},
}
Figure