Benchmarking evaluation shows state-of-the-art accuracy in few-shot graph query generation, indicating that multi-granular syntax-guided retrieval enables training-free translation across schemas.
Translating natural language into graph query languages (NL2GQL) enables non-expert users to access graph databases, but supervised parsers depend on large annotated corpora and costly retraining whenever the schema evolves. Few-shot in-context learning offers a training-free alternative, yet its effectiveness hinges on demonstration selection, and conventional retrieval based on sentence-level matching and a single similarity signal often overlooks beneficial exemplars. We propose MGDR-SDR, a training-free approach that applies constituency parsing to derive three complementary representations of the utterance: a shallow abstraction preserving fine-grained lexical and syntactic detail, a deep abstraction exposing the intent-level syntactic skeleton, and a noun phrase list capturing concrete graph elements. These representations drive a multi-granular retrieval procedure that aggregates evidence across dense and sparse channels, yielding broader and more precise demonstration coverage. We evaluate MGDR-SDR on SPARQL generation over KQA Pro and Cypher generation over ZOGRASCOPE. Without any training, it reaches 86.58% Hits@1 on KQA Pro, surpassing strong supervised parsers and setting a new state-of-the-art among few-shot methods, and it transfers across GQL formalisms, attaining the best iid accuracy and a balanced generalization profile that surpasses all open-source few-shot baselines on ZOGRASCOPE. These results show that syntax-derived, multi-granular retrieval is an effective and generalizable strategy for few-shot NL2GQL semantic parsing.
No takes yet. Share an insight, caveat, or question.
Li et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: