Add dataset card
Browse files
README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
size_categories:
|
| 6 |
+
- 100K<n<1M
|
| 7 |
+
task_categories:
|
| 8 |
+
- text-generation
|
| 9 |
+
pretty_name: Structured Output SFT (100K)
|
| 10 |
+
tags:
|
| 11 |
+
- structured-output
|
| 12 |
+
- json
|
| 13 |
+
- yaml
|
| 14 |
+
- csv
|
| 15 |
+
- xml
|
| 16 |
+
- markdown
|
| 17 |
+
- json-schema
|
| 18 |
+
- openapi
|
| 19 |
+
- formatting
|
| 20 |
+
- sft
|
| 21 |
+
- supervised-fine-tuning
|
| 22 |
+
- synthetic
|
| 23 |
+
configs:
|
| 24 |
+
- config_name: default
|
| 25 |
+
data_files:
|
| 26 |
+
- split: train
|
| 27 |
+
path: structured-output-sft-100k.jsonl
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
# Structured Output SFT (100K)
|
| 31 |
+
|
| 32 |
+
100,000 ShareGPT conversations demonstrating correct generation of structured data formats: JSON, YAML, CSV, XML, Markdown tables, JSON Schema, and OpenAPI fragments. Each example pairs a natural language specification with a valid, well-formed output.
|
| 33 |
+
|
| 34 |
+
## Motivation
|
| 35 |
+
|
| 36 |
+
Structured output generation is among the most commercially critical LLM capabilities. Models fail in characteristic ways:
|
| 37 |
+
|
| 38 |
+
- **Invalid JSON**: unclosed brackets, trailing commas, unquoted keys, mismatched types
|
| 39 |
+
- **Schema violations**: required fields missing, wrong types, values outside enum constraints
|
| 40 |
+
- **Nesting errors**: objects where arrays expected, flat structure instead of hierarchy
|
| 41 |
+
- **Format inconsistency**: CSV with inconsistent quoting, XML without closing tags, YAML indentation errors
|
| 42 |
+
- **Semantic errors**: technically valid JSON that violates the intended schema
|
| 43 |
+
|
| 44 |
+
This dataset trains models to produce valid, semantically correct structured output from natural language specifications.
|
| 45 |
+
|
| 46 |
+
## Dataset Description
|
| 47 |
+
|
| 48 |
+
**100,000 conversations** across 7 output formats and 20 task types:
|
| 49 |
+
|
| 50 |
+
### Format Distribution
|
| 51 |
+
|
| 52 |
+
| Format | Count | % |
|
| 53 |
+
|---|---|---|
|
| 54 |
+
| JSON | ~36,400 | 36% |
|
| 55 |
+
| YAML | ~18,200 | 18% |
|
| 56 |
+
| Markdown Tables | ~18,200 | 18% |
|
| 57 |
+
| CSV | ~13,600 | 14% |
|
| 58 |
+
| JSON Schema | ~4,500 | 5% |
|
| 59 |
+
| Markdown (docs) | ~4,500 | 5% |
|
| 60 |
+
| XML | ~4,500 | 5% |
|
| 61 |
+
|
| 62 |
+
### Task Categories
|
| 63 |
+
|
| 64 |
+
| Category | Examples |
|
| 65 |
+
|---|---|
|
| 66 |
+
| Data extraction (text to JSON) | 4,546 |
|
| 67 |
+
| Schema/config design | 13,637 |
|
| 68 |
+
| API design (request/response/error formats) | 9,091 |
|
| 69 |
+
| Infrastructure config (Docker, Kubernetes, CI) | 13,637 |
|
| 70 |
+
| Data generation (sample/test data) | 9,091 |
|
| 71 |
+
| Data formatting (tables, reports) | 9,090 |
|
| 72 |
+
| Data modeling (trees, state machines) | 9,090 |
|
| 73 |
+
| Technical documentation | 4,545 |
|
| 74 |
+
| Geospatial (GeoJSON) | 4,545 |
|
| 75 |
+
| ML results (confusion matrices) | 4,545 |
|
| 76 |
+
| Time-series data | 4,545 |
|
| 77 |
+
|
| 78 |
+
## Format Example
|
| 79 |
+
|
| 80 |
+
```json
|
| 81 |
+
{
|
| 82 |
+
"conversations": [
|
| 83 |
+
{
|
| 84 |
+
"from": "human",
|
| 85 |
+
"value": "Extract the following information into JSON: 'John Smith, 34 years old, works as a software engineer at Acme Corp...'"
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"from": "gpt",
|
| 89 |
+
"value": "```json\n{\n \"name\": \"John Smith\",\n \"age\": 34,\n ...\n}\n```"
|
| 90 |
+
}
|
| 91 |
+
],
|
| 92 |
+
"metadata": {
|
| 93 |
+
"format": "json",
|
| 94 |
+
"topic": "user_profile_schema",
|
| 95 |
+
"output_format": "json",
|
| 96 |
+
"task": "extraction"
|
| 97 |
+
},
|
| 98 |
+
"id": "abc123"
|
| 99 |
+
}
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
## Key Properties of Responses
|
| 103 |
+
|
| 104 |
+
**1. Syntactic validity**: Every JSON/YAML/CSV/XML output is syntactically valid and would parse without errors.
|
| 105 |
+
|
| 106 |
+
**2. Schema adherence**: When a schema is specified (required fields, type constraints, enum values, length limits), the output strictly follows it.
|
| 107 |
+
|
| 108 |
+
**3. Semantic correctness**: Beyond syntax, outputs are semantically meaningful -- GeoJSON coordinates are [lon, lat] not [lat, lon]; polygon rings are closed; state machine terminal states have no transitions.
|
| 109 |
+
|
| 110 |
+
**4. Format-specific conventions**: XML declarations, RSS version attributes, GeoJSON `FeatureCollection` wrapper, YAML `---` document separator, CSV quoting -- each format's conventions are followed.
|
| 111 |
+
|
| 112 |
+
**5. Explanatory notes**: Where non-obvious choices are made (coordinate order, ring closure, terminal states), responses explain why.
|
| 113 |
+
|
| 114 |
+
**6. Production-quality patterns**: Kubernetes Deployments use `readOnly`, Docker Compose uses named volumes, GitHub Actions use pinned action versions (`actions/checkout@v4`).
|
| 115 |
+
|
| 116 |
+
## Real-World Use Cases Covered
|
| 117 |
+
|
| 118 |
+
- **REST API design**: request bodies, response envelopes, error formats, pagination
|
| 119 |
+
- **Infrastructure as Code**: Kubernetes Deployments, Docker Compose, GitHub Actions CI/CD
|
| 120 |
+
- **Data schemas**: JSON Schema, OpenAPI component schemas, Pydantic-like definitions
|
| 121 |
+
- **Data exchange**: webhook payloads, GeoJSON features, RSS feeds
|
| 122 |
+
- **Analytics**: comparison tables, time-series, confusion matrices, cohort data
|
| 123 |
+
- **Configuration**: server config with nested structure, environment-specific settings
|
| 124 |
+
- **Documentation**: API endpoint docs with request/response examples
|
| 125 |
+
|
| 126 |
+
## Use Cases for Training
|
| 127 |
+
|
| 128 |
+
- SFT fine-tuning for structured output reliability
|
| 129 |
+
- Training models for JSON mode and function calling
|
| 130 |
+
- Improving model performance on schema-following benchmarks
|
| 131 |
+
- Building AI data entry, extraction, and transformation pipelines
|
| 132 |
+
- Training code assistants that generate config files correctly
|
| 133 |
+
- Complementary to `json-structured-output-dpo-3k` (small DPO) -- this provides large-scale SFT
|
| 134 |
+
|
| 135 |
+
## License
|
| 136 |
+
|
| 137 |
+
Apache 2.0
|