--- license: cc-by-4.0 language: - en pretty_name: "GPIO-LLM: Raspberry Pi 5 GPIO request-to-action dataset" size_categories: - 10K **Safety.** Model output must never drive hardware directly. Every action is meant to pass a deterministic > validator and hardware controller first (the project ships a validator and a GPIO simulator). The labels > encode the project's safety policy; they are not a substitute for correct wiring. ## Quick start ```python from datasets import load_dataset ds = load_dataset("AwaleSagar/gpio-llm-rpi5-actions") # splits: train, eval, eval_core row = ds["train"][0] print(row["prompt"] + row["target"]) ``` Fine-tune on `target` with the loss masked over `prompt`. The target starts with a space (`"Assistant:"` | `" {...}"`), so tokenizing the two parts separately gives exactly the tokens of the joined text. ## Splits | Split | Rows | Purpose | |---|---|---| | `train` | 58,821 | Training | | `eval` | 26,297 | Held-out evaluation: 132 phrasing templates never used in training | | `eval_core` | 5,083 | Quick evaluation: 46 rows from every eval template | Train and eval share no ids, no phrasing templates and no number-normalised text; the largest word-3-shingle Jaccard similarity between any train and eval row is 0.6923 (limit 0.7). `eval_core` is a subset of `eval`. ## Fields | Field | Type | Description | |---|---|---| | `id` | string | Unique row id | | `prompt` | string | Model input: optional `Context: {json}` line, the conversation as `User:` / `Assistant:` lines, ending with `Assistant:` | | `target` | string | Model output: a space and the action as compact JSON | | `tokens` | int | Tokens of `prompt + target` with the project tokenizer (`gpio_llm_bpe_12k`) | | `action` | string | Action name (`ask_clarification`, `gpio_mode`, `gpio_pulse`, `gpio_pwm`, `gpio_read`, `gpio_sequence`, `gpio_write`, `report_error`, `wait`) | | `category` | string | One of `clarification`, `driver`, `error`, `general_hardware`, `gpio_mode`, `gpio_pwm`, `gpio_read`, `gpio_sequence`, `gpio_timing`, `gpio_write`, `safety`, `sensor` | | `template_id` | string | Phrasing template the row was derived from (the unit of the train/eval split) | | `source` | string | `golden_manual`, `synthetic_template_v1/v2`, or `teacher_` for model-rewritten wording | | `difficulty` | int | 1 (direct) to 5 (multi-step or tricky) | | `fact_refs` | list | Hardware facts (`F-*`) and dataset policies (`P-*`) the label depends on (`configs/rpi5_hardware_facts.json`) | | `messages` | list | The conversation as role/content turns | | `context` | string (JSON) | Optional runtime context: `device_mappings`, `available_pins` or `gpio_state` | | `expected_action` | string (JSON) | The label as a JSON object (same as `target`) | Actions, fields, enums and reason codes are defined in `configs/action_vocabulary.json`. ## Example ```text prompt: Context: {"device_mappings":{"door_lock_relay":20}} User: Turn on the door lock relay. Assistant: target: {"action":"gpio_write","pin":20,"value":"HIGH"} ``` ## Composition | Category | Train | Eval | |---|---|---| | clarification | 3,608 | 1,672 | | driver | 1,896 | 1,168 | | error | 10,853 | 4,711 | | general_hardware | 162 | 43 | | gpio_mode | 4,513 | 1,619 | | gpio_pwm | 5,964 | 2,286 | | gpio_read | 4,079 | 1,340 | | gpio_sequence | 6,401 | 3,880 | | gpio_timing | 6,067 | 3,133 | | gpio_write | 7,960 | 3,654 | | safety | 4,187 | 1,674 | | sensor | 3,131 | 1,117 | ## How it was made 1. **Hardware facts.** Every capability comes from cited sources: the Raspberry Pi documentation, the RP1 peripherals datasheet (Table 4, checked cell by cell) and the Raspberry Pi 5 product brief. Nothing is invented; uncertain facts are excluded from labels (see *Limitations*). 2. **Labels.** 98 hand-written golden rows and fact-grounded templates produce every target deterministically. No label was written by a language model. 3. **Wording.** Teacher models only rewrote the user's words for existing targets (`deepseek/deepseek-v4.1-flash` 197, `gpt-5.6-terra` 10,997, `z-ai/glm-5.3-flash` 72,306 rows). Each rewrite passed deterministic wording checks (same pins, numbers and meaning), the strict validator, duplicate and leakage checks, and a judge model (`gpt-5.6-terra`). 4. **Checks.** Strict schema and hardware-rule validation, pin grounding (every pin in a target appears in the request or context), exact and near-duplicate removal, contradiction checks, template-level train/eval separation, and replay of every target through the GPIO simulator. ## Intended use and limitations - Intended for training and evaluating small models that map requests to structured hardware actions, and for research on clarification and refusal behaviour. - All requests are synthetic (template or model-rewritten). Real spoken phrasing is under-represented. - Scope is action vocabulary 1.0 on the 40-pin header: digital I/O, pulls, drive strength, documented alternate functions, hardware/software PWM, pulses, waits and sequences. Bus transactions (I2C/SPI/UART payloads), sensor protocols, edge-triggered waits and timing precision limits are out of scope. - Conservative policies are built into the labels, for example: GPIO0/1 are refused, "pin N" means BCM GPIO N, "turn on" means HIGH, hedged pin choices trigger a clarifying question, and PWM on GPIO14/15 is never taught. Each policy is recorded in `docs/SPEC_V1_DECISIONS.md` (specification 1.0). ## Licence and attribution - Released under **CC-BY-4.0**. - User wording in `teacher_*` rows was generated with third-party models; check those providers' terms on using model outputs for your use case. - Hardware facts summarise public Raspberry Pi documentation and datasheets. - The companion English pretraining text is **not** included. It is a filtered subset of [HuggingFaceTB/smollm-corpus](https://huggingface.co/datasets/HuggingFaceTB/smollm-corpus) (`fineweb-edu-dedup`, ODC-By 1.0, derived from Common Crawl); `provenance/` lists the exact selection so it can be rebuilt. The project's pretraining mix used 550M tokens. ## Provenance `provenance/release_manifest.json` records the SHA-256 of every source file, the counts above, the pretraining mix and the SPEC targets. Release version: `gpio_llm_v1`. ## Citation ```bibtex @misc{gpio_llm_dataset, title = {GPIO-LLM: Raspberry Pi 5 GPIO request-to-action dataset}, author = {GPIO-LLM project}, year = {2026}, note = {Release gpio_llm_v1} } ```