Datasets:
File size: 5,823 Bytes
542d370 35d4c55 542d370 35d4c55 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | ---
language:
- code
license: apache-2.0
task_categories:
- text-generation
tags:
- code
- coding
- synthetic
- instruction-tuning
- sharegpt
- alpaca
- multi-language
- 2b-model
- fine-tuning
size_categories:
- 1M<n<10M
---
# Synthetic Coding Dataset v1
A large-scale synthetic coding dataset designed for training and fine-tuning ~2B parameter language models. Contains **~1.5M instruction-response pairs** spanning **22 programming languages** and **10 task categories**, formatted in the ShareGPT/Alpaca hybrid conversation schema.
## Dataset Summary
| Property | Value |
|---|---|
| **Total Entries** | ~1,500,000 |
| **Total Size** | ~4.48 GB |
| **Format** | JSONL (63 part files) |
| **Schema** | ShareGPT/Alpaca hybrid (conversations array) |
| **Languages** | 22 programming languages |
| **Task Categories** | 10 types |
| **Difficulty Levels** | 4 (beginner to expert) |
| **Generated** | 2026-06-22 |
## Supported Languages
Python, JavaScript, TypeScript, Java, C++, Go, Rust, C#, Ruby, PHP, Kotlin, Swift, Scala, C, Lua, Julia, Elixir, Haskell, OCaml, Dart, R, Bash
## Task Categories
| Category | Description |
|---|---|
| `code_generation` | Write functions, classes, and complete programs |
| `debugging` | Find and fix bugs in existing code |
| `explanation` | Explain programming concepts and code behavior |
| `refactoring` | Improve code quality, readability, and structure |
| `algorithm` | Implement classic and advanced algorithms |
| `system_design` | Design scalable systems and architectures |
| `code_review` | Review and critique code for issues |
| `best_practices` | Language-specific idioms and best practices |
| `design_pattern` | Explain and implement design patterns |
| `data_structure` | Implement and manipulate data structures |
## Difficulty Levels
- **beginner** — Basic syntax, simple loops, conditionals, and introductory concepts
- **intermediate** — Standard design patterns, common algorithms, and typical development tasks
- **advanced** — Complex algorithms, performance optimization, and non-trivial problem solving
- **expert** — System design, architecture decisions, and large-scale engineering challenges
## Data Format
Each line in the JSONL files is a JSON object with the following structure:
```json
{
"id": "unique_identifier",
"source": "synthetic_coding_dataset_v1",
"category": "code_generation",
"language": "Python",
"difficulty": "intermediate",
"conversations": [
{"from": "human", "value": "Write a function that..."},
{"from": "gpt", "value": "Here is the implementation..."}
],
"metadata": {
"task_type": "code_generation",
"has_code": true,
"tokens_approx": 1234
}
}
```
### Field Descriptions
| Field | Type | Description |
|---|---|---|
| `id` | `string` | Unique identifier for the entry |
| `source` | `string` | Dataset source identifier (always `synthetic_coding_dataset_v1`) |
| `category` | `string` | One of the 10 task categories listed above |
| `language` | `string` | Programming language for the task |
| `difficulty` | `string` | One of: `beginner`, `intermediate`, `advanced`, `expert` |
| `conversations` | `array` | Array of message objects with `from` (`human`/`gpt`) and `value` fields |
| `metadata.task_type` | `string` | Mirrors the `category` field |
| `metadata.has_code` | `boolean` | Whether the response contains code blocks |
| `metadata.tokens_approx` | `integer` | Approximate token count for the entry |
## Dataset Structure
The dataset is distributed as 63 JSONL part files:
```
data/
├── coding_dataset_part_001.jsonl
├── coding_dataset_part_002.jsonl
├── ...
└── coding_dataset_part_063.jsonl
```
> **Note:** Two part files (043 and 050) are empty (0 bytes) and can be safely ignored.
## Usage
### Loading with Hugging Face Datasets
```python
from datasets import load_dataset
dataset = load_dataset("your-username/synthetic_coding_dataset_v1", split="train")
print(dataset[0])
```
### Loading Manually
```python
import json
entries = []
for i in range(1, 64):
filepath = f"data/coding_dataset_part_{i:03d}.jsonl"
try:
with open(filepath, "r", encoding="utf-8") as f:
for line in f:
line = line.strip()
if line:
entries.append(json.loads(line))
except FileNotFoundError:
continue
print(f"Loaded {len(entries)} entries")
```
### Filtering by Language or Category
```python
# Filter Python entries
python_entries = [e for e in dataset if e["language"] == "Python"]
# Filter debugging tasks at advanced level
debugging_advanced = [
e for e in dataset
if e["category"] == "debugging" and e["difficulty"] == "advanced"
]
```
## Intended Use
This dataset is designed for:
- **Instruction tuning** of code-generation language models in the ~2B parameter range
- **Fine-tuning** existing base models for coding tasks
- **Research** on multi-language code understanding and generation
- **Benchmarking** code model performance across languages and difficulty levels
## Limitations
- This is a **synthetically generated** dataset. While it covers a broad range of coding tasks, it may not fully represent the complexity and nuance of real-world developer interactions or production codebases.
- The responses are generated by an AI model and may occasionally contain suboptimal solutions, outdated APIs, or minor inaccuracies.
- The dataset has not been manually verified at scale; users are encouraged to perform their own quality filtering based on their specific requirements.
## License
This dataset is released under the **MIT** license.
## Acknowledgements
Generated using large language models for synthetic data creation. Designed to support open-source code model training and research. |