Source-linked AI summary

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

Niklas Freymuth, Dong Liu, Thomas Ricatte, Saab Mansour

arXiv:2501.18707v1cs.IR

TL;DR

Dense retrieval often targets unstructured text, although e-commerce products contain multiple structured fields that can support different query matches. CHARM uses hierarchical field representations and aggregated vectors in a two-stage retrieval pipeline. It matches or outperforms state-of-the-art baselines, with reported reductions in computational cost and field-specific query alignment.

  • Problem

    Dense retrieval typically targets unstructured text, while e-commerce products contain multiple structured fields that are important potential sources of retrieval information.

    Source: §1 · p. 1
  • Method

    CHARM uses block-triangular attention to create hierarchical field-level product representations and aggregates them for initial shortlisting before field-level matching.

    Source: §1 · pp. 1–2
  • Results

    CHARM outperforms common bi-encoder methods and matches or outperforms multi-representation approaches, while significantly reducing computational cost.

    Source: §1 · p. 2
  • Takeaways & Limitations

    More complex product fields yield increasingly diverse representations, and intricate queries tend to align with similarly complex fields.

    Source: §7 · p. 9

Abstract

from arXiv · show

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.

1 Introduction

E-commerce products contain structured fields that can match diverse shopping intents, but dense retrieval has largely focused on unstructured text. CHARM builds hierarchical field-level representations and uses aggregated vectors for shortlisting before field-level matching; experiments report strong baseline comparisons and lower computational cost.

1 Introduction

  • Dense retrieval commonly represents unstructured text, while e-commerce products contain fields such as brand, category, title, and description that support varied matching needs.Prior multi-field work has largely addressed auxiliary pre-training tasks rather than directly adapting retrieval.Source: §1 · p. 1
  • A block-triangular attention mechanism builds cascading field-level representations, with each representation accumulating information from its own and all preceding product fields.The method treats fields as different encodings of the same product at varying levels of detail.Source: §1 · pp. 1–2
  • An aggregated representation selects a shortlist, after which query similarity is compared with individual field-level representations for more precise matching.This avoids performing the costly field-level similarity search across the full product collection.Source: §1 · p. 2, Figure 1 · p. 2
  • CHARM matches or outperforms state-of-the-art baselines, including multi-representation approaches, while significantly reducing computational cost through two-stage retrieval.The evaluation uses a public collection of large-scale e-commerce datasets.Source: §1 · p. 2

2 Related Work

Related work advances dense retrieval and multi-field product learning, but existing approaches face constraints in field supervision, representation depth, or retrieval cost. CHARM directly changes encoder attention to build hierarchical field representations in one forward pass.

2 Related Work

  • Dense retrieval commonly uses Transformer and BERT-based dual encoders, but most approaches do not exploit the rich multi-field structure of e-commerce products.Prior extensions include multitask optimization [1], query expansion, and token-level embeddings [23].Source: §2 · p. 2
  • MADRAL uses categorical field labels that require pruning, while MURAL [52] avoids labels but struggles to give complex descriptions semantic depth from token embeddings.Both approaches generate or align field-specific representations.Source: §2 · p. 2
  • Other multi-field methods [51] primarily improve field relationships during auxiliary masked-language-model pre-training, whereas CHARM modifies information processing in the product encoder.The cited pre-training objectives support later aggregation into a single retrieval representation [7] [8] [34].Source: §2 · p. 3
  • Multiple-representation retrieval methods and [19] increase retrieval cost as the number of product representations grows.MVG [19] may require retrieving many items to retain a fixed number of unique results after de-duplication.Source: §2 · p. 3
  • Prior two-stage systems [28] combine field-level dense and traditional retrieval for reranking, while CHARM conditions each field representation on preceding fields in one encoder pass.Joint retrieval-and-ranking methods [45] still require separate retrieval and ranking models.Source: §2 · p. 3

3 Methodology

The methodology builds on a shared-backbone dual encoder and organizes product fields into a hierarchy. CHARM uses block-triangular attention to produce field-level and aggregated representations for a two-stage retrieval pipeline.

3.1 Preliminaries

  • The dual encoder maps product and query encodings into the same latent space using a shared BERT backbone and aligns them with an InfoNCE loss.The loss uses the query embedding, a positive product embedding, and other product embeddings in the batch.Source: §3.1 · p. 3

