Add lora_init_seed config for reproducible LoRA initialization#735
Open
Butanium wants to merge 1 commit into
Open
Add lora_init_seed config for reproducible LoRA initialization#735Butanium wants to merge 1 commit into
lora_init_seed config for reproducible LoRA initialization#735Butanium wants to merge 1 commit into
Conversation
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.
Butanium
commented
May 26, 2026
Author
Butanium
left a comment
There was a problem hiding this comment.
that was pretty useful for my experiments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lora_init_seed: int | None = Nonefield to the SFT (tinker_cookbook/supervised/train.py), RL (tinker_cookbook/rl/train.py), and DPO (tinker_cookbook/preference/train_dpo.py)Configdataclasses.service_client.create_lora_training_client[_async](..., seed=...)in all three trainers.Nonepreserves current behavior (SDK picks a random seed pertinker.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