Abstract
Information retrieval (IR) systems often struggle with short, context-poor user queries, leading to the "vocabulary mismatch" problem. This paper proposes Database-Augmented Query representation (DAQu), a framework that enriches queries by leveraging structured metadata from relational databases. By employing a hierarchical, graph-based set-encoding strategy, DAQu captures complex user context across multiple tables while maintaining efficiency and order invariance. Evaluations across seven retrieval tasks demonstrate that DAQu consistently outperforms existing query expansion methods, including those based on Large Language Models (LLMs).
Introduction
In Information Retrieval (IR), the "vocabulary mismatch" problem is a classic hurdle: a user’s short query might not contain the exact terms found in the most relevant document. While modern dense retrievers (like DPR) help by mapping queries and documents into a shared latent space, they still struggle when the query is "information-poor."
Previous solutions usually involve Query Expansion, where a model adds extra terms to the query. Recently, researchers have used Large Language Models (LLMs) to "hallucinate" relevant context. However, LLMs rely on general parametric knowledge and often lack the specific, private context of a user (e.g., their purchase history or past forum comments). This paper argues that the "gold mine" of context is actually the relational database where the query lives, which contains a web of interconnected information across multiple tables.
Methodology: The DAQu Framework
The authors propose DAQu, which treats the relational database as a structured knowledge source for query augmentation.
Relational Linking and Encoding
When a user issues a query, DAQu identifies the corresponding row in the database and follows foreign key relationships to gather related metadata (e.g., the user’s bio, their previous posts, or tags they’ve used). Database metadata can be massive and has no inherent order. Simply concatenating it into a long string would exceed LLM context limits and ignore the database's structure. Instead, DAQu uses a two-layer hierarchical approach:
- Intra-column Encoding: Encodes and aggregates individual cells within a specific column (e.g., all of a user's past "tags") into a single column-level vector using mean pooling.
- Inter-column Encoding: Aggregates these column-level vectors into a final query-level metadata representation.
Efficient Training and Augmentation
To handle the potentially huge volume of data, the authors use a "two-stage sample selection" strategy. During training, they randomly sample only three attributes per column to update the encoder, preventing overfitting and reducing computational load. The final metadata representation is combined with the original query representation in the latent space using a weighted sum (controlled by a hyperparameter $\lambda$).
Experimental Evaluation
The authors evaluated DAQu on seven different retrieval tasks across three major relational database benchmarks:
- Stack Exchange: Tasks included "Any Answer" and "Best Answer" retrieval, requiring the model to find relevant forum posts based on user history and metadata.
- Amazon Product Catalog: A "Future Purchase Retrieval" task, predicting what a user will buy next based on their review history and product metadata.
- H&M: Another "Future Purchase" task focused on fashion retail transactions.
Key Results and Insights
DAQu consistently outperformed all baselines, including standard DPR, Contriever, and LLM-based expansion methods.
Performance Gains
On the Stack Exchange "Answer Retrieval" task, DAQu improved Recall@10 by up to 18.73% over the no-expansion baseline. The results show that LLM-based expansion (Expan. w/ LLM) can actually hurt performance in these specific tasks because the LLM lacks the specific user-context found in the database.
Structural Advantages
The "aha moment" here is that the structure of the database is a feature in itself. By using a hierarchical graph encoder, the model learns to weigh different types of metadata (like "comments" vs. "tags") differently, which is more effective than treating all metadata as a flat bag of words. Ablation studies revealed that metadata from different tables is complementary. For instance, adding "comments" from a separate table provided a much larger performance boost than just using "tags" from the same table as the query.
Robustness and Efficiency
In case studies, DAQu proved more robust than "Full Metadata Expansion" (which just appends all text). While raw text expansion often introduced "noise" that confused the retriever, DAQu’s latent-space encoding successfully filtered for relevant signals. Despite the extra processing, DAQu only added a marginal overhead to inference time (roughly 1.2x relative to no expansion), making it viable for real-world applications.
Conclusion and Future Work
While DAQu shows significant promise, the authors acknowledge that using relational databases for IR raises privacy concerns, as these databases often contain sensitive personal information. Future work would need to incorporate robust data masking or differential privacy techniques. Additionally, the authors suggest investigating "data pruning" to identify the most useful metadata features before encoding. A logical next step is integrating DAQu into Retrieval-Augmented Generation (RAG) pipelines to see if better query representations lead to more accurate LLM-generated answers.
Summary updated