sirunchained commited on
Commit
dca809a
Β·
verified Β·
1 Parent(s): ee1cfd6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -33
README.md CHANGED
@@ -1,4 +1,3 @@
1
- ---
2
  license: mit
3
  datasets:
4
  - sirunchained/text-to-sql-dataset
@@ -42,8 +41,7 @@ Converts natural language questions into SQL queries. Supports:
42
  - βœ… `SELECT` queries (with JOINs, aggregations, subqueries)
43
  - βœ… `INSERT` operations
44
  - βœ… `UPDATE` operations
45
- - βœ… `DELETE` operations
46
- - βœ… `INVALID_QUERY` handling for non-SQL requests
47
 
48
  ---
49
 
@@ -54,8 +52,8 @@ Converts natural language questions into SQL queries. Supports:
54
  | **Base Model** | `google/gemma-3-270m-it` |
55
  | **Fine-tuning Method** | LoRA + 4-bit quantization (QLoRA) |
56
  | **Framework** | `trl` (SFTTrainer) |
57
- | **Dataset** | `sirunchained/text-to-sql-dataset` (2500 samples) |
58
- | **Training Epochs** | 10 |
59
  | **Batch Size** | 32 |
60
  | **Learning Rate** | 5e-5 |
61
  | **LoRA Rank (r)** | 8 |
@@ -66,21 +64,16 @@ Converts natural language questions into SQL queries. Supports:
66
 
67
  ## πŸ“ˆ Training Performance
68
 
69
- | Epoch | Training Loss | Validation Loss | Entropy | Num Tokens | Mean Token Accuracy |
70
- |-------|---------------|-----------------|---------|------------|---------------------|
71
- | 1 | 1.043 | 1.266 | 0.879 | 200,895 | 76.2% |
72
- | 2 | 0.674 | 0.904 | 0.827 | 401,790 | 80.6% |
73
- | 3 | 0.651 | 0.750 | 0.725 | 602,685 | 83.0% |
74
- | 4 | 0.681 | 0.666 | 0.669 | 803,580 | 84.1% |
75
- | 5 | 0.584 | 0.636 | 0.625 | 1,004,475 | 84.7% |
76
- | 6 | 0.562 | 0.624 | 0.602 | 1,205,370 | 84.9% |
77
- | 7 | 0.412 | 0.619 | 0.596 | 1,406,265 | 84.9% |
78
- | 8 | 0.752 | 0.619 | 0.592 | 1,607,160 | **85.1%** |
79
- | 9 | 0.832 | **0.617** | 0.594 | 1,808,055 | 85.0% |
80
- | 10 | 0.776 | 0.618 | 0.593 | 2,008,950 | 84.9% |
81
-
82
- > **Best validation loss** was achieved at **epoch 9** (`0.617`).
83
- > **Highest mean token accuracy** on validation was at **epoch 8** (`85.1%`).
84
 
85
  ---
86
 
@@ -135,26 +128,26 @@ The model was trained on [sirunchained/text-to-sql-dataset](https://huggingface.
135
 
136
  | Split | Size |
137
  |-------|------|
138
- | Train | 2,000 samples |
139
- | Validation | 250 samples |
140
- | Test | 250 samples |
141
 
142
  **Dataset format:**
143
  - `text`: Natural language question
144
  - `schema`: Optional database schema
145
- - `query`: Target SQL query or `INVALID_QUERY`
146
 
147
  ---
148
 
149
  ## πŸ§ͺ Evaluation Results
150
 
151
- **Test Set Performance (Epoch 10 model):**
152
 
153
  | Metric | Value |
154
  |--------|-------|
155
- | **Test Loss** | 0.808 |
156
- | **Mean Token Accuracy** | **81.6%** |
157
- | **Entropy** | 0.773 |
158
 
159
  ---
160
 
@@ -181,14 +174,14 @@ LoraConfig(
181
 
182
  # Training Configuration
183
  SFTConfig(
184
- num_train_epochs=10, # Actually ran 30 epochs
185
  per_device_train_batch_size=32,
186
  learning_rate=5e-5,
187
- lr_scheduler_type="cosine",
188
- weight_decay=0.01,
189
  load_best_model_at_end=True,
190
- metric_for_best_model="eval_loss",
191
- greater_is_better=False,
192
  )
193
  ```
194
 
 
 
1
  license: mit
2
  datasets:
3
  - sirunchained/text-to-sql-dataset
 
41
  - βœ… `SELECT` queries (with JOINs, aggregations, subqueries)
42
  - βœ… `INSERT` operations
43
  - βœ… `UPDATE` operations
44
+ - βœ… `DELETE` operations (currently weak at this)
 
45
 
46
  ---
47
 
 
52
  | **Base Model** | `google/gemma-3-270m-it` |
53
  | **Fine-tuning Method** | LoRA + 4-bit quantization (QLoRA) |
54
  | **Framework** | `trl` (SFTTrainer) |
55
+ | **Dataset** | `sirunchained/text-to-sql-dataset` (4518 samples training, 200 validation, 200 test) |
56
+ | **Training Epochs** | 5 |
57
  | **Batch Size** | 32 |
58
  | **Learning Rate** | 5e-5 |
59
  | **LoRA Rank (r)** | 8 |
 
64
 
65
  ## πŸ“ˆ Training Performance
66
 
67
+ | Epoch | Training Loss | Validation Loss | Mean Token Accuracy |
68
+ |-------|---------------|-----------------|---------------------|
69
+ | 1 | 0.800 | 0.700 | 83.8% |
70
+ | 2 | 0.650 | 0.680 | 84.2% |
71
+ | 3 | 0.500 | 0.650 | 84.6% |
72
+ | 4 | 0.350 | **0.640** | **85.1%** |
73
+ | 5 | 0.550 | **0.640** | 83.5% |
74
+
75
+ > **Best validation loss** was achieved at **epoch 4 & 5** (`0.640`).
76
+ > **Highest mean token accuracy** on validation was at **epoch 4** (`85.1%`).
 
 
 
 
 
77
 
78
  ---
79
 
 
128
 
129
  | Split | Size |
130
  |-------|------|
131
+ | Train | 4,518 samples |
132
+ | Validation | 200 samples |
133
+ | Test | 200 samples |
134
 
135
  **Dataset format:**
136
  - `text`: Natural language question
137
  - `schema`: Optional database schema
138
+ - `query`: Target SQL query
139
 
140
  ---
141
 
142
  ## πŸ§ͺ Evaluation Results
143
 
144
+ **Test Set Performance (Epoch 5 model):**
145
 
146
  | Metric | Value |
147
  |--------|-------|
148
+ | **Test Loss** | 0.638 |
149
+ | **Mean Token Accuracy** | **0.830** |
150
+ | **Entropy** | 0.636 |
151
 
152
  ---
153
 
 
174
 
175
  # Training Configuration
176
  SFTConfig(
177
+ num_train_epochs=5,
178
  per_device_train_batch_size=32,
179
  learning_rate=5e-5,
180
+ lr_scheduler_type="constant",
181
+ weight_decay=0.0,
182
  load_best_model_at_end=True,
183
+ metric_for_best_model="mean_token_accuracy",
184
+ greater_is_better=True,
185
  )
186
  ```
187