3.2 Cascading Hierarchical Attention Retrieval Model

  • CHARM produces one retrieval vector per prefix of the ordered product fields, with each successive vector incorporating additional field information.The block-triangular attention structure lets tokens attend to their own field and all previous fields, generating increasingly detailed representations in one pass.Source: §3.2 · pp. 3–4, Figure 2 · p. 4

Evaluation.

  • The product index stores both field-level vectors and an aggregated vector; retrieval first shortlists products by the aggregate, then scores shortlist products using their field vectors.The method requires O(N(M + k|F|)) comparisons, compared with O(NM|F|) for full field-dependent retrieval.Source: Evaluation · p. 4
  • CHARM trains the aggregate and individual field representations with multiple InfoNCE losses, including an additional loss favoring the field vector most similar to the query.The block-triangular structure supports diverse field representations without an explicit diversity loss.Source: Evaluation · pp. 4–5

4 Experiments

Experiments use multilingual product-search data and compare CHARM with single- and multi-representation baselines. Ablations vary attention, losses, query representation, and field ordering.

4.1 Datasets

  • The English, Spanish, and Japanese datasets contain thousands of queries, hundreds of thousands of products, and exact, substitute, complementary, or irrelevant labels.Training samples an exact match as a positive and another labeled product as a hard negative.Source: §4.1 · p. 5

4.2 Implementation Details

  • Training uses product-corpus MLM pre-training, a shared BERT backbone, unit loss weights, and 200 epochs with batch size 1024.Gradient caching enables in-batch negatives at this batch size.Source: §4.2 · p. 5

4.3 Baselines

  • Baselines include MVR, which uses multiple product representations but lacks two-stage evaluation, and BiBERT variants testing all fields, title-only input, and omission of MLM pre-training.MURAL is also included, but its supervised pre-training makes its results not directly comparable; MADRAL is omitted because MURAL outperformed it in its paper.Source: §4.3 · pp. 5–6

4.4 Ablation Experiments

  • Ablations vary full versus block-diagonal attention, loss terms, query representation, and field order to test hierarchy, diversity, and retrieval importance.Block-diagonal attention yields independent fields, while full attention gives every representation access to all fields; the tested alternative order is Title, Bullet Points, Category, Brand, Description, and Color.Source: §4.4 · p. 6

5 Results

CHARM generally performs best across retrieval tasks, and its two-stage evaluation improves most metrics over evaluations of comparable cost. Ablations identify contributions from its losses, attention structure, and field ordering.

5.1 Metrics

  • The evaluation reports Recall@10/100, NDCG@50, and classifier-based Precision@5/10 for two-stage retrieval with a 100-product shortlist.Exact pairs are positives for recall; NDCG weights exact, substitute, complementary, and irrelevant pairs as 1.0, 0.1, 0.01, and 0.0.Source: §5.1 · p. 6

5.2 Retrieval Performance

  • CHARM generally performs best across tasks, and two-stage retrieval improves metrics other than Recall@100 over evaluations of comparable cost.The aggregated representation is on par with or better than regular BiBERT; with a 100-product shortlist, Recall@100 is unchanged between aggregated and two-stage evaluation.Source: §5.2 · p. 6

5.3 Ablation Results

  • Each loss term contributes to US two-stage performance, while adding MVR’s diversity loss provides no gain.Setting λAgg = 0 yields a poorer shortlist and sharply degrades Recall@100, although top matches such as R@10 are less affected.Source: §5.3 · p. 6, Table 2 · p. 7
  • Higher-level product fields generally match longer queries by closest dot-product similarity.Figure 3 relates average query length to the field matched.Source: Figure 3 · p. 7
  • Full attention lacks representation diversity even with a diversity loss, while retrieval-importance field ordering slightly decreases performance.The authors suggest that shorter, more compressed fields early in the hierarchy benefit the model.Source: §5.3 · p. 7

6 Further Analysis

Further analysis finds that CHARM’s field representations vary in detail and match query complexity, while its aggregate weights and field matches show interpretable patterns. Two-stage retrieval preserves many high-quality matches in its initial shortlist.

6.1 Diversity of Field-level Representations

  • More detailed product fields have greater corpus-level representation diversity, and longer queries tend to match representations from longer fields.The analysis uses query character count as a proxy for complexity and reports Euclidean distance, dot-product similarity, and log-determinant diversity measures.Source: §6.1 · p. 7, Table 3 · p. 7

