TLDR: Query Attribute Modeling (QAM) is a new hybrid search framework that significantly improves search precision and relevance. It works by decomposing open-text queries into structured metadata tags and semantic elements, enabling early filtering and advanced ranking. Tested on the Amazon Toys Reviews dataset, QAM achieved a mAP@5 of 52.99%, outperforming traditional keyword, semantic, and hybrid search methods, making it a robust solution for enterprise and e-commerce search.
In the evolving landscape of digital information, the quest for more precise and relevant search results remains a significant challenge. From the early days of basic keyword matching to the more sophisticated semantic search engines, the goal has always been to understand user intent better. However, even modern hybrid search systems, which combine keyword and semantic approaches, struggle with complex queries that involve both specific attributes and contextual meaning.
A new research paper introduces an innovative solution called Query Attribute Modeling (QAM). This hybrid framework is designed to significantly enhance search precision and relevance by intelligently breaking down user queries. Instead of treating a query as a single block of text, QAM deconstructs it into structured metadata tags and semantic elements. This approach helps reduce irrelevant results and allows for a more focused retrieval of information.
How QAM Works: A Four-Step Process
QAM operates through a systematic four-stage process:
1. Query Decomposition: The first step involves dissecting a user’s query into two main parts: metadata tags and semantic elements. Metadata tags are explicit requirements like product brand, color, or price constraints (e.g., “black dress from Zara under $100”). Semantic elements capture the deeper, contextual intent of the query (e.g., “suitable for formal events”). This decomposition is powered by advanced language models, such as GPT-4, which are adept at parsing complex natural language.
2. Metadata Filtering: Once metadata tags are extracted, they are immediately used to filter the dataset. For instance, if a query specifies “black” and “Zara,” the system quickly eliminates all products that are not black or not from Zara. This early filtering significantly enhances search precision and efficiency by removing irrelevant items before more intensive processing begins.
3. Query and Product Description Similarity Search: With the filtered dataset, QAM then focuses on the semantic elements of the query. It uses semantic embeddings, generated by models like nomic-embed-text-v1, to understand the contextual meaning of both the query and product reviews. Cosine similarity is then calculated to determine how well a product’s qualitative descriptions (often found in reviews) align with the user’s implicit preferences. This step ensures that products matching the user’s intent, even if not explicitly stated in metadata, are prioritized.
4. Final Ranking: The final stage integrates all the information gathered. A cross-encoder model, such as msmarco-MiniLM-L12-en-de-v1, is employed to compute a final relevance score for each product. Unlike simpler models, cross-encoders process the query and product together, allowing for a more nuanced understanding of their relationship. Products are then sorted by these scores, delivering a highly relevant and personalized list of results to the user.
Also Read:
- Unraveling Why AI Reasoning Models Struggle with Complex Multi-Hop Questions
- Enhancing Mathematical Problem-Solving with Knowledge Graphs and Executable Code
Demonstrated Superiority in Experiments
The effectiveness of QAM was rigorously evaluated using the Amazon Toys Reviews dataset, which includes 10,000 unique items and over 40,000 reviews with detailed product attributes. To simulate real-world scenarios, 1,000 diverse queries were generated using GPT-4o, with 200 high-quality queries selected for the final evaluation.
QAM’s performance was compared against several conventional search methods: BM25 keyword search, encoder-based semantic similarity search, cross-encoder re-ranking, and hybrid search (combining BM25 and semantic results via Reciprocal Rank Fusion). The results were annotated for relevance by an LLM (GPT-4) and evaluated using standard metrics like Precision@k (P@k) and Mean Average Precision@k (mAP@k).
The findings clearly demonstrated QAM’s superior performance. It achieved a mean average precision at 5 (mAP@5) of 52.99%, significantly outperforming all other methods. This represents a 28.67% improvement over BM25, 6.5% over semantic search, 8.58% over cross-encoder re-ranking, and 9.96% over hybrid search. QAM also consistently retrieved a higher percentage of relevant results across all Precision@k values, proving its robustness in delivering accurate and contextually relevant search outcomes.
This research establishes QAM as a powerful solution, particularly for enterprise search applications and e-commerce systems, where precise and contextually aware search is crucial. For more technical details, you can refer to the full research paper here.


