trace-to-training-data
Skill này làm gì
Công cụ này chuyển kết quả kiểm thử AI thành dữ liệu có thể dùng để huấn luyện lại. Nó lấy các ví dụ AI thành công hoặc thất bại và sắp xếp chúng để AI có thể học từ đó.
Khi nào nên dùng
- ✓Khi bạn có kết quả kiểm thử AI đã được đánh giá và muốn dùng chúng để huấn luyện.
- ✓Khi AI mắc lỗi và bạn muốn biến các lỗi đó thành ví dụ học tập.
- ✓Khi bạn muốn tạo các cặp “tốt và xấu” để dạy AI chọn câu trả lời tốt nhất.
Liên kết skill
https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/trace-to-training-data/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chuyển các kết quả kiểm thử này thành dữ liệu huấn luyện cho AI.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ lấy các kết quả kiểm thử đã được đánh dấu “đúng” hoặc “sai” và định dạng chúng. Nó sắp xếp thông tin này để AI dùng làm ví dụ mà học.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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,
…
Câu hỏi thường gặp
“Traces” là gì?
“Traces” giống như bản ghi chi tiết về cách AI thử giải quyết một vấn đề, cho thấy các bước nó đã thực hiện.
Tại sao chỉ nên dùng kết quả tốt nhất?
Dùng những kết quả tốt nhất (chứ không phải bất kỳ kết quả nào vượt qua kiểm tra) giúp AI học từ các ví dụ chất lượng cao, khiến quá trình học hiệu quả hơn.
Điều gì xảy ra nếu dữ liệu kiểm thử có thông tin nhạy cảm?
Công cụ kiểm tra và loại bỏ thông tin nhạy cảm hoặc cá nhân trước khi chuyển đổi dữ liệu, đảm bảo quyền riêng tư và an toàn.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6736
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
screen-reader-testing
41kGiúp agent của bạn kiểm thử website bằng trình đọc màn hình để đảm bảo chúng có thể truy cập được.
wcag-audit-patterns
41kGiúp agent của bạn kiểm toán website về khả năng truy cập và sửa các vấn đề theo hướng dẫn WCAG.
multi-reviewer-patterns
41kCho phép agent của bạn điều phối các đợt rà soát mã song song, loại bỏ phát hiện trùng lặp và tổng hợp báo cáo.
parallel-debugging
41kCho phép agent gỡ lỗi các vấn đề phức tạp bằng cách điều tra song song và phân tích nguyên nhân gốc.
Skill tương tự
pytorch-patterns
280kGiúp agent của bạn dùng PyTorch cho các mô hình học máy. Áp dụng thực hành tốt nhất để huấn luyện mô hình hiệu quả và đảm bảo kết quả có thể lặp lại.
evm-token-decimals
280kGiúp agent tránh lỗi về số thập phân khi làm việc với các mạng blockchain khác nhau. Đảm bảo giá trị token chính xác trong giao dịch và phép tính.
ito-inference
280kGiúp agent kiểm tra xem các mô hình AI đã sẵn sàng để dùng chưa. Kết nối yêu cầu tài nguyên tính toán với dịch vụ mô hình đã sẵn sàng.