Skip to content
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

NuSLERP #357

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

NuSLERP #357

wants to merge 7 commits into from

Conversation

cg123
Copy link
Collaborator

@cg123 cg123 commented Jun 26, 2024

Adds a new merge method nuslerp. This method allows for a superset of the functionality of slerp. If provided with a base model nuslerp will perform spherical interpolation of the task vectors. While the original slerp always flattens weight tensors into a single dimension nuslerp can also do row-wise and column-wise interpolation of tensors.

This method remedies one of my long-standing gripes with how I implemented slerp. Instead of taking a t parameter and using base_model to specify which is the "first" model, nuslerp simply takes a weight parameter for each model and computes the interpolation factor t internally. This makes it fit the conventions of the other merge methods much better. The weight parameter behaves in the same fashion as it does for merge_method: linear with normalize: true.

The idea to add task vector SLERP is inspired by DeepMind's great use of it in their WARP paper.

@jpeek34556
Copy link

jpeek34556 commented Jul 22, 2024

I sincerely think that the spherical visualization of SLERP and the 3D axis within could be the forerunner to future model merging GUI. A kind of DAW from music producing but now we're mixing models. Visualization is the psychological ignition. A picture is worth 1000 words. Kudos on nuslerp. ref.: https://en.wikipedia.org/wiki/Phase_space

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.

2 participants