skills/fine-tuning-dataset-curator/SKILL.md
Prepare high-quality datasets for LLM fine-tuning with filtering, deduplication, augmentation, and RLHF data formatting. Activate on: fine-tuning data, training data curation, RLHF dataset, data quality filtering, SFT dataset. NOT for: model training infrastructure (ai-engineer), prompt engineering without fine-tuning (prompt-engineer).
npx skillsauth add curiositech/windags-skills fine-tuning-dataset-curatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Prepare, filter, deduplicate, and format high-quality datasets for supervised fine-tuning (SFT), RLHF, and DPO training of language models.
Activate on: "fine-tuning dataset", "training data preparation", "RLHF data", "DPO pairs", "SFT data", "data quality filtering", "dedup training data", "curate instruction dataset", "preference data"
NOT for: Model training loop implementation (ai-engineer), prompt optimization without fine-tuning (prompt-engineer), or general ETL pipelines (data-pipeline-engineer)
| Domain | Technologies | Notes | |--------|-------------|-------| | Quality Filtering | fasttext classifiers, perplexity scoring, regex rules | Remove noise before it poisons the model | | Deduplication | MinHash (datasketch), exact hash, SimHash | Near-dedup critical for training stability | | Augmentation | LLM-generated paraphrases, backtranslation, persona variation | 3-5x dataset size with diversity | | Format Conversion | chat-ml, Alpaca, ShareGPT, OpenAI JSONL | Match target training framework | | PII Removal | presidio, regex, spaCy NER | Legal requirement for most training data | | RLHF/DPO Prep | Preference pair generation, reward model labeling | Chosen/rejected pairs with margin scoring |
Raw Sources ──→ [Extract] ──→ [Filter] ──→ [Dedup] ──→ [Augment] ──→ [Format] ──→ [Validate]
│ │ │ │ │ │ │
logs, docs parse to quality MinHash paraphrase chat-ml hold-out
APIs, CSVs instruction/ scoring near-dedup via LLM or JSONL eval set
response remove < persona distribution
pairs threshold variation check
# Quality filtering pipeline
import hashlib
from datasketch import MinHash, MinHashLSH
def curate_sft_dataset(raw_examples: list[dict]) -> list[dict]:
# Step 1: Basic quality filters
filtered = []
for ex in raw_examples:
instruction, response = ex["instruction"], ex["response"]
if len(response.split()) < 10: # Too short
continue
if len(response.split()) > 2000: # Too long (likely garbage)
continue
if instruction.strip() == "": # Empty instruction
continue
if response.count("\n") > 50: # Excessive formatting
continue
filtered.append(ex)
# Step 2: Near-deduplication with MinHash
lsh = MinHashLSH(threshold=0.8, num_perm=128)
deduped = []
for i, ex in enumerate(filtered):
mh = MinHash(num_perm=128)
for word in ex["response"].split():
mh.update(word.encode("utf-8"))
if not lsh.query(mh): # No near-duplicate found
lsh.insert(f"doc_{i}", mh)
deduped.append(ex)
# Step 3: Format for training
formatted = []
for ex in deduped:
formatted.append({
"messages": [
{"role": "user", "content": ex["instruction"]},
{"role": "assistant", "content": ex["response"]}
]
})
return formatted
Instruction ──→ [Generate N responses] ──→ [Score/Rank] ──→ [Select Pairs]
│ │ │
temperature=0.8 human eval chosen: best
N=4 responses per or LLM judge rejected: worst
instruction or heuristic margin > threshold
Output format (DPO):
{
"prompt": "Explain quantum computing",
"chosen": "Quantum computing uses qubits...", # High-quality response
"rejected": "Quantum computing is computers..." # Lower-quality response
}
10 Gold Examples ──→ [LLM Generator] ──→ [Quality Filter] ──→ 500 Examples
│ │
"Generate 50 remove duplicates,
variations of score perplexity,
this instruction human spot-check
with different 10% sample
personas and
complexity levels"
data-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.