Guide for checkpointing — saving, loading, and resuming training with CheckpointRecord. Use when the user asks about saving weights, resuming training, checkpoint management, or the checkpoint lifecycle.
日本語の概要は準備中です。原文の説明を表示しています。
Guide for hyperparameter selection — learning rate formulas, LoRA rank, batch size, group size, schedules, and model-specific tuning. Use when the user asks about learning rate, batch size, hyperparameter tuning, or how to configure training parameters.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Guide for choosing training hyperparameters across SL, RL, DPO, and distillation.
docs/supervised-learning/sl-hyperparams.mdx — SL hyperparameter guide with LR formuladocs/rl/rl-hyperparams.mdx — RL hyperparameters (batch_size, group_size, num_substeps, async)tinker_cookbook/hyperparam_utils.py — LR formulas and model-specific calculationsThe recommended LR for a model m with LoRA:
LR(m) = lr_base × M_LoRA × (2000 / H_m) ^ P_m
Where:
lr_base = 5e-5M_LoRA = 10 (1 for full fine-tuning)H_m = hidden size of the modelP_m = model-specific exponent (0.0775 for Qwen, 0.781 for Llama)from tinker_cookbook.hyperparam_utils import get_lr
lr = get_lr("meta-llama/Llama-3.1-8B", is_lora=True)
# Returns model-specific recommended LR
This formula gives <0.5% regret vs exhaustive sweeps across diverse SFT experiments.
| Training type | Typical LR range | Notes |
|---|---|---|
| SL (LoRA) | 1e-4 to 5e-4 | Use get_lr() |
| SL (full FT) | 1e-5 to 5e-5 | LoRA LR / 10 |
| RL | 1e-5 to 4e-5 | Lower than SL |
| DPO | ~1e-5 | Much lower than SL |
| RLHF (RL stage) | ~1e-5 | Same as RL |
| Distillation | ~1e-4 | Similar to SL |
from tinker_cookbook.hyperparam_utils import get_lora_param_count
# Check parameter count for a given rank
params = get_lora_param_count("meta-llama/Llama-3.1-8B", lora_rank=32)
LR ∝ √batch_sizeTwo parameters control RL batch composition:
batch_size (or groups_per_batch): Number of unique problems/environments per batchgroup_size: Number of rollouts per problem (advantages centered within group)total_rollouts = batch_size × group_size
Guidelines:
group_size for more training signalLR ∝ √batch_sizegroups_per_batch=4, group_size=2)Available schedules:
"linear" — Linear decay to 0 (most common)"cosine" — Cosine annealing"constant" — No decaySet via lr_schedule parameter in config.
num_substeps (RL)Controls how many optimizer updates per sampling iteration:
num_substeps=1 (default): One update per batch — simplest, usually sufficientnum_substeps>1: Splits batch into mini-batches, one update each. Requires PPO objective.dpo_beta=0.1 — Well-tested default. Controls deviation from reference model.kl_penalty_coef=1.0 — Weight of KL penalty from teacherkl_discount_factor=0.0 — No discounting (increase for long sequences)| Scenario | Model | LR | Batch | LoRA Rank |
|---|---|---|---|---|
| SFT on chat data | Llama-3.1-8B | get_lr(model) | 128 | 32 |
| Math GRPO | Llama-3.1-8B-Instruct | 4e-5 | 128×16 | 32 |
| DPO | Llama-3.2-1B | 1e-5 | 256 | 32 |
| Distillation | Qwen3-8B-Base | 1e-4 | 1024×4 | 128 |
| Multi-turn RL | Kimi-K2-Thinking | 1e-5 | 8×4 | 32 |
get_lr() to get it rightget_lr() currently only supports Llama and Qwen families — other models need manual tuningまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Guide for checkpointing — saving, loading, and resuming training with CheckpointRecord. Use when the user asks about saving weights, resuming training, checkpoint management, or the checkpoint lifecycle.
日本語の概要は準備中です。原文の説明を表示しています。
Guide for testing conventions and CI pipelines — unit tests, integration smoke tests, pytest markers, and GitHub Actions workflows. Use when the user asks about testing, CI, running tests, or adding tests for a recipe.
日本語の概要は準備中です。原文の説明を表示しています。
Guide for using completers — TokenCompleter and MessageCompleter for text generation during RL rollouts and evaluation. Use when the user asks about generating text, completing messages, or using completers in RL environments.
日本語の概要は準備中です。原文の説明を表示しています。
Guide for contributing to the tinker-cookbook repo — development setup, code style, type checking, PR process, and design conventions. Use when the user asks about how to contribute, set up the dev environment, code style, or project conventions.
日本語の概要は準備中です。原文の説明を表示しています。
Guide for dataset construction — SupervisedDatasetBuilder, RLDatasetBuilder, ChatDatasetBuilder, and custom dataset creation from JSONL, HuggingFace, or conversation data. Use when the user asks about datasets, data loading, data preparation, or custom data formats.
日本語の概要は準備中です。原文の説明を表示しています。
Set up and run knowledge distillation (on-policy, off-policy, or multi-teacher) from a teacher model to a student model using the Tinker API. Use when the user wants to distill knowledge, compress models, or train a student from a teacher.
日本語の概要は準備中です。原文の説明を表示しています。