Skip to content

Add lora_init_seed config for reproducible LoRA initialization#735

Open
Butanium wants to merge 1 commit into
thinking-machines-lab:mainfrom
Butanium:lora-init-seed
Open

Add lora_init_seed config for reproducible LoRA initialization#735
Butanium wants to merge 1 commit into
thinking-machines-lab:mainfrom
Butanium:lora-init-seed

Conversation

@Butanium
Copy link
Copy Markdown

@Butanium Butanium commented May 26, 2026

Summary

  • Add an optional lora_init_seed: int | None = None field to the SFT (tinker_cookbook/supervised/train.py), RL (tinker_cookbook/rl/train.py), and DPO (tinker_cookbook/preference/train_dpo.py) Config dataclasses.
  • Thread the field into service_client.create_lora_training_client[_async](..., seed=...) in all three trainers.
  • Default None preserves current behavior (SDK picks a random seed per tinker.ServiceClient.create_lora_training_client_async(seed=None)); setting it makes the LoRA adapter initialization reproducible across runs with the same config.

Motivation

I want to study sensitivity to LoRA adapter initialization (running the same training config across seeds with everything else held fixed). Today the trainers don't expose the SDK's seed= knob, so the adapter init is non-deterministic and not controllable from the cookbook layer.

🤖 Drafted with Claude Code — Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

Threads a new optional `lora_init_seed: int | None = None` through the
SFT, RL, and DPO trainer configs and forwards it to
`service_client.create_lora_training_client[_async](seed=...)`. Default
`None` preserves current behavior (SDK picks a random seed); setting it
makes LoRA adapter initialization reproducible across runs with the same
config.
Copy link
Copy Markdown
Author

@Butanium Butanium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was pretty useful for my experiments

@Butanium Butanium marked this pull request as ready for review May 26, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant