PrismSQL-35B-A3B / README.md
flintglass's picture
Release Flintglass PrismSQL-35B-A3B BF16 part 1 (74.73% Complex SQL #1, +11.77 pts Multi-Joins, 3B-active MoE)
d5188bd verified
|
Raw History Blame Contribute Delete
3.57 kB
---
language:
- en
license: apache-2.0
library_name: transformers
pipeline_tag: text-generation
base_model: Qwen/Qwen3.6-35B-A3B
tags:
- flintglass
- prismsql
- qwen3
- moe
- text-to-sql
- sql
- sqlite
- rlvr
- grpo
- apache-2.0
---
# Flintglass PrismSQL-35B-A3B
**Ultra-Fast 3B-Active MoE Text-to-SQL RLVR Specialist on Apache-2.0 `Qwen/Qwen3.6-35B-A3B` (35B Total / 3B Active Parameters)** — achieving **#1 Complex SQL Execution Accuracy in the Flintglass Stack (`74.73%` across 459 non-basic SQL schemas, `+2.62 pts`)**, **`64.14%` Macro Complexity (+2.15 pts)**, **`+11.77 pts` on Multi-Joins (`64.71%`)**, **`+5.00 pts` on Single Joins (`84.29%`)**, and crisp **`27.1` average tokens (`-13%`)** at **3B-class inference speed**!
> **Part of the [Flintglass Prism Open-Source Agent & RAG Stack](https://huggingface.co/collections/flintglass/flintglass-prism-open-agent-and-rag-stack-6b0df22104aefbb7e8d4fe11)** · **GGUF Quantizations:** [`flintglass/PrismSQL-35B-A3B-GGUF`](https://huggingface.co/flintglass/PrismSQL-35B-A3B-GGUF) (`Q4_K_M`, `Q6_K`)
---
## Verified Zero-Leakage Live-SQLite Execution Results (1,000 Held-Out Schemas)
Every prediction is executed against an isolated in-memory SQLite database populated with schema DDL + sample rows, and verified by normalized result-set equivalence against gold SQL (`enable_thinking=False`, greedy decoding):
| SQL Category | Tasks | `Qwen/Qwen3.6-35B-A3B` (Base) | **`flintglass/PrismSQL-35B-A3B`** | Delta |
|---|---:|---:|---:|---:|
| **Overall SQLite Execution Accuracy** | **1,000** | 81.10% | **82.00%** | **+0.90 pts** |
| **Complex SQL (Non-Basic, 459 tasks)** | **459** | 72.11% | **74.73%** | **+2.62 pts** |
| **Macro Complexity Avg (7 cats)** | **1,000** | 61.99% | **64.14%** | **+2.15 pts** |
| `single join` | 140 | 79.29% | **84.29%** | **+5.00 pts** |
| `multiple_joins` | 17 | 52.94% | **64.71%** | **+11.77 pts** |
| `subqueries` | 49 | 69.39% | **71.43%** | **+2.04 pts** |
| `aggregation` | 224 | 74.11% | **75.45%** | **+1.34 pts** |
| `set operations` | 7 | 28.57% | 28.57% | 0.00 pts |
| `basic SQL` | 541 | **88.72%** | 88.17% | -0.55 pts |
| `window functions` | 22 | **40.91%** | 36.36% | -4.55 pts |
| **Raw Clean SQL Rate** | 1,000 | 86.4% | **88.4%** | **+2.0 pts** |
| **Avg Output Tokens** | 1,000 | 31.3 | **27.1** | **-13%** |
---
## Quickstart (`transformers`)
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "flintglass/PrismSQL-35B-A3B"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
messages = [
{"role": "system", "content": "Return ONLY a valid SQLite SELECT query."},
{"role": "user", "content": "Schema:\nCREATE TABLE orders(id INT, customer_id INT, total REAL);\nCREATE TABLE customers(id INT, country TEXT);\n\nQuestion: Top 5 countries by total revenue."},
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=192, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
```
## Training & Provenance
- **Base Model:** `Qwen/Qwen3.6-35B-A3B` (Apache-2.0, 35B total / 3B active MoE)
- **Algorithm:** Pure On-Policy PPO-Clipped GRPO (`r=32`, 50 steps, `K=8` rollouts/prompt, live in-memory SQLite execution reward). Zero synthetic SFT, zero proprietary distillation.
- **License:** Apache-2.0