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 — V3 (uppercase-Snowflake)

Supervised fine-tuning corpus for a Clinical Trial Management System (CTMS) analytics assistant, spanning 7 tasks over a 122-table CTMS schema. This is the V3 build: all SQL uses unquoted identifiers that resolve against the uppercase-identifier Snowflake schema DUMMY_FORTREA_AI_MODEL.FORTREA_AI_MODEL_V3_CAP.

Data is fully synthetic (generated from a CTMS data generator). It contains no real patient, investigator, or trial data.

Contents — 21,019 examples

task examples description
generate_sql 11,514 natural-language question → Snowflake SQL (Vanna-style prompt: schema context + DDL + guidelines)
sql_correction 2,000 broken SQL + execution error → corrected SQL (agentic-retry & regeneration subtasks)
trend_summarizer 2,000 conversation → trend question extraction + pointwise trend hints
summarizer 2,000 conversation → SQL-relevant question extraction + SQL hints
chart 1,505 result dataframe + goal → Plotly chart code (<think> + Python)
classifier 1,000 route a follow-up to SQL / PROFILING / CHART
insight 1,000 result dataframe → grounded natural-language insight
Total 21,019

Splits (80/10/10): train 16,817 · validation 2,101 · test 2,101. Seed-grouped (leakage-safe: examples sharing a source query move together), task-stratified, with verified-only evaluation.

Format

Chat-style, assistant-only loss:

{"messages": [{"role": "system", "content": "..."},
              {"role": "user", "content": "..."},
              {"role": "assistant", "content": "..."}],
 "meta": {"task": "generate_sql", "schema_variant": "v3_cap_uppercase", ...}}

SQL dialect / V3 note

SQL targets Snowflake with standard uppercase identifiers. Identifiers are written unquoted (e.g. SELECT s.study_code FROM study s) so Snowflake folds them to the stored uppercase names (STUDY, STUDY_CODE). A previous V2 build used quoted-lowercase identifiers ("study"."study_code") for a lowercase schema; this V3 build is the port to the uppercase schema.

Verification: every SQL-bearing answer — all 11,514 generate_sql answers and all 2,000 sql_correction corrected answers (13,514 total) — was executed live on FORTREA_AI_MODEL_V3_CAP and returns without error. DuckDB→Snowflake dialect issues were repaired (FIRST/LAST(x ORDER BY y)MIN_BY/MAX_BY, INTERVAL n DAYDATEADD, reserved word user"USER", digit-leading aliases kept quoted). Static check confirms zero quoted-lowercase identifiers remain in any SQL.

Usage

from datasets import load_dataset
ds = load_dataset("persistent-fm/ctms-multitask-sft-v3")
print(ds)                      # train / validation / test
print(ds["train"][0]["messages"])

mixture.json provides suggested per-task sampling temperature weights (√-scaled) to prevent generate_sql from dominating a single multi-task model under uniform sampling.

Provenance & caveats

  • Synthetic CTMS data; a hand-authored + execution-verified corpus.
  • Prompts for generate_sql/sql_correction follow a Vanna-style envelope (schema context + DDL + response guidelines); chart uses a canonical Plotly-code prompt.
  • Intended for SFT of a domain assistant that answers CTMS analytics questions and generates Snowflake SQL against the uppercase V3 schema.
Downloads last month
3