Add random gaussian noise vector to embeddings #736
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.
This pull request introduces support for adding configurable L2-normalized Gaussian noise to token embeddings in the model, both during training and inference. The noise scale can be set via configuration, command-line arguments, or YAML sweep files, and is applied in all relevant embedding lookup paths. The changes also improve experiment reproducibility by logging the noise parameter and allow for easy parameter sweeps.
Embedding Gaussian Noise Support:
embedding_gaussian_noise_stdtoGPTConfigand CLI/train args, controlling the standard deviation of L2-normalized Gaussian noise added to embeddings (gpt_conf.py,train_args.py). [1] [2]add_embedding_gaussian_noisemethod inmodel.pyand applied it to all embedding lookup locations, ensuring noise is consistently added during forward passes (model.py). [1] [2] [3] [4]Experimentation and Reproducibility:
embedding_gaussian_noise_sweep.yaml) to facilitate running experiments with different noise levels.sample.py) to allow overriding the noise scale at inference time and to log the noise parameter in evaluation summaries for reproducibility. [1] [2] [3]Evaluation Output Improvements: