BERT4CTR: An Efficient Framework to Combine Pre-trained Language Model with Non-textual Features for CTR Prediction

Dong Wang, Kavé Salamatian, Yunqing Xia, Weiwei Deng, Qi Zhiang · DOI

Abstract

Although deep pre-trained language models have shown promising benefit in a large set of industrial scenarios, including Click-Through-Rate (CTR) prediction, how to integrate pre-trained language models that handle only textual signals into a prediction pipeline with non-textual features is challenging. Up to now two directions have been explored to integrate multi-modal inputs in fine-tuning of pre-trained language models. One consists of fusing the outcome of language models and non-textual features through an aggregation layer, resulting into ensemble framework, where the cross-information between textual and non-textual inputs are only learned in the aggregation layer. The second one consists of splitting non-textual features into fine-grained fragments and transforming the fragments to new tokens combined with textual ones, so that they can be fed directly to transformer layers in language models. However, this approach increases the complexity of the learning and inference because of the numerous additional tokens. To address these limitations, we propose in this work a novel framework BERT4CTR, with the Uni-Attention mechanism that can benefit from the interactions between non-textual and textual features while maintaining low time-costs in training and inference through a dimensionality reduction. Comprehensive experiments on both public and commercial data demonstrate that BERT4CTR can outperform significantly the state-of-the-art frameworks to handle multi-modal inputs and be applicable to CTR prediction.

Introduction

In the domain of online advertising and search engines, predicting Click-Through-Rate (CTR) is a critical task that directly impacts revenue and user experience. This task requires processing two distinct types of data: textual signals (such as search queries and ad titles) and non-textual signals (such as user demographics, device types, and historical click rates). While Pre-trained Language Models (PLMs) like BERT have set new benchmarks in natural language understanding, integrating them into CTR pipelines remains challenging.

Current approaches typically employ "shallow interaction," where the text model's output is fused with other features only in the final layers, or a "tokenization" approach that converts every numerical feature into a text token. Shallow interaction fails to capture deep cross-modal relationships, while tokenization leads to excessively long input sequences that are too computationally expensive for real-world production environments.

The BERT4CTR Framework

To bridge the gap between text-heavy PLMs and structured non-textual data, we propose BERT4CTR. This framework enables deep cross-modal interaction while maintaining high efficiency.

Input representation for BERT4CTR, illustrating the combination of query, ad, and non-textual features into a single sequence.

Uni-Attention Mechanism

The core innovation of BERT4CTR is the Uni-Attention mechanism. Unlike standard self-attention where every token interacts with every other token, Uni-Attention uses an asymmetric approach. Textual tokens undergo standard self-attention to preserve semantic depth. Meanwhile, non-textual features act as "Queries" that attend to the textual "Keys" and "Values." This allows the model to learn how specific user attributes relate to the query text without the quadratic computational explosion associated with full self-attention across all modalities.

The BERT4CTR architecture, showcasing the Uni-Attention mechanism and the interaction between textual and non-textual components.

Dimensionality Reduction and Training Strategy

Industrial CTR tasks often involve hundreds of features. BERT4CTR maps these into a compact $K$-dimensional embedding space before the attention phase, ensuring that adding more features does not lead to a linear explosion in latency. Furthermore, to prevent the noise of randomly initialized non-textual layers from corrupting the pre-trained knowledge in the BERT model, we utilize a two-step joint training process: a warm-up phase where textual and non-textual parts are trained separately, followed by a final joint fine-tuning step.

Experimental Evaluation

We evaluated BERT4CTR on two massive datasets: the commercial Microsoft Bing Ads dataset (190 million samples with 90 non-textual features) and the public KDD CUP 2012 dataset (235 million samples with 57 non-textual features).

BERT4CTR significantly outperformed state-of-the-art baselines, including DeepFM and NumBERT. On the Bing Ads dataset, it achieved a substantial AUC gain of 0.6%. In terms of efficiency, BERT4CTR reduced training costs by 64% and inference latency by 52% compared to the tokenization-based NumBERT approach. The model showed particularly strong performance on the "Tail Slice" (infrequent query-ad pairs), suggesting that multi-modal fusion helps the model generalize better when text data is sparse.

Conclusion

BERT4CTR demonstrates that early fusion of textual and non-textual features is essential for high-accuracy CTR prediction. By utilizing the Uni-Attention mechanism and dimensionality reduction, the framework achieves deep cross-modal interaction with minimal computational overhead. Future work will explore extending this framework to include visual ad content and applying knowledge distillation for ultra-low latency environments.

Summary updated

BibTeX
@inproceedings{wang2023bert,
  author = {Dong Wang and Kavé Salamatian and Yunqing Xia and Weiwei Deng and Qi Zhiang},
  title = {{BERT4CTR: An Efficient Framework to Combine Pre-trained Language Model with Non-textual Features for CTR Prediction}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2023},
  doi = {10.1145/3580305.3599780},
}
Figure