Reproduce “RetrySQL: text-to-SQL training with retry data for self-correcting query generation” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Alicja Rączkowska, Riccardo Belluzzo, Piotr Zieliński, Joanna Baran, Paweł Olszewski

Researchers at Allegro.com developed RetrySQL, a training methodology that integrates self-correction capabilities directly into the generation process of small, open-source coding Large Language Models (LLMs) for text-to-SQL tasks. Utilizing "retry data" with synthetically introduced errors and corrections, RetrySQL enhanced Execution Accuracy by up to 4 percentage points for OpenCoder 1.5B and enabled small models to achieve performance comparable to much larger proprietary LLMs in end-to-end pipelines.

Key insights

  • Small, pre-trained coding LLMs possess an innate, hidden ability to discern correct versus incorrect reasoning steps, as demonstrated by linear probing achieving 82% balanced accuracy.
  • The "Forward Single" (FS) variant of retry data preparation, which introduces a single erroneous future step followed by a correction, proved to be the most effective strategy for improving text-to-SQL generation.
  • Improvements in accuracy are attributed to a learned self-correction mechanism within the models, evidenced by lower confidence before errors and higher confidence after corrections, along with reduced uncertainty in token predictions.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.