TL;DR
Meta researchers have introduced the Hierarchical Structured Neural Network (HSNN), a framework that brings the expressive power of complex ranking models into the high-speed retrieval stage of recommendation systems. By using a hierarchical index to share computations across groups of items and jointly learning the index with the model via gradient descent, HSNN achieves significant accuracy gains (up to +2.57% in production) while maintaining sublinear inference costs.
What Problem Does This Paper Address?
Recommendation systems typically operate in a "cascade": a fast retrieval stage filters millions of items down to thousands, followed by a computationally heavy ranking stage.
The industry standard for retrieval is Embedding Based Retrieval (EBR) using "Two Tower" models. While efficient, Two Tower models have two major flaws:
- Limited Expressiveness: They rely on a simple dot product between user and item embeddings. This prevents the model from learning complex, non-linear interactions between users and items that are common in ranking models.
- Index Inconsistency: The model training and the index building (e.g., using K-means or HNSW) are usually separate processes. As models undergo continuous online training or as new items enter the system ("item drift"), the static index becomes stale, leading to suboptimal retrieval.
Methods
The authors propose a two-part solution: a new modular architecture and a hierarchical scaling strategy.
1. Modular Neural Network (MoNN)
Instead of two towers, MoNN uses three: a User Tower, an Item Tower, and a dedicated Interaction Tower. The Interaction Tower specifically consumes cross-features (e.g., "has this user engaged with this item's category before?") to capture complex relationships. These are then fused by an "OverArch" (like DHEN or NeuMF) to produce a final score.
To keep the Interaction Tower efficient, the authors introduced Inverted Index Based Interaction Features (I2IF), which allows for fast crossing of sparse features at query time.
2. Hierarchical Structured Neural Network (HSNN)
To scale MoNN to millions of items, HSNN organizes items into a hierarchy (e.g., L1 coarse nodes, L2 medium nodes, and L3 individual items).
- Computation Sharing: A large, complex MoNN operates at the coarse L1 level. Because many items share the same L1 node, this heavy computation is performed only once per group.
- Refinement: As the search moves down the hierarchy, smaller, more efficient MoNNs handle finer-grained item details.
3. Jointly Optimized Indexing (JOIM)
Rather than using a pre-built index, HSNN uses a Learning To Index (LTI) algorithm. It uses an attention-based "soft assignment" that allows the hierarchical index to be learned via standard gradient descent alongside the model parameters. This ensures the index and the model are always perfectly aligned, even during continuous online training.
Datasets
The paper evaluates HSNN using Meta's internal production datasets for Ads recommendation. These datasets involve:
- Scale: Tens to hundreds of millions of items.
- Features: Over 1,000 dense and sparse features.
- Labels: User clicks and conversions.
- Evaluation: Offline metrics include Normalized Entropy (NE) and Recall@K. Online metrics focus on topline ad revenue and engagement.
No public benchmarks were used, which is common for large-scale industrial systems research.
Key Insights and Ideas
- The "Granularity" Trade-off: The authors realized that you don't need a complex model for every single item. You can afford a massive, "ranking-quality" model if its results are shared across a cluster of 1,000 similar items.
- Differentiable Indexing: By replacing the non-differentiable
argmax(used to pick a cluster) with a soft-max/attention mechanism, they turned index building into a standard deep learning optimization problem. - Residual Learning: HSNN uses residual learning between layers—the L2 layer only tries to learn what the L1 layer missed. This makes the hierarchy more efficient and easier to train.
Key Results
HSNN demonstrated massive improvements over the baseline Two Tower models:
- Offline Gains: A 3-layer HSNN achieved a 1.46% gain in Normalized Entropy and a 10% lift in Recall. In the world of large-scale ads, a 0.05% NE gain is usually considered significant.
- Online Impact: When deployed at Meta, HSNN led to a 2.57% increase in topline metrics, a substantial win for a production system of that scale.
- Efficiency: While a vanilla "Large" MoNN would require 24x the infrastructure cost to serve, the hierarchical HSNN achieved better results with only 4.5x the cost, making it practical for real-time retrieval.
Limitations and Future Work
- User-Side Hierarchy: The current hierarchy is built on items. The authors suggest that building a similar hierarchy for users could further improve performance.
- Generative Retrieval: The paper notes the emergence of generative retrieval (treating items as tokens to be generated) and suggests that incorporating generative components into the HSNN framework is a promising future direction.
- Optimization Complexity: The joint optimization requires careful tuning of "softmax temperature" and "warmup strategies" to prevent the index from collapsing into a few nodes.
Summary updated