unsloth/unsloth/models
Daniel Han 56e9046b2f
Lower default weight_decay in RL config from 0.01 to 0.001 (#5747)
In full FT, AdamW weight decay shrinks the parameter directly so the
implicit prior is W -> 0. In LoRA the trained parameters are A and B
while the effective weight is W = W_init + (alpha/r) * B @ A; decaying
A and B separately drives BA -> 0, hence W -> W_init rather than 0.
The previous default of 0.01 inherited from full-FT recipes adds a
measurable pull on the merged adapter back toward the base model over
a few thousand steps. 0.001 keeps a small Frobenius-norm prior on
||A||^2 + ||B||^2 for numerical stability without meaningfully biasing
the merged weight toward init, and aligns with the value used across
the unsloth notebook templates.
2026-05-23 22:28:59 -07:00
..
__init__.py Revert "feat: Add Mixtral model support" 2026-03-13 22:38:49 -07:00
_utils.py API fixes + pypi 2026-05-22 09:16:53 -07:00
cohere.py Fix forward compatibility with transformers 5.x (#4752) 2026-04-01 06:04:03 -07:00
dpo.py Formatting & bug fixes (#3563) 2025-11-07 06:00:22 -08:00
falcon_h1.py Fix forward compatibility with transformers 5.x (#4752) 2026-04-01 06:04:03 -07:00
gemma.py Fix/pr 3699 leftpad prefill main (#4100) 2026-02-25 07:21:04 -08:00
gemma2.py Fix forward compatibility with transformers 5.x (#4752) 2026-04-01 06:04:03 -07:00
glm4_moe.py [MoE] Improve moe kernels for unsloth fine tuning (#3812) 2026-02-05 06:03:25 -08:00
granite.py Fix forward compatibility with transformers 5.x (#4752) 2026-04-01 06:04:03 -07:00
llama.py Respect GC for GRPO (#5269) 2026-05-22 05:37:25 -07:00
llama4.py Qwen 3 2025-05-02 03:09:44 -07:00
loader.py fix(gpt-oss): prefer flex attention over sdpa (#5701) 2026-05-22 08:38:38 -07:00
loader_utils.py studio: reuse HF cached repo casing to prevent duplicate downloads (#4822) 2026-04-03 05:48:24 -07:00
mapper.py Re-apply #4939: updated models template mappers (#4950) 2026-04-15 07:52:12 -07:00
mistral.py fast_generate: unify legacy/new logits kwarg + fix Mistral merge site (#5543) 2026-05-18 04:19:48 -07:00
qwen2.py Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" 2025-12-01 07:24:58 -08:00
qwen3.py Fix forward compatibility with transformers 5.x (#4752) 2026-04-01 06:04:03 -07:00
qwen3_moe.py Fix correctness bugs across multiple model files (#3813) 2026-01-01 02:36:33 -08:00
rl.py Lower default weight_decay in RL config from 0.01 to 0.001 (#5747) 2026-05-23 22:28:59 -07:00
rl_replacements.py Respect GC for GRPO (#5269) 2026-05-22 05:37:25 -07:00
sentence_transformer.py fix(sentence_transformer): resume PEFT checkpoints under sentence-transformers >= 5.4 (#5454) 2026-05-17 04:02:36 -07:00
vision.py fix(peft): expose finetune_last_n_layers for parity with mlx-lm CLI (#5564) 2026-05-19 05:58:44 -07:00