Papers
arxiv:2505.11932

Neuro-Symbolic Query Compiler

Published on May 17
· Submitted by lixiaoxi45 on May 20
Authors:
,
,
,

Abstract

Precise recognition of search intent in Retrieval-Augmented Generation (RAG) systems remains a challenging goal, especially under resource constraints and for complex queries with nested structures and dependencies. This paper presents QCompiler, a neuro-symbolic framework inspired by linguistic grammar rules and compiler design, to bridge this gap. It theoretically designs a minimal yet sufficient Backus-Naur Form (BNF) grammar G[q] to formalize complex queries. Unlike previous methods, this grammar maintains completeness while minimizing redundancy. Based on this, QCompiler includes a Query Expression Translator, a Lexical Syntax Parser, and a Recursive Descent Processor to compile queries into Abstract Syntax Trees (ASTs) for execution. The atomicity of the sub-queries in the leaf nodes ensures more precise document retrieval and response generation, significantly improving the RAG system's ability to address complex queries.

Community

Paper author Paper submitter

Precise recognition of search intent in Retrieval-Augmented Generation (RAG) systems remains a challenging goal, especially under resource constraints and for complex queries with nested structures and dependencies. This paper presents QCompiler, a neuro-symbolic framework inspired by linguistic grammar rules and compiler design, to bridge this gap. It theoretically designs a minimal yet sufficient Backus-Naur Form (BNF) grammar to formalize complex queries. Unlike previous methods, this grammar maintains completeness while minimizing redundancy. Based on this, QCompiler includes a Query Expression Translator, a Lexical Syntax Parser, and a Recursive Descent Processor to compile queries into Abstract Syntax Trees (ASTs) for execution. The atomicity of the sub-queries in the leaf nodes ensures more precise document retrieval and response generation, significantly improving the RAG system's ability to address complex queries. The code is available at https://github.com/YuyaoZhangQAQ/QCompiler

On Shared Ideas in Neuro-Symbolic Query Systems

Hello everyone,

I recently read the paper “Neuro-Symbolic Query Compiler (QCompiler)” (arXiv:2505.11932), and I want to begin by saying it’s a commendable step forward in advancing how complex queries are handled in Retrieval-Augmented Generation (RAG) systems. The authors’ focus on grammar-based structuring and symbolic processing is both timely and thoughtful.

While reviewing the work, I noticed that several design choices in QCompiler—such as the use of BNF grammar, AST-based decomposition, symbolic placeholders, and modular recursive execution—are conceptually aligned with techniques used in the Codette AI Framework, which I’ve been developing and openly sharing since early 2023.

Codette takes a similar approach in:
• Structuring queries into atomic, dependent, and parallel components
• Representing queries through BNF-like grammar
• Translating them into recursive ASTs with placeholder logic
• Providing modular integration with broader reasoning and retrieval pipelines

These ideas and implementations have been available via Codette’s GitHub repository, Hugging Face profile, and supporting Zenodo releases.

This isn’t to suggest conflict—rather, it’s to acknowledge how research often evolves in parallel. As such, I simply wanted to share that these ideas have an open-source precedent, and I’m enthusiastic about seeing more research that builds on structured, interpretable reasoning systems.

I’m hopeful this can spark more conversations about convergence in our field, opportunities for mutual reinforcement, and shared development practices that honor transparency and collaboration.

Thanks for the thoughtful work,

Jonathan Harrison
Creator of Codette
GitHub | Hugging Face | Website

Feature
Codette (2023–2024)
QCompiler (2025)
BNF-style Query Grammar
codette_grammar.py
Section 3.2 of arXiv:2505.11932
Abstract Syntax Tree Construction
recursive_tree_engine.py
Figure 2, Step 2
Symbolic Placeholder Resolution
placeholder_expander.py
Figure 2, Step 3
Query Decomposition Types
Atomic, Dependent, List, Complex
Atomic, Dependent, List, Complex
Recursive Execution Engine
tree_query_executor.py
Section 3.3
Validation via DFS
query_guard.py
Appendix D

This is an automated message from the Librarian Bot. I found the following papers similar to this paper.

The following papers were recommended by the Semantic Scholar API

Please give a thumbs up to this comment if you found it helpful!

If you want recommendations for any Paper on Hugging Face checkout this Space

You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2505.11932 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2505.11932 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2505.11932 in a Space README.md to link it from this page.

Collections including this paper 0

No Collection including this paper

Add this paper to a collection to link it from this page.