Generating impossible queries
Year: 2025
Type: article
Abstract: Modern databases are not designed to answer queries that rely on information not explicitly stored in their schemas. Here, we present a deep learning-based querying pipeline capable of generating “impossible queries”, those requiring inference over latent relationships, contextual understanding, and multimodal reasoning. Our system integrates Gemini 1.5 Pro and a fine-tuned BERT model to process complex inputs across text, image, and document modalities, enriching static records with derived features. We demonstrate that this architecture enables robust performance across basic, advanced, and integrated reasoning scenarios. Unlike conventional methods limited to explicit fields or handcrafted rules, our approach dynamically identifies subtle attributes, such as the presence of stylized imagery or implicit product features, and translates them into actionable primary key filters. We evaluate the system against state-of-the-art baselines, including CLIP, RAG, and heuristic SQL matches, achieving 99% accuracy across real-world annotated scenarios. The pipeline outperforms traditional CRUD operations in relevance, especially in multi-tenant and cloud-based environments where schema heterogeneity and data complexity are prevalent. Through experiments on Amazon product datasets, we show how our system distinguishes between nuanced cases like stylized versus real photos and infers attributes despite their absence in structured fields. These findings highlight the potential of integrating deep learning into querying frameworks to unlock latent insights and automate reasoning at scale. Our results mark a significant step toward intelligent database systems capable of reasoning beyond their schemas and responding meaningfully to real-world human intent.
Authors: Mehdi Nejjar, Aymane Hassini, Yousra Chtouki
Institution: Al Akhawayn University
Language: English
Subfield: Computer Networks and Communications
Field: Computer Science
Domain: Physical Sciences
Open Access status: gold
Estimated APC paid: $2,340
Funder: Al Akhawayn University in Ifrane
OpenAlex ID: W4411081205
