RAS: Reflection-Augmented Scaling with In-Context Learning for Executable Cypher Query Generation
On the map: LLM reasoning → Test-time compute and efficient thinking
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Test-time compute and efficient thinking, one of 17 directions in LLM reasoning. Builds on 11 of its 25 references that are in the map. First posted on arXiv 21 May 2026.
Builds on
11 of 25 references.
Closest ancestors · 2
Same direction, newest first
- 2024Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters6 Aug
- 2024Inference Scaling Laws: An Empirical Analysis of Compute-Optimal Inference for Problem-Solving with Language Models1 Aug
Other references · 9
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2024Large Language Monkeys: Scaling Inference Compute with Repeated Samplingcited by 991
- 2023C3: Zero-shot Text-to-SQL with ChatGPTcited by 164
- 2021A Survey on Complex Knowledge Base Question Answering: Methods, Challenges and Solutionscited by 78
- 2024SM3-Text-to-Query: Synthetic Multi-Model Medical Text-to-Query Benchmarkcited by 14
- 2025GraphRAFT: Retrieval Augmented Fine-Tuning for Knowledge Graphs on Graph Databasescited by 7
- 20253D Optimization for AI Inference Scaling: Balancing Accuracy, Cost, and Latencycited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025First Finish Search: Efficient Test-Time Scaling in Large Language Models
- 2026Beam Search, Self-Consistency, and the Limits of Inference-Time Scaling for Grammar-Constrained Text-to-SQL in Small Language Models
- 2024Inference Scaling for Long-Context Retrieval Augmented Generation
- 2025The Art of Scaling Test-Time Compute for Large Language Models
- 2024Towards Evaluating Large Language Models for Graph Query Generation
- 2025A*-Decoding: Token-Efficient Inference Scaling
- 2025Agentar-Scale-SQL: Advancing Text-to-SQL through Orchestrated Test-Time Scaling
- 2026What Drives Recovery in Agentic Text-to-Cypher? LAST-CQ: An LLM Agent Self-Refinement Framework