Tree-based Text-Vision BERT for Video Search in Baidu Video Advertising

Tan Yu, Jie Liu, Yi Yang, Yi Li, Hongliang Fei, Ping Li

Abstract

In large-scale video advertising, matching user queries to relevant video content requires sophisticated cross-modal understanding. While VisionBERT models offer high accuracy by modeling fine-grained interactions between text and visual regions, their computational complexity makes them prohibitive for real-time retrieval across billions of candidates. This paper presents the Tree-based Combo-Attention Network (TCAN), a novel architecture that integrates heavy cross-modal attention into a hierarchical tree-based retrieval framework. By utilizing a dual-path structure and geometric negative sampling, TCAN reduces search complexity from linear to logarithmic. Deployed at Baidu, the system achieved a 2.29% increase in Click-Through Rate (CTR) and a 2.63% increase in Conversion Rate (CVR), demonstrating the viability of complex BERT-based models in high-throughput industrial search environments.

Introduction

In the domain of search advertising, the ability to accurately match a user's intent—expressed via a text query—to a relevant video advertisement is critical for both user experience and platform revenue. Historically, this matching process relied heavily on query-to-title matching, treating video retrieval as a text-to-text problem. However, video titles are frequently noisy, incomplete, or unrepresentative of the actual visual content, leading to missed opportunities for relevant matches.

While cross-modal models like VisionBERT have emerged to bridge this gap by performing joint attention over text and visual features, they face a significant scaling bottleneck. In an industrial setting like Baidu, which manages billions of queries and videos, the computational cost of performing exhaustive cross-modal attention (a "heavy" operation) against every candidate is infeasible. Most systems resort to a multi-stage pipeline where a fast, less accurate model retrieves a small subset of candidates for a more complex re-ranking model. The risk of this approach is "retrieval bias": if the initial stage fails to find a relevant video due to poor metadata, the high-quality re-ranker never has the chance to evaluate it.

The TCAN Architecture

To address these challenges, the Tree-based Combo-Attention Network (TCAN) was developed to enable high-quality cross-modal matching directly at the retrieval stage. The architecture is built upon three primary innovations:

1. One-stage Combo-Attention (CAN)

Unlike traditional models that process text and vision in separate streams before fusion, TCAN utilizes a single self-attention framework. It simultaneously processes the query tokens, the video’s visual features (extracted as bounding boxes from keyframes), and the video’s title. This allows the model to learn deep, non-linear correlations between specific words in a query and specific regions within the video frames from the very first layer.

2. Dual-Path Structure

A significant hurdle in using attention-based models for retrieval is that attention is a relational metric between two inputs, whereas efficient retrieval (like tree-based or vector-based search) requires static representations. TCAN solves this by employing a dual-path structure. One path generates a global embedding—a single vector representing the video—which is used to construct and navigate the search tree. The second path maintains the full cross-modal attention mechanism, ensuring that the fine-grained nuances of the video content are preserved for the final matching score.

3. Tree Indexing and Distillation

Videos are organized into a hierarchical binary search tree using k-medoids clustering. This structure allows the system to navigate from the root to the leaves, evaluating only $O(\log N)$ nodes rather than $N$ videos. To ensure the system meets the strict latency requirements of live advertising, the researchers employed Knowledge Distillation. A complex 4-layer "teacher" model was used to train a streamlined 2-layer "student" model, maintaining high accuracy while significantly reducing inference time.

Training and Optimization

TCAN was trained on the Daily1.2B dataset, an internal Baidu corpus containing 1.2 billion query-video pairs. For each video, 16 keyframes were sampled, and visual features were extracted using a Faster R-CNN detector. These features were then clustered into 32 representative visual tokens to keep the input sequence manageable.

A key insight during training was the use of Geometric Negative Sampling. In a tree-based retrieval model, the system must learn to distinguish between increasingly similar candidates as it moves deeper into the tree. By sampling negative examples more aggressively from the deeper levels of the hierarchy, the researchers forced the model to learn the fine-grained distinctions necessary for high-precision retrieval.

Results and Industrial Impact

The implementation of TCAN yielded significant improvements in both offline benchmarks and live production environments:

  • Retrieval Accuracy: TCAN achieved a 0.694 mAP@1, a substantial improvement over the 0.627 achieved by standard embedding-only baselines.
  • Search Efficiency: In a database of 10 million videos (requiring a 23-layer tree), TCAN identifies the top candidate using only 45 similarity calculations, compared to the 10 million required by brute-force linear search.
  • Online Performance: Following its deployment on Baidu’s dynamic video advertising platform, the system drove a 2.29% increase in CTR and a 2.63% increase in CVR, proving that better cross-modal understanding translates directly to business value.

Conclusion and Future Work

TCAN demonstrates that the computational hurdles of cross-modal BERT models can be overcome in large-scale industrial applications through clever architectural design and indexing strategies. By moving heavy attention into the retrieval stage via a tree-based structure, Baidu has significantly improved the relevance of video ads.

Future research will focus on optimizing tree maintenance to handle the daily influx of millions of new videos and exploring end-to-end visual feature learning. Currently, the system relies on pre-trained object detectors; tuning these detectors specifically for the nuances of advertising content could further enhance retrieval precision.

Summary updated

BibTeX
@inproceedings{yu2022tree,
  author = {Tan Yu and Jie Liu and Yi Yang and Yi Li and Hongliang Fei and Ping Li},
  title = {{Tree-based Text-Vision BERT for Video Search in Baidu Video Advertising}},
  booktitle = {IEEE Big Data},
  year = {2022},
  doi = {10.1109/bigdata55660.2022.10020922},
}
Figure