Abstract
A challenge for natural-language-to-SQL systems involves leveraging historical user context to improve query generation while mitigating privacy and security risks associated with storing raw user data. A method can address this through a privacy-preserving feedback loop. A system can programmatically identify successful query interactions, and then anonymize and synthesize the conversational history into an exemplar composed of a synthetic natural language intent and its corresponding successful structured query language query. These anonymized exemplars may be stored in a shared, decoupled repository. When a user submits a new query, relevant historical exemplars can be retrieved and injected as few-shot examples into a language model's prompt. This process can enable a model to apply complex structural patterns from past interactions to improve the accuracy of new queries, while avoiding the persistence of sensitive historical user data or session information.
Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 License.
Recommended Citation
Rutowski, Tomek; Manickavelu, Paramesh; Hsu, Paul; Mirza, Saeed; and Malesevic, Stevan, "Privacy-Preserving Feedback Loop Using Synthesized Contextual Exemplars", Technical Disclosure Commons, (July 27, 2026)
https://www.tdcommons.org/dpubs_series/11142