trace-to-training-data
하는 일
이 도구는 AI 테스트 결과를 AI를 다시 학습시키는 데 쓸 수 있는 데이터로 바꿉니다. AI가 성공하거나 실패한 예시를 가져와서, AI가 그것으로부터 배울 수 있도록 정리합니다.
사용하는 경우
- ✓이미 평가된 AI 테스트가 있고, 이를 AI 학습에 쓰고 싶을 때.
- ✓AI가 실수를 해서 그 실수를 학습 예시로 만들고 싶을 때.
- ✓AI가 최선의 답을 고르도록 '좋은 답 대 나쁜 답' 쌍을 만들고 싶을 때.
스킬 링크
https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/trace-to-training-data/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 테스트 결과를 AI를 위한 학습 데이터로 바꿔 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
도구는 이미 '맞음' 또는 '틀림'으로 표시된 테스트 결과를 받아 형식을 맞춥니다. AI가 예시로 배울 수 있도록 이 정보를 정리합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Trace To Training Data
This skill assumes eval-harness-first
already graded the traces being
converted here — goldens, graders,
and runs/<run-id>/results.json
all exist before conversion
starts. This is the flywheel edge
that skill names in its own flow:
"the same labeled traces become
the training set." Conversion
happens here; grading already
happened upstream.
Input: graded traces —
eval/goldens.jsonl plus
runs/<run-id>/results.json, each
row carrying a task_id, a
verdict from the grader, and a
reward when the task supports a
scalar score (judge score,
execution partial-credit, or an
RLVR verifier):
{"task_id": "t-042", "trace_id": "t-042-a3",
"messages": [{"role": "user", "content": "..."}],
"verdict": "pass", "reward": 0.91,
"grader": "exact_match"}
Output format: rows shaped
exactly like dataset-curation's
Format Selection table — SFT
messages rows or DPO
prompt/chosen/rejected
pairs — so this skill's output is
that skill's input with no
reshaping step in between.
The Principle
The eval harness already did the
labeling work: every trace in
results.json carries a verdict,
and often a reward, before this
skill ever touches it. Converting
a graded trace into a training
row is mechanical — pick a shape
from dataset-curation's table,
map fields, write JSONL.
Curation is the work that
remains — which traces clear a
quality bar, which pairs are
informative, and which rows must
never enter the training set at
all.
Treat any conversion step that
requires re-judging a trace as a
sign the harness is missing a
grader, not a gap this skill
should paper over. A trace with
no verdict or reward isn't
convertible yet — route it back
to eval-harness-first first,
don't hand-label it here to
unblock conversion.
SFT From Traces
- Keep the top-reward fraction of successful trajectories, not every passing one. Rank passing traces by reward and take a fraction (the Agent-lightning pattern) rather than every trace that merely cleared the pass bar — a trace that barely passed is a weaker SFT signal than one that scored well above threshold.
- Expert-corrected failures become gold SFT examples directly (the Langfuse pattern) — when a human edits a failing trace's output into a correct one, that correction needs no reward threshold; a human already validated it. Route corrections straight into the SFT set.
- Step-level masking beats whole-trajectory discard for multi-step traces. When only some steps in a multi-step trajectory are bad, mask the loss on the bad steps and keep the good ones, rather than discarding the whole trajectory. SRFT reports 32.2% vs. 30.9% on SWE-bench for step-level critic masking over trajectory discard — a real, if modest, gap from the finer-grained cut.
Preference Pairs From Traces
- Build pairs from passing-vs-failing trajectories on the SAME task, never from unrelated best- and worst-scoring traces pulled across different tasks — cross-task pairs teach the model to prefer one task over another, not one response over another.
- Select the rejected member at
μ−2σ of the reward distribution
for that task, never the
absolute minimum.
preference-optimization's Pair Construction section owns the full selection formula; this skill supplies the graded trajectories it consumes. - Judge-scored delta selection cuts pair volume without cutting signal. Score each candidate pair by chosen-minus-rejected judge delta and keep only the highest-delta subset — the top 5k of a 16.5k candidate pool matched the full pool's downstream result. Build the full candidate set first, then filter by delta; don't cap generation at 5k up front.
Hygiene
- Scan for secrets and PII before any row ships, and redact what's found. Traces sourced from production logs can carry credentials, API keys, tokens, or customer data — run a secret/PII scan over every SFT and DPO row and redact matches; conversion fails closed (the row is dropped, not shipped with the raw content) if sensitive fields remain after redaction. Never commit secrets.
- Eval goldens must never leak
into training data. Hold
every
eval/goldens.jsonlID out of every converted SFT and DPO set — a trace that also appears as a golden trains on the exact item the checkpoint gets graded against later,
…
자주 묻는 질문
'트레이스'란 무엇인가요?
AI가 문제를 어떻게 풀려고 했는지, 거친 단계를 보여 주는 자세한 기록입니다.
왜 가장 좋은 결과만 써야 하나요?
단순히 통과한 결과가 아니라 가장 좋은 결과만 쓰면, AI가 고품질 예시로 배워 학습이 더 효율적으로 됩니다.
테스트 데이터에 민감한 정보가 들어 있으면 어떻게 되나요?
도구가 민감하거나 개인적인 정보를 확인하고, 변환하기 전에 제거하여 개인정보와 보안을 지킵니다.
상세 정보
작성자의 원본 설명
Convert evaluation traces and production logs into SFT examples and preference pairs. Use when graded traces or failure examples exist and need to become training data, when applying rejection sampling to model outputs, or when building DPO pairs from passing and failing runs.
repo: wshobson/agents
인기도
- GitHub 스타
- 41k
- 순위
- #6736
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
screen-reader-testing
41k에이전트가 스크린 리더로 웹사이트를 테스트해 접근성을 확인하도록 돕습니다.
wcag-audit-patterns
41k에이전트가 WCAG 지침에 따라 웹사이트의 접근성을 감사하고 문제를 고치도록 돕습니다.
multi-reviewer-patterns
41k에이전트가 병렬 코드 리뷰를 조율하고, 중복된 발견 사항을 정리하며, 보고서를 통합하도록 돕습니다.
parallel-debugging
41k에이전트가 병렬 조사와 근본 원인 분석으로 복잡한 문제를 디버그하도록 돕습니다.