Releases: ApolloResearch/rib
v2.0.0
What's Changed
- Edge Ablations by @nix-apollo in #285
- Tweak edge ablation's handling of constant directions by @nix-apollo in #297
- Support jacobian basis (formerly November B): Refactor version. by @stefan-apollo in #294
- resupport tinystories by @nix-apollo in #304
- Add helper function for interaction rotation operation by @nix-apollo in #306
- [RFR] Bisect ablation scheduler by @stefan-apollo in #303
- Format with new black and pin dev dependencies by @danbraunai-apollo in #309
- Run ablation tests without reading sample graphs by @danbraunai-apollo in #307
- Split layernorm into two sequential modules by @danbraunai-apollo in #305
- Small plotting fixes by @nix-apollo in #308
- Stochastic sources jacobian basis by @stefan-apollo in #296
- Add n_documents option for HF datasets by @danbraunai-apollo in #316
- Gauss-Legendre alpha integral, plus integral refactor by @stefan-apollo in #317
- Allow distributed edge splitting over out_dim by @danbraunai-apollo in #319
- Specify integral method by layer by @nix-apollo in #325
- Build test fixes by @nix-apollo in #330
- Updates for python 3.12 by @nix-apollo in #327
- Distributed calculation for basis by @nix-apollo in #332
- Nix' magic memory saving changes by @stefan-apollo in #338
- Bugfix for distributed seeds by @nix-apollo in #340
- Fix/negative variance edge ablation [Replacement for #323] by @stefan-apollo in #346
- Naive implementation of gradient flow (in refactored code) by @stefan-apollo in #333
- Isolate the variance in layernorm into a separate RIB dir by @nix-apollo in #345
- Feature/plotting improvements by @nix-apollo in #348
- Ablations with reference to baseline by @stefan-apollo in #347
- Fix for plotting bug introduced in #348 by @stefan-apollo in #351
- Use a huggingface cache by @stefan-apollo in #350
- Use separate (larger) dataset for gram (and mean) matrices by @stefan-apollo in #344
- Set huggingface cache at the right point by @stefan-apollo in #356
- Take cache mode activations off the GPU by @stefan-apollo in #355
- Improve ablations by @nix-apollo in #357
- Improved docstring / comments by @stefan-apollo in #359
- Update the modular addition config file by @stefan-apollo in #360
- Added new hook & function for feature viz tool by @stefan-apollo in #363
- Preparation for publication by @danbraunai-apollo in #364
- Modularity Analysis by @nix-apollo in #349
- Paper plotting scripts by @stefan-apollo in #366
- Implement paper plots feedback by @stefan-apollo in #367
Full Changelog: v1.0...v2.0.0
v1.0
Breaking Changes
Many. The most important being that:
- All rib build experiments were combined and can be run from
rib_scripts/rib_buildand all ablation experiments were combined and can be run fromrib_scripts/ablations. - Rib build outputs a RibBuildResults pydantic object.
Some more detailed breaking changes are given in the PR descriptions that were merged for this release.
What's Changed
- Fix bug overwriting edges each batch by @danbraunai-apollo in #243
- Separated out attention scores into module to be cache-able by @stefan-apollo in #246
- Add option to add node_labels to graph by @stefan-apollo in #250
- Normalize after squaring in jacobian squared by @danbraunai-apollo in #247
- Throw a warning if only the IGNORE field is mismatched by @stefan-apollo in #252
- Utility to get rib activations by @nix-apollo in #242
- Update workflow file for self-hosted runner by @danbraunai-apollo in #255
- Implement ModularDNN model by @stefan-apollo in #235
- Add unused import error in pre-commit by @danbraunai-apollo in #258
- Add get_config functions to test_build_graph by @nix-apollo in #256
- PCA basis by @nix-apollo in #249
- Remove 'model' key when parsing interaction_graph_info by @danbraunai-apollo in #262
- Combine lm and mlp ablation scripts by @danbraunai-apollo in #263
- Combine lm_rib_build with mlp_rib_build by @danbraunai-apollo in #264
- Move core functionality from experiments to rib package by @danbraunai-apollo in #267
- Make RibResults a pydantic model by @danbraunai-apollo in #268
- Use raw MLP class for modular MLPs by @danbraunai-apollo in #269
- Convert InteractionRotation and Eigenvectors to pydantic models by @danbraunai-apollo in #270
- Store edges in Edges pydantic model by @danbraunai-apollo in #273
- Rename variables and clean docs by @danbraunai-apollo in #274
- Add Stochastic Noise Sources (SNS) attribution method by @danbraunai-apollo in #254
- add kwarg support for test configs by @nix-apollo in #277
- Move ablation schedule from fn to instance methods by @danbraunai-apollo in #281
- Nix's unify clenaups by @nix-apollo in #280
- Centered rib by @nix-apollo in #257
- Rename torch types by @danbraunai-apollo in #284
- Remove extra return_set arg by @danbraunai-apollo in #286
- Combine Eigenvectors object with InteractionRotation by @danbraunai-apollo in #290
- Major Refactoring by @danbraunai-apollo in #260
Full Changelog: v0.2...v1.0
v0.2
What's Changed
- Support CIFAR model training by @nix-apollo in #223. Breaking Changes:
- Moved and renamed files and folders that referenced MNIST
- Moved the mlp experiment file's ModelConfig, that is now MlpConfig in models/mlp.py
- MLP configs require input and output size.
- Support different bases and edges formulas by @stefan-apollo in #219
- Forbid extra args in pydantic configs by @danbraunai-apollo in #237. Breaking Changes
- Any configs that contained arguments which weren't valid for that config will not throw a pydantic ValidationError.
- Tiny stories support by @nix-apollo in #232
- Add svd basis by @nix-apollo in #239
- Support return_set_frac and n_samples for all datasets by @danbraunai-apollo in #238. Breaking Changes
- No longer supports passing "both" as a
return_setargument. - Previously, VisionDataset had a return_set_frac that took samples from the start of the dataset. This change will therefore be a breaking change for configs that previously defined a return_set_frac. VisionDataset is a new thing, and Nix said that this isn't a concern.
- No longer supports passing "both" as a
Full Changelog: v0.1...v0.2
v0.1
Breaking Changes
Update transformer-lens (#222)
- You must re-install the rib package in your environment as the requirements have changed.
MLP complete rewrite in #201
- MLP layers and models have an updated interface and fold biases in a very different way. In particular, note:
- You can't train after folding the bias
- You can't fold the bias of sigmoid or tanh models, as there is no x where act(x)=1 for these functions.
- MLP models and layers now have a .has_bias_folded and .fold_bias attribute. This is the preferred interface for bias folding.
- Renamed mlp Layer class to MLPLayer (especially as it's imported into rib.models namespace)
- Old MLP models will no longer be able to be loaded.
Return values and out_dirs (#213)
- Previously a main method would return None if the user decided not to overwrite the file. Now it raises a FileExistsError. This is so the main method can have a non-optional return type.
- changed the meaning of
out_dir=Noneto not write an output file. The default is still.out/ - AblationConfigs can no longer have no experiment name. Previously this was used to have no output file. In able to have no output file, pass out_dir = None instead.
Can no longer pass eps to an lm_rib_build or lm_ablation config (#225)
What's Changed
- Parallelize edge calculations by @nix-apollo in #196
- Fold biases by default by @danbraunai-apollo in #199
- main methods accept config objects in addition to paths by @nix-apollo in #200
- Feature to force overwrite of output file via cmdline argument or config file by @stefan-apollo in #202
- MLP class refactor, particularly for fold_bias by @nix-apollo in #201
- Fix M matrix floating point issues by @stefan-apollo in #203
- Assert sequential node_layers in run_mnist_rib_build by @danbraunai-apollo in #214
- Clean up tests and standardize configs by @nix-apollo in #213
- Run RIB build over multiple nodes by @danbraunai-apollo in #208
- Clean up dtype loading by @danbraunai-apollo in #215
- Update tlens and misc config settings by @danbraunai-apollo in #222
- Add n_ctx to config by @nix-apollo in #209
- Remove epsilon from script configs by @danbraunai-apollo in #225
New Contributors
- @nix-apollo made their first contribution in #196
Full Changelog: v0.0...v1.0
v0.0
State of Project
- Runs single-process RIB on MNIST, modular addition, and Pythia-14m (although the latter will take many days/weeks to compute all edges).
- Calculates ablation curves
Recent Updates
Normalize gradients in edge calculation #189
Normalizes gradients by the dataset_size and token dimension before summing with the input tensor
Implement split-up Attention module #180
Splits Atttention (attn) into AttentionIn (attn_in) and AttentionOut (attn_out). attn_in just creates the KQV activations, and attn_out handles the rest
Replace jacrev with for loop #185
Uses a for loop instead of jacrev for the edge calculation
Refactor SequentialTransformer for cleanliness #183
Refactors SequentialTransformer and major cleanup of it's docs and structure. I recommend having a read of the full file, it might clear things up for you about how this class works and what module_id and section_ids are.
Map for module_id to section_id mapping #182
Introduces a mapping function between a section_id (e.g. sections.section_2.3 to a module_id (e.g. mlp_out.3 ). E.g. you can do:
>> model = SequentialTransformer(cfg, node_layers)
>> print(model.section_id_to_module_id["sections.section_2.3"])
mlp_out.3