# Self-Refining Prompt Induction for Streaming Text-to-SQL

DevFeed: [Self-Refining Prompt Induction for Streaming Text-to-SQL](<https://devfeed.tech/articles/self-refining-prompt-induction-for-streaming-text-to-sql-113644.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.00960>)

Author: Gaetano Rossiello, Alfio Gliozzo, Nandana Mihindukulasooriya, Erick Lee, Nabila Siregar, Lisa Amini

Published: 2026-11-03T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>), [arXiv: Databases](<https://devfeed.tech/sources/arxiv-databases.md>)

Topics: [text2sql](<https://devfeed.tech/topics/text2sql.md>), [Enhancing AI model performance](<https://devfeed.tech/topics/enhancing-ai-model-performance.md>), [Prompt Engineering](<https://devfeed.tech/topics/prompt-engineering.md>), [AI for SQL query generation](<https://devfeed.tech/topics/ai-for-sql-query-generation.md>), [prompt](<https://devfeed.tech/topics/prompt.md>)

Tags: [compression](<https://devfeed.tech/tags/compression.md>), [confluent-cloud](<https://devfeed.tech/tags/confluent-cloud.md>), [cross](<https://devfeed.tech/tags/cross.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-db](<https://devfeed.tech/tags/cs-db.md>), [domains](<https://devfeed.tech/tags/domains.md>), [feedback](<https://devfeed.tech/tags/feedback.md>), [fixed](<https://devfeed.tech/tags/fixed.md>), [flink](<https://devfeed.tech/tags/flink.md>), [generation](<https://devfeed.tech/tags/generation.md>), [generator](<https://devfeed.tech/tags/generator.md>), [induction](<https://devfeed.tech/tags/induction.md>), [inference](<https://devfeed.tech/tags/inference.md>), [instructions](<https://devfeed.tech/tags/instructions.md>), [llm](<https://devfeed.tech/tags/llm.md>), [model](<https://devfeed.tech/tags/model.md>), [model-weights](<https://devfeed.tech/tags/model-weights.md>), [offline](<https://devfeed.tech/tags/offline.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [sql](<https://devfeed.tech/tags/sql.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [text](<https://devfeed.tech/tags/text.md>)

## AI overview

SRPI turns text-to-SQL generation failures into reusable Flink SQL prompt instructions while keeping model weights fixed. A Refiner uses reference-conditioned feedback from three LLM judges; a regression guard checks sampled earlier successes, and a separate Compressor shortens the prompt. Inference uses the frozen prompt without retrieval or query repair. In a controlled synthetic evaluation seeded with 30 expert examples, the induced prompt improved mean judge scores by 7.1-19.2 percentage points across seven Generators, including 85.3% to 97.5% for the induction model. Compression cut prompt length by 52.7% with a 0.19-point score decrease. The evaluation used 335 induction examples and 257 held-out-domain questions; the abstract reports early access and initial user feedback, not broader deployment results.

## Source excerpt

arXiv:2611.00960v1 Announce Type: cross Abstract: Text-to-SQL assistants for streaming engines must handle dialect-specific types, windowing rules, and temporal semantics, including constructs poorly handled by generic prompts. We present Self-Refining Prompt Induction (SRPI), an offline method that converts generation failures into reusable dialect instructions while keeping model weights fixed. A Refiner revises the Generator's prompt using reference-conditioned feedback from three LLM judges; a sampled regression guard checks earlier successes, and a separate Compressor reduces prompt length. Inference uses the frozen prompt without retrieval or query repair. We evaluate cross-domain and cross-model transfer on Confluent Cloud Flink SQL using a controlled synthetic workload seeded by 30 expert-written examples, with 335 induction examples and 257 questions from held-out domains. The same induced prompt improves mean judge scores across seven Generators by 7.1-19.2 percentage points, including an increase from 85.3% to 97.5% for the induction model. A separate compression study reduces prompt length by 52.7% with a 0.19-percentage-point score decrease. An assistant using the induced prompt is in early access, with initial user feedback to inform subsequent refinement.