ContextNet: A Click-Through Rate Prediction Framework Using Contextual information to Refine Feature Embedding

Zhiqiang Wang, Qingyun She, Pengtao Zhang, Junlin ZhangarXiv 2021

Abstract

ContextNet is a novel Click-Through Rate (CTR) prediction framework inspired by NLP models like BERT. It dynamically refines feature embeddings based on the "context" of other features present in the same user-item interaction, using multiplicative operations to capture high-order feature crosses. It achieves state-of-the-art accuracy while remaining highly interpretable and computationally efficient enough for real-world deployment.

Introduction

In personalized advertising and recommender systems, accurately predicting the Click-Through Rate (CTR) relies heavily on capturing complex, high-order feature interactions (e.g., the specific combination of "User Age: 25," "App: TikTok," and "Time: Evening").

Historically, deep learning models like DeepFM use shallow Multi-Layer Perceptrons (MLPs) to learn these interactions implicitly, which has proven inefficient. Newer models like xDeepFM explicitly model these interactions but are computationally expensive. Meanwhile, attention-based models (like AutoInt) use additive aggregation (weighted sums), which research shows is suboptimal for capturing distinct feature crosses.

The authors bridge this gap by asking: What if we treat features in a CTR instance like words in a sentence? Just as BERT changes the embedding of the word "bank" depending on whether the context is a river or a financial institution, ContextNet dynamically alters a feature's embedding based on the other features it appears alongside.

Methods

ContextNet moves away from standard static embeddings and introduces a dynamic, layer-by-layer refinement process. The architecture consists of three main parts:

  1. Contextual Embedding Module (TCE): For every feature in an instance, this module aggregates global contextual information from all other features. It uses a two-layer feed-forward network (an aggregation layer and a projection layer) to compress this global context into a vector of the same size as the original feature embedding.
  2. ContextNet Block: This is where the core refinement occurs. The block takes the original feature embedding and merges it with the contextual embedding using a Hadamard product (element-wise multiplication). This multiplicative approach explicitly forces feature crossing. The merged output is then passed through a non-linear transformation. The authors propose two variants for this transformation: ContextNet-PFFN (Point-Wise Feed-Forward Network) and ContextNet-SFFN (Single-Layer Feed-Forward Network).
  3. Prediction Layer: After stacking several ContextNet blocks, the final refined embeddings are fed into a simple linear Logistic Regression layer to output the final CTR prediction.
Figure 1: The overall architecture of ContextNet, illustrating the flow from OneHot input to final prediction through ContextNet Blocks and the Contextual Embedding Module.

To keep the model lightweight, the authors utilize a "share-bottom" parameter strategy, sharing the aggregation layer weights across all feature fields.

Key Insights and Ideas

  • Multiplication beats Addition for Feature Crosses: A major takeaway is that merging context and features multiplicatively (via Hadamard product) is vastly superior to the additive attention mechanisms used in Transformer-based CTR models.
  • Simpler is Better: Surprisingly, the simpler ContextNet-SFFN variant consistently outperformed the more complex ContextNet-PFFN. Removing residual connections and LayerNorm actually yielded a more accurate and faster model, making SFFN highly practical for production.
  • Deep Learning can be Interpretable: Because ContextNet uses a simple linear layer at the very end of its deep architecture, the model is highly interpretable. Practitioners can easily calculate the exact weight and contribution of every dynamically refined feature to the final prediction score.
  • High Trainability: ContextNet blocks can be stacked surprisingly deep. The authors successfully stacked up to 11 blocks (effectively ~40 hidden layers) without suffering from performance degradation.

Key Results

The authors evaluated their framework on four standard, real-world benchmark datasets: Criteo, MovieLens-1M (ML-1m), Malware, and Avazu. ContextNet-SFFN achieved the highest AUC across all four datasets, improving accuracy over the baseline FM model by 2.80% to 11.17%, and beating the popular DeepFM model by 1.06% to 5.02%.

Beyond accuracy, ContextNet is highly efficient. When utilizing the parameter-sharing strategy (Share-A), ContextNet runs only slightly slower than a basic DNN and significantly faster than heavy models like xDeepFM and AutoInt, making it highly viable for real-time applications.

Figure 6: Training efficiency comparison showing seconds per epoch across various models. ContextNet variants maintain high efficiency compared to complex models like xDeepFM.

Conclusion

ContextNet provides a powerful yet efficient framework for CTR prediction by leveraging contextual refinement. While the current TCE module uses linear aggregation, future work may explore more advanced architectures to further enhance global context extraction.

Summary updated

BibTeX
@misc{wang2021contextnet,
  author = {Zhiqiang Wang and Qingyun She and Pengtao Zhang and Junlin Zhang},
  title = {{ContextNet: A Click-Through Rate Prediction Framework Using Contextual information to Refine Feature Embedding}},
  year = {2021},
  eprint = {2107.12025},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.12025},
}
Figure