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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved Lora finetuning script #1179
base: main
Are you sure you want to change the base?
Improved Lora finetuning script #1179
Changes from 1 commit
0cae6b4
e9cd2b1
6bf87f0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can understand the desire for not hardcoding the instruction. On the other hand, always using the same one is useful to observe progress in the continuation.
Maybe it's best to drop this bit entirely instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought was that it is helpful to get a feeling if the model generalizes well over the validation data. If you always have the same prompt you can't really tell, or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this as a preference without no right or wrong. I'll defer this decision to the folks who finetune the most: @rasbt and @awaelchli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say for the generalization aspect, we already calculate the loss over the validation set. The fixed prompt here is more of a small visual check, and I do think it helps having it the same prompt.
We could potentially do it like this:
validation_instruction: str = "fixed"
defaults to the current behavior but that might be overkillThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me when this happens. Everytime the validation function is called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add what Sebastian said I would say that we can't tell very well from a single example by how much the model is improving. Whether it is a sample from the dataset or one we provide doesn't matter much. It's there as a sanity check to make sure the model eventually starts following instructions and adopting the prompt template. I am in favor of keeping it simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say if we were to add the rotation, that would be also done every
eval.interval
steps (the default is 100) (which currently includes both calculating the loss over the entire validation set and then also using the one example prompt/instruction for a quick visual sanity check that the model generates coherent text.)