Add random gaussian noise vector to embeddings 2 #737
Merged
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 L2-normalized Gaussian noise to token embeddings as a configurable regularization technique. The changes allow users to specify the noise scale during both training and inference, and to sweep over different noise values in experiments. The implementation ensures noise is consistently applied in all relevant embedding pathways and tracked in evaluation outputs.
Embedding Gaussian Noise Regularization:
embedding_gaussian_noise_stdas a new configuration parameter inGPTConfig, CLI arguments (train_args.py,sample.py), and experiment sweep YAML to control the scale of Gaussian noise applied to token embeddings. [1] [2] [3] [4]add_embedding_gaussian_noisemethod inmodel.pyto inject L2-normalized Gaussian noise into token embeddings, and integrated this method into all embedding lookup pathways (forward,embed_tokens). [1] [2] [3] [4]Inference and Evaluation Enhancements:
sample.py, ensuring flexibility for evaluation experiments. [1] [2]Experimentation Support:
embedding_gaussian_noise_stdsweep values toembedding_gaussian_noise_sweep.yamlfor systematic experimentation.