Add dataset card
Browse files
README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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: Code Explanation SFT (100K)
|
| 10 |
+
tags:
|
| 11 |
+
- code-explanation
|
| 12 |
+
- programming
|
| 13 |
+
- software-engineering
|
| 14 |
+
- developer-tools
|
| 15 |
+
- documentation
|
| 16 |
+
- education
|
| 17 |
+
- sft
|
| 18 |
+
- supervised-fine-tuning
|
| 19 |
+
- synthetic
|
| 20 |
+
configs:
|
| 21 |
+
- config_name: default
|
| 22 |
+
data_files:
|
| 23 |
+
- split: train
|
| 24 |
+
path: code-explanation-sft-100k.jsonl
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# Code Explanation SFT (100K)
|
| 28 |
+
|
| 29 |
+
100,000 ShareGPT conversations demonstrating high-quality code explanation across 10 programming languages and 22 technical concepts. Each example explains real code clearly — with line-by-line breakdowns, analogies for unfamiliar concepts, practical examples, and audience-appropriate vocabulary.
|
| 30 |
+
|
| 31 |
+
## Motivation
|
| 32 |
+
|
| 33 |
+
Code explanation is one of the most common developer tool use cases — and models routinely fail at it:
|
| 34 |
+
|
| 35 |
+
- **Superficial explanations**: "This function adds two numbers" instead of explaining why the code is structured the way it is
|
| 36 |
+
- **No audience calibration**: Explaining Python decorators to a senior developer the same way as to a beginner
|
| 37 |
+
- **Missing the "why"**: Describing what the code does without explaining the design decision or the problem it solves
|
| 38 |
+
- **Wall of text**: Long prose explanations when a table or annotated example would be clearer
|
| 39 |
+
- **Ignoring the language context**: Explaining Go syntax to a Python developer without Python analogues, or explaining Rust lifetimes without context on what problem they solve
|
| 40 |
+
|
| 41 |
+
This dataset trains models to explain code at the right level for the reader, with appropriate analogies, examples, and structure.
|
| 42 |
+
|
| 43 |
+
## Dataset Description
|
| 44 |
+
|
| 45 |
+
**100,000 conversations** across 10 languages and 22 concepts:
|
| 46 |
+
|
| 47 |
+
### Language Distribution
|
| 48 |
+
|
| 49 |
+
| Language | Count | % |
|
| 50 |
+
|---|---|---|
|
| 51 |
+
| Python | ~45,000 | 45% |
|
| 52 |
+
| JavaScript/TypeScript | ~13,500 | 13.5% |
|
| 53 |
+
| SQL | ~9,000 | 9% |
|
| 54 |
+
| YAML (Docker, Kubernetes) | ~9,000 | 9% |
|
| 55 |
+
| Rust | ~4,500 | 4.5% |
|
| 56 |
+
| Go | ~4,500 | 4.5% |
|
| 57 |
+
| Bash | ~4,500 | 4.5% |
|
| 58 |
+
| CSS | ~4,500 | 4.5% |
|
| 59 |
+
| GraphQL | ~4,500 | 4.5% |
|
| 60 |
+
|
| 61 |
+
### Concepts Covered
|
| 62 |
+
|
| 63 |
+
Binary search, array methods, window functions, React hooks, Fibonacci algorithms, Python decorators, generics and interfaces (TypeScript, Java comparison), Rust lifetimes, shell scripting, async/await, dataclasses and ABC, Docker Compose, closures, Kubernetes deployments, tree traversal, database indexes, generators, GraphQL schemas, context managers, Redis caching, CSS Flexbox, JWT authentication, and more.
|
| 64 |
+
|
| 65 |
+
## Format
|
| 66 |
+
|
| 67 |
+
```json
|
| 68 |
+
{
|
| 69 |
+
"conversations": [
|
| 70 |
+
{
|
| 71 |
+
"from": "human",
|
| 72 |
+
"value": "Explain what this Python function does and how it works:\n\n```python\ndef binary_search(arr, target):\n ...\n```"
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"from": "gpt",
|
| 76 |
+
"value": "This function finds the position of a `target` value in a sorted array using binary search...\n\n**How it works:**\n..."
|
| 77 |
+
}
|
| 78 |
+
],
|
| 79 |
+
"metadata": {
|
| 80 |
+
"language": "python",
|
| 81 |
+
"concept": "binary_search",
|
| 82 |
+
"explanation_level": "intermediate"
|
| 83 |
+
},
|
| 84 |
+
"id": "abc123"
|
| 85 |
+
}
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## Key Properties of Responses
|
| 89 |
+
|
| 90 |
+
**1. Audience awareness**: Explanations reference what the asker already knows. A Java developer learning Go gets Java analogues. A beginner gets analogies; an intermediate developer gets implementation details.
|
| 91 |
+
|
| 92 |
+
**2. Line-by-line breakdown when appropriate**: Complex code is annotated line by line rather than described in aggregate. The reader can follow along.
|
| 93 |
+
|
| 94 |
+
**3. Why, not just what**: Every explanation answers both "what does this do" and "why is it written this way." Design decisions are surfaced, not glossed over.
|
| 95 |
+
|
| 96 |
+
**4. Practical examples**: Abstract concepts are grounded with concrete, runnable examples showing input/output.
|
| 97 |
+
|
| 98 |
+
**5. Gotchas and caveats**: Common mistakes and limitations are flagged — the things that burn developers who don't know about them (Python's mutable default arguments, JWT statelessness, SQL N+1 problem, etc.).
|
| 99 |
+
|
| 100 |
+
**6. Comparison to known concepts**: Unfamiliar concepts are anchored to familiar ones (Rust's `?` is like Java's checked exceptions, GraphQL resolvers work like REST endpoints, etc.).
|
| 101 |
+
|
| 102 |
+
## Use Cases
|
| 103 |
+
|
| 104 |
+
- SFT fine-tuning for coding AI assistants (GitHub Copilot, Cursor, Replit)
|
| 105 |
+
- Training AI code documentation generators
|
| 106 |
+
- Building AI tutors for programming education platforms
|
| 107 |
+
- Improving model performance on code comprehension tasks
|
| 108 |
+
- Training models for developer onboarding tools
|
| 109 |
+
- Building AI for code review and explanation in IDE extensions
|
| 110 |
+
|
| 111 |
+
## License
|
| 112 |
+
|
| 113 |
+
Apache 2.0
|