Two-tower models are a prevalent matching framework for recommendation, which have been widely deployed in industrial applications. The success of two-tower matching attributes to its efficiency in retrieval among a large number of items, since the item tower can be precomputed and used for fast Approximate Nearest Neighbor (ANN) search. However, it suffers two main challenges, including limited feature interaction capability and reduced accuracy in online serving. Existing approaches attempt to design novel late interactions instead of dot products, but they still fail to support complex feature interactions or lose retrieval efficiency. To address these challenges, we propose a new matching paradigm named SparCode, which supports not only sophisticated feature interactions but also efficient retrieval. Specifically, SparCode introduces an all-to-all interaction module to model fine-grained query-item interactions. Besides, we design a discrete code-based sparse inverted index jointly trained with the model to achieve effective and efficient model inference. Extensive experiments have been conducted on open benchmark datasets to demonstrate the superiority of our framework. The results show that SparCode significantly improves the accuracy of candidate item matching while retaining the same level of retrieval efficiency with two-tower models. Our source code will be available at MindSpore/models.
双塔模型是一种流行的推荐匹配框架，在工业应用中得到了广泛部署。双塔匹配在大量项目中的检索效率取得了成功，因为物品塔可以预先计算并用于快速近似最近邻居（ANN）搜索。然而，它面临着两个主要挑战，包括功能交互能力有限和在线服务中的准确性降低。现有方法试图设计新颖的晚交互，而不是点积，但它们仍然无法支持复杂的特征交互，或者导致检索效率降低。为了应对这些挑战，我们提出了一个新的匹配范例，名为SparCode，它支持复杂的特征交互和有效的检索。具体来说，SparCode引入了全交互模块来建模细粒度的查询-项目交互。此外，我们与模型共同训练了一个离散代码的稀疏逆索引，以实现有效且高效的模型推理。我们在公开基准数据集上进行了广泛的实验，以证明我们框架的优越性。结果表明，SparCode在保留与双塔模型相同检索效率的同时，显著提高了候选项目匹配的准确性。我们的源代码将 available at MindSpore/models。