Skip to content
#small language model Open access

Balanced Defensive Fine-Tuning for Text-to-SQL on a Small Code Language Model: A Pre-Registered Measurement Report

Oct 2026 · Zenodo (CERN European Organization for Nuclear Research)
Adversarial Robustness in Machine Learning

Abstract

Locally run small language models enable generating SQL from natural language without sending the database schema to third-party servers. However, a model fine-tuned only to "translate the question into SQL" can also translate destructive or unauthorized commands embedded in the prompt. In this report we measure, under a pre-registered protocol, the Balanced SFT method applied with QLoRA (nf4, r=16) on Qwen2.5-Coder-3B-Instruct. In this method each training example is drawn from the attack set with probability α and from the legitimate Spider set with probability 1−α. The compared conditions are: the untrained base model (B0), standard SFT on legitimate data only (A0, α=0), balanced SFT (A.3, α=0.3), and SFT on defense data only (A1, α=1.0). Each trained condition was run with 3 seeds. The test sets consist of 500 attack prompts, 1034 Spider-dev questions, and 24 legitimate questions that contain risky words. Attack success rate (ASR) measured with a database-execution (DB-exec) judge is 61.53% ± 2.53 on A0 and 0.00% on A.3. The difference is −61.53 points, with 95% confidence interval [−64.73; −58.53]. Official test-suite execution accuracy (EX) is 70.25% ± 0.49 on A0 and 69.50% ± 0.88 on A.3. The difference is −0.74 points, with 95% confidence interval [−2.06; 0.55]. Thus H1 (security) and H2 (cost, non-inferiority) pass the pre-specified thresholds. However, the protocol-mandated human judge audit of 100 examples was not performed and will not be performed (Appendix A, S18). ASR was measured only with the automatic DB-exec judge; because judge validity was not tested against human labels, both hypotheses are reported only as supported (provisional), and this label can no longer become definitive. The over-refusal hypothesis H3 remains exploratory because the test set was reduced from 250 to 24: even with 0/24 errors the Wilson upper bound is 13.8% and lies above the 10% threshold. The α=1.0 condition collapsed on all three seeds to a solution that rejects every input. Deviations from the locked plan and unplanned analysis decisions are collected in a single table in Appendix A, with dates and whether they were taken before or after results were seen (11 coded deviations, 6 uncoded decisions; 17 items, 18 rows). Seven of these items were taken after results were seen. Among them are the 14 October 2026 finalization of the decision to stop at 3 seeds, the merging of the category 3/4 rule in the DB-exec judge, and moving the human-audit target from A.3_s11 to A0_s11. The collapse of A1 and the fact that ASR is a proxy measurement are not deviations but a result and a measurement note.

View source

Similar papers

#small language model Dataset Open access Oct 2026

Socratic guiding questions in synthetic arithmetic data: matched LoRA runs (revision v2)

Supporting data, adapters, predictions and code for the article *Low-Cost LoRA Fine-Tuning of Small Language Models for Multi-Step Arithmetic Reasoning* by Jake O'Grady, Asena Isik Gürhan, Chee Fong Ting and Effirul Ramlan (University of Galway). We generated 20,000 GSM8K-derived arithmetic problems with step-by-step s...

O'Grady, Jake, Gürhan, Asena Isik, Chee, Fong Ting et al. · 465 citations
#computer vision Open access Jun 2016

Software Development in Startup Companies: The Greenfield Startup Model

The results are packaged in the Greenfield Startup Model (GSM), which explains the priority of startups to release the product as quickly as possible, and the need to shorten time-to-market, by speeding up the development through low-precision engineering activities.

Carmine Giardino, Nicolò Paternoster, M. Unterkalmsteiner et al. · 178 citations · ⚡14
#computer vision Open access Oct 2016

Software Startups - A Research Agenda

Software startup companies develop innovative, software-intensive products within limited timeframes and with few resources, searching for sustainable and scalable business models.

M. Unterkalmsteiner, P. Abrahamsson, Xiaofeng Wang et al. · 157 citations · ⚡17
#machine learning Review Open access Oct 2016

“Failures” to be celebrated: an analysis of major pivots of software startups

This study conducts a case survey study based on the secondary data of the major pivots happened in 49 software startups, and demonstrates that customer need pivot is the most common among all pivot types.

Sohaib Shahid Bajwa, Xiaofeng Wang, Anh Nguyen-Duc et al. · 127 citations · ⚡15
#computer vision Review Open access May 2015

A survey study on major technical barriers affecting the decision to adopt cloud services

The comparison of adopter and non-adopter sample reveals three potential adoption inhibitor, security, data privacy, and portability, which underlines the importance of the technical and security perspectives for research investigating the adoption of technology.

Nattakarn Phaphoom, Xiaofeng Wang, S. Samuel et al. · 111 citations · ⚡8
#computer vision Open access Feb 2018

Lean Internal Startups for Software Product Innovation in Large Companies: Enablers and Inhibitors

This study investigates how Lean internal startup facilitates software product innovation in large companies and identifies its enablers and inhibitors, and shows the potential of the method-in-action framework to investigate the Lean startup approach in non-startup context.

Henry Edison, Nina M. Smørsgård, Xiaofeng Wang et al. · 78 citations · ⚡6

Related blog posts

MIT News · Artificial Intelligence Oct 15, 2026

AI model decodes the language cells use to communicate

A new computational approach reveals how cells communicate to assemble into tissues. This could accelerate stem cell engineering, improve disease models, and inform therapies.

Microsoft Research Blog Oct 15, 2026

Proof-based general-purpose computing with Magnetar

Zero-knowledge proofs can verify computing results without rerunning workloads or exposing sensitive data. Magnetar helps bring them into the mainstream with support for standard programming languages, major speed gains, and quantum-resistant security. The post Proof-based general-purpose computing with Magnetar appeared first on Microsoft Research.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.