Datasets:

Modalities:
Tabular
Text
Formats:
parquet
Languages:
English
ArXiv:
License:
File size: 6,728 Bytes
b34004b
71713cc
9379442
 
 
 
 
 
 
 
28a5abc
 
 
9379442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b34004b
9379442
71713cc
9379442
71713cc
28a5abc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9379442
 
 
 
 
 
 
 
28a5abc
 
 
 
 
 
 
 
 
 
9379442
 
 
28a5abc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9379442
 
28a5abc
 
 
 
 
 
9379442
28a5abc
9379442
28a5abc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9379442
 
 
 
 
 
28a5abc
 
 
 
 
 
 
 
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
---
pretty_name: codeLens
language:
- en
task_categories:
- text-generation
tags:
- code
- sft
- reinforcement-learning
- code-generalization
- category-annotation
- ablation
license: other
license_name: source-specific-licenses
license_link: LICENSE
size_categories:
- 10K<n<100K
configs:
- config_name: kodcode_sft
  default: true
  data_files:
  - split: train
    path: data/kodcode/sft/train.parquet
  - split: validation
    path: data/kodcode/sft/validation.parquet
- config_name: kodcode_rl
  data_files:
  - split: train
    path: data/kodcode/rl/train.parquet
  - split: validation
    path: data/kodcode/rl/validation.parquet
- config_name: taco_leetcode_sft
  data_files:
  - split: train
    path: data/taco_leetcode/sft/train.parquet
  - split: validation
    path: data/taco_leetcode/sft/validation.parquet
- config_name: taco_leetcode_rl
  data_files:
  - split: train
    path: data/taco_leetcode/rl/train.parquet
  - split: validation
    path: data/taco_leetcode/rl/validation.parquet
---

# codeLens

codeLens brings together curated data from **KodCode, TACO, and
LeetCodeDataset** for studying how code training affects generalization across
tasks and algorithmic categories. We clean and organize the source data, add
LLM-assisted category annotations to the KodCode portion, and provide SFT and RL
configurations with reproducible category-ablation subsets.

## What we contribute

- **Data curation.** We select and prepare source problems for training. For
  KodCode, this includes deduplication by original question, interface repair,
  static checks, and reference-solution execution checks, yielding 36,074 problems.
- **Category annotation and organization.** We use an LLM API to classify
  KodCode problems, retain the classification reasons and review records, and
  map the reviewed labels into ten categories. For TACO and LeetCodeDataset, we
  organize the existing upstream tags into seven ablation groups; these are
  not new API annotations.
- **Support for controlled experiments.** We provide SFT examples, RL prompts
  and execution-based reward tests, validation splits, and the recorded sample
  IDs used for category-removal experiments. This lets users compare training
  on the full corpus with training on a specified ablation subset.

The underlying problems, reference answers, and tests come from the credited
upstream datasets. Our work is the curation, additional annotation, category
mapping, and preparation of these research configurations.

## Data configurations

| Configuration | Train | Validation |
|---|---:|---:|
| `kodcode_sft` | 35,974 | 100 |
| `kodcode_rl` | 35,974 | 100 |
| `taco_leetcode_sft` | 21,779 | 100 |
| `taco_leetcode_rl` | 17,249 | 100 |

Choose an **SFT** configuration for supervised training on reference answers, or
an **RL** configuration for training with execution-based rewards. KodCode SFT
and RL share the same problems and split membership; their row counts should
not be added together as distinct problems. The two data families retain their
own category systems.

## Quick start

After downloading this repository to a folder named `dataset`:

```python
from datasets import load_dataset

train = load_dataset("./dataset", "kodcode_sft", split="train")
print(train[0]["messages"])

# Select problems with a particular primary category.
dp = train.filter(lambda row: row["primary_category"] == "dynamic_programming")
```

To load from Hugging Face directly, replace `./dataset` with the repository ID
shown on the dataset page (`owner/Code-generalization`).

| Use | Main fields |
|---|---|
| SFT | `messages`, or the text pair `prompt` and `response` |
| RL | `prompt` (a list of messages) and `reward_model.ground_truth` (tests for the scorer) |
| Category analysis | `primary_category`; KodCode annotation fields or TACO/LeetCode `overlap_categories` |

Apply the target model's template at training time. Classification reasons and
reward tests are not SFT targets and should not be appended to training prompts.

## Category annotations

KodCode records include a primary category, auxiliary techniques, a short
classification reason, and annotation provenance. Across its 36,074 problems,
7,564 records are marked as reviewed and 1,677 as changed during review.
The released ten-category labels are a deterministic mapping of the reviewed
earlier labels. See [KodCode notes](docs/kodcode.md) for the model records and
field definitions.

A real annotation, showing selected fields:

```json
{
  "problem_id": "Algorithm_12700_C",
  "primary_category": "dynamic_programming",
  "techniques": ["dp_table", "lcs_reconstruction", "backtracking"],
  "rationale": "Builds an LCS length table and backtracks to reconstruct the subsequence."
}
```

KodCode's main ablations remove the selected **primary category**. TACO/LeetCode
ablations remove problems when **any mapped category** matches the removed
group. Use the recorded memberships to reproduce the experimental subsets;
a simple category filter does not reproduce their additional sampling.
Export commands are in the [KodCode](docs/kodcode.md) and
[TACO/LeetCode](docs/taco_leetcode.md) notes.

## Quality and usage notes

- All released KodCode problems carry a historical reference-execution-pass
  flag. In TACO/LeetCode RL training data, 11,587 records are marked as
  reference-execution-verified and 5,662 as structural-only. Passing the
  supplied tests does not establish correctness on every possible input.
- KodCode's fixed 100-problem validation set comes from Light-RL-10K, whereas
  its training set combines two KodCode sources. TACO SFT's 100-problem holdout
  was added for this release; the other splits preserve the historical setup.
- TACO SFT and RL were separate experiments, not a shared SFT-to-RL partition.
  There are cross-configuration overlaps; see the
  [split notes](docs/taco_leetcode.md#splits-and-verification) before combining them.
- Reward execution requires Linux and an isolated environment. See
  [verification notes](docs/rl_verification.md) for the two reward rules and
  execution limits. Loading the dataset does not execute the problem code.

To check the local release, run these commands from the repository root:

```bash
pip install -r requirements.txt
python scripts/validate_release.py --hf
```

## Sources and license

Please credit the original [KodCode](https://arxiv.org/abs/2503.02951),
[TACO](https://arxiv.org/abs/2312.14852), and
[LeetCodeDataset](https://arxiv.org/abs/2504.14655) work when using their data.
Source repositories and attribution are listed in [NOTICE](NOTICE.md).
Source-specific terms remain in effect; see [LICENSE](LICENSE), including the
non-commercial condition on the KodCode-derived portion.