6.2 Query-Product Match Analysis

  • Media products place higher aggregate weights on Description than clothing, while Title is the most frequent top-10 matched field in the US dataset.The authors suggest extra fields may add unnecessary information for some queries.Source: §6.1 · p. 7, §6.2 · p. 7, Figure 4 · p. 8
  • Most queries match two or three fields among top-10 results, and qualitative examples show different products matching the same query through fields that add information beyond preceding fields.Table 4 presents query, matched-field, and previous-field examples.Source: §6.2 · p. 7, Table 4 · p. 8
  • CHARM achieves higher product-type entropy than MVR and BiBERT across all examined top-k values, indicating more diverse product types in its matches.Entropy is averaged across queries from the product types present in each query’s top-k results.Source: §6.2 · p. 8, Figure 5 · p. 8

6.3 Two-stage retrieval

  • With a shortlist size of 50, the initial stage captures over 90% of the true top-10 matches from the best-matching fields.Figure 6 plots recall across top-k retrievals for shortlist sizes 50, 75, and 100.Source: §6.3 · p. 8, Figure 6 · p. 8

7 Conclusion

CHARM encodes product fields as increasingly detailed representations, then combines them for shortlisting and field-level re-evaluation. Its empirical validation reports effectiveness against state-of-the-art baselines, while future work proposes broader field-attention patterns and field-specific retrieval dimensions.

7 Conclusion

  • A single forward pass creates increasingly detailed field-level representations, which are aggregated for efficient shortlisting before query-product matches are re-evaluated against individual fields.The attention structure lets each field’s tokens attend to tokens in that field and all previous fields.Source: §7 · pp. 8–9
  • The model’s empirical validation finds that leveraging multiple fields and their emerging diversity is effective against state-of-the-art baselines, with deeper fields tending to represent more complex queries.Ablations validate each component, and the field representations are described as diverse and interpretable.Source: §7 · p. 9
  • Future work proposes generalizing the attention matrix to arbitrary communication between selected field subsets and varying retrieval dimensions by field information content.Source: §7 · p. 9

A Block-triangular Attention

  • Figure 7’s rows and columns represent token attention; two-colored cells mark cross-field attention, while red dotted cells mark masked attention that limits each field to itself and earlier fields.The resulting cascade gives later fields’ token vectors increasingly detailed information.Source: Figure 7 · p. 11

B Datasets

The appendix describes dataset statistics for three Multi-Aspect Amazon Shopping Queries subsets and reports shared training and evaluation settings. The supplied passages do not include the statistics’ values.

B Datasets

  • Table 5 covers train and evaluation query counts, average positive and negative product pairs, and full-corpus size for the US, ES, and JP subsets.Source: B Datasets · p. 11, Table 5 · p. 11

C Hyperparameters

  • Experiments used Adam with linear learning-rate scheduling and a 0.1 warm-up ratio, 16-bit floating-point operations, gradient-norm clipping at 1.0, and four Nvidia V100 GPUs.Source: C Hyperparameters · p. 11

C.1 MLM Pre-training.

MLM pre-training uses shared listed parameters across datasets, with dataset-specific model and training-step choices for non-English subsets.

C.1 MLM Pre-training.

  • The resulting checkpoints initialize experiments; non-English ES and JP use mBERT and 30,000 training steps, versus 40,000 for US.The passage attributes the reduced step count to mBERT’s more expensive run time from its larger token vocabulary.Source: §C.1 · p. 11
  • Table 6 lists MLM pre-training parameters, with parameters listed once shared across datasets.Source: Table 6 · p. 11, §C.1 · p. 11

C.2 Training Setup and Hyperparameters.

The training setup passage names the software used for the experiments and contrastive training.

C.2 Training Setup and Hyperparameters.

  • Experiments were implemented in PyTorch with Hugging Face Transformers and Tevatron for contrastive training.Source: §C.2 · p. 11

training.

Contrastive training starts from each dataset’s final MLM-pretraining checkpoint and uses gradient caching to accommodate a batch size of 1024. Retrieval uses FAISS-GPU with full dot-product similarity search.

training.

  • FAISS-GPU performs retrieval with full similarity search using dot-product similarity.Source: training · p. 11
  • Gradient caching lets contrastive training use a batch size of 1024, allowing all batch samples to serve as in-batch negatives.The batch size does not fit into memory without gradient caching.Source: training · p. 11
  • Contrastive training initializes each dataset’s runs from its final MLM-pretraining checkpoint.The same hyperparameters are used for other methods unless noted otherwise.Source: training · p. 11
  • Table 7 lists CHARM’s contrastive-training parameters, with parameters listed once shared across datasets.Source: Table 7 · p. 11
Loading 2501.18707v1…