You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

CTMS Multi-task SFT — V6

A matched pair of corpora for a clinical-trial-management text-to-SQL agent, differing in exactly one variable: whether generate_sql rows carry a <think> reasoning trace.

run_a (control) run_b (traced)
total 23,049 23,049
train / val / test 18,698 / 2,172 / 2,179 18,698 / 2,172 / 2,179
traced train SQL rows 0 10,125 (81.0%)
gold SQL identical, byte-for-byte identical, byte-for-byte

Tasks

task n
generate_sql 13,490
summarizer 2,000
sql_correction 2,000
trend_summarizer 2,000
chart 1,505
classifier 1,000
insight 1,000
refuse_insufficient 253

⚠️ run_a is a no-SQL-trace control, not a no-trace control: it contains 1,505 chart golds that natively carry <think> blocks. Do not describe it as trace-free.

Verification — every SQL gold runs on Snowflake

15,490 / 15,490 SQL golds execute on Snowflake (FORTREA_AI_MODEL_V3_CAP) and return ≥1 row. Every one carries sf_verified: true, sf_rows and sf_schema.

slice result
new V5 rows 1,999 / 1,999 OK
previously unverified generate_sql 6,015 → 6,007 OK / 8 EMPTY / 0 ERR
sql_correction 2,000 / 2,000 OK
rewritten golds 9 / 9 OK

For the 1,999 new rows, Snowflake row counts were also compared against a 1.48M-row local mirror: 1,999 / 1,999 identical, 0 divergences.

Two production-only bugs were found that no local check could catch, both cases of the mirror being more permissive than Snowflake:

  • COALESCE(MAX(<date>), '(none recorded)') — SQLite accepts a date/text mix, Snowflake rejects it.
  • LIKE is case-insensitive in SQLite and case-sensitive in Snowflake, so a pattern matched 15 rows locally and 9 in production.

What is new in V6 — the refusal branch

The serving prompt instructs three behaviours. Before this release the corpus demonstrated one:

branch before now
1 — context sufficient → emit SQL 15,505 13,490
3 — context insufficient → explain why 0 253
2 — almost sufficient → intermediate_sql probe 0 0 (still open)

So the model was trained that the answer is always SQL, and confabulated instead of declining — the observed production failure was a fabricated join (ORGANIZATION_ID = ADDRESS_ID) that resolved, executed and returned plausible garbage.

253 refusal rows, in two deliberately distinct flavours:

kind n claim
clinical_absent 98 the measurement is not recorded — this is a CTMS (operations) schema, not an EDC (clinical data) one
definition_only 81 EDC_ITEM defines the field; nothing stores a per-subject response
concept_absent 71 the concept appears nowhere at all
table_not_offered 3 the data exists but was not provided in this prompt

The last row-type is separated on purpose: "not in what I was given" and "not in the database" are different claims, and a model that conflates them starts denying data it has simply never been shown.

definition_only is the subtlest and most valuable: EDC_ITEM defines items labelled Sex, Race, Age, Body Weight, Systolic Blood Pressure, ECG Interpretation and more, and no per-subject value for any of them is stored anywhere. A naive model sees ITEM_LABEL = 'Sex' and groups by it. There is a two-hop path (EDC_ITEM → QUESTION.RESPONSE_VALUE → CRF_INFO.SUBJECT_ID) and several golds name it explicitly to explain why it does not answer the question: it carries monitoring checklist answers (Yes/No/Partial/N/A), never a clinical value.

21 counter-examples were also removed — rows whose gold selected from a table absent from its own prompt, i.e. demonstrations of the exact confabulation being corrected. 9 further golds were rewritten to use only offered tables, each verified byte-identical to the original.

Construct coverage (from the 1,999 hand-authored V5 rows)

construct V5 slice pre-V5 corpus
no aggregate 75.5% 0.9%
joins ≥ 3 35.0% 4.1%
LIKE 8.7% 0 uses
NOT EXISTS 7.0% 0.5%
LEFT/OUTER JOIN 6.6% 0.2%
CASE WHEN 5.7% 0.7%
EXCEPT 5.1% 0.1%
NOT IN 4.8% 1 row
UNION / INTERSECT 1.0% / 0.9% 0.1% / 0
"per/each" phrasing 6.9% 65.5%

By category: listing 500 · multihop 600 · negation 399 · daterange 200 · pattern 150 · casewhen 100 · setop 50. All 36 tables the old corpus used ≤20 times are now covered.

Known limitations — read before drawing conclusions

  1. No training run has validated any of this. These are data-quality claims, not accuracy claims.
  2. 19.6% of SQL golds reference a column with a byte-identical twin (five DOCUMENT date columns hold the same values; ADVERSE_EVENT_TERM.LLT_NAME = PT_NAME on all 30,867 rows). On those rows exec-match cannot tell a correct column choice from a wrong one — an upper bound on invisible error, and it makes "column disambiguation" partly untestable on this schema.
  3. Snowflake verification compares row counts, not row contents. A dialect difference that changes values while preserving cardinality is invisible to it.
  4. Refusal rows carry no <think> block in run_b — the refusal prose is the reasoning. So the model sees traced SQL and untraced refusals, which teaches "reason then answer" for one and "answer directly" for the other.
  5. Refusals cannot be scored by exec-match. 18 sit in val and 18 in test, but a correct refusal has no result set; scoring abstention needs a separate check.
  6. 19 eval rows are unanswerable as golded — their prompt lacks a table their gold uses, so a model that correctly declines is marked wrong. Left untouched to preserve comparability with earlier measurements; this is a known defect in the eval set.
  7. Branch 2 (intermediate_sql) still has zero examples.
  8. Questions are shaped by what the retriever can serve. Where a needed table was not retrieved, the question was reworded until it was; rows that could not be made retrievable were dropped and leave no trace, so the corpus under-represents genuinely deep questions.
  9. Traces are backward-rationalized — written with the gold in hand, not generated forward and filtered by execution.
  10. Synthetic source data with degenerate columns: booleans are encoded three ways (140 columns 0/1, 48 'Y'/'N', 5 'Yes'/'No') with no naming convention; SITE_MILESTONE.INITIAL_MILESTONE_FLAG holds date strings; SITE_ADDRESS is 98.8% geographically incoherent.

Suggested use

Train both configs identically and compare. Select on hard-tier exec-match and output entropy — not validation loss, which has picked the wrong arm five times on this project. Score the refusal rows with an abstention check, not exec-match.

Split integrity (V6.1)

Splits are grouped by seed_id and de-duplicated across the split boundary. An audit of V6.0 found 161 eval rows whose question (or whose gold SQL, compared alias-insensitively with the Snowflake row count as corroboration) also appeared in train; 7.2% of the SQL test set was therefore unscoreable. Those eval rows were dropped, plus 11 val/test twins and 27 exact in-split duplicate prompts -- 199 rows in all. The train corpus was left intact, since the paraphrase clusters are legitimate training signal and eval retains ample power.

Verified after the fix: 0 residual cross-split duplicates, 0 shared seed_id, run_a/run_b carry identical ids in identical order, run_a has 0 traced SQL rows, both eval sets are bare (untraced), non-SQL rows are byte-identical across the two configs, and all 15,297 SQL golds are sf_verified.

Two caveats found during the audit and worth knowing: chart golds natively contain a short <think> block in both configs (it is part of that task's output format, not a trace), so the "run_a is untraced" invariant is scoped to generate_sql/sql_correction. And de-duplication must compare the full prompt: insight, summarizer and trend_summarizer end with a boilerplate instruction, so comparing only the last turn collapses every row of those tasks together.

Downloads last month
27