text capability recovery: weight merging#16
Open
sprnjt wants to merge 2 commits intoCohere-Labs-Community:mainfrom
Open
text capability recovery: weight merging#16sprnjt wants to merge 2 commits intoCohere-Labs-Community:mainfrom
sprnjt wants to merge 2 commits intoCohere-Labs-Community:mainfrom
Conversation
Member
|
Do you save some logs of the run? how does it look like? |
Author
|
The merge would happen after the fine tuning. I figured out the merging process and will need to fix the code as per the changes. |
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.
Problem:
Adding visual capabilities to Tiny Aya consistently degrades its multilingual text performance on benchmarks like m-ArenaHard and GlobalMGSM. With only 3.35B parameters, Tiny Aya has less capacity redundancy than the 8B/32B models where cross-modal merging has previously been validated.
Too early to merge in main (since it is Phase 1 rn)
Solution:
Implement a weight-merging script that linearly interpolates the fine-tuned VLM's LLM backbone with the original text-only Tiny Aya Base weights.
This lead to the idea of Pareto merging concept (which I did earlier in a research project, basically finding the best sweep or the sweet spot)
The merge ratio α ∈ {0.3, 0.4, 0.5, 0.6, 0.7} is a CLI parameter, enabling a sweep to find the Pareto-optimal point between visual grounding and text task recovery.
What the script does?
Loads the original Tiny Aya base model, and fine tuned VLM checkpoint
Very important: Interpolates only language_model.* parameters — the multi_modal_projector and vision_encoder pass through untouched from the fine-tuned checkpoint
Validates key and shape compatibility before merging
Saves merged_state.pt and optionally a full HF model dir (--save-hf)
Usage: