TokenBender's picture
Expand dataset README with file tree and oracle flow
ff83410 verified
|
Raw
History Blame Contribute Delete
7.11 kB
---
license: mit
task_categories:
- text-generation
- reinforcement-learning
language:
- en
- code
pretty_name: Dummy PIE C++ Oracle Seed
size_categories:
- n<1K
configs:
- config_name: default
data_files:
- split: oracle_seed
path: data/oracle_seed.jsonl
---
# Dummy PIE C++ Oracle Seed
This is a tiny 5-row Hugging Face dataset skeleton for generating oracle SFT data for a PIE-style C++ optimization task.
The rows are intentionally synthetic. They define the exact shape we want for real PIE C++ tasks without exposing or depending on private prepared artifacts.
The goal is to give an oracle-data writer a clean contract:
1. read a C++ optimization task;
2. produce one verified optimized solution;
3. return the result in chat/SFT format;
4. include enough verification metadata for us to decide whether the row is safe to train on.
This dataset is not a benchmark and should not be used to claim model quality. It is a format sample for building the real oracle dataset.
## Repository Layout
```text
dummy-pie-cpp-oracle-seed
├── README.md
├── ORACLE_WRITER_INSTRUCTIONS.md
├── data/
│ ├── oracle_seed.jsonl
│ └── oracle_return_example.jsonl
└── schema/
├── oracle_seed.schema.json
└── oracle_return.schema.json
```
### `README.md`
This file. It explains the dataset purpose, the row contract, the expected return format, and the intended reading order.
### `ORACLE_WRITER_INSTRUCTIONS.md`
The short handoff file for the person or agent generating oracle solutions. Send them this file first. It tells them how to read each row, what answer format to produce, and what verification fields to fill.
### `data/oracle_seed.jsonl`
The actual 5-row seed dataset. Each line is one prompt-only C++ optimization task.
Important fields:
- `messages`: the canonical chat input. Use this as the real prompt.
- `prompt_template_id`: the input style used by the row.
- `prompt`: a flattened fallback for tools that cannot consume chat messages.
- `source_code`: the original inefficient but correct C++20 program.
- `visible_tests`: public tests included in the task.
- `compile`: compiler command and timeout.
- `run`: runtime and memory limits.
- `constraints`: required assistant output contract.
- `metadata`: problem notes and expected optimization direction.
### `data/oracle_return_example.jsonl`
One solved example showing the expected output from an oracle writer. The returned row copies the original input `messages` and appends one `assistant` message with the optimized C++ answer.
### `schema/oracle_seed.schema.json`
JSON Schema for validating input seed rows before sending them to an oracle writer.
### `schema/oracle_return.schema.json`
JSON Schema for validating returned oracle rows before running the stronger local verifier.
## Recommended Reading Order
For an oracle-data writer:
1. `ORACLE_WRITER_INSTRUCTIONS.md`
2. `data/oracle_seed.jsonl`
3. `data/oracle_return_example.jsonl`
For a training or verification owner:
1. `README.md`
2. `schema/oracle_seed.schema.json`
3. `schema/oracle_return.schema.json`
4. `data/oracle_seed.jsonl`
5. `data/oracle_return_example.jsonl`
## What The Oracle Writer Receives
Each row is a prompt-only optimization task. The canonical input is `messages`, not `prompt`.
- `task_id`: stable row identifier.
- `messages`: the exact chat input to give the model or oracle writer.
- `prompt_template_id`: which input style this row uses.
- `prompt`: flattened fallback for loaders that do not support chat messages.
- `source_code`: the unoptimized but correct C++20 program.
- `visible_tests`: public tests included in the prompt.
- `public_checker`: how visible outputs should be compared.
- `compile`: expected compiler command and timeout.
- `run`: expected runtime and memory limits.
- `constraints`: required assistant output contract.
- `metadata`: problem notes and expected optimization direction.
## Prompt Diversity
The 5 seed rows intentionally vary the input style so the model does not overfit to one prompt wording:
- system message with output contract, user message with task;
- user-only full instruction;
- system role instruction, brief user request;
- structured user spec with a system contract;
- natural user request with inline answer-format instruction.
The output format is intentionally fixed. Only the input prompt style varies.
## Required Oracle Return Format
For each input row, return one SFT-ready chat row. Copy the input `messages` exactly, then append the assistant answer:
```json
{
"task_id": "dummy_pie_cpp_0001_sum_even",
"messages": [
{
"role": "system",
"content": "same system message from the seed row, if present"
},
{
"role": "user",
"content": "same user message from the seed row"
},
{
"role": "assistant",
"content": "<reasoning>Short optimization explanation.</reasoning>\n```cpp\n// optimized C++20 code\n```"
}
],
"verification": {
"compile_ok": true,
"all_visible_tests_pass": true,
"all_hidden_tests_pass": null,
"score": 1.0,
"runtime_ms": null,
"notes": "Verified locally by oracle writer."
}
}
```
The assistant message must contain exactly:
1. One `<reasoning>...</reasoning>` block.
2. One fenced C++ block starting with ```` ```cpp ````.
3. No extra prose outside those two parts.
## End-To-End Flow
```text
oracle_seed row
-> oracle writer reads messages
-> oracle writer writes optimized C++ answer
-> oracle writer compiles and runs visible tests
-> oracle writer returns oracle_return row
-> local verifier checks format, compile, tests, and score
-> only full-mark verified rows become SFT data
```
## Validation Rule For Real Training
Returned oracle rows should not be used for SFT until our local verifier confirms:
- output format is valid;
- generated C++ compiles;
- visible tests pass;
- hidden/generated tests pass when available;
- reward or grade is full mark.
The `verification` object in returned rows is useful metadata, but it is not enough by itself. It should be treated as a claim from the oracle writer. The final training set should be built only after our own verifier confirms the row.
## Intended SFT Conversion
Once a returned row is verified, the `messages` array is already in SFT-ready chat form:
```json
[
{"role": "system", "content": "...optional system instruction..."},
{"role": "user", "content": "...C++ optimization task..."},
{"role": "assistant", "content": "<reasoning>...</reasoning>\n```cpp\n...\n```"}
]
```
Rows that fail compilation, fail tests, have invalid formatting, or receive partial credit should be excluded from SFT.
## Boundary
This dummy dataset only specifies the data interface. It does not include:
- real PIE C++ train/eval rows;
- hidden tests;
- a full verifier implementation;
- model training scripts;
- claims about model improvement.
## Loading Locally
```python
from datasets import load_dataset
ds = load_dataset("json", data_files="data/oracle_seed.jsonl", split="train")
print(ds[0])
```