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

Minseok Jung, Abhas Ricky, Muhammad Rameez Chatni
5/21/2026
cs.CL

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{jung2026ras,
  title  = {RAS: Reflection-Augmented Scaling with In-Context Learning for Executable Cypher Query Generation},
  author = {Minseok Jung and Abhas Ricky and Muhammad Rameez Chatni},
  year   = {2026},
  eprint = {2605.22937},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.22937v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.22937.svg)](https://codeofpaper.com/paper/2605.22937)

Discussion