Chuyển đến nội dung
Skillpedia
Agent41k · #6731

finetuning-method-selection

Skill này làm gì

Công cụ này giúp bạn quyết định có cần huấn luyện một mô hình AI hay không và cách tốt nhất để làm việc đó. Nó hướng dẫn bạn chọn kỹ thuật phù hợp (như dạy bằng ví dụ hoặc phản hồi) và kích thước mô hình, tránh chi tiêu không cần thiết.

Khi nào nên dùng

  • ✓Khi bạn bắt đầu một dự án huấn luyện AI mới.
  • ✓Khi bạn chưa chắc một kỹ thuật đơn giản hơn có giải quyết được vấn đề không.
  • ✓Khi bạn chọn giữa dạy bằng sở thích (thích/không thích) hoặc bằng phần thưởng (đúng/sai).

Liên kết skill

https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/finetuning-method-selection/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/finetuning-method-selection/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi cần huấn luyện một mô hình để hiểu tài liệu kỹ thuật của công ty mình. Tôi nên làm gì?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ phân tích vấn đề của bạn để xem có thật sự cần huấn luyện không. Nếu cần, nó hỏi về loại thông tin bạn có (ví dụ, ý kiến, thành công/thất bại) để đề xuất phương pháp và mô hình phù hợp nhất.

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.

Fine-Tuning Method Selection

This is the router skill for the fine-tuning lifecycle: it decides whether fine-tuning is the right tool at all, and if so, which method and which base-model size class. Every other skill in this plugin assumes this routing already happened — start here before opening lora-qlora-recipes, preference-optimization, or grpo-rlvr-training.

When to Use This Skill

  • Starting any fine-tuning effort, before a framework or base model has been chosen.
  • Unsure whether RAG or prompt engineering would solve the problem more cheaply than training.
  • Choosing between preference optimization (DPO family) and a reinforcement method (GRPO/RLVR) for the same underlying task.
  • Sizing a candidate model/method combination before committing to a run.

Quick Reference

Situation Route
Facts change often (prices, docs, news) RAG, not fine-tuning
Desired behavior still being figured out Prompt engineering
Stable domain knowledge, ≥500MB text CPT then SFT — see Off-Ramps First
Have input/output demonstrations SFT — see lora-qlora-recipes
Have preference pairs or thumbs-up/down DPO/ORPO/KTO — see preference-optimization
Have a verifiable pass/fail signal GRPO+RLVR — see grpo-rlvr-training
No eval harness yet Stop — see eval-harness-first

Off-Ramps First

Most requests that sound like "fine-tune this" are served better and cheaper elsewhere. Check these off-ramps before opening a training run:

  • Knowledge-bound and volatile (the gap is facts that change — prices, docs, current events): route to RAG, not fine-tuning. A fine-tuned model bakes in a snapshot; volatile facts go stale immediately.
  • Behavior-bound and shifting (the desired behavior is still being figured out, or changes per request): route to prompt engineering. Fine-tuning locks in a behavior; don't lock in one that hasn't stabilized yet.
  • Stable, dense domain knowledge: this is where continued pretraining (CPT) enters, sized by how much domain text exists:
Domain text volume Route
<10MB RAG only
10MB–500MB RAG + fine-tune
500MB–10GB CPT, then SFT
>10GB CPT required

CPT learning rate ≈ 10% of the pretraining LR. CPT is guidance-only in this plugin — sizing and LR guidance live here, but this plugin does not execute a CPT run.

Method Router

Once the off-ramps are ruled out, this is the full decision tree (verbatim from the research this plugin is built on):

New FACTS?  volatile → RAG | stable+dense → CPT (LR ~10% of pretrain) → SFT
New BEHAVIOR? shifting → prompt-engineering | stable:
  demos → SFT (LoRA/QLoRA, all-linear, α=2r)
  preference pairs → DPO (SimPO if length-bias, ORPO if memory-bound)
  unpaired 👍/👎 → KTO
  verifiable success → RLVR + GRPO (DAPO/GSPO/Dr.GRPO per failure mode)
Deploy: FP8 (Hopper+) | NVFP4 (Blackwell scale) | AWQ (older) | GGUF+imatrix (edge)
BEFORE ANY OF THIS: the eval harness must exist first.

Read the tree top-down: answer "new facts or new behavior," then follow the branch that matches the data shape in hand (demos, preference pairs, thumbs up/down, or verifiable success/failure). The data shape picks the method — not the other way around.

Worked Routing Examples

  • "Users want the assistant to follow our support macros exactly." Behavior is stable and demonstrable from transcripts → demos → SFT.
  • "We have pairs of good/bad responses from reviewer thumbs-up/down, unpaired." → unpaired signal → KTO, not DPO (DPO needs paired preferences).
  • "The model can already solve some of these math problems and we can grade correctness automatically." → verifiable success signal → GRPO+RLVR, and only after confirming the model succeeds at least sometimes (see Key Routing Facts below).
  • "We want the model to know this week's pricing page." → volatile facts → RAG, no training run at all.

Key Routing Facts

  • Loss-function choice is low-leverage. A 240-H100-run study found method choice worth ~1 percentage point versus ~50 points for model scale, and zero of 20 DPO variants beat vanilla DPO. Don't spend a routing decision agonizing over DPO-variant selection — spend it on getting the data shape and scale right.
  • DPO is for taste, GRPO+RLVR is for reasoning. Preference pairs that encode a subjective judgment (tone, style, "which answer

…

Câu hỏi thường gặp

Khi nào nên dùng RAG thay vì huấn luyện?

Hãy dùng RAG nếu thông tin thường xuyên thay đổi (như giá cả hoặc tin tức), vì huấn luyện mô hình bằng dữ liệu cũ là không hiệu quả.

SFT là gì?

SFT (Supervised Fine-Tuning) là phương pháp huấn luyện trong đó bạn cho mô hình xem các ví dụ gồm “đầu vào” và “đầu ra” mong muốn để nó học.

Các phương pháp tối ưu theo sở thích (DPO, v.v.) là gì?

Đó là các phương pháp dùng khi bạn có các cặp phản hồi và có thể chỉ ra phản hồi nào tốt hơn, giúp mô hình ưu tiên các câu trả lời chất lượng cao hơn.

Chi tiết

Mô tả gốc của tác giả

Decide whether to fine-tune at all, and route to the right method (SFT, DPO/ORPO/KTO, GRPO/RLVR, continued pretraining) and base model. Use when starting any fine-tuning effort, when unsure whether RAG or prompting would suffice, or when choosing between preference-optimization and reinforcement methods.

repo: wshobson/agents

Độ phổ biến

Sao GitHub
41k
Vị trí xếp hạng
#6731
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự