feat(passthrough): Introduce noise injection#642
feat(passthrough): Introduce noise injection#642TheLocalDrummer wants to merge 2 commits intoarcee-ai:mainfrom
Conversation
…d seed in passthrough merge method
|
I have read the CLA Document and I hereby sign the CLA TheLocalDrummer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
|
||
| tensor = tensor + noisy_tensor | ||
|
|
||
| print(f"noise_scale={noise_scale}, noise_seed={noise_seed}, noise_variance={noise_variance}") |
There was a problem hiding this comment.
To remove before merging
| ConfigParameterDef(name="scale", required=False, default_value=None), | ||
| ConfigParameterDef(name="noise_scale", required=False, default_value=None), | ||
| ConfigParameterDef(name="noise_variance", required=False, default_value=None), | ||
| ConfigParameterDef(name="noise_seed", required=False, default_value=None) |
There was a problem hiding this comment.
Bug: Default Seed Value Not Honored
The noise_seed parameter has default_value=None in its definition, but line 36 expects it to default to 42. When not provided by the user, the parameter will be None in the dict, so .get("noise_seed", 42) returns None instead of 42, causing the seed to be None rather than the intended default of 42.
There was a problem hiding this comment.
I remember getting confused by this one. ConfigParameterDef seems to cast the default value into a string?
|
I have read the CLA Document and I hereby sign the CLA |
Note
Adds configurable noise injection to
passthrough(withnoise_scale,noise_seed,noise_variance) and updates documentation.mergekit/merge_methods/passthrough.pycontrolled by per-model parameters:noise_scale: scales Gaussian noise added to the tensornoise_seed: seeds the noise generator for reproducibilitynoise_variance: scales noise bytensor.std() * noise_variancetensor_parameters()to expose new options alongside existingscale.docs/merge_methods.mdforpassthroughto documentnoise_scale,noise_seed, andnoise_varianceparameters.Written by Cursor Bugbot for commit 783e3ff. This will update automatically on new commits. Configure here.
Thanks Cursor! Please note that I haven't revisited this since a month or two ago. Will take another serious look before finalizing things!
Sample config
Base with noise: https://huggingface.co/BeaverAI/Signal-24B-Base-v1a-GGUF
Finetuned: https://huggingface.co/BeaverAI/Signal-24B-v1a-GGUF
TODO
noise_seed_incrementto shuffle random values while maintaining replicability. (Alternatively, the user can just do it manually via the config?)noise_varianceinto a number (for scaling) instead of a flagnoise_generatorfor a significant speed increase (more-so when introducingnoise_seed_incrementpassthroughcan be run alongside other merge methodsNoise can rewire the LLM to consider new novel concepts. Noise can also lobotomize a model, so make sure to apply it properly! Ask your local LLM for advice.
Credits to DavidAU for inspiration 🤣