Skip to content
Back to skills

Data Preparation

ASecurity

"Prepare and validate OpenRLHF datasets for SFT, reward modeling,

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
toolspythonbash

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill data-preparation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Preparation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data Preparation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-data-preparation-06f03ec0/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-data-preparation-06f03ec0)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: data-preparation
description: "Prepare and validate OpenRLHF datasets for SFT, reward modeling,
  DPO, PPO/RL prompts, chat-template use, dataset mixing, packing-sensitive
  length checks, and VLM image placeholders before expensive training."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# OpenRLHF Data Preparation

Use this sub-skill when the task is about dataset schemas, key mapping, chat-template choices, prompt/reward/preference records, tiny dry-run validation, or VLM image placeholder alignment for OpenRLHF.

## Route by Training Mode

- **SFT**: prepare prompt/response or multiturn chat records; see `references/data-formats.md#sft-records` and validate with `scripts/validate_openrlhf_dataset.py --mode sft`.
- **Reward model**: prepare chosen/rejected pairs, optional prompt prefixes, and optional margin values; see `references/data-formats.md#reward-model-records` and validate with `--mode rm`.
- **DPO**: prepare chosen/rejected preferences with optional shared prompt; see `references/data-formats.md#dpo-records` and validate with `--mode dpo`.
- **PPO/RL prompts**: prepare prompt-only records with optional labels and datasource fields; see `references/data-formats.md#ppo-and-rl-prompt-records` and validate with `--mode ppo`.
- **VLM prompts**: verify `<image>` placeholders line up with the configured image key before Ray/vLLM training; see `references/data-formats.md#vlm-image-prompts` and `references/troubleshooting.md#multimodal-image-mismatches`.

## Core Decisions

- Match CLI key flags (`--data.input_key`, `--data.output_key`, `--data.prompt_key`, `--data.chosen_key`, `--data.rejected_key`, `--data.label_key`, `--data.image_key`) to the actual record fields before launching training.
- Choose exactly one prompt formatting path: use `--data.apply_chat_template` for chat-message lists, or `--data.input_template` for plain string prompts.
- For SFT multiturn data, enable `--data.multiturn` only with `--data.apply_chat_template`, and put the full trajectory under `--data.input_key` rather than splitting assistant turns into `--data.output_key`.
- For mixed datasets, keep comma-separated `--data.dataset` and `--data.dataset_probs` counts aligned; probabilities are parsed as floats and must match the dataset count.
- Treat `--data.max_len`, prompt length, packing, ring attention, and VLM image counts as preflight risks; see `references/validation.md` before running expensive GPU jobs.

## Safe Local Validator

Run the bundled validator on tiny local JSON or JSONL samples without importing OpenRLHF, Ray, torch, datasets, or transformers:

```bash
python skills/openrlhf/sub-skills/data-preparation/scripts/validate_openrlhf_dataset.py \
  --mode sft \
  --input sample.jsonl \
  --input-key question \
  --output-key response \
  --max-samples 20
```

The validator checks required keys, null/empty values, chat-message shape, chosen/rejected confusion, dataset probability counts, rough length limits, and VLM placeholder/image alignment. It is a schema preflight, not a tokenizer-accurate training simulation.

## Boundaries

- For full SFT/RM/DPO training command construction, hand off to `supervised-preference-training` after data validates.
- For PPO/Ray/vLLM rollout setup, agent functions, or reward services, hand off to `rl-agent-training` after prompt data validates.
- For installation, CUDA, flash-attn, Ray, vLLM, DeepSpeed, checkpoint, and environment issues, hand off to `operations-and-utilities`.

Files in this skill

  • SKILL.md3.4 KB
  • references/data-formats.md7.8 KB
  • references/troubleshooting.md4.5 KB
  • references/validation.md4.2 KB
  • scripts/validate_openrlhf_dataset.py15.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.