RAS: Reflection-Augmented Scaling with In-Context Learning for Executable Cypher Query Generation

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Jung, Minseok, Ricky, Abhas, Chatni, Muhammad Rameez
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866911706969538560
author Jung, Minseok
Ricky, Abhas
Chatni, Muhammad Rameez
author_facet Jung, Minseok
Ricky, Abhas
Chatni, Muhammad Rameez
contents Inference-time scaling can reduce errors in structured query generation, but methods to allocate the compute for query code generation remains underexplored. We study Text2Cypher, where language models generate Cypher queries that execute against property graph databases. Non-executable queries constitute a distinct syntactic failure separate from semantic inaccuracy: a syntax error triggers a system-generated error message from the database. These error messages are typically discarded at inference time rather than leveraged through in-context learning (ICL). We compare two inference methods: Independent Scaling (IS), which performs memoryless resampling, and Reflection-Augmented Scaling (RAS), which conditions each new attempt on prior execution feedback via ICL. Across three Neo4j datasets and five code-specialized language models, RAS reduces the Query Execution Error Rate by 41--50% at n{=}5, outperforming IS at 32--38%. Execution errors are not merely failures to discard but actionable feedback, and structuring inference-time compute around them is a more efficient path to executability than scaling independent samples.
format Preprint
id arxiv_https___arxiv_org_abs_2605_22937
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle RAS: Reflection-Augmented Scaling with In-Context Learning for Executable Cypher Query Generation
Jung, Minseok
Ricky, Abhas
Chatni, Muhammad Rameez
Computation and Language
Inference-time scaling can reduce errors in structured query generation, but methods to allocate the compute for query code generation remains underexplored. We study Text2Cypher, where language models generate Cypher queries that execute against property graph databases. Non-executable queries constitute a distinct syntactic failure separate from semantic inaccuracy: a syntax error triggers a system-generated error message from the database. These error messages are typically discarded at inference time rather than leveraged through in-context learning (ICL). We compare two inference methods: Independent Scaling (IS), which performs memoryless resampling, and Reflection-Augmented Scaling (RAS), which conditions each new attempt on prior execution feedback via ICL. Across three Neo4j datasets and five code-specialized language models, RAS reduces the Query Execution Error Rate by 41--50% at n{=}5, outperforming IS at 32--38%. Execution errors are not merely failures to discard but actionable feedback, and structuring inference-time compute around them is a more efficient path to executability than scaling independent samples.
title RAS: Reflection-Augmented Scaling with In-Context Learning for Executable Cypher Query Generation
topic Computation and Language
url https://arxiv.org/abs/2605.22937