Hierarchical Multi-field Representations for Two-Stage E-commerce Retrieval

Niklas Freymuth, Dong Liu, Thomas Ricatte, Saab MansourarXiv 2025

Abstract

Dense retrieval methods typically target unstructured text data represented as flat strings. However, e-commerce catalogs often include structured information across multiple fields, such as brand, title, and description, which contain important information potential for retrieval systems. We present Cascading Hierarchical Attention Retrieval Model (CHARM), a novel framework designed to encode structured product data into hierarchical field-level representations with progressively finer detail. Utilizing a novel block-triangular attention mechanism, our method captures the interdependencies between product fields in a specified hierarchy, yielding field-level representations and aggregated vectors suitable for fast and efficient retrieval. Combining both representations enables a two-stage retrieval pipeline, in which the aggregated vectors support initial candidate selection, while more expressive field-level representations facilitate precise fine-tuning for downstream ranking. Experiments on publicly available large-scale e-commerce datasets demonstrate that CHARM matches or outperforms state-of-the-art baselines. Our analysis highlights the framework's ability to align different queries with appropriate product fields, enhancing retrieval accuracy and explainability.

Introduction: The Challenge of Structured Product Data

In e-commerce, a product is not merely a flat string of text; it is a collection of structured fields such as brand, category, title, and description. Traditional dense retrieval methods often flatten this data, losing the inherent hierarchy and relationships between fields. This approach leads to two primary challenges: Intent Mismatch, where simple queries (e.g., "Nike") require different levels of information than complex, specific queries (e.g., "waterproof running shoes with arch support"), and the Multi-Vector Curse, where the computational cost of searching multiple vectors per product can become prohibitive at scale.

Methods: Cascading Hierarchical Attention (CHARM)

The Cascading Hierarchical Attention Retrieval Model (CHARM) introduces a novel way to encode structured e-commerce data by treating product fields as a hierarchy of increasing detail.

Block-triangular Attention

The core innovation of CHARM is the Block-triangular Attention mechanism. Unlike standard Transformers where every token can attend to every other token, CHARM restricts attention based on a predefined field hierarchy. Tokens in a "lower" field (like Brand) cannot see tokens in a "higher" field (like Description). However, tokens in the Description field can attend to everything in the preceding Brand and Title fields. This creates a "cascade" of field-level representations ($h_{p,f}$) where each subsequent vector accumulates information from all previous, simpler fields.

The CHARM architecture featuring the block-triangular attention mechanism and the two-stage retrieval pipeline.

Two-Stage Retrieval Pipeline

This hierarchical structure enables a highly efficient two-stage retrieval process:

  1. Stage 1 (Shortlisting): The model learns an aggregated representation ($h_p$)—a weighted sum of all field vectors. This single vector is used to quickly identify a shortlist of candidate products using standard approximate nearest neighbor search.
  2. Stage 2 (Re-ranking): The query is then compared against every individual field vector of the products in the shortlist. The final score is the maximum similarity found across any of the fields, allowing for precise matching of specific query intents.

Key Insights: Query-Field Alignment

A striking finding from the researchers' analysis is the strong correlation between query length and field matching. As shown in the empirical data, shorter, broader queries tend to align with high-level fields like "Brand" or "Category," while longer, more specific queries match more frequently with detailed fields like "Description" or "Bullet Points."

Average query length across different product fields, demonstrating that more detailed fields attract longer, more specific queries.

This alignment provides inherent explainability. Because the model identifies which specific field provided the best match for a query, it offers a "window" into the retrieval logic, making the system more interpretable than standard black-box dense retrievers.

Experimental Results

CHARM was evaluated using the Multi-Aspect Amazon Shopping Queries (ESCI) dataset across multiple languages. The model consistently outperformed standard BiBERT and Multi-View Representation (MVR) baselines. On the US dataset, CHARM achieved a Recall@10 of 34.77, compared to 33.61 for BiBERT.

Furthermore, the two-stage approach proved highly robust. Even with a shortlist of only 50 items, the first stage successfully captured over 90% of the "true" top matches that would have been found by a full (and much slower) multi-vector search, demonstrating the efficiency of the aggregated representation.

Conclusion and Future Work

CHARM demonstrates that leveraging the structured hierarchy of product data improves both retrieval accuracy and interpretability without sacrificing computational efficiency. Future research may explore learning arbitrary attention graphs to allow the model to discover optimal information flow between fields, as well as utilizing variable-sized embeddings to further optimize storage for simpler fields.

Summary updated

BibTeX
@misc{freymuth2025hierarchical,
  author = {Niklas Freymuth and Dong Liu and Thomas Ricatte and Saab Mansour},
  title = {{Hierarchical Multi-field Representations for Two-Stage E-commerce Retrieval}},
  year = {2025},
  eprint = {2501.18707},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.18707},
}
Figure