Add Batch 99368f76-d613-48de-8c2d-baaa7cb6eb71 data
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +64 -0
- 2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/c97b8b7c-607e-4bee-a1f9-a3a08e3c23fa_content_list.json +0 -0
- 2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/c97b8b7c-607e-4bee-a1f9-a3a08e3c23fa_model.json +0 -0
- 2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/c97b8b7c-607e-4bee-a1f9-a3a08e3c23fa_origin.pdf +3 -0
- 2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/full.md +873 -0
- 2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/images.zip +3 -0
- 2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/layout.json +0 -0
- 2025/Repetition Improves Language Model Embeddings/a1da781f-b124-4ff7-b979-4e630c28049f_content_list.json +0 -0
- 2025/Repetition Improves Language Model Embeddings/a1da781f-b124-4ff7-b979-4e630c28049f_model.json +0 -0
- 2025/Repetition Improves Language Model Embeddings/a1da781f-b124-4ff7-b979-4e630c28049f_origin.pdf +3 -0
- 2025/Repetition Improves Language Model Embeddings/full.md +0 -0
- 2025/Repetition Improves Language Model Embeddings/images.zip +3 -0
- 2025/Repetition Improves Language Model Embeddings/layout.json +0 -0
- 2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/791cb7c8-9e55-4a03-85bd-a3775369aa76_content_list.json +0 -0
- 2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/791cb7c8-9e55-4a03-85bd-a3775369aa76_model.json +0 -0
- 2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/791cb7c8-9e55-4a03-85bd-a3775369aa76_origin.pdf +3 -0
- 2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/full.md +483 -0
- 2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/images.zip +3 -0
- 2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/layout.json +0 -0
- 2025/Representational Similarity via Interpretable Visual Concepts/2112ed29-8c76-4c56-84e8-bba7e682892d_content_list.json +0 -0
- 2025/Representational Similarity via Interpretable Visual Concepts/2112ed29-8c76-4c56-84e8-bba7e682892d_model.json +0 -0
- 2025/Representational Similarity via Interpretable Visual Concepts/2112ed29-8c76-4c56-84e8-bba7e682892d_origin.pdf +3 -0
- 2025/Representational Similarity via Interpretable Visual Concepts/full.md +655 -0
- 2025/Representational Similarity via Interpretable Visual Concepts/images.zip +3 -0
- 2025/Representational Similarity via Interpretable Visual Concepts/layout.json +0 -0
- 2025/Repulsive Latent Score Distillation for Solving Inverse Problems/b01edac8-dfb7-4a0d-bf86-d41f21b22210_content_list.json +0 -0
- 2025/Repulsive Latent Score Distillation for Solving Inverse Problems/b01edac8-dfb7-4a0d-bf86-d41f21b22210_model.json +0 -0
- 2025/Repulsive Latent Score Distillation for Solving Inverse Problems/b01edac8-dfb7-4a0d-bf86-d41f21b22210_origin.pdf +3 -0
- 2025/Repulsive Latent Score Distillation for Solving Inverse Problems/full.md +0 -0
- 2025/Repulsive Latent Score Distillation for Solving Inverse Problems/images.zip +3 -0
- 2025/Repulsive Latent Score Distillation for Solving Inverse Problems/layout.json +0 -0
- 2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/d709add5-526d-468b-a950-f8446de182da_content_list.json +0 -0
- 2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/d709add5-526d-468b-a950-f8446de182da_model.json +0 -0
- 2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/d709add5-526d-468b-a950-f8446de182da_origin.pdf +3 -0
- 2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/full.md +0 -0
- 2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/images.zip +3 -0
- 2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/layout.json +0 -0
- 2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/d1f0fb8d-9179-45cf-a4f3-2da7a6c2ae85_content_list.json +0 -0
- 2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/d1f0fb8d-9179-45cf-a4f3-2da7a6c2ae85_model.json +0 -0
- 2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/d1f0fb8d-9179-45cf-a4f3-2da7a6c2ae85_origin.pdf +3 -0
- 2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/full.md +680 -0
- 2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/images.zip +3 -0
- 2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/layout.json +0 -0
- 2025/Residual Stream Analysis with Multi-Layer SAEs/c5f0cfd3-597a-4802-9eab-e315341b6fe2_content_list.json +0 -0
- 2025/Residual Stream Analysis with Multi-Layer SAEs/c5f0cfd3-597a-4802-9eab-e315341b6fe2_model.json +0 -0
- 2025/Residual Stream Analysis with Multi-Layer SAEs/c5f0cfd3-597a-4802-9eab-e315341b6fe2_origin.pdf +3 -0
- 2025/Residual Stream Analysis with Multi-Layer SAEs/full.md +748 -0
- 2025/Residual Stream Analysis with Multi-Layer SAEs/images.zip +3 -0
- 2025/Residual Stream Analysis with Multi-Layer SAEs/layout.json +0 -0
- 2025/Residual-MPPI_ Online Policy Customization for Continuous Control/625fdd9e-3614-412b-932f-3c849bf63d56_content_list.json +0 -0
.gitattributes
CHANGED
|
@@ -2583,3 +2583,67 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 2583 |
2025/Relaxed[[:space:]]Recursive[[:space:]]Transformers_[[:space:]]Effective[[:space:]]Parameter[[:space:]]Sharing[[:space:]]with[[:space:]]Layer-wise[[:space:]]LoRA/7b7db68e-7fd4-4390-983f-81cb82b5d9dd_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2584 |
2025/Release[[:space:]]the[[:space:]]Powers[[:space:]]of[[:space:]]Prompt[[:space:]]Tuning_[[:space:]]Cross-Modality[[:space:]]Prompt[[:space:]]Transfer/d90b90bb-820d-4ee0-bccb-a24fe90e5fb8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2585 |
2025/Reliable[[:space:]]and[[:space:]]Diverse[[:space:]]Evaluation[[:space:]]of[[:space:]]LLM[[:space:]]Medical[[:space:]]Knowledge[[:space:]]Mastery/79dc703e-cac7-4844-982a-f93a19996f6e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2583 |
2025/Relaxed[[:space:]]Recursive[[:space:]]Transformers_[[:space:]]Effective[[:space:]]Parameter[[:space:]]Sharing[[:space:]]with[[:space:]]Layer-wise[[:space:]]LoRA/7b7db68e-7fd4-4390-983f-81cb82b5d9dd_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2584 |
2025/Release[[:space:]]the[[:space:]]Powers[[:space:]]of[[:space:]]Prompt[[:space:]]Tuning_[[:space:]]Cross-Modality[[:space:]]Prompt[[:space:]]Transfer/d90b90bb-820d-4ee0-bccb-a24fe90e5fb8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2585 |
2025/Reliable[[:space:]]and[[:space:]]Diverse[[:space:]]Evaluation[[:space:]]of[[:space:]]LLM[[:space:]]Medical[[:space:]]Knowledge[[:space:]]Mastery/79dc703e-cac7-4844-982a-f93a19996f6e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2586 |
+
2025/Remove[[:space:]]Symmetries[[:space:]]to[[:space:]]Control[[:space:]]Model[[:space:]]Expressivity[[:space:]]and[[:space:]]Improve[[:space:]]Optimization/c97b8b7c-607e-4bee-a1f9-a3a08e3c23fa_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2587 |
+
2025/Repetition[[:space:]]Improves[[:space:]]Language[[:space:]]Model[[:space:]]Embeddings/a1da781f-b124-4ff7-b979-4e630c28049f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2588 |
+
2025/RepoGraph_[[:space:]]Enhancing[[:space:]]AI[[:space:]]Software[[:space:]]Engineering[[:space:]]with[[:space:]]Repository-level[[:space:]]Code[[:space:]]Graph/791cb7c8-9e55-4a03-85bd-a3775369aa76_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2589 |
+
2025/Representational[[:space:]]Similarity[[:space:]]via[[:space:]]Interpretable[[:space:]]Visual[[:space:]]Concepts/2112ed29-8c76-4c56-84e8-bba7e682892d_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2590 |
+
2025/Repulsive[[:space:]]Latent[[:space:]]Score[[:space:]]Distillation[[:space:]]for[[:space:]]Solving[[:space:]]Inverse[[:space:]]Problems/b01edac8-dfb7-4a0d-bf86-d41f21b22210_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2591 |
+
2025/Residual[[:space:]]Connections[[:space:]]and[[:space:]]Normalization[[:space:]]Can[[:space:]]Provably[[:space:]]Prevent[[:space:]]Oversmoothing[[:space:]]in[[:space:]]GNNs/d709add5-526d-468b-a950-f8446de182da_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2592 |
+
2025/Residual[[:space:]]Kernel[[:space:]]Policy[[:space:]]Network_[[:space:]]Enhancing[[:space:]]Stability[[:space:]]and[[:space:]]Robustness[[:space:]]in[[:space:]]RKHS-Based[[:space:]]Reinforcement[[:space:]]Learning/d1f0fb8d-9179-45cf-a4f3-2da7a6c2ae85_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2593 |
+
2025/Residual[[:space:]]Stream[[:space:]]Analysis[[:space:]]with[[:space:]]Multi-Layer[[:space:]]SAEs/c5f0cfd3-597a-4802-9eab-e315341b6fe2_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2594 |
+
2025/Residual-MPPI_[[:space:]]Online[[:space:]]Policy[[:space:]]Customization[[:space:]]for[[:space:]]Continuous[[:space:]]Control/625fdd9e-3614-412b-932f-3c849bf63d56_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2595 |
+
2025/Resolution[[:space:]]Attack_[[:space:]]Exploiting[[:space:]]Image[[:space:]]Compression[[:space:]]to[[:space:]]Deceive[[:space:]]Deep[[:space:]]Neural[[:space:]]Networks/22386c00-e8e6-42af-b920-028b0062da65_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2596 |
+
2025/Restyling[[:space:]]Unsupervised[[:space:]]Concept[[:space:]]Based[[:space:]]Interpretable[[:space:]]Networks[[:space:]]with[[:space:]]Generative[[:space:]]Models/73e3bda0-a9a9-4981-aad3-e1acbd7261d2_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2597 |
+
2025/Rethinking[[:space:]]Artistic[[:space:]]Copyright[[:space:]]Infringements[[:space:]]In[[:space:]]the[[:space:]]Era[[:space:]]Of[[:space:]]Text-to-Image[[:space:]]Generative[[:space:]]Models/dbb35fc5-5405-4d4a-96e3-420dd349024f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2598 |
+
2025/Rethinking[[:space:]]Audio-Visual[[:space:]]Adversarial[[:space:]]Vulnerability[[:space:]]from[[:space:]]Temporal[[:space:]]and[[:space:]]Modality[[:space:]]Perspectives/24a9032c-762c-45f4-920d-e143b102771b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2599 |
+
2025/Rethinking[[:space:]]Classifier[[:space:]]Re-Training[[:space:]]in[[:space:]]Long-Tailed[[:space:]]Recognition_[[:space:]]Label[[:space:]]Over-Smooth[[:space:]]Can[[:space:]]Balance/a7bcd58d-a26b-413c-9bb3-90eebd518e9f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2600 |
+
2025/Rethinking[[:space:]]Diffusion[[:space:]]Posterior[[:space:]]Sampling_[[:space:]]From[[:space:]]Conditional[[:space:]]Score[[:space:]]Estimator[[:space:]]to[[:space:]]Maximizing[[:space:]]a[[:space:]]Posterior/1bfcc8f7-b2e6-4600-813f-6c2e312218f8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2601 |
+
2025/Rethinking[[:space:]]Evaluation[[:space:]]of[[:space:]]Sparse[[:space:]]Autoencoders[[:space:]]through[[:space:]]the[[:space:]]Representation[[:space:]]of[[:space:]]Polysemous[[:space:]]Words/758f4eae-6ec0-44c9-a11b-d7714e261df8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2602 |
+
2025/Rethinking[[:space:]]Fair[[:space:]]Representation[[:space:]]Learning[[:space:]]for[[:space:]]Performance-Sensitive[[:space:]]Tasks/4b3c2e33-3279-4dc5-9aef-5e72ff975fc3_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2603 |
+
2025/Rethinking[[:space:]]Graph[[:space:]]Neural[[:space:]]Networks[[:space:]]From[[:space:]]A[[:space:]]Geometric[[:space:]]Perspective[[:space:]]Of[[:space:]]Node[[:space:]]Features/c5615337-7fd3-467e-9145-3ea23dde3f64_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2604 |
+
2025/Rethinking[[:space:]]Invariance[[:space:]]Regularization[[:space:]]in[[:space:]]Adversarial[[:space:]]Training[[:space:]]to[[:space:]]Improve[[:space:]]Robustness-Accuracy[[:space:]]Trade-off/179dfb19-cd2a-4ff8-82c1-cf80d7e3072e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2605 |
+
2025/Rethinking[[:space:]]Invariance[[:space:]]in[[:space:]]In-context[[:space:]]Learning/2b9ce3be-d812-4727-a8fe-0adb8e236ae2_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2606 |
+
2025/Rethinking[[:space:]]LLM[[:space:]]Unlearning[[:space:]]Objectives_[[:space:]]A[[:space:]]Gradient[[:space:]]Perspective[[:space:]]and[[:space:]]Go[[:space:]]Beyond/dd84ff96-c3f8-44c1-a5d1-efbb27aa6631_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2607 |
+
2025/Rethinking[[:space:]]Light[[:space:]]Decoder-based[[:space:]]Solvers[[:space:]]for[[:space:]]Vehicle[[:space:]]Routing[[:space:]]Problems/2f47b87e-2038-46bc-8978-1c65d2957e24_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2608 |
+
2025/Rethinking[[:space:]]Multiple-Instance[[:space:]]Learning[[:space:]]From[[:space:]]Feature[[:space:]]Space[[:space:]]to[[:space:]]Probability[[:space:]]Space/e5aaf29a-b177-4a15-8b37-7cafb70625d8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2609 |
+
2025/Rethinking[[:space:]]Neural[[:space:]]Multi-Objective[[:space:]]Combinatorial[[:space:]]Optimization[[:space:]]via[[:space:]]Neat[[:space:]]Weight[[:space:]]Embedding/e2cdc554-4406-4202-82ff-7b0bddcd9c48_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2610 |
+
2025/Rethinking[[:space:]]Self-Distillation_[[:space:]]Label[[:space:]]Averaging[[:space:]]and[[:space:]]Enhanced[[:space:]]Soft[[:space:]]Label[[:space:]]Refinement[[:space:]]with[[:space:]]Partial[[:space:]]Labels/6969fc01-e8a0-4b7d-8be5-23fa42a0ab7e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2611 |
+
2025/Rethinking[[:space:]]Shapley[[:space:]]Value[[:space:]]for[[:space:]]Negative[[:space:]]Interactions[[:space:]]in[[:space:]]Non-convex[[:space:]]Games/e622f9f3-b02d-4c1b-afe6-6627f81b118d_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2612 |
+
2025/Rethinking[[:space:]]Spiking[[:space:]]Neural[[:space:]]Networks[[:space:]]from[[:space:]]an[[:space:]]Ensemble[[:space:]]Learning[[:space:]]Perspective/0cace8bd-b929-41d4-9ff1-c139e7cf4713_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2613 |
+
2025/Rethinking[[:space:]]Visual[[:space:]]Counterfactual[[:space:]]Explanations[[:space:]]Through[[:space:]]Region[[:space:]]Constraint/22d91451-0925-48ee-b713-82d61aa61417_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2614 |
+
2025/Rethinking[[:space:]]the[[:space:]]role[[:space:]]of[[:space:]]frames[[:space:]]for[[:space:]]SE(3)-invariant[[:space:]]crystal[[:space:]]structure[[:space:]]modeling/9e03ce4f-11df-40bf-99fc-49aaa4ae4d8b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2615 |
+
2025/Retrieval[[:space:]]Augmented[[:space:]]Diffusion[[:space:]]Model[[:space:]]for[[:space:]]Structure-informed[[:space:]]Antibody[[:space:]]Design[[:space:]]and[[:space:]]Optimization/f7acd3d6-98fd-44fc-89f1-ebdfd9435d23_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2616 |
+
2025/RetroInText_[[:space:]]A[[:space:]]Multimodal[[:space:]]Large[[:space:]]Language[[:space:]]Model[[:space:]]Enhanced[[:space:]]Framework[[:space:]]for[[:space:]]Retrosynthetic[[:space:]]Planning[[:space:]]via[[:space:]]In-Context[[:space:]]Representation[[:space:]]Learning/e769c0e3-d827-4db8-9d45-8697b0b91470_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2617 |
+
2025/Reveal[[:space:]]Object[[:space:]]in[[:space:]]Lensless[[:space:]]Photography[[:space:]]via[[:space:]]Region[[:space:]]Gaze[[:space:]]and[[:space:]]Amplification/9ef7cf8e-beb2-462c-b116-e57bca2f6587_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2618 |
+
2025/Revealing[[:space:]]and[[:space:]]Mitigating[[:space:]]Over-Attention[[:space:]]in[[:space:]]Knowledge[[:space:]]Editing/d61cc9b9-55ce-4e5c-99fb-66b77fef6909_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2619 |
+
2025/Revealing[[:space:]]and[[:space:]]Reducing[[:space:]]Gender[[:space:]]Biases[[:space:]]in[[:space:]]Vision[[:space:]]and[[:space:]]Language[[:space:]]Assistants[[:space:]](VLAs)/da1d2c6e-a35a-47ed-9f19-4408ea85dd04_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2620 |
+
2025/Revealing[[:space:]]the[[:space:]]3D[[:space:]]Cosmic[[:space:]]Web[[:space:]]through[[:space:]]Gravitationally[[:space:]]Constrained[[:space:]]Neural[[:space:]]Fields/12295227-2684-4376-b577-8bec408dc9c4_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2621 |
+
2025/RevisEval_[[:space:]]Improving[[:space:]]LLM-as-a-Judge[[:space:]]via[[:space:]]Response-Adapted[[:space:]]References/071d9f21-314d-4d87-9430-70ca0188f7c6_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2622 |
+
2025/Revisit[[:space:]]Large-Scale[[:space:]]Image-Caption[[:space:]]Data[[:space:]]in[[:space:]]Pre-training[[:space:]]Multimodal[[:space:]]Foundation[[:space:]]Models/c246baa5-1c90-492e-b89a-f15a7d0510f9_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2623 |
+
2025/Revisit[[:space:]]Micro-batch[[:space:]]Clipping_[[:space:]]Adaptive[[:space:]]Data[[:space:]]Pruning[[:space:]]via[[:space:]]Gradient[[:space:]]Manipulation/8604ffdc-3716-40a6-8a7d-79ebbbe8771a_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2624 |
+
2025/Revisit[[:space:]]the[[:space:]]Open[[:space:]]Nature[[:space:]]of[[:space:]]Open[[:space:]]Vocabulary[[:space:]]Semantic[[:space:]]Segmentation/a759bc67-5424-4d11-ae88-b31b15068909_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2625 |
+
2025/Revisiting[[:space:]]Convolution[[:space:]]Architecture[[:space:]]in[[:space:]]the[[:space:]]Realm[[:space:]]of[[:space:]]DNA[[:space:]]Foundation[[:space:]]Models/2a79c757-997f-44f8-b378-fc0694910a29_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2626 |
+
2025/Revisiting[[:space:]]In-context[[:space:]]Learning[[:space:]]Inference[[:space:]]Circuit[[:space:]]in[[:space:]]Large[[:space:]]Language[[:space:]]Models/eb9d1a32-18f4-429e-a401-faefdaf58138_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2627 |
+
2025/Revisiting[[:space:]]Large-Scale[[:space:]]Non-convex[[:space:]]Distributionally[[:space:]]Robust[[:space:]]Optimization/12dc78b0-e2c3-40d0-b3bb-72186c8965e8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2628 |
+
2025/Revisiting[[:space:]]Mode[[:space:]]Connectivity[[:space:]]in[[:space:]]Neural[[:space:]]Networks[[:space:]]with[[:space:]]Bezier[[:space:]]Surface/6adbf199-1310-4e09-92f3-b090f28dbd2a_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2629 |
+
2025/Revisiting[[:space:]]Nearest[[:space:]]Neighbor[[:space:]]for[[:space:]]Tabular[[:space:]]Data_[[:space:]]A[[:space:]]Deep[[:space:]]Tabular[[:space:]]Baseline[[:space:]]Two[[:space:]]Decades[[:space:]]Later/9183aa8a-882e-4642-97ec-1d493a2740c0_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2630 |
+
2025/Revisiting[[:space:]]Prefix-tuning_[[:space:]]Statistical[[:space:]]Benefits[[:space:]]of[[:space:]]Reparameterization[[:space:]]among[[:space:]]Prompts/d7fac4c1-d3ab-4a02-bc43-8b54734b2f88_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2631 |
+
2025/Revisiting[[:space:]]Source-Free[[:space:]]Domain[[:space:]]Adaptation_[[:space:]]a[[:space:]]New[[:space:]]Perspective[[:space:]]via[[:space:]]Uncertainty[[:space:]]Control/4d1d3c62-11c2-4600-84da-fb6bf8e20d14_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2632 |
+
2025/Revisiting[[:space:]]a[[:space:]]Design[[:space:]]Choice[[:space:]]in[[:space:]]Gradient[[:space:]]Temporal[[:space:]]Difference[[:space:]]Learning/74e6ed4d-cca5-4b8e-8c8e-36e04a24e0e5_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2633 |
+
2025/Revolutionizing[[:space:]]EMCCD[[:space:]]Denoising[[:space:]]through[[:space:]]a[[:space:]]Novel[[:space:]]Physics-Based[[:space:]]Learning[[:space:]]Framework[[:space:]]for[[:space:]]Noise[[:space:]]Modeling/9622d3c1-39d0-4237-9a10-04dc43fd3b23_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2634 |
+
2025/Reward[[:space:]]Dimension[[:space:]]Reduction[[:space:]]for[[:space:]]Scalable[[:space:]]Multi-Objective[[:space:]]Reinforcement[[:space:]]Learning/f0dfe910-390f-4f14-ba14-211560111efe_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2635 |
+
2025/Reward[[:space:]]Learning[[:space:]]from[[:space:]]Multiple[[:space:]]Feedback[[:space:]]Types/4631ce78-675c-4e6d-8978-05fdcecf2b12_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2636 |
+
2025/Risk-Sensitive[[:space:]]Diffusion_[[:space:]]Robustly[[:space:]]Optimizing[[:space:]]Diffusion[[:space:]]Models[[:space:]]with[[:space:]]Noisy[[:space:]]Samples/d630cad8-2680-4efa-9c70-f1bbd542f530_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2637 |
+
2025/Risk-Sensitive[[:space:]]Variational[[:space:]]Actor-Critic_[[:space:]]A[[:space:]]Model-Based[[:space:]]Approach/60bffdc0-ea36-47c6-b693-3c1018d8434e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2638 |
+
2025/Robotouille_[[:space:]]An[[:space:]]Asynchronous[[:space:]]Planning[[:space:]]Benchmark[[:space:]]for[[:space:]]LLM[[:space:]]Agents/d59bac4b-c4ce-464d-ba5f-3ca767db20ee_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2639 |
+
2025/Robots[[:space:]]Pre-train[[:space:]]Robots_[[:space:]]Manipulation-Centric[[:space:]]Robotic[[:space:]]Representation[[:space:]]from[[:space:]]Large-Scale[[:space:]]Robot[[:space:]]Datasets/e0b99275-2e53-48d8-a9b1-332e32183c46_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2640 |
+
2025/RobuRCDet_[[:space:]]Enhancing[[:space:]]Robustness[[:space:]]of[[:space:]]Radar-Camera[[:space:]]Fusion[[:space:]]in[[:space:]]Bird's[[:space:]]Eye[[:space:]]View[[:space:]]for[[:space:]]3D[[:space:]]Object[[:space:]]Detection/6ecf04ab-d8ca-4700-b57f-9ec7a48bb330_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2641 |
+
2025/Robust[[:space:]]Barycenter[[:space:]]Estimation[[:space:]]using[[:space:]]Semi-Unbalanced[[:space:]]Neural[[:space:]]Optimal[[:space:]]Transport/a0e2679d-408d-43f8-b4ea-7c5f76c7b66f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2642 |
+
2025/Robust[[:space:]]Conformal[[:space:]]Prediction[[:space:]]with[[:space:]]a[[:space:]]Single[[:space:]]Binary[[:space:]]Certificate/0c19f3aa-fc2b-432b-b7eb-bb3bda196823_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2643 |
+
2025/Robust[[:space:]]Feature[[:space:]]Learning[[:space:]]for[[:space:]]Multi-Index[[:space:]]Models[[:space:]]in[[:space:]]High[[:space:]]Dimensions/b2c882a5-4c9d-4826-8857-2f8967cc109a_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2644 |
+
2025/Robust[[:space:]]Gymnasium_[[:space:]]A[[:space:]]Unified[[:space:]]Modular[[:space:]]Benchmark[[:space:]]for[[:space:]]Robust[[:space:]]Reinforcement[[:space:]]Learning/897bcf8d-ed52-42db-a6bf-de305b6cf70c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2645 |
+
2025/Robust[[:space:]]LLM[[:space:]]safeguarding[[:space:]]via[[:space:]]refusal[[:space:]]feature[[:space:]]adversarial[[:space:]]training/ecc359f6-ddf8-4f2e-a17a-fa72a3449fb1_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2646 |
+
2025/Robust[[:space:]]Representation[[:space:]]Consistency[[:space:]]Model[[:space:]]via[[:space:]]Contrastive[[:space:]]Denoising/22cec25b-6e55-464e-a033-154dcee4d05a_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2647 |
+
2025/Robust[[:space:]]Root[[:space:]]Cause[[:space:]]Diagnosis[[:space:]]using[[:space:]]In-Distribution[[:space:]]Interventions/3c99803f-7268-47d3-8b1c-259207e4ecff_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2648 |
+
2025/Robust[[:space:]]Simulation-Based[[:space:]]Inference[[:space:]]under[[:space:]]Missing[[:space:]]Data[[:space:]]via[[:space:]]Neural[[:space:]]Processes/582a1a49-cfc2-4a9f-bf09-cda0f4ac14bb_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2649 |
+
2025/Robust[[:space:]]System[[:space:]]Identification_[[:space:]]Finite-sample[[:space:]]Guarantees[[:space:]]and[[:space:]]Connection[[:space:]]to[[:space:]]Regularization/a9298da4-cb56-4c01-964a-36edebbe906e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/c97b8b7c-607e-4bee-a1f9-a3a08e3c23fa_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/c97b8b7c-607e-4bee-a1f9-a3a08e3c23fa_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/c97b8b7c-607e-4bee-a1f9-a3a08e3c23fa_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1772e7f871386b4e67ab77ae4ee405ed870f82bf9d1f90cdf7eaffc055a78c6c
|
| 3 |
+
size 2883373
|
2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/full.md
ADDED
|
@@ -0,0 +1,873 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REMOVE SYMMETRIES TO CONTROL MODEL EXPRESSIVITY AND IMPROVE OPTIMIZATION
|
| 2 |
+
|
| 3 |
+
Liu Ziyin $^{1,2,*}$ , Yizhou Xu $^{3,*}$ , Isaac Chuang $^{1,4}$
|
| 4 |
+
|
| 5 |
+
$^{1}$ Research Laboratory of Electronics, Massachusetts Institute of Technology
|
| 6 |
+
$^{2}$ Physics & Informatics Laboratories, NTT Research
|
| 7 |
+
<sup>3</sup>Computer and Communication Sciences, École Polytechnique Fédérale de Lausanne
|
| 8 |
+
$^{4}$ Department of Physics, Massachusetts Institute of Technology
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
When symmetry is present in the loss function, the model is likely to be trapped in a low-capacity state that is sometimes known as a "collapse." Being trapped in these low-capacity states can be a major obstacle to training across many scenarios where deep learning technology is applied. We first prove two concrete mechanisms through which symmetries lead to reduced capacities and ignored features during training and inference. We then propose a simple and theoretically justified algorithm, syre, to remove almost all symmetry-induced low-capacity states in neural networks. When this type of entrapment is especially a concern, removing symmetries with the proposed method is shown to correlate well with improved optimization or performance. A remarkable merit of the proposed method is that it is model-agnostic and does not require any knowledge of the symmetry.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
The unprecedented scale and complexity of modern neural networks, which contain a vast number of neurons and connections, inherently introduce a high degree of redundancy in model parameters. This complexity in the architecture and the design of loss functions often implies that the loss functions are invariant to various hidden and nonlinear transformations of the model parameters. These invariant transformations, or "symmetries," in the loss function have been extensively documented in the literature, with common examples including permutation, rescaling, scale, and rotation symmetries (Simsek et al., 2021; Entezari et al., 2021; Dinh et al., 2017; Neyshabur et al., 2014; Tibshirani, 2021; Zhao et al., 2023; Godfrey et al., 2022; Ziyin et al., 2024).
|
| 17 |
+
|
| 18 |
+
A unifying perspective to understand how these symmetries affect learning is the framework of reflection symmetries (Ziyin, 2024). A per-sample loss function $\ell$ possesses a $P$ -reflection symmetry if for all $\theta$ , and all data points $x$ ,
|
| 19 |
+
|
| 20 |
+
$$
|
| 21 |
+
\ell ((I - 2 P) \theta , x) = \ell (\theta , x). \tag {1}
|
| 22 |
+
$$
|
| 23 |
+
|
| 24 |
+
The solutions where $\theta = (I - P)\theta$ are the symmetric solutions with respect to $P$ . It has been shown that almost all models contain quite a few reflection symmetries. Permutation, rescaling, scale, and rotation symmetries all imply the existence of one or multiple reflection symmetries in the loss.
|
| 25 |
+
|
| 26 |
+
Recent literature has shown that symmetries in the loss function of neural networks often lead to the formation of low-capacity saddle points within the loss landscape (Fukumizu, 1996; Li et al., 2019). These saddle points are located at the symmetric solutions and often possess a lower capacity than the minimizers of the loss. When a model encounters these saddle points during training, the model parameters are not only slow to escape them but also attracted to these solutions because these the gradient noise also vanish close to these saddles (Chen et al., 2023). Essentially, the model's learning process stagnates, and it fails to achieve optimal performance due to reduced capacity. However, while many works have characterized the dynamical properties of training algorithms close to symmetric solutions, no methods are known to enable full escape from them.
|
| 27 |
+
|
| 28 |
+
Because these low-capacity saddles are created by symmetries, we propose a method to explicitly remove these symmetries from the loss functions of neural networks. The method we propose is
|
| 29 |
+
|
| 30 |
+
theoretically justified and only takes one line of code to implement. By removing these symmetries, our method allows neural networks to explore a more diverse set of parameter spaces and access more expressive solutions. The main contributions of this work are:
|
| 31 |
+
|
| 32 |
+
1. We show how discrete symmetries in the model can severely limit the expressivity of neural networks in the form commonly known as "collapses" (Section 4);
|
| 33 |
+
2. We propose a simple method that provably removes almost all symmetries in neural networks, without having any knowledge of the symmetry (Section 5);
|
| 34 |
+
3. We apply the method to solve a broad range of practical problems where symmetry-impaired training can be a major concern (Section 6).
|
| 35 |
+
|
| 36 |
+
We introduce the notations and problem setting for our work in the next section. Closely related works are discussed in Section 3. All proofs and experimental details are deferred to the appendix.
|
| 37 |
+
|
| 38 |
+
# 2 DISCRETE SYMMETRIES IN NEURAL NETWORKS
|
| 39 |
+
|
| 40 |
+
Notation. For a matrix $A$ , we use $A^{+}$ to denote the pseudo-inverse of $A$ . For groups $U$ and $G$ , $U \triangleleft G$ denotes that $U$ is a subgroup of $G$ . For a vector $\theta$ and matrix $D$ , $\| \theta \|_{D}^{2} \coloneqq \theta^{T} D \theta$ is the norm of $\theta$ with respect to $D$ . $\odot$ denotes the element-wise product between vectors.
|
| 41 |
+
|
| 42 |
+
Let $f(\theta, x)$ be a function of the model parameters $\theta$ and input data point $x$ . For example, $f$ could either be a sample-wise loss function $\ell$ or the model itself. Whenever $f$ satisfies the following condition, we say that $f$ has the $P$ -reflection symmetry (general symmetry groups are dealt with in Theorem 5 in Section 5).
|
| 43 |
+
|
| 44 |
+
Definition 1. Let $P$ be a projection matrix and $\theta'$ be a point. $f$ is said to have the $(\theta', P)$ -reflection symmetry if for all $x$ and $\theta$ , (1) $f(\theta + \theta', x) = f((I - 2P)\theta + \theta', x)$ , and (2) $P\theta' = \theta'$ .
|
| 45 |
+
|
| 46 |
+
The second condition is due to the fact that there is a redundancy in the choice of $\theta^{\prime}$ when $\theta^{\prime} \neq 0$ . Requiring $P\theta^{\prime} = \theta^{\prime}$ removes this redundancy and makes the choice of $\theta^{\prime}$ unique. Since every projection matrix can be written as a product of a (full-rank or low-rank) matrix $O$ with orthonormal columns, one can write $P = O O^{T}$ and refer to this symmetry as an $O$ symmetry. In common deep learning scenarios, it is almost always the case that $\theta^{\prime} = 0$ (for example, this holds for the common cases of rescaling symmetries, (double) rotation symmetries, and permutation symmetries, see Theorem 2-4 of Ziyin (2024)). A consequence of $\theta^{\prime} = 0$ is that the symmetric projection $P\theta$ of any $\theta$ always has a smaller norm than $\theta$ : thus, a symmetric solution is coupled to the solutions of weight decay, which also favors small-norm solutions. As an example of reflection symmetry, consider a simple tanh network $f(\theta ,x) = \theta_{1}\tanh (\theta_{2}x)$ . The model output is invariant to a simultaneous sign flip of $\theta_{1}$ and $\theta_{2}$ . This corresponds to a reflection symmetry whose projection matrix is the identity $P = ((1,0),(0,1))$ . The symmetric solutions correspond to the trivial state where $\theta_{1} = \theta_{2} = 0$ .
|
| 47 |
+
|
| 48 |
+
To be more general, we allow $\theta^{\prime}$ to be nonzero to generalize the theory and method to generic hyperplanes since the purpose of the method is to remove all reflection symmetries that may be hidden or difficult to enumerate. Let us first establish some basic properties of a loss function with $P$ -reflection, to gain some intuition (again, proofs are in the appendix).
|
| 49 |
+
|
| 50 |
+
Proposition 1. Let $f$ have the $(\theta', P)$ -symmetry and let $f'(\theta) = f(\theta + \theta^\dagger)$ . Then, (1) for any $\theta^\dagger$ such that $P\theta^\dagger = \theta'$ , $f(\theta + \theta^\dagger) = f((I - 2P)\theta + \theta^\dagger)$ , and (2) $f'$ has the $(\theta' - \theta^\dagger, P)$ symmetry.
|
| 51 |
+
|
| 52 |
+
Therefore, requiring $P\theta' = \theta'$ is without loss of generality: it only reduces different manifestations of the symmetry to a unique one and simply shifting the function will not remove any symmetry. This proposition emphasizes the subtle difficulty in removing a symmetry.
|
| 53 |
+
|
| 54 |
+
# 3 RELATED WORKS
|
| 55 |
+
|
| 56 |
+
One closely related work is that of Ziyin (2024), which shows that every reflection symmetry in the model leads to a low-capacity solution that is favored when weight decay is used. This is because the minimizer of the weight decay is coupled with stationary points of the reflection symmetries – the projection of any parameter to a symmetric subspace always decreases the norm of the parameter, and is thus energetically preferred by weight decay. Our work develops a method to decouple symmetries and weight decay, thus avoiding collapsing into low-capacity states during training. Besides weight decay, an alternative mechanism for this type of capacity loss is gradient-noise induced collapse, which happens when the learning rate - batchsize ratio is high (Chen et al., 2023).
|
| 57 |
+
|
| 58 |
+
Contemporarily, Lim et al. (2024) empirically explores how removing symmetries can benefit neural network training and suggests a heuristic for removing symmetries by hold a fraction of the weights unchanged during training. However, the proposed method is only proved to work for explicit permutation symmetries in fully connected layers. This is particularly a problem because most of the symmetries in nonlinear systems are unknown and hidden (Cariglia, 2014; Frolov et al., 2017). In sharp contrast, the technique proposed in our work is both architecture-independent and symmetry-agnostic and provably removes all known and unknown discrete symmetries in the loss.
|
| 59 |
+
|
| 60 |
+
# 4 SYMMETRY IMPAIRS MODEL CAPACITY
|
| 61 |
+
|
| 62 |
+
We first show that reflection symmetry directly affects the model capacity. For simplicity, we let $\theta' = 0$ for all symmetries. Let $f(x,\theta) \in \mathbb{R}$ be a Taylor-expandable model that contains a $P$ -reflection symmetry. Let $\Delta = \theta - \theta_0$ . Then, close to any symmetric point $\theta_0$ (any $\theta_0$ for which $P\theta_0 = 0$ ), for all $x$ , Ziyin (2024) showed that
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
f (x, \theta) - f (x, \theta_ {0}) = \underbrace {\nabla_ {\theta} f (x , \theta_ {0}) (I - P) \Delta + O (\| P \Delta \|) ^ {2}} _ {\text {S y m m e t r y s u b s p a c e}} + \underbrace {\frac {1}{2} \Delta^ {T} P H (x) P \Delta + O (\| \Delta \| ^ {3})} _ {\text {S y m m e t r y - b r o k e n s u b s p a c e}}, \tag {2}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $H(x)$ is the Hessian matrix of $f$ . An important feature is that the symmetry subspace is a generic expansion where both odd and even terms are present, and the first order term does not vanish in general. In contrast, in the symmetry-broken subspace, all odd-order terms in the expansion vanish, and the leading order term is the second order. This implies that close to a symmetric solution, escaping from it will be slow, and if at the symmetric solution, it is impossible for gradient descent to leave it. The effect of this entrapment can be quantified by the following two propositions.
|
| 69 |
+
|
| 70 |
+
Proposition 2. (Symmetry removes feature.) Let $f$ have the $P$ -symmetry, and $\theta$ be initialized at $\theta_0$ such that $P\theta_0 = 0$ . Then, the kernelized model, $g(x,\theta) = \lim_{\lambda \to 0}(\lambda^{-1}f(x,\lambda \theta +\theta_0) - f(x,\theta_0))$ , converges to
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\theta^ {*} = A ^ {+} \sum_ {x} \nabla_ {\theta} f (x, \theta_ {0}) ^ {T} y (x) \tag {3}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
under $GD$ for a sufficiently small learning rate. Here $A\coloneqq (I - P)\sum_{x}\nabla_{\theta}f(x,\theta_0)^T\nabla_{\theta}f(x,\theta_0)(I - P)$ and $A^{+}$ denotes the Moore-Penrose inverse of $A$ .
|
| 77 |
+
|
| 78 |
+
This means that in the kernel regime $^2$ , being at a symmetric solution implies that the feature kernel features are being masked by the projection matrix:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\nabla_ {\theta} f (x, \theta_ {0}) \rightarrow (I - P) \nabla_ {\theta} f (x, \theta_ {0}), \tag {4}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
and learning can only happen given these masks. This implies that the model is not using the full feature space that is available to it.
|
| 85 |
+
|
| 86 |
+
Proposition 3. (Symmetry reduces parameter dimension.) Let $f$ have the $P$ -symmetry, and $\theta \in \mathbb{R}^d$ be initialized at $\theta_0$ such that $P\theta_0 = 0$ . Then, for all time steps $t$ under $GD$ or $SGD$ , there exists a model $f'(x,\theta')$ and sequence of parameters $\theta_t'$ such that for all $x$ ,
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
f ^ {\prime} \left(x, \theta_ {t} ^ {\prime}\right) = f \left(x, \theta_ {t}\right), \tag {5}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $\dim (\theta^{\prime}) = d - \mathrm{rank}(P)$
|
| 93 |
+
|
| 94 |
+
The existence of this type of dimension reduction when symmetry is present has also been noticed by previous works in case of permutation symmetry (Simsek et al.,
|
| 95 |
+
|
| 96 |
+
2021). Intuitively, the above two results follow from the fact that the symmetric subspaces of reflection symmetries (and any general discrete symmetries) are a linear subspace, and so gradient descent (and thus gradient flow) cannot take the model away from it, despite the discretization error. This means that, essentially, the model is identical to a model with a strictly smaller dimension
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Figure 1: Training loss $\ell$ as a function of the iteration $t$ for a fully connected network on MNIST. Starting from a low-capacity state, vanilla neural networks are trapped under SGD or Adam training (left). Blacker lines correspond to higher-capacity initializations, where more neurons are away from the permutation-symmetric state. When the symmetries are removed, the capacity of the initialization no longer affects the solution found at the end of the training (right).
|
| 100 |
+
|
| 101 |
+
throughout its training, no matter whether the training is through GD or SGD. When there are multiple symmetries, there is a compounding effect. See Figure 1 for an illustration. We initialize a two-layer ReLU neural network on a low-capacity state where a fraction of the hidden neurons are identical (corresponding to the symmetric states of the permutation symmetry) and train with and without removing the symmetries. We see that when the symmetries are removed (with the method proposed in the next section), the model is no longer stuck at these neuron-collapsed solutions. Also, see Section C for the evolution of NTK and gradient covariance during training.
|
| 102 |
+
|
| 103 |
+
# 5 REMOVING SYMMETRY WITH STATIC BIAS
|
| 104 |
+
|
| 105 |
+
Next, we prove that a simple algorithm that involves almost no modification to any deep learning training pipeline can remove almost all such symmetries from the loss without creating new ones. From this section onward, we will consider the case where the function under consideration is the loss function (a per-batch loss or its expectation): $f = \ell$ .
|
| 106 |
+
|
| 107 |
+
# 5.1 COUNTABLE SYMMETRIES
|
| 108 |
+
|
| 109 |
+
We seek an algorithm that eliminates the reflection symmetries from the loss function $\ell$ . This subsection will show that when the number of reflection symmetries in the loss function is countable, one can completely remove them using a simple technique. The symmetries are required to have the following property and the loss function is assumed to obey assumption 1.
|
| 110 |
+
|
| 111 |
+
Property 1. (Enumeratability) There exists a countable set of pairs of projection matrices and biases $S = \{(\theta_i^\dagger, P_i)\}_i^N$ such that $\ell(\theta, x)$ has the $\theta_i^\dagger$ -centric $P_i$ -reflection symmetry for all $i$ . In addition, $\ell$ does not have any $(\theta^\dagger, P)$ symmetry for $(\theta, P) \notin S$ .
|
| 112 |
+
|
| 113 |
+
Assumption 1. There only exists countably many pairs $(c_0, \tilde{\theta})$ such that $g(x) = \ell(\theta, x) - c_0\theta$ contains a $\tilde{\theta}$ -centric $P$ symmetry, where we require $Pc_0 = c_0$ and $P\tilde{\theta} = \tilde{\theta}$ .
|
| 114 |
+
|
| 115 |
+
This assumption is satisfied by common neural networks with standard activations. The main purpose of this assumption is to rule out the pathological of a linear or quadratic deterministic objective, which never appears in practice or for which symmetry is not a concern.<sup>3</sup>
|
| 116 |
+
|
| 117 |
+
For symmetry removal, we propose to utilize the following alternative loss function. Let $\theta_0$ be drawn from a Gaussian distribution with variance $\sigma_0$ and $\ell$ be the original loss function:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\ell_ {\mathrm {r}} (\theta , x) = \ell (\theta + \theta_ {0}) + \gamma \| \theta \| ^ {2}. \tag {6}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
$\gamma$ is nothing but the standard weight decay. We will see that using a static bias along with weight decay is essential for the method to work. We find that with unit probability, the loss function $\ell_{\mathrm{r}}$ contains no reflection symmetry:
|
| 124 |
+
|
| 125 |
+
Theorem 1. Let $\ell$ satisfy Property 1 and Assumption 1. Then, with probability 1 over the sampling of $\theta_0$ , there exists no projection matrix $P$ and reflection point $\theta'$ such that $\ell_{\mathrm{r}}$ has the $(\theta', P)$ -symmetry.
|
| 126 |
+
|
| 127 |
+
The core mechanism of this theorem is decoupling of the solutions of the symmetries from the solutions of the weight decay. With weight decay, a solution with a small norm is favored, whereas with a random bias, the symmetric solutions are shifted by a small constant and no longer overlap with solutions that have a small norm. Equivalently, this method can be implemented as a random bias in the $L_{2}$ regularization: $\ell_{\mathrm{r}}(\theta ,x) = \ell (\theta) + \gamma \| \theta +\theta_0\|^2$ . This is a result of the fact that simple translation does not change the nature of the function. There are two remarkable parts of the theorem: (1) it not only removes all existing symmetries but also guarantees that there are no remaining ones; (2) the proof works as long as the variance of $\theta_0$ is nonzero. This hints at the possibility of using a small and random $\theta_0$ , which removes all symmetries in principle and also does not essentially affect the solutions of the original objective. In this work, we will refer to the method in Eq. (6) as syre, an abbreviation for "symmetry removal."
|
| 128 |
+
|
| 129 |
+
# 5.2 UNCOUNTABLY MANY SYMMETRIES
|
| 130 |
+
|
| 131 |
+
In deep learning, it is possible for the model to simultaneously contain infinitely many reflection symmetries. This happens, for example, when the model parameters have the rotation symmetry or the double rotation symmetry (common in self-supervised learning problems Ziyin et al. (2023) or
|
| 132 |
+
|
| 133 |
+
transformers). It turns out that adding a static bias and weight decay is not sufficient to remove all symmetries, but we will show that a simple modification would suffice.
|
| 134 |
+
|
| 135 |
+
We propose to train on the following alternative loss instead, where $ar$ stands for "advanced removal":
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\ell_ {\operatorname {a r}} (\theta) = \ell (\theta + \theta_ {0}) + \gamma \| \theta \| _ {D} ^ {2}, \tag {7}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
where $D$ is a positive diagonal matrix in which all diagonal elements of $D$ are different. The simplest way to achieve such a $D$ is to set $D_{ii} \sim \mathrm{Uniform}(1 - \epsilon, 1 + \epsilon)$ , where $\epsilon$ is a small quantity.
|
| 142 |
+
|
| 143 |
+
Theorem 2. Any $(\theta', P)$ -symmetry that $\ell_{\mathrm{ar}}$ satisfies obeys: (1) $P\theta_0 = \theta'$ (2) and $PD = DP$ .
|
| 144 |
+
|
| 145 |
+
Conditions (1) and (2) implies that there are at most finitely many $(\theta', P)$ -symmetry $\ell_{\mathrm{ar}}$ can have. When there does not exist any symmetry that satisfies this condition, we have removed all the symmetries. In the worst case where $\ell$ is a constant function, there are $2^{N}$ symmetries where $N$ is the number of reflection symmetries. If we further assume that every $P$ is associated with at most finitely many $\theta'$ , then we, again, remove all symmetries with probability 1. The easiest way to determine this $D$ matrix is through sampling from a uniform distribution with a variance $\sigma_{D} \ll 1$ .
|
| 146 |
+
|
| 147 |
+
# 5.3 STRENGTH OF SYMMETRY REMOVAL
|
| 148 |
+
|
| 149 |
+
While any level of $\theta_0$ and $\sigma_{D}$ are sufficient to remove the symmetries, one might want to quantify the degree to which the symmetries are broken. This is especially relevant when the model is located close to a symmetric solution and requires a large gradient to escape from it. Also, a related question that may arise in practice is how large one should choose $\sigma_0$ and $\sigma_{D}$ , which are the variances of $\theta_0$ and $D$ . The following theorem gives a quantitative characterization of the degree of symmetry breaking. $^4$
|
| 150 |
+
|
| 151 |
+
Theorem 3. Let the original loss satisfy a $(\theta^{*},P)$ -symmetry, where $\theta^{*}\in \mathbb{R}^{d}$ . Then, for any local minimum $\theta \in \Theta (1)$ , if $\sigma_{D} = o(\sigma_{0})$ and $P\theta \neq 0$ ,
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\Delta := \frac {1}{\| P \theta \|} \left[ \ell_ {\operatorname {a r}} \left(\theta + \theta^ {*}\right) - \ell_ {\operatorname {a r}} \left((I - 2 P) \theta + \theta^ {*}\right) \right] = \Omega (\gamma \sigma_ {0}). \tag {8}
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
This theorem essentially shows a "super-Lipschitz" property of the difference between the loss function values between parameters and their reflections. This means that with a random bias, the symmetry will be quite strongly removed, as long as we ensure $\sigma_{D} \ll \sigma_{0}$ , which is certainly ensured when $\sigma_{D} = 0$ . As a corollary, it also shows that after applying a static bias, no symmetric solution where $P\theta = 0$ can still be a stationary point because as $P\theta \to 0$ , the quantity $\Delta$ converges to the projection of the gradient onto symmetry breaking subspace.
|
| 158 |
+
|
| 159 |
+
Corollary 1. For any $\theta$ such that $P\theta = 0$ , $P\nabla_{\theta}\ell_{\mathrm{ar}} = \Omega (\gamma \sigma_0)$ .
|
| 160 |
+
|
| 161 |
+
Now, the more advanced question is the case when there are multiple reflection symmetries, and one wants to significantly remove every one of them.
|
| 162 |
+
|
| 163 |
+
Theorem 4. Let $\ell$ contain $N$ reflection symmetries: $\{(P_i,\theta_i^*)\}_{i = 1}^N$ . Let
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\Delta_ {i} := \frac {\ell_ {\operatorname {a r}} \left(\theta + \theta_ {i} ^ {*}\right) - \ell_ {\operatorname {a r}} \left(\left(I - 2 P _ {i}\right) \theta + \theta_ {i} ^ {*}\right)}{\| P _ {i} \theta \|}. \tag {9}
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Then, for any local minimum $\theta \in \Theta(1)$ , letting $\gamma \sigma_0 = \Omega\left(\frac{2\epsilon N}{1 - \delta}\right)$ guarantees that $\operatorname*{Pr}(\min_i |\Delta_i| > \epsilon) > \delta$ for any $\epsilon$ and $\delta < 1$ .
|
| 170 |
+
|
| 171 |
+
In the theorem, the probability is taken over the random sampling of the static bias. Namely, the achievable strengths of symmetry-breaking scales inversely linearly in $N$ , the size of the minimal set of the entire group generated by $N$ reflections. In general, without further assumptions there is no way to improve this scaling because, for example, the smallest of $N$ independent bounded variables roughly scales as $1 / N$ towards its lower boundary.
|
| 172 |
+
|
| 173 |
+
General Groups. Lastly, one can generalize the theory to prove that the proposed method removes symmetries from a generic group. Let $G$ be the linear representation of a generic finite group, possibly with many nontrivial subgroups. If the loss function $\ell$ is invariant under transformation by the group $G$ , then
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\forall g \in G, \ell (\theta) = \ell (g \theta). \tag {10}
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
Because $G$ is finite, it follows that the representations $g$ must be full-rank and unipotent.
|
| 180 |
+
|
| 181 |
+
The following theorem shows that at every symmetric solution, there exists an escape direction with a strong gradient that pulls the parameters away from every subgroup of the related symmetry. In other words, it is no longer possible to be trapped in a symmetric solution. While general groups appear less common, they exist in a lot of application scenarios with equivariant networks (Cohen & Welling, 2016), where it is common to incorporate group structures into the model.
|
| 182 |
+
|
| 183 |
+
Letting $U$ be a subgroup of $G$ , we denote with the overbar the following matrix:
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\bar {U} = \frac {1}{| U |} \sum_ {u \in U} u. \tag {11}
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
Note that $\overline{U}$ is a projection matrix: $\overline{U}\overline{U} = \overline{U}$ . This means that $I - \overline{U}$ is also a projection matrix. Importantly, $\overline{U}$ projects a vector into the symmetric subspace. For any $u\in U$ , $u\overline{U} = \overline{U}$ . Likewise, $I - \overline{U}$ projects any vector into the symmetry-broken subspace, a well-known result in the theory of finite groups (Gorenstein, 2007). We denote by
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\Delta_ {V} = \left\| (I - \bar {V}) \nabla_ {\theta} \ell \right\| \tag {12}
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
the strength of the symmetry removal for the subgroup $V$ .
|
| 196 |
+
|
| 197 |
+
Theorem 5. Let $\Gamma(G)$ denote the smallest minimal generating set for the group $G$ . $Z$ denotes the number of minimal subgroups of $G$ . Let $\ell$ be invariant under the group transformation $G$ and let $\theta$ be in the invariant subspace of a subgroup $U \triangleleft G$ . Then, for every subgroup $V \triangleleft U \triangleleft G$ ,
|
| 198 |
+
|
| 199 |
+
1. $\Delta_V = \Omega (\gamma \sigma_0\mathrm{rank}(I - \overline{V}))$
|
| 200 |
+
2. $\min_{V\triangleleft U}\Delta_V = \Omega (\gamma \sigma_0\mathrm{rank}(I - \overline{V})Z^{-1})$
|
| 201 |
+
3. if $G$ is abelian, $\min_{V\triangleleft U}\Delta_V = \Omega (\gamma \sigma_0\mathrm{rank}(I - \overline{V})|\Gamma (U)|^{-1})$
|
| 202 |
+
4. additionally, for any $\epsilon > 0$ and $\delta < 1$ , $\operatorname*{Pr}(\min_{V \triangleleft U} \Delta_V > \epsilon) > \delta$ , if $\gamma \sigma_0 = \Omega\left(\frac{2\epsilon|\Gamma(U)|}{1 - \delta}\right)$ .
|
| 203 |
+
|
| 204 |
+
Item (2) of the theorem is essentially due to the fact that removing symmetries from a larger group can be reduced to removing them from one of its subgroups. Conceptually, this result has the same root as the classical theory of combinatorial designs, where averaging over a subset of groups has the same effect as averaging over the whole group (Lindner & Rodger, 2017). In general, $1 \leq Z \leq |G|$ (and sometimes $\ll |G|$ ), and so this scaling is not bad. For the part (3) of the theorem, the term $|\Gamma(U)|$ is especially meaningful. It is well-known that $|\Gamma(U)| \leq \log |U|$ , and so the worst-case symmetry-breaking strength is only of order $1 / \log |U|$ , which is far slower than what one would expect. In fact, for a finite group with size $N$ , the number of subgroups can grow as fast as $N^{\log N}$ (Borovik et al., 1996), and thus, one might naively think that the minimal breaking strength decreases as $N^{-\log N}$ . This theorem shows that the proposed method is highly effective at breaking the symmetries in the loss function or the model.
|
| 205 |
+
|
| 206 |
+
A numerical example is shown in Figure 2, which validates a major
|
| 207 |
+
|
| 208 |
+
prediction of the theorem: a symmetry is easier to remove if it is high-dimensional. We train a two-layer ReLU net in a teacher-student scenario and change the input dimension. This experiment holds the number of (permutation) symmetries fixed and directly controls $\mathrm{rank}(I - \overline{V})$ . As the input dimension increases, the symmetry of the learned model becomes lower. In comparison, without a static bias, having a high dimension is not so helpful.
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 2: With the proposed method, the rank of the feature covariance matrix increases with the input dimension. The same may happen under vanilla weight decay, but the effect is not strong. The covariance is computed from the first-layer output with batch size 1000, and eigenvalues larger than $10^{-4}$ are truncated to zero.
|
| 212 |
+
|
| 213 |
+
# 5.4 HYPERPARAMETER AND IMPLEMENTATION REMARK
|
| 214 |
+
|
| 215 |
+
As discussed, there are two ways to implement the method (Eq. (6) or Eq. (7)). In our experiments, we stick to the definition of Eq. (6), where the model parameters are biased, and weight decay is the same as the standard implementation. For the choice of hyperparameters, we always set $\sigma_{D} = 0$
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
Figure 3: Training with syre in standard settings. The result shows that biasing the models by a small static bias does not change the performance of standard training settings. Left: Application of the method to a linear regression problem. Here, $\alpha^{-1} = d / N$ is the degree of parameterization. A well-known use of weight decay is to prevent double descent when $\alpha = 1$ . Here, we see that the proposed method works as well as vanilla weight decay. Because there is no reflection symmetry in the problem, the proposed method should approximate vanilla weight decay. Mid: Test accuracy of Resnet18 on the CIFAR-10 datasets. The blue line denotes the performance of Resnet, and the shadowed area denotes its standard deviation estimated over 10 trials. For $\sigma_0 < 0.2$ , there is no significant difference between the performance of the vanilla Resnet and syre Resnet. Right: linear regression with a redundant parametrization (Poon & Peyre, 2021). The loss function takes the form $\ell(u, w) = \left\| (u \odot w)^T x - y \right\|^2$ . Due to symmetry, the point $(u_i, w_i) = 0$ is a low-capacity state where the $i$ -th neuron is "dead". Training with style, the model stayed away from any trapping low-capacity state during training. In comparison, training with vanilla SGD or a heuristic for fixing the weights does not fix the problem of collapsing to a low-capacity state.
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
|
| 224 |
+
as we find only introducing $\sigma_0$ to be sufficient for most tasks. Experiments with standard training settings (see the next section for the Resnet18 experiment on CIFAR-10) show that choosing $\sigma_0$ to be at least an order of magnitude smaller than the standard initialization scale (usually of order $1 / \sqrt{d}$ for a width of $d$ ) works the best. We thus recommend a default value of $\sigma_0$ to be $0.01 / \sqrt{d}$ , where $1 / d$ is the common initialization variance. For the rest of the paper, we state $\sigma_0$ in relative units of $\sqrt{d}^{-1}$ for this reason. That being said, we stress that $\sigma_0$ is a hyperparameter worth tuning, as it directly controls the tradeoff between optimization and symmetry removal.
|
| 225 |
+
|
| 226 |
+
# 6 EXPERIMENT
|
| 227 |
+
|
| 228 |
+
First, we show that the proposed method is compatible with standard training methods. We then apply the method to a few settings where symmetry is known to be a major problem in training. We see that removing symmetries with the proposed method is well correlated with improved model performance for these problems. Additional experiments are presented in Appendix B, including the time and memory usage of syre and its application to transformers and improving mode connectivity. $^6$
|
| 229 |
+
|
| 230 |
+
# 6.1 COMPATIBILITY WITH STANDARD TRAINING
|
| 231 |
+
|
| 232 |
+
Ridge linear regression. Let us first consider the classical problem of linear regression with $d$ -dimensional data, where one wants to find $\min_{w}\sum_{i}(w^{T}x_{i} - y_{i})^{2}$ . Here, the use of weight decay has a well-known effect of preventing the divergence of generalization loss at a critical dataset size $N = d$ (Krogh & Hertz, 1992; Hastie et al., 2019). This is due to the fact that the Hessian matrix of the loss becomes singular exactly at $N = d$ (at infinite $N$ and $d$ ). The use of weight decay shifts all the eigenvalues of the Hessian by $\gamma$ and removes this singularity. In this case, one can show that the proposed method is essentially identical to the simple ridge regression. The ridge solution is $w^{*} = \mathbb{E}[\gamma I + A]^{-1}\mathbb{E}[xy]$ , where $A = \mathbb{E}[xx^T]$ , and the solution to the biased model is
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
w ^ {*} = \mathbb {E} [ \gamma I + A ] ^ {- 1} (\mathbb {E} [ x y ] + \gamma \theta_ {0}). \tag {13}
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
The difference is negligible with the original solution if either $\gamma$ and $\theta_0$ are small. See Figure 3-left.
|
| 239 |
+
|
| 240 |
+
Reparametrized Linear Regression. A minimal model with emergent interest in the problem of compressing neural networks is the reparametrized version of linear regression (Poon & Peyré, 2021; Ziyin & Wang, 2023), the loss function of which is $\ell(u, w) = \|(u \odot w)^T x - y\|^2$ , where we let $u$ , $w$ , $x \in \mathbb{R}^{200}$ and $y \in \mathbb{R}$ . Due to the rescaling symmetry between every parameter $u_i$ and $w_i$ , the solutions where $u_i = w_i = 0$ is a low-capacity state where the $i$ -th neuron is "dead."
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 4: The degree of symmetry versus the objective value for two choices of $B$ and various training methods with different hyperparameters. The proposed method is the only method to smoothly interpolate between optimized solutions and solutions with low symmetry. syre performs well in both cases. Left: objective with unstructured symmetry Right: structured symmetry.
|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
|
| 247 |
+
For this problem, we compare the training with standard SGD and syre. We also compare with a heuristic method (W-fix), where a fraction $\phi = 0.3$ of weights of every layer is held fixed with a fixed variance $\kappa = 0.01$ at initialization. This method has been suggested in Lim et al. (2024) as a heuristic for removing symmetries and is found to work well when there is permutation symmetry. We see that both the vanilla training and the W-fix collapse to low-capacity states during training, whereas the proposed method stayed away from them throughout. The reason is that the proposed method is model-independent and symmetry-agnostic, working effectively for any type of possibly unknown symmetry in an arbitrary architecture.
|
| 248 |
+
|
| 249 |
+
ResNet. We also benchmark the performance of the proposed method for ResNet18 with different $\sigma_0$ on the CIFAR-10 datasets in Figure 3. When $\sigma_0 = 0$ , the syre model is equivalent to the vanilla model. Figure 3 shows that the difference in performance between the vanilla Resnet and syre Resnet is very small and becomes negligible when $\sigma_0 < 0.2$ .
|
| 250 |
+
|
| 251 |
+
# 6.2 BENCHMARKING SYMMETRY REMOVAL
|
| 252 |
+
|
| 253 |
+
In this section, we benchmark the effect of symmetry control of the proposed method for two controlled experiments. To compare the influence of syre and other training methods on the degree of symmetry, we consider minimizing the following objective function:
|
| 254 |
+
|
| 255 |
+
$$
|
| 256 |
+
\left(w ^ {T} w\right) ^ {2} - w ^ {T} B w := \left(w ^ {T} w\right) ^ {2} - \sum_ {i = 1} ^ {d} \lambda_ {i} \left(v _ {i} ^ {T} w\right) ^ {2},
|
| 257 |
+
$$
|
| 258 |
+
|
| 259 |
+
where $w \in \mathbb{R}^d$ is the optimization parameter and $B \in \mathbb{R}^{d \times d}$ is a given symmetric matrix with eigenvalues $\lambda_i$ and eigenvectors $v_i$ ( $v_i^T v_i = 1$ ). The objective function has $n$ reflection symmetries $P_i w := w - 2(v_i^T w) v_i$ . Hence, we define the degree of symmetry as $\sum_{i=1}^d \mathbf{1}\{v_i^T w < c_{\mathrm{th}}\}$ , where $c_{\mathrm{th}}$ is a given threshold. Depending on the spectrum of $B$ , the nature of the task is different. We thus consider two types of spectra: (1) an unstructured spectrum where $B = G + G^T$ for a Gaussian matrix $G$ , and (2) a structured spectrum where $B = \operatorname{diag}(v)$ where $v$ is a random Gaussian vector. Conceptually, the first type is more similar to rotation and double rotation symmetries in neural networks where the basis can be arbitrary, while the second is a good model for common discrete symmetries where the basis is often diagonal or sparse. For the first case we choose $c_{\mathrm{th}} = 10^{-3}$ and for the second case we choose $c_{\mathrm{th}} = 10^{-1}$ .
|
| 260 |
+
|
| 261 |
+
In Figure 4, we compare syre, W-fix, drop out, weight decay, and the standard training methods in this setting for $d = 1000$ and two choices of $B$ . In both cases, we use Gaussian initialization and gradient descent with a learning rate of $10^{-4}$ . For syre and weight decay, we choose weight decay from 0.1 to 10. For W-fix, we choose $\phi$ from 0.001 to 0.1. For dropout, we choose a dropout rate from 0.01 to 0.6. Figure 4 shows that for both cases, syre is the only method that effectively and smoothly interpolates between solutions with low symmetry and best optimization. This is a strong piece of evidence that the proposed method can control the degree of symmetries in the model.
|
| 262 |
+
|
| 263 |
+
# 6.3 FEATURE AND NEURON COLLAPSES IN SUPERVISED LEARNING
|
| 264 |
+
|
| 265 |
+
See Figure 5, where we train the vanilla and syre four-layer networks with various levels of weight decay $\gamma$ and input-output covariance $\alpha$ . The dataset is constructed by rescaling the input by a factor of $\alpha$ for the MNIST dataset. The theory predicts that the syre model can remove the permutation symmetry in the hidden layer. This is supported by subfigures in Figure 5, where vanilla training results in a low-rank solution. Meanwhile, the accuracy of the low-rank solution is significantly lower for a large $\gamma$ or a small $\alpha$ , which corresponds to the so-called neural collapses. Also, we
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 5: Performance of a 4-layer FCN for datasets with various weight decay $\gamma$ and data distributions with varings strengths of linear correlation $\alpha$ . As the theory predicts, the covariance of the model with vanilla weight decay has a low-rank structure and performs significantly worse. In the main figures, solid lines denote training accuracy and dashed lines denote test accuracy. The dashed black line corresponds to random guess. Subfigures show the rank of the covariance matrix of the first layer output before (solid lines) and after (dashed lines) activation with batch size 1000. We set eigenvalues smaller than $10^{-4}$ to 0. Left: $\alpha = 1$ and different $\gamma$ . Right: $\gamma = 0.01$ and different $\alpha$ . A similar experiment for vision transformers is presented in Section B.5.
|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
|
| 272 |
+
<table><tr><td>vanilla</td><td>Hyperparameter -</td><td>Low-rankness 70%</td><td>Penult. Layer Acc. 46.8%</td><td>Last Layer Acc. 22.2%</td></tr><tr><td rowspan="4">syre</td><td>σ0 = 0.1</td><td>0%</td><td>46.8%</td><td>31.7%</td></tr><tr><td>σ0 = 0.01</td><td>0%</td><td>46.2%</td><td>32.5%</td></tr><tr><td>σ0 = 0.1, all layers</td><td>0%</td><td>44.6%</td><td>30.7%</td></tr><tr><td>σ0 = 0.01, all layers</td><td>0%</td><td>45.4%</td><td>32.4%</td></tr></table>
|
| 273 |
+
|
| 274 |
+
Table 1: Performance of the linearly evaluated Resnet18 on CIFAR100 for the unsupervised self-constractive learning task. Here, the low-rankness measures the proportion of eigenvalues smaller than $10^{-5}$ . Our experiment indicates that symmetry-induced reduction in model capacity can explain about $50\%$ of the performance difference between the representation of the two layers.
|
| 275 |
+
|
| 276 |
+
observe that syre shifts the eigenvalues of the representation by a magnitude proportional to $\sigma_0$ , thus explaining the robustness of the method against collapses in the latent representation (See Figure 8).
|
| 277 |
+
|
| 278 |
+
# 6.4 POSTERIOR COLLAPSE IN BAYESIAN LEARNING
|
| 279 |
+
|
| 280 |
+
Wang & Ziyin (2022) points out that a type of posterior collapse in Bayesian learning (Lucas et al., 2019; Wang et al., 2021) is caused by the low-rankness of the solutions. We show that training with syre could overcome this kind of posterior collapse. In Figure 9, we train a $\beta$ -VAE (Kingma & Welling, 2013; Higgins et al., 2016) on the Fashion MNIST dataset. Following Wang & Ziyin (2022), we use $\beta$ to weigh the KL loss, which can be regarded as the strength of prior matching. Both the encoder and the decoder are a two-layer network with SiLU activation. The hidden dimension and the latent dimension are 200. Only the encoder has weight decay because the low-rank problem is caused by the encoder rather than the decoder. We also choose the prior variance of the latent variable to be $\eta_{enc} = 0.01$ . Other settings are the same as Wang & Ziyin (2022). Posterior collapse happens at $\beta = 10$ , signalized by a large reconstruction loss in the right side of Figure 9. However, the reconstruction loss decreases, and the rank of the encoder output increases (according to the left side of Figure 9) after we use weight decay and syre. This is further verified by the generated image in Figure 10. Therefore, we successfully remove the permutation symmetry of the encoder.
|
| 281 |
+
|
| 282 |
+
# 6.5 LOW-CAPACITY TRAP IN SELF-SUPERVISED LEARNING
|
| 283 |
+
|
| 284 |
+
A common but bizarre practice in self-supervised learning (SSL) is to throw away the last layer of the trained model and use the penultimate learning representation, which is found to have much better expressiveness than the last layer representation. From the perspective of symmetry, this problem is caused by the rotation symmetry of the last weight matrix in the SimCLR loss. We train a Resnet-18 together with a two-layer projection head over the CIFAR-100 dataset according to the setting for training SimCLR in Chen et al. (2020). Then, a linear classifier is trained using the learned representations. Our implementation reproduces the typical accuracy of SimCLR over the CIFAR-100 dataset (Patacchiola & Storkey, 2020). As in Chen et al. (2020), the hidden layer before the projection head is found to be a better representation than the layer after. Therefore, we apply our syre method to the projection head or to all layers. According to Table 1, syre removes the low-rankness of the learned features and increases the accuracy trained with the features after projection while not
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure 6: Loss of plasticity in continual learning in an RL setting. We use the PPO algorithm (Schulman et al., 2017) to solve the Slippery-Ant problem (Dohare et al., 2023). The rank and the performance of the vanilla PPO decrease quickly, while the rank and the performance of PPO with syre remain the same, beyond that of PPO with weight decay. Left: the effective rank of the policy network as defined in Dohare et al. (2023). Right: returns. Each trajectory is averaged over 5 different random seeds.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
|
| 291 |
+
changing the representation before projection. Thus, symmetry-induced reduction in model capacity can explain about $50\%$ of the performance difference between the representation of the two layers. Also, an interesting observation is that just improving the expressivity of the last layer is insufficient to close the gap between the performance of the last layer and the penultimate layer. This helps us gain a new insight: symmetry is not the only reason why the last layer representation is defective.
|
| 292 |
+
|
| 293 |
+
# 6.6 LOSS OF PLASTICITY IN CONTINUAL LEARNING
|
| 294 |
+
|
| 295 |
+
A form of low-capacity collapse also happens during continual learning, i.e., the plasticity of the network gradually decreases as the model is trained on more and more tasks. This problem is common in both supervised and reinforcement learning settings and may also be relevant to the finetuning of large language models (McCloskey & Cohen, 1989; Ash & Adams, 2020; Dohare et al., 2021; Abbas et al., 2023).
|
| 296 |
+
|
| 297 |
+
Supervised Learning. In Figure 11, we train a CNN with two convolution layers (10 channels and 20 channels) and two fully connected layers (320 units and 50 units) over the MNIST datasets. For the data, we randomly permute the pixels of the training and test sets for 9 times, forming 10 different tasks (including the original MNIST). We then train a vanilla CNN and a syre CNN over the 10 tasks continually with SGD and weight decay 0.01. The inset of Figure 11 shows that the rank of the original model gradually decreases, but the syre model remains close to full rank. Correspondingly, in the right side of Figure 11, the accuracy over the test set drops while the rank of the original model collapses, but the accuracy of the syre model remains similar.
|
| 298 |
+
|
| 299 |
+
Reinforcement Learning. In Figure 6, we use the PPO algorithm for the Slippery-Ant problem (Dohare et al., 2023), a continual variant of the Pybullet's Ant problem (Coumans & Bai, 2016) with friction that changes every $5M$ steps. Hyperparameters for the PPO algorithm are borrowed from Dohare et al. (2023), and we use a weight decay of 0.002 for both PPO with weight decay and with syre. Figure 6 suggests that syre is effective in maintaining the rank of the model during continual training and obtains better performance than pure weight decay.
|
| 300 |
+
|
| 301 |
+
# 7 CONCLUSION
|
| 302 |
+
|
| 303 |
+
Symmetry-induced neural-network training problems exist extensively in machine learning. We have shown that the existence of symmetries in the model or loss function may severely limit the expressivity of the trained model. We then developed a theory that leverages the power of representation theory to show that adding random static biases to the model, along with weight decay, is sufficient to remove almost all symmetries, explicit or hidden. We have demonstrated the relevance of the method to a broad range of applications in deep learning, and a possible future direction is to deploy the method in large language models, which naturally contain many symmetries. Lastly, it is worth noting that on its own, symmetry is neither good nor bad. For example, practitioners may be interested in introducing symmetries to the model architecture in order to control the capacity or hierarchy of the model (Ziyin et al., 2025). However, with too much symmetry, the training of models becomes slow and likely to contain many low-capacity traps. Meanwhile, a model completely without symmetry may have undesirably high capacity and be more prone to overfitting. Having the right degree of symmetry might thus be crucial for achieving both smooth optimization and good generalization. With our proposed method, it becomes increasingly possible to deliberately fine-grain engineer symmetries in the loss function, introducing desired symmetries and removing undesirable ones.
|
| 304 |
+
|
| 305 |
+
# REFERENCES
|
| 306 |
+
|
| 307 |
+
Zaheer Abbas, Rosie Zhao, Joseph Modayil, Adam White, and Marlos C Machado. Loss of plasticity in continual deep reinforcement learning. arXiv preprint arXiv:2303.07507, 2023.
|
| 308 |
+
Jordan Ash and Ryan P Adams. On warm-starting neural network training. Advances in neural information processing systems, 33:3884-3894, 2020.
|
| 309 |
+
Alexandre Borovik, Laszlo Pyber, and Aner Shalev. Maximal subgroups in finite and profinite groups. Transactions of the American Mathematical Society, 348(9):3745-3761, 1996.
|
| 310 |
+
Marco Cariglia. Hidden symmetries of dynamics in classical and quantum physics. Reviews of Modern Physics, 86(4):1283, 2014.
|
| 311 |
+
Feng Chen, Daniel Kunin, Atsushi Yamamura, and Surya Ganguli. Stochastic collapse: How gradient noise attracts sgd dynamics towards simpler subnetworks. arXiv preprint arXiv:2306.04251, 2023.
|
| 312 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020.
|
| 313 |
+
Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. arXiv preprint arXiv:1812.07956, 2018.
|
| 314 |
+
Taco Cohen and Max Welling. Group equivariant convolutional networks. In International conference on machine learning, pp. 2990-2999. PMLR, 2016.
|
| 315 |
+
Erwin Coumans and Yunfei Bai. Pybullet, a python module for physics simulation for games, robotics and machine learning, 2016.
|
| 316 |
+
L. Dinh, R. Pascanu, S. Bengio, and Y. Bengio. Sharp Minima Can Generalize For Deep Nets. ArXiv e-prints, March 2017.
|
| 317 |
+
Shibhansh Dohare, Richard S Sutton, and A Rupam Mahmood. Continual backprop: Stochastic gradient descent with persistent randomness. arXiv preprint arXiv:2108.06325, 2021.
|
| 318 |
+
Shibhansh Dohare, J Fernando Hernandez-Garcia, Parash Rahman, Richard S Sutton, and A Rupam Mahmood. Maintaining plasticity in deep continual learning. arXiv preprint arXiv:2306.13812, 2023.
|
| 319 |
+
Rahim Entezari, Hanie Sedghi, Olga Saukh, and Behnam Neyshabur. The role of permutation invariance in linear mode connectivity of neural networks. arXiv preprint arXiv:2110.06296, 2021.
|
| 320 |
+
Valeri P Frolov, Pavel Krtouš, and David Kubiznák. Black holes, hidden symmetries, and complete integrability. Living reviews in relativity, 20:1-221, 2017.
|
| 321 |
+
Kenji Fukumizu. A regularity condition of the information matrix of a multilayer perceptron network. Neural networks, 9(5):871-879, 1996.
|
| 322 |
+
Charles Godfrey, Davis Brown, Tegan Emerson, and Henry Kvinge. On the symmetries of deep learning models and their internal representations. Advances in Neural Information Processing Systems, 35:11893-11905, 2022.
|
| 323 |
+
Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013.
|
| 324 |
+
Daniel Gorenstein. Finite groups, volume 301. American Mathematical Soc., 2007.
|
| 325 |
+
Trevor Hastie, Andrea Montanari, Saharon Rosset, and Ryan J Tibshirani. Surprises in high-dimensional ridgeless least squares interpolation. arXiv preprint arXiv:1903.08560, 2019.
|
| 326 |
+
|
| 327 |
+
Irina Higgins, Loic Matthew, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. 2016.
|
| 328 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 329 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521-3526, 2017.
|
| 330 |
+
Seijin Kobayashi, Yassir Akram, and Johannes Von Oswald. Weight decay induces low-rank attention layers. arXiv preprint arXiv:2410.23819, 2024.
|
| 331 |
+
Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pp. 950-957, 1992.
|
| 332 |
+
Xingguo Li, Junwei Lu, Raman Arora, Jarvis Haupt, Han Liu, Zhaoran Wang, and Tuo Zhao. Symmetry, saddle points, and global optimization landscape of nonconvex matrix factorization. IEEE Transactions on Information Theory, 65(6):3489-3514, 2019.
|
| 333 |
+
Derek Lim, Moe Putterman, Robin Walters, Haggai Maron, and Stefanie Jegelka. The empirical impact of neural parameter symmetries, or lack thereof. arXiv preprint arXiv:2405.20231, 2024.
|
| 334 |
+
Charles C Lindner and Christopher A Rodger. Design theory. Chapman and Hall/CRC, 2017.
|
| 335 |
+
James Lucas, George Tucker, Roger Grosse, and Mohammad Norouzi. Don't blame the elbo! a linear vae perspective on posterior collapse, 2019.
|
| 336 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In *Psychology of learning and motivation*, volume 24, pp. 109-165. Elsevier, 1989.
|
| 337 |
+
Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. arXiv preprint arXiv:1412.6614, 2014.
|
| 338 |
+
Massimiliano Patacchiola and Amos J Storkey. Self-supervised relational reasoning for representation learning. Advances in Neural Information Processing Systems, 33:4003-4014, 2020.
|
| 339 |
+
Clarice Poon and Gabriel Peyre. Smooth bilevel programming for sparse regularization. Advances in Neural Information Processing Systems, 34:1543-1555, 2021.
|
| 340 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 341 |
+
Berfin Simsek, François Ged, Arthur Jacot, Francesco Spadaro, Clément Hongler, Wulfram Gerstner, and Johann Brea. Geometry of the loss landscape in overparameterized neural networks: Symmetries and invariances. In International Conference on Machine Learning, pp. 9722-9732. PMLR, 2021.
|
| 342 |
+
Ryan J Tibshirani. Equivalences between sparse models and neural networks. Working Notes. URL https://www.stat.cmu.edu/~ryantibs/papers/sparsitynn.pdf, 2021.
|
| 343 |
+
Yixin Wang, David Blei, and John P Cunningham. Posterior collapse and latent variable non-identifiability. Advances in neural information processing systems, 34:5443-5455, 2021.
|
| 344 |
+
Zihao Wang and Liu Ziyin. Posterior collapse of a linear latent variable model. Advances in Neural Information Processing Systems, 35:37537-37548, 2022.
|
| 345 |
+
Kentaro Yoshioka. vision-transformers-cifar10: Training vision transformers (vit) and related models on CIFar-10. https://github.com/kentaroy47/vision-transformers-cifar10, 2024.
|
| 346 |
+
|
| 347 |
+
Bo Zhao, Robert M Gower, Robin Walters, and Rose Yu. Improving convergence and generalization using parameter symmetries. arXiv preprint arXiv:2305.13404, 2023.
|
| 348 |
+
Liu Ziyin. Symmetry induces structure and constraint of learning. In *Forty-first International Conference on Machine Learning*, 2024. URL https://openreview.net/forum?id=7AF0AMI4AE.
|
| 349 |
+
Liu Ziyin and Zihao Wang. spred: Solving L1 Penalty with SGD. In International Conference on Machine Learning, 2023.
|
| 350 |
+
Liu Ziyin, Ekdeep Singh Lubana, Masahito Ueda, and Hidenori Tanaka. What shapes the loss landscape of self supervised learning? In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=3zSn48RUO8M.
|
| 351 |
+
Liu Ziyin, Mingze Wang, Hongchao Li, and Lei Wu. Parameter symmetry and noise equilibrium of stochastic gradient descent. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
|
| 352 |
+
Liu Ziyin, Yizhou Xu, Tomaso Poggio, and Isaac Chuang. Parameter symmetry breaking and restoration determines the hierarchical learning in ai systems. arXiv preprint arXiv:2502.05300, 2025.
|
| 353 |
+
|
| 354 |
+
# A THEORETICAL CONCERNS
|
| 355 |
+
|
| 356 |
+
# A.1 PROOF OF PROPOSITION 1
|
| 357 |
+
|
| 358 |
+
Proof. Part (1). Note that we have
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\theta^ {\dagger} = P \theta^ {\dagger} + (I - P) \theta^ {\dagger} = \theta^ {\prime} + (I - P) \theta^ {\dagger}. \tag {14}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
Thus,
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
(I - 2 P) (I - P) \theta^ {\dagger} = (I - P) \theta^ {\dagger}. \tag {15}
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
Therefore, we have
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
f \left(\theta + \theta^ {\dagger}\right) = f \left(\left(\theta + (I - P) \theta^ {\dagger}\right) + \theta^ {\prime}\right) = f \left((I - 2 P) \left(\theta + (I - P) \theta^ {\dagger}\right) + \theta^ {\prime}\right) = f \left(\left(I - 2 P\right) \theta + \theta^ {\dagger}\right). \tag {16}
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
This proves part (1).
|
| 377 |
+
|
| 378 |
+
Part (2). By definition,
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\begin{array}{l} f ^ {\prime} \left(\theta - \theta^ {\dagger} + \theta^ {\prime}\right) = f \left(\theta + \theta^ {\prime}\right) (17) \\ = f \left(\left(I - 2 P\right) \theta + \theta^ {\prime}\right) (18) \\ = f ^ {\prime} \left(\left(I - 2 P\right) \theta - \theta^ {\dagger} + \theta^ {\prime}\right). (19) \\ \end{array}
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
This completes the proof.
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
|
| 388 |
+
# A.2 PROOF OF PROPOSITION 2
|
| 389 |
+
|
| 390 |
+
Proof. By (2), $g(x, \theta)$ simplifies to a kernel model
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
g (x, \theta) = \nabla_ {\theta_ {0}} f (x, \theta_ {0}) (I - P) \theta . \tag {20}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
Let us consider the squared loss $\ell(\theta) = \sum_{x} \|y(x) - g(x, \theta)\|^2$ and denote $A := \sum_{x}(I - P)\nabla_{\theta_0}f(x, \theta_0)^T\nabla_{\theta_0}f(x, \theta_0)(I - P)$ , $b := (I - P)\sum_{x}\nabla_{\theta_0}f(x, \theta_0)^Ty(x)$ . Assuming the learning rate to be $\eta$ , the GD reads
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\theta^ {t + 1} = \theta^ {t} - 2 \eta (A \theta^ {t} - b), \tag {21}
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
where $\theta^0 = 0$ . If
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\eta < \frac {1}{2 \lambda_ {\max } (A)}, \tag {22}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
GD converges to
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array}{l} \theta^ {*} = \lim _ {t \rightarrow \infty} \sum_ {k = 0} ^ {t} (I - 2 \eta A) ^ {k} * 2 \eta b \tag {23} \\ = A ^ {+} b, \\ \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
which is the well-known least square solution.
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
|
| 418 |
+
# A.3 PROOF OF PROPOSITION 3
|
| 419 |
+
|
| 420 |
+
Proof. According to Ziyin (2024, Theorem 4), we have
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
P \nabla_ {\theta} \ell (x, \theta_ {0}) = 0. \tag {24}
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
Therefore, after one step of GD or SGD, we still have $P\theta_{1} = 0$ . By induction, we have $P\theta_{t} = 0$
|
| 427 |
+
|
| 428 |
+
Finally, suppose that $\{a_i\}_{i=1}^{d - \mathrm{rank}(P)}$ forms a basis of $\ker P$ , and define $f'(x, \theta') := f(x, \sum_{i=1}^{d - \mathrm{rank}(P)} \theta'_i a_i)$ for $\dim(\theta') = d - \mathrm{rank}(P)$ . By choosing $\theta'_i = \theta^T a_i$ , we have $f'(x, \theta'_t) = f(x, \theta_t)$ .
|
| 429 |
+
|
| 430 |
+
# A.4 LEMMAS
|
| 431 |
+
|
| 432 |
+
Lemma 1. Let $x \in \mathbb{R}^d$ and $P$ be a projection matrix. Let $f(x)$ be a scalar function that satisfies
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
f (x + x ^ {\prime}) = f ((I - 2 P) x + x ^ {\prime}) + c ^ {T} P x, \tag {25}
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
where $c$ is a constant vector. Then, there exists a unique function $g(x)$ such that
|
| 439 |
+
|
| 440 |
+
1. $g(x)$ has the $x^{\prime}$ -centric $P$ -symmetry,
|
| 441 |
+
2. and $f(x) = g(x) + \frac{1}{2} c_0^T P x$ .
|
| 442 |
+
|
| 443 |
+
Proof. (a) Existence. $f(x) = g(x) + \frac{1}{2} c_0^T x$ . Let us suppose $g(x)$ is not $x'$ -centric $P$ -symmetry. Then, there exists $x$ such that
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
g \left(x + x ^ {\prime}\right) - g \left(\left(I - 2 P\right) x + x ^ {\prime}\right) = \Delta \neq 0. \tag {26}
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
Then, by definition, we have that
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\begin{array}{l} c _ {0} ^ {T} P x = f \left(x + x ^ {\prime}\right) + f ((I - 2 P) x + x ^ {\prime}) (27) \\ = g \left(x + x ^ {\prime}\right) - \frac {1}{2} c _ {0} ^ {T} P \left(x + x ^ {\prime}\right) - g \left(\left(I - 2 P\right) x + x ^ {\prime}\right) - c _ {0} ^ {T} P \left(x + x ^ {\prime}\right) (28) \\ = \Delta + \frac {1}{2} c _ {0} ^ {T} P \left(x + x ^ {\prime}\right) - \frac {1}{2} c _ {0} ^ {T} P \left(\left(I - 2 P\right) x + x ^ {\prime}\right) (29) \\ = \Delta + c _ {0} ^ {T} P x. (30) \\ \end{array}
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
This is a contradiction. Therefore, there must exist $g(x)$ that satisfies the lemma statement.
|
| 456 |
+
|
| 457 |
+
(b) Uniqueness. Simply note that the expression of $g$ is uniquely given by
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
g (x) = f \left(x + x ^ {\prime}\right) - f ((I - 2 P) x + x ^ {\prime}). \tag {31}
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+

|
| 464 |
+
|
| 465 |
+
# A.5 PROOF OF THEOREM 1
|
| 466 |
+
|
| 467 |
+
Proof. We prove by contradiction. Let us suppose there exists such pair, $(\theta', P)$ . By definition, we have that
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
\ell_ {\mathrm {r}} \left(\theta + \theta^ {\prime}\right) = \ell \left(\theta + \theta^ {\prime} + \theta_ {0}\right) + \gamma \| \theta + \theta^ {\prime} \| ^ {2}. \tag {32}
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
By assumption, we have that
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
\ell \left(\left(I - 2 P\right) \theta + \theta^ {\prime} + \theta_ {0}\right) + \gamma \| \left(I - 2 P\right) \theta + \theta^ {\prime} \| ^ {2} = \ell \left(\theta + \theta^ {\prime} + \theta_ {0}\right) + \gamma \| \theta + \theta^ {\prime} \| ^ {2}, \tag {33}
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
and, so, for all $\theta$
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\ell \left(\left(I - 2 P\right) \theta + \theta^ {\prime} + \theta_ {0}\right) = \ell \left(\theta + \theta^ {\prime} + \theta_ {0}\right) + 4 \gamma \theta^ {T} P \theta^ {\prime}. \tag {34}
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
There are two cases: (1) $P\theta' = 0$ and (2) $P\theta' \neq 0$ .
|
| 486 |
+
|
| 487 |
+
For case (1), we have that $\ell((I - 2P)\theta + \theta' + \theta_0) = \ell(\theta + \theta' + \theta_0)$ , but this can only happen if the original loss $\ell$ has the $(\theta' + \theta_0)$ -centric $P$ -symmetry. By Property 1, this implies that
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\theta^ {\prime} + \theta_ {0} = \theta_ {i} ^ {\dagger} \tag {35}
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
for some $i$ . Applying $P$ on both sides, we obtain that
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
P \theta_ {0} = P \theta_ {i} ^ {\dagger}. \tag {36}
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
But, $\theta_0$ is a random variable with a full-rank covariance while the set $\{P\theta_i^\dagger\}$ has measure zero in the real space, and so this equality holds with probability zero.
|
| 500 |
+
|
| 501 |
+
For case (2), it follows from Lemma 1 that for a fixed $x$ and $\theta_0$ , $\ell(\theta)$ can be uniquely decomposed in the following form
|
| 502 |
+
|
| 503 |
+
$$
|
| 504 |
+
\ell (\theta) = g (\theta) - 2 \gamma \theta^ {T} P \theta^ {\prime}, \tag {37}
|
| 505 |
+
$$
|
| 506 |
+
|
| 507 |
+
where $g(\theta)$ has the $\theta^{\prime} + \theta_{0}$ -centric $P$ -symmetry.
|
| 508 |
+
|
| 509 |
+
Let $c_{0} = 2\gamma P\theta^{\prime}$ and $\tilde{\theta} = P(\theta^{\prime} + \theta_{0})$ . Then $\ell (\theta) + c_0\theta$ has the $\tilde{\theta}$ -centric $P$ symmetry. We also have $\tilde{\theta} - \frac{c_0}{2\gamma} = P\theta_0$ . According to Assumption 1, there are only countable many such $\{c_0,\tilde{\theta}\}$ pairs. However, $P\theta_{0}$ is a standard Gaussian random variable, which leads to a contradiction with probability 1.
|
| 510 |
+
|
| 511 |
+
Remark. It is easy to see that Assumption 1 could be slightly relaxed. We only require $\{\tilde{\theta} -\frac{c_0}{2\gamma}\}$ to have a zero measure, which is also a necessary and sufficient condition.
|
| 512 |
+
|
| 513 |
+
# A.6 PROOF OF THEOREM 2
|
| 514 |
+
|
| 515 |
+
Proof. We prove by contradiction. Let us suppose there exists such pair, $(\theta', P)$ . By definition, we have that
|
| 516 |
+
|
| 517 |
+
$$
|
| 518 |
+
\ell_ {\operatorname {a r}} \left(\theta + \theta^ {\prime}\right) = \ell \left(\theta + \theta^ {\prime} + \theta_ {0}\right) + \gamma \| \theta + \theta^ {\prime} \| _ {D} ^ {2}. \tag {38}
|
| 519 |
+
$$
|
| 520 |
+
|
| 521 |
+
By assumption, we have that
|
| 522 |
+
|
| 523 |
+
$$
|
| 524 |
+
\ell \left(\left(I - 2 P\right) \theta + \theta^ {\prime} + \theta_ {0}\right) + \gamma \| \left(I - 2 P\right) \theta + \theta^ {\prime} \| _ {D} ^ {2} = \ell \left(\theta + \theta^ {\prime} + \theta_ {0}\right) + \gamma \| \theta + \theta^ {\prime} \| _ {D} ^ {2}, \tag {39}
|
| 525 |
+
$$
|
| 526 |
+
|
| 527 |
+
and, so, for all $\theta$
|
| 528 |
+
|
| 529 |
+
$$
|
| 530 |
+
\ell \left(\left(I - 2 P\right) \theta + \theta^ {\prime} + \theta_ {0}\right) = \ell \left(\theta + \theta^ {\prime} + \theta_ {0}\right) + 4 \theta^ {T} P D \left(\left(I - P\right) \theta + \theta^ {\prime}\right). \tag {40}
|
| 531 |
+
$$
|
| 532 |
+
|
| 533 |
+
There are two cases: (1) $PD\big((I - P)\theta + \theta'\big) = 0$ and (2) $PD\big((I - P)\theta + \theta'\big) \neq 0$ .
|
| 534 |
+
|
| 535 |
+
Like before, there are two cases. For case (2), the proof is identical, and so we omit it. For case (1), it must be the case that for some $P$ , and $\theta'$
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\ell \left(\left(I - 2 P\right) \theta + \theta^ {\prime} + \theta_ {0}\right) = \ell \left(\theta + \theta^ {\prime} + \theta_ {0}\right). \tag {41}
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
This is possible if and only if $P(\theta' + \theta_0) = \theta_i^\dagger$ for some $i$ and $P = P_i$ for the corresponding projection matrix. However, because $P\theta' = 0$ , this requires that
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
P \left(\theta^ {\prime} + \theta_ {0}\right) = \theta_ {i} ^ {\dagger}. \tag {42}
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
By the definition of the reflection symmetry, we have that
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
P \theta^ {\prime} = \theta^ {\prime}. \tag {43}
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
This means that
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
\theta^ {\prime} = \theta_ {i} ^ {\dagger} - P \theta_ {0}. \tag {44}
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
At the same time, we have
|
| 560 |
+
|
| 561 |
+
$$
|
| 562 |
+
P D \left(\left(I - P\right) \theta + \theta^ {\prime}\right) = 0, \tag {45}
|
| 563 |
+
$$
|
| 564 |
+
|
| 565 |
+
which implies that
|
| 566 |
+
|
| 567 |
+
$$
|
| 568 |
+
P D (I - P) \theta = - P D \theta^ {\prime}. \tag {46}
|
| 569 |
+
$$
|
| 570 |
+
|
| 571 |
+
Because the right hand side is a constant that only depends on $\theta$ . This can only happen if both sides are zero, which is achieved if:
|
| 572 |
+
|
| 573 |
+
$$
|
| 574 |
+
P D (I - P) = 0, \tag {47}
|
| 575 |
+
$$
|
| 576 |
+
|
| 577 |
+
and
|
| 578 |
+
|
| 579 |
+
$$
|
| 580 |
+
\theta_ {i} ^ {\dagger} = P \theta_ {0}. \tag {48}
|
| 581 |
+
$$
|
| 582 |
+
|
| 583 |
+
The first condition implies that
|
| 584 |
+
|
| 585 |
+
$$
|
| 586 |
+
P D = P D P = D ^ {T} P ^ {T} = D P, \tag {49}
|
| 587 |
+
$$
|
| 588 |
+
|
| 589 |
+
which implies that $P$ and $D$ must share the eigenvectors because they commute. Noting that
|
| 590 |
+
|
| 591 |
+
$$
|
| 592 |
+
P \theta_ {i} ^ {\dagger} = \theta_ {i} ^ {\dagger}, \tag {50}
|
| 593 |
+
$$
|
| 594 |
+
|
| 595 |
+
we obtain that $\theta_i^\dagger$ is an eigenvector of $P$ and so $\theta_i^\dagger$ is an eigenvector of $D$ , but $D$ is diagonal and with nonidentical diagonal entries, $\theta_i^\dagger$ much then be a one-hot vector, and $P$ must also be diagonal and consists of values of 1 and 0 in the diagonal entries.
|
| 596 |
+
|
| 597 |
+

|
| 598 |
+
|
| 599 |
+
# A.7 PROOF OF THEOREM 3
|
| 600 |
+
|
| 601 |
+
Proof. First of all, note that shifting parameters of $\ell$ is the same as shifting the parameters of the weight decay. Therefore, for any local minimum $\theta'$ ,
|
| 602 |
+
|
| 603 |
+
$$
|
| 604 |
+
\ell_ {\operatorname {a r}} \left(\theta^ {\prime}\right) = \ell (\theta) + \gamma \| \theta - \theta_ {0} \| ^ {2}, \tag {51}
|
| 605 |
+
$$
|
| 606 |
+
|
| 607 |
+
where $\theta = \theta^{\prime} + \theta_{0}$
|
| 608 |
+
|
| 609 |
+
Therefore,
|
| 610 |
+
|
| 611 |
+
$$
|
| 612 |
+
\begin{array}{l} \ell_ {\mathrm {a r}} \left(\theta^ {\prime} + \theta^ {*}\right) - \ell_ {\mathrm {a r}} \left(\left(I - 2 P\right) \theta^ {\prime} + \theta^ {*}\right) (52) \\ = \ell (\theta + \theta^ {*}) + \gamma \| \theta + \theta^ {*} - \theta_ {0} \| _ {D} ^ {2} - \ell ((I - 2 P) \theta + \theta^ {*}) - \gamma \| (I - 2 P) \theta + \theta^ {*} - \theta_ {0} \| _ {D} ^ {2} (53) \\ = \gamma \| \theta + \theta^ {*} - \theta_ {0} \| _ {D} ^ {2} - \gamma \| (I - 2 P) \theta + \theta^ {*} - \theta_ {0} \| _ {D} ^ {2} (54) \\ = \gamma \left(z _ {\perp} ^ {T} (D - I) z _ {\parallel} + z _ {\perp} ^ {T} D \left(\theta^ {*} - \theta_ {0}\right)\right), (55) \\ \end{array}
|
| 613 |
+
$$
|
| 614 |
+
|
| 615 |
+
where we have used the definition of reflection symmetry in the third line. In the fourth line, we have defined $z_{\perp} = P\theta$ and $z_{\parallel} = (I - P)\theta$ . Thus,
|
| 616 |
+
|
| 617 |
+
$$
|
| 618 |
+
\left\| \theta \right\| ^ {2} = \left\| z _ {\perp} \right\| ^ {2} + \left\| z _ {\parallel} \right\| ^ {2} = \Theta (1). \tag {56}
|
| 619 |
+
$$
|
| 620 |
+
|
| 621 |
+
Thus, we have that
|
| 622 |
+
|
| 623 |
+
$$
|
| 624 |
+
\begin{array}{l} \Theta \left(\ell_ {\operatorname {a r}} \left(\theta^ {\prime} + \theta^ {*}\right) - \ell_ {\operatorname {a r}} \left((I - 2 P) \theta^ {\prime} + \theta^ {*}\right)\right) = \gamma \Theta \left(z _ {\perp} ^ {T} (D - I) z _ {\parallel}\right) + \Theta \left(z _ {\perp} ^ {T} D \left(\theta^ {*} - \theta_ {0}\right)\right) (57) \\ = \gamma \Theta \left(\sigma_ {D} \| z _ {\perp} \|\right) + \Omega \left(\sigma_ {0} \| z _ {\perp} \|\right), (58) \\ \end{array}
|
| 625 |
+
$$
|
| 626 |
+
|
| 627 |
+
where we have used the fact that each element of $\theta^{*} - \theta_{0}$ is $\Omega (\sigma_0)$ because $\theta^{*}$ is an arbitrary constant and $\theta_0\sim \mathcal{N}(0,\sigma^2)$ . By the assumption that $\sigma_D = o(\sigma_0)$ , we obtain the desired relation
|
| 628 |
+
|
| 629 |
+
$$
|
| 630 |
+
\ell_ {\operatorname {a r}} \left(\theta^ {\prime} + \theta^ {*}\right) - \ell_ {\operatorname {a r}} \left(\left(I - 2 P\right) \theta^ {\prime} + \theta^ {*}\right) = \Omega (\gamma \sigma_ {0}) \| z _ {\perp} \|. \tag {59}
|
| 631 |
+
$$
|
| 632 |
+
|
| 633 |
+
This finishes the proof.
|
| 634 |
+
|
| 635 |
+

|
| 636 |
+
|
| 637 |
+
# A.8 PROOF OF THEOREM 4
|
| 638 |
+
|
| 639 |
+
Proof. First of all,
|
| 640 |
+
|
| 641 |
+
$$
|
| 642 |
+
\Pr \left(\min _ {i} \left| \Delta_ {i} \right| > \epsilon\right) = \Pr \left(\left| \Delta_ {1} \right| > \epsilon \wedge \dots \wedge \left| \Delta_ {N} \right| > \epsilon\right) \tag {60}
|
| 643 |
+
$$
|
| 644 |
+
|
| 645 |
+
$$
|
| 646 |
+
\geq \max \left(0, \sum_ {i} ^ {N} \Pr \left(\left| \Delta_ {i} \right| > \epsilon\right) - N + 1\right), \tag {61}
|
| 647 |
+
$$
|
| 648 |
+
|
| 649 |
+
where we have applied the Frechet inequality in the second line.
|
| 650 |
+
|
| 651 |
+
The sum $\sum_{i}^{N}\operatorname *{Pr}\big(|\Delta_{i}| > \epsilon \big)$ can also be lower bounded if each $\Delta_{i}$ is a Gaussian variable with variance $\sigma_{i}$ :
|
| 652 |
+
|
| 653 |
+
$$
|
| 654 |
+
\sum_ {i} ^ {N} \Pr \left(\left| \Delta_ {i} \right| > \epsilon\right) \geq \sum_ {i} ^ {N} \left(1 - \frac {2 \epsilon}{\sqrt {2 \pi \sigma_ {i} ^ {2}}}\right) \tag {62}
|
| 655 |
+
$$
|
| 656 |
+
|
| 657 |
+
$$
|
| 658 |
+
\geq N - \frac {2 \epsilon N}{\min _ {i} \sqrt {2 \pi \sigma_ {i} ^ {2}}}. \tag {63}
|
| 659 |
+
$$
|
| 660 |
+
|
| 661 |
+
Thus, for $\operatorname*{Pr}(\min_i|\Delta_i| > \epsilon)$ to be larger than $1 - \delta$ , we must have
|
| 662 |
+
|
| 663 |
+
$$
|
| 664 |
+
\min _ {i} \sigma_ {i} \geq \frac {2 \epsilon N}{\sqrt {2 \pi} (1 - \delta)}. \tag {64}
|
| 665 |
+
$$
|
| 666 |
+
|
| 667 |
+
Now, we show that $\Delta_{i}$ -s are indeed Gaussian variables. From the previous proof, it is easy to see that for a unit vector $n_i$ ,
|
| 668 |
+
|
| 669 |
+
$$
|
| 670 |
+
\Delta_ {i} = \gamma n _ {i} ^ {T} \left(\theta^ {*} - \theta_ {0}\right) + o (\gamma \sigma_ {0}). \tag {65}
|
| 671 |
+
$$
|
| 672 |
+
|
| 673 |
+
Therefore, $\Delta_{i}$ is a Gaussian variable with standard deviation $\gamma \sigma_0$ . Thus, $\min_i\sigma_i = \gamma \sigma_0$ . Thus, we have obtained the desired result
|
| 674 |
+
|
| 675 |
+
$$
|
| 676 |
+
\gamma \sigma_ {0} \geq \frac {2 \epsilon N}{\sqrt {2 \pi} (1 - \delta)}. \tag {66}
|
| 677 |
+
$$
|
| 678 |
+
|
| 679 |
+

|
| 680 |
+
|
| 681 |
+
# A.9 PROOF OF THEOREM 5
|
| 682 |
+
|
| 683 |
+
Before we start proving Theorem 5, we introduce a definition that facilitates the proof.
|
| 684 |
+
|
| 685 |
+
Definition 2. (Symmetry reduction.) We say that removing a symmetry from group $G_{1}$ reduces to removing the symmetry due to group $G_{2}$ if for any vector $n$ ,
|
| 686 |
+
|
| 687 |
+
$$
|
| 688 |
+
\left\| \left(I - \overline {{G _ {2}}}\right) n \right\| \leq \left\| \left(I - \overline {{G _ {1}}}\right) n \right\|. \tag {67}
|
| 689 |
+
$$
|
| 690 |
+
|
| 691 |
+
Now, we are ready to prove the main theorem.
|
| 692 |
+
|
| 693 |
+
Proof. We first show $(I - \overline{V})^T\nabla_\theta \ell (\theta) = 0$ . For any $g\in V$ and $z\in \mathbb{R}$ , we have
|
| 694 |
+
|
| 695 |
+
$$
|
| 696 |
+
\ell (\theta + z n) = \ell (g (\theta + z n)), \tag {68}
|
| 697 |
+
$$
|
| 698 |
+
|
| 699 |
+
where $n$ is an arbitrary unit vector. Taking the derivative with respect to $z$ , and recalling that $g\theta = \theta$ , we have
|
| 700 |
+
|
| 701 |
+
$$
|
| 702 |
+
\left(g n\right) ^ {T} \nabla_ {\theta} \ell (\theta) = n ^ {T} \nabla_ {\theta} \ell (\theta). \tag {69}
|
| 703 |
+
$$
|
| 704 |
+
|
| 705 |
+
Accordingly, we have
|
| 706 |
+
|
| 707 |
+
$$
|
| 708 |
+
(V n) ^ {T} \nabla_ {\theta} \ell (\theta) := \frac {1}{| V |} \sum_ {g \in V} (g n) ^ {T} \nabla_ {\theta} \ell (\theta) = n ^ {T} \nabla_ {\theta} \ell (\theta). \tag {70}
|
| 709 |
+
$$
|
| 710 |
+
|
| 711 |
+
Due to the arbitrary choice of $n$ , we have $(I - \overline{V})^T\nabla_\theta \ell (\theta) = 0$
|
| 712 |
+
|
| 713 |
+
Therefore,
|
| 714 |
+
|
| 715 |
+
$$
|
| 716 |
+
\begin{array}{l} \left(I - \bar {V}\right) ^ {T} \nabla_ {\theta} \ell_ {\operatorname {a r}} (\theta) = \gamma \left(I - \bar {V}\right) ^ {T} \nabla_ {\theta} \| \theta - \theta_ {0} \| _ {D} ^ {2} (71) \\ = 2 \gamma (I - \bar {V}) ^ {T} D (\theta - \theta_ {0}) (72) \\ = 2 \gamma (I - \bar {V}) ^ {T} \theta_ {0} + o (\gamma \sigma_ {0} (1 + \sigma_ {D})). (73) \\ \end{array}
|
| 717 |
+
$$
|
| 718 |
+
|
| 719 |
+
As $\theta_0$ is a Gaussian vector with mean 0 and variance $\sigma_0^2$ , $\| (I - \overline{V})^T\theta_0\|$ is a Gaussian variable with mean 0 and variance $\| I - \overline{V}\|^2\sigma_0^2 = \Omega (\mathrm{rank}(I - \overline{V})\sigma_0^2)$ , which gives $\| (I - \overline{V})\nabla_{\theta}\ell \| = \Omega (\gamma \sigma_0\sqrt{\mathrm{rank}(I - \overline{V})})$ .
|
| 720 |
+
|
| 721 |
+
Now, we prove part (2) of the theorem. Note that if $V \triangleleft U$ and if $\theta_0 \in \ker \overline{V}$ , then $\theta_0 \in \ker \overline{U}$ . This means that for any group $U$ such that $V \triangleleft U$ and any vector $\theta_0$
|
| 722 |
+
|
| 723 |
+
$$
|
| 724 |
+
\left\| \left(I - \bar {V}\right) \theta_ {0} \right\| < \left\| \left(I - \bar {U}\right) \theta_ {0} \right\|. \tag {74}
|
| 725 |
+
$$
|
| 726 |
+
|
| 727 |
+
This means that to remove the symmetry from a large group $U$ , it suffices to remove the symmetry from one of its minimal subgroups. Thus, let $M_G$ denote the set of minimal subgroups of the group $G$ , we have
|
| 728 |
+
|
| 729 |
+
$$
|
| 730 |
+
\min _ {V \triangleleft G} \| (I - \bar {V}) \theta_ {0} \| \geq \min _ {V \triangleleft M _ {G}} \| (I - \bar {V}) \theta_ {0} \|. \tag {75}
|
| 731 |
+
$$
|
| 732 |
+
|
| 733 |
+
The number of minimal subgroups is strictly upper bounded by the number of elements of the group because all minimal subgroups are only trivially intersect each other. This follows from the fact that the intersection of groups must be a subgroup, which can only be the identity for two different minimal subgroups. Therefore, the number of minimal subgroups cannot exceed the number of elements of the group. This finishes the second part of the theorem.
|
| 734 |
+
|
| 735 |
+
For the third part, we show that the symmetry broken subspace of any subgroup contains the symmetry broken subspace of a group generated by one of the generators and so it suffices to only remove the symmetries due to the subgroups generated by each generator. Let us introduce the following notation for a matrix representation $z$ of a group element:
|
| 736 |
+
|
| 737 |
+
$$
|
| 738 |
+
\bar {z} = \frac {1}{\operatorname {o r d} (z)} \sum_ {i = 1} ^ {\operatorname {o r d} (z)} z ^ {i}, \tag {76}
|
| 739 |
+
$$
|
| 740 |
+
|
| 741 |
+
where $\operatorname{ord}(z)$ denotes the order of $z$ . This is equivalent to the symmetry projection matrix of the subgroup generated by $z$ .
|
| 742 |
+
|
| 743 |
+
Now, let $G$ be abelian. Then, both $U$ and $V$ are abelian. Let us denote by $\Gamma(U) = \{z_i\}$ the minimal generating set of $U$ . Suppose that for all $n \neq 0$ such that $n \in \mathrm{im}(I - \overline{V})$ , we must have $n \notin \mathrm{im}(I - \overline{z_j})$ for all $j$ . This means that
|
| 744 |
+
|
| 745 |
+
$$
|
| 746 |
+
n \notin \bigcup_ {j} \operatorname {i m} (I - \bar {z _ {j}}). \tag {77}
|
| 747 |
+
$$
|
| 748 |
+
|
| 749 |
+
Or, equivalently,
|
| 750 |
+
|
| 751 |
+
$$
|
| 752 |
+
n \in \bigcap_ {j} \operatorname {i m} \left(\bar {z _ {j}}\right). \tag {78}
|
| 753 |
+
$$
|
| 754 |
+
|
| 755 |
+
However, the space $\cap_j\mathrm{im}(\overline{z_j})\subseteq \mathrm{im}(\overline{V})$ because $V$ is a subgroup of $U$ , which is generated by $z_{1},\dots ,z_{m}$ . To see this, let $n\in \mathrm{im}(\overline{z_j})$ for all $j$ , then,
|
| 756 |
+
|
| 757 |
+
$$
|
| 758 |
+
z _ {j} n = n \tag {79}
|
| 759 |
+
$$
|
| 760 |
+
|
| 761 |
+
for all $j$ . Now, let $v = \prod_{i}z_{i}^{d_{i}(v)}\in V$ , we have
|
| 762 |
+
|
| 763 |
+
$$
|
| 764 |
+
(I - \bar {V}) n = (I - \sum_ {v} \prod_ {i} z _ {i} ^ {d _ {i} (v)}) n = 0 \tag {80}
|
| 765 |
+
$$
|
| 766 |
+
|
| 767 |
+
This means that $n$ is in both $\operatorname{im}(\overline{V})$ and $\operatorname{im}(I - \overline{V})$ , which is possible only if $n = 0$ – a contradiction. Therefore, as long as $I - \bar{V}$ is not rank 0, it must share a common subspace with one of the $I - \overline{z_j}$ , and so removing the symmetry from any subgroup $V$ of $U$ can be reduced to removing the symmetry from the cyclic group generated by one of its generators from the minimal generating set. $^8$
|
| 768 |
+
|
| 769 |
+
Therefore, we have proved that removing symmetries due to any subgroup of $U$ can be reduced to removing the symmetry from a (proper or trivial) subgroup of each of the cyclic decompositions of the group $U$ , each of which is generated by a minimal generator of $U$ . By the fundamental theorem of finite abelian groups, each of these groups is of order $p^k$ for some prime number $p$ . Because each of these groups is cyclic, it contains exactly $k$ nontrivial subgroups. Taken together, this means that if $|U| = p_1^{k_1} \dots p_m^{k_m}$ , we only have to remove symmetries from at most
|
| 770 |
+
|
| 771 |
+
$$
|
| 772 |
+
\sum_ {i} ^ {m} k _ {i} = \log | U | \tag {81}
|
| 773 |
+
$$
|
| 774 |
+
|
| 775 |
+
many subgroups. This completes part (3).
|
| 776 |
+
|
| 777 |
+
For part (4), we denote $\Delta_i \coloneqq (I - \overline{V}_i)^T \nabla_\theta \ell_{\mathrm{ar}}(\theta)$ for $i = 1, \dots, |\Gamma(U)|$ . According to (73), $\Delta_i$ is approximately a Gaussian variable with zero mean and variance $\gamma^2 \mathrm{rank}(I - \overline{V}) \sigma_0^2$ . Therefore,
|
| 778 |
+
|
| 779 |
+
$$
|
| 780 |
+
\sum_ {i} ^ {| \Gamma (U) |} \Pr \left(| \Delta_ {i} | > \epsilon\right) \geq | \Gamma (U) | - \frac {2 \epsilon | \Gamma (U) |}{\min _ {i} \sqrt {2 \pi \gamma^ {2} \operatorname {r a n k} (I - \bar {V}) \sigma_ {0} ^ {2}}}. \tag {82}
|
| 781 |
+
$$
|
| 782 |
+
|
| 783 |
+
For $\operatorname*{Pr}(\min_i|\Delta_i| > \epsilon)$ to be larger than $1 - \delta$ , we must have
|
| 784 |
+
|
| 785 |
+
$$
|
| 786 |
+
\gamma \sigma_ {0} \geq \frac {2 \epsilon | \Gamma (U) |}{\sqrt {2 \pi \operatorname {r a n k} (I - \bar {V})} (1 - \delta)}. \tag {83}
|
| 787 |
+
$$
|
| 788 |
+
|
| 789 |
+

|
| 790 |
+
|
| 791 |
+

|
| 792 |
+
Figure 7: For the same setting as Figure 2, the rank of the covariance matrix decreases with the label noise and increases with the input noise. We set eigenvalues smaller than $10^{-3}$ to zero.
|
| 793 |
+
|
| 794 |
+

|
| 795 |
+
|
| 796 |
+

|
| 797 |
+
Figure 8: The spectrum of the covariance matrix of the model with vanilla weight decay (Left) and the syre model (Right) for $\gamma = 0.01$ and $\alpha = 1$ . Clearly, the vanilla model learns a low-rank solution.
|
| 798 |
+
|
| 799 |
+

|
| 800 |
+
|
| 801 |
+
# B ADDITIONAL EXPERIMENTS AND EXPERIMENTAL DETAIL
|
| 802 |
+
|
| 803 |
+
# B.1 TEACHER-STUDENT SCENARIO
|
| 804 |
+
|
| 805 |
+
This section gives some additional details and additional experiments in the teacher-student scenario in Figure 2. Specifically, we implement a two-layer network with tanh activation, 300 hidden units, and different input units. The network outputs a ten-dimensional vector corresponding to ten different classes. We then randomly generate such a network as the teacher model, 10000 standard Gaussian samples as the training set, and 1000 standard Gaussian samples. For both the syre and the vanilla model, we choose the Adam optimizer, learning rate 0.01, and weight decay 0.01.
|
| 806 |
+
|
| 807 |
+
As additional experiments, we also measure the influence of noisy labels and noisy input on the rank of the model in Figure 7. For the label noise, we randomly change $0\%$ to $80\%$ of the labels, and for the input noise, we add a Gaussian noise to the input with standard deviation 0 to 1.6. Figure 7 suggests that the rank of the vanilla model decreases in the face of noisy labels and increases in the face of noisy input, perhaps because the latter can be regarded as data augmentation. The syre model, however, is not affected.
|
| 808 |
+
|
| 809 |
+
# B.2 SUPERVISED LEARNING
|
| 810 |
+
|
| 811 |
+
This section presents some additional experiments for Section 6.3. Figure 8 gives the eigenvalue distribution of the networks in Fig.5, which further supports the claim that the vanilla network leads to a low-rank solution. In all the experiments above and in Section 6.3, we use a four-layer FCN with 300 neurons in each layer trained on the MNIST dataset with batch size 64.
|
| 812 |
+
|
| 813 |
+

|
| 814 |
+
Figure 9: Rank and reconstruction loss for a VAE is trained on the Fashion MNIST dataset. The covariance of the model with vanilla weight decay has a low-rank structure and larger reconstruction loss. More importantly, posterior collapse happens at $\beta = 5$ but is mitigated with weight decay. Left: the rank of the encoder output with batch size 1000. We set eigenvalues smaller than $10^{-6}$ to 0. Right: reconstruction loss of vanilla and syre models.
|
| 815 |
+
|
| 816 |
+

|
| 817 |
+
|
| 818 |
+

|
| 819 |
+
Figure 10: Examples of Fashion MNIST reconstruction with syre and $\beta = 10$ . Left: No weight decay. Right: $\gamma = 1000$ . Clearly, the posterior collapse is mitigated by imposing syre with weight decay.
|
| 820 |
+
|
| 821 |
+

|
| 822 |
+
|
| 823 |
+

|
| 824 |
+
Figure 11: Performance and accuracy of a CNN trained on a continual learning task (permuted MNIST (Goodfellow et al., 2013; Kirkpatrick et al., 2017)). The main figure shows the test accuracy, and the subfigure shows the rank of the convolution layers output with batch size 1000, where we set eigenvalues smaller than $10^{-4}$ to 0. The results suggest that the rank of the model with vanilla weight decay gradually decreases, and the model completely collapses after the sixth task, while the syre model remains unaffected.
|
| 825 |
+
|
| 826 |
+
# B.3 POSTERIOR COLLAPSE
|
| 827 |
+
|
| 828 |
+
See Figures 9 and 10.
|
| 829 |
+
|
| 830 |
+
# B.4 CONTINUAL LEARNING
|
| 831 |
+
|
| 832 |
+
See Figure 11.
|
| 833 |
+
|
| 834 |
+

|
| 835 |
+
Figure 12: Test accuracy and rank of ViT for CIFAR10 (adapted from Yoshioka (2024)) with various weight decay $\gamma$ and data distributions with varying strengths of linear correlation $\alpha$ . As the theory predicts, the covariance of features of the model with vanilla weight decay has a low-rank structure and performs significantly worse. Dashed black lines correspond to random guesses. Subfigures show the rank of the covariance matrix of the final layer input with batch size 512. We set eigenvalues smaller than $10^{-4}$ to 0. Left: $\alpha = 1$ and different $\gamma$ . Right: $\gamma = 0.0001$ and different $\alpha$ .
|
| 836 |
+
|
| 837 |
+

|
| 838 |
+
|
| 839 |
+
<table><tr><td>batchsize</td><td>MLP</td><td>syre-MLP</td><td>ResNet</td><td>syre-ResNet</td><td>ViT</td><td>syre-ViT</td></tr><tr><td>512</td><td>95 ± 0.1</td><td>97 ± 1</td><td>18.4 ± 0.7</td><td>19.2 ± 0.9</td><td>80 ± 1</td><td>84 ± 2</td></tr><tr><td>256</td><td>48 ± 1</td><td>49 ± 1</td><td>18.6 ± 0.2</td><td>19.6 ± 0.4</td><td>48 ± 5</td><td>57 ± 3</td></tr><tr><td>128</td><td>26 ± 1</td><td>26 ± 1</td><td>19.9 ± 0.4</td><td>20.9 ± 0.3</td><td>39 ± 1</td><td>47 ± 2</td></tr></table>
|
| 840 |
+
|
| 841 |
+
Table 2: The per-batch time (ms) of various models.
|
| 842 |
+
|
| 843 |
+
<table><tr><td>batchsize</td><td>MLP</td><td>syre-MLP</td><td>ResNet</td><td>syre-ResNet</td><td>ViT</td><td>syre-ViT</td></tr><tr><td>512</td><td>382</td><td>384</td><td>7020</td><td>7049</td><td>4216</td><td>4218</td></tr><tr><td>256</td><td>360</td><td>382</td><td>3936</td><td>4254</td><td>2482</td><td>2484</td></tr><tr><td>128</td><td>360</td><td>382</td><td>2096</td><td>2190</td><td>1574</td><td>1574</td></tr></table>
|
| 844 |
+
|
| 845 |
+
Table 3: The GPU memory usage (M) of various models.
|
| 846 |
+
|
| 847 |
+
# B.5 VISION TRANSFORMER (VIT)
|
| 848 |
+
|
| 849 |
+
Similar to Section 6.3, we train the vanilla and syre ViT with various levels of weight decay $\gamma$ and various levels of input-output covariance $\alpha$ . The dataset is constructed by rescaling the input by a factor of $\alpha$ for the CIFAR10 dataset. As the theoretical prediction, we can see that syre removes the rotation symmetries symmetry of transformers (Kobayashi et al., 2024) and leads to a full-rank solution with higher accuracy, as shown in Figure 12. Moreover, syre also performs better than the W-asymmetric and $\sigma$ -asymmetric networks proposed in Lim et al. (2024). We implement $\sigma$ -asymmetric networks using the recommended hyperparameters in Lim et al. (2024), and implement W-asymmetric networks by setting the same hyperparameters for each layer and doing a grid search.
|
| 850 |
+
|
| 851 |
+
# B.6 TIME AND MEMORY CONSUMPTION
|
| 852 |
+
|
| 853 |
+
The time and memory consumption of various models used in previous sections is given in Tables 2 and 3. In all experiments, we train the models on the CIFAR10 dataset with a signal A6000 GPU. It is clear that syre has a negligible influence on time and memory consumption. This is as expected because syre only adds a static bias to training.
|
| 854 |
+
|
| 855 |
+
# B.7 LINEAR MODEL CONNECTIVITY
|
| 856 |
+
|
| 857 |
+
We also test the influence of syre on the linear model connectivity with the same setting as Lim et al. (2024). Specifically, we obtain two well-behaved MLP with parameters $\theta_{1}$ and $\theta_{2}$ , and test the performance of another MLP with parameters $\lambda \theta_{1} + (1 - \lambda)\theta_{2}$ for $0 < \lambda < 1$ . By removing the permutation symmetry of MLP, we expect that the MLP with parameters $\lambda \theta_{1} + (1 - \lambda)\theta_{2}$ also performs well. Figure 13 suggests that syre performs similarly to W-asymmetric networks proposed in Lim et al. (2024), while our methods have much fewer hyperparameters.
|
| 858 |
+
|
| 859 |
+

|
| 860 |
+
Figure 13: Linear mode connectivity: test accuracy and loss curves along linear interpolations between trained networks. We train MLPs over the MNIST dataset.
|
| 861 |
+
|
| 862 |
+

|
| 863 |
+
|
| 864 |
+

|
| 865 |
+
Figure 14: Ranks of the gradient covariance and NTK (Left: beginning of training. Right: end of training.) against the theoretical upper bound implied by Propositions 3 and 2. Two observations agree with our expectation: (1) the ranks of both matrices decrease as more and more neurons are stuck at the entrapped subspace, and (2) the ranks are always upper bound by the theoretical upper bound.
|
| 866 |
+
|
| 867 |
+

|
| 868 |
+
|
| 869 |
+
# C SYMMETRY AND RANK OF THE NTK
|
| 870 |
+
|
| 871 |
+
In this section, we show that the rank of the NTK and gradient reduces as more and more of the neurons are in the symmetric state (namely, the fixed point induced by the group averaging projector).
|
| 872 |
+
|
| 873 |
+
Due to the difficulty in computing the spectrum of the NTK, we restrict to a two-layer subnetwork within a large network trained on MNIST with the number of neurons $10 \to 64 \to 10$ , with 1280 many parameters. This means that the gradient second moment has dimension $1280 \times 1280$ , and the model is trained on 1500 data points. Thus, the empirical NTK can be seen as a matrix having dimension $1500 \times 1500$ . Here, the symmetry projection we consider is due to the permutation symmetry, whose projection has a rank of 20 (because every neuron has ten outgoing weights and incoming weights). Thus, according to the Propositions 3 and 2, the maximum possible rank for the NTK and the gradient is $1280 - 20 \times n$ , where $n$ is the number of neurons projected to the symmetry fixed point. See Figure 14.
|
2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4b97b28bc2af76ff357b09bce5798c4ae6e0cfcd647b8ef89d93b47eaabfb56e
|
| 3 |
+
size 835525
|
2025/Remove Symmetries to Control Model Expressivity and Improve Optimization/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Repetition Improves Language Model Embeddings/a1da781f-b124-4ff7-b979-4e630c28049f_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Repetition Improves Language Model Embeddings/a1da781f-b124-4ff7-b979-4e630c28049f_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Repetition Improves Language Model Embeddings/a1da781f-b124-4ff7-b979-4e630c28049f_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ae9cabf05679339bffebd92b75e900168151d6b507b7c34bca04955265e76e6
|
| 3 |
+
size 1432743
|
2025/Repetition Improves Language Model Embeddings/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Repetition Improves Language Model Embeddings/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b5608e61ac48bc333bf2529c29d324e260d600c201e269fed30c12fe1f88e7b
|
| 3 |
+
size 4340361
|
2025/Repetition Improves Language Model Embeddings/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/791cb7c8-9e55-4a03-85bd-a3775369aa76_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/791cb7c8-9e55-4a03-85bd-a3775369aa76_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/791cb7c8-9e55-4a03-85bd-a3775369aa76_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f7e71dde1236edc74768e3f599adaa3376c2ab5a324e9b8ac1d3dc4aa0e72497
|
| 3 |
+
size 6755336
|
2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/full.md
ADDED
|
@@ -0,0 +1,483 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REPOGRAPH: ENHANCING AI SOFTWARE ENGINEERING WITH REPOSITORY-LEVEL CODE GRAPH
|
| 2 |
+
|
| 3 |
+
Siru Ouyang $^{1}$ , Wenhao Yu $^{2}$ , Kaixin Ma $^{2}$ , Zilin Xiao $^{3}$ , Zhihan Zhang $^{4}$ , Mengzhao Jia $^{4}$ , Jiawei Han $^{1}$ , Hongming Zhang $^{2}$ , Dong Yu $^{2}$
|
| 4 |
+
|
| 5 |
+
<sup>1</sup> University of Illinois Urbana-Champaign, <sup>2</sup> Tencent AI Seattle Lab
|
| 6 |
+
|
| 7 |
+
$^{3}$ Rice University, $^{4}$ University of Notre Dame siruo2@illinois.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Large Language Models (LLMs) excel in code generation yet struggle with modern AI software engineering tasks. Unlike traditional function-level or file-level coding tasks, AI software engineering requires not only basic coding proficiency but also advanced skills in managing and interacting with code repositories. However, existing methods often overlook the need for repository-level code understanding, which is crucial for accurately grasping the broader context and developing effective solutions. On this basis, we present REPOGRAPH, a plug-in module that manages a repository-level structure for modern AI software engineering solutions. REPOGRAPH offers the desired guidance and serves as a repository-wide navigation for AI software engineers. We evaluate REPOGRAPH on the SWE-bench by plugging it into four different methods of two lines of approaches, where REPOGRAPH substantially boosts the performance of all systems, leading to a new state-of-the-art among open-source frameworks. Our analyses also demonstrate the extensibility and flexibility of REPOGRAPH by testing on another repo-level coding benchmark, CrossCodeEval. Our code is available at https://github.com/ozyyshr/RepoGraph
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Recent advancements in large language models (LLMs) have showcased their powerful capabilities across various natural language processing tasks (OpenAI, 2023; Anil et al., 2023; Dubey et al., 2024), and now, coding-specific LLMs are emerging to tackle complex software engineering challenges (Hou et al., 2023; Fan et al., 2023), such as Code-Llama (Rozière et al., 2023) and StarCoder (Li et al., 2023a). These coding-specific LLMs are capable of assisting users with various software engineering tasks, even achieving human-level performance in many function-level coding tasks, such as program synthesis (Chen et al., 2021; Austin et al., 2021), code annotation (Yao et al., 2019), bug fixing (Tufano et al., 2019), and code translation (Rozière et al., 2020).
|
| 16 |
+
|
| 17 |
+
Real-world software engineering often extends beyond single function or self-contained code files. Applications are typically built as repositories containing multiple interdependent files, modules, and libraries (Bairi et al., 2024). These complex structures require a holistic understanding of the entire codebase to perform tasks such as code completion (Shrivastava et al., 2023; Ding et al., 2023), feature addition (Liang et al., 2024), or issue resolving (Jimenez et al., 2024). Recent benchmarks like SWE-Bench (Jimenez et al., 2024) have been proposed to evaluate LLMs on real-world GitHub issues. It requires LLMs to modify the repository to resolve the issue, either by fixing a bug or introducing a new feature. This task is particularly challenging because it requires navigating complex code bases, understanding intricate dependencies between code files, and ensuring that changes integrate seamlessly without introducing new issues, which highlights the difficulties in scaling from function-level to repository-level understanding, as expounded in Figure 1.
|
| 18 |
+
|
| 19 |
+
A key step in addressing repository-level tasks is to understand the structure of a repository and identify related code. To achieve this, retrieval-augmented generation (RAG) and its variants (Xiao et al.,
|
| 20 |
+
|
| 21 |
+
Input text: Write a python function to find the first repeated character in a given string.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
|
| 25 |
+
1. def first_repeated_char(str1):
|
| 26 |
+
2. for index,c in enumerate(str1):
|
| 27 |
+
3. if str1[:index+1].count(c) > 1:return c
|
| 28 |
+
4. return "None"
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
(a) Function-level Coding Problem
|
| 32 |
+
(b) Repository-level Coding Problem
|
| 33 |
+
Figure 1: The illustration of (a) a function-level coding problem from HumanEval (Chen et al., 2021) and (b) a repository-level coding problem from SWE-Bench (Jimenez et al., 2024).
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
2023; Zhang et al., 2023; Phan et al., 2024; Wu et al., 2024) have been leveraged, in a procedural manner, to retrieve relevant code files across the repository first, providing context for LLMs for further edition. However, indexing at file-level can only identify semantically similar but not genuinely related code snippets. Instead of using RAG, recent approaches like Agentless (Xia et al., 2024) construct a skeletal format for each file, and directly prompt LLMs to identify relevant files and code lines. However, this method still treats code repositories as flat documents (Zhang et al., 2024), which suffers from limitations of repository structure such as the intricate inter-dependencies across files. An alternative approach is to design agent frameworks (Yang et al., 2024; Wang et al., 2024), which enables LLMs to interact with repositories using actions. While LLM agents can freely determine the next action based on current observations, without the grasp of global repository structures, they tend to focus narrowly on specific files, resulting in local optimums. Addressing these limitations requires going beyond semantic matching and developing techniques that enable a deeper understanding of the codebase structure. This will allow LLMs to leverage fine-grained context across multiple files and function calls, facilitating more informed, repository-wide decision-making for coding tasks.
|
| 38 |
+
|
| 39 |
+
Motivated by this, we propose REPOGRAPH, a plug-in module designed to help LLMs-based AI programmers leverage the code structure of an entire repository. REPOGRAPH is a graph structure and operates at the line level, offering a more fine-grained approach compared to previous file-level browsing methods. Each node in the graph represents a line of code, and edges represent the dependencies of code definitions and references. REPOGRAPH is constructed via code line parsing and encodes the structured representation of the entire repository. Sub-graph retrieval algorithms are then used to extract ego-graphs, which represent the relationships of a central node (in our case, specific keywords). These ego-graphs can be smoothly integrated with both procedural and agent frameworks, offering key clues that provide a more comprehensive context for LLMs to solve real-world software engineering problems.
|
| 40 |
+
|
| 41 |
+
To assess REPOGRAPH's effectiveness and versatility as a plug-in module, we integrate it with four existing software engineering frameworks and evaluate its performance using SWE-bench, a recent benchmark for AI software engineering. Experiment results show that REPOGRAPH boosts the success rate of existing methods for both agent and procedural frameworks by achieving an average relative improvement of $32.8\%$ . We also test REPOGRAPH on CrossCodeEval to verify its transferability to general coding tasks that require repository-level code understanding. Additionally, we systematically analyze different sub-graph retrieval algorithms and integration methods. Together with error analyses, we hope to shed light on future works targeting modern AI software engineering.
|
| 42 |
+
|
| 43 |
+
# 2 RELATED WORKS
|
| 44 |
+
|
| 45 |
+
# 2.1 LLM-BASED METHODS FOR AI SOFTWARE ENGINEERING
|
| 46 |
+
|
| 47 |
+
Recently, there has been a significant increase in research focused on AI-driven software engineering, which can be broadly categorized into two primary approaches: (i) LLM agent-based frameworks and (ii) SWE-featured procedural frameworks. While this field has advanced rapidly, with most methods being released as proprietary solutions for industry applications (Cognition, 2024), our related work section will concentrate specifically on open-source frameworks.
|
| 48 |
+
|
| 49 |
+
LLM agent-based framework equips large language models (LLMs) with a set of predefined tools, allowing agents to iteratively and autonomously perform actions, observe feedback, and plan future steps (Yang et al., 2024; Zhang et al., 2024; Wang et al., 2024; Cognition, 2024; Ouyang et al., 2024; Tang et al., 2025). While the exact set of tools may vary across different agent frameworks, they typically include capabilities such as opening, writing, or creating files, searching for code lines, running tests, and executing shell commands. To solve a problem, agent-based approaches involve multiple actions, with each subsequent turn depending on the actions taken in previous ones and the feedback received from the environment. For example, SWE-agent (Yang et al., 2024) facilitates interactions with the execution environment by designing a special agent-computer interface (ACI). There are various actions, including "search and navigation", "file viewer and editor", and "context management". Another work, AutoCodeRover (Zhang et al., 2024), further offers fine-grained searching methods for LLM agents in better contexts without an execution process. Specifically, it supports class and function-level code search. OpenDevin (Wang et al., 2024), initiated after Devin (Cognition, 2024), is a community-driven platform that integrates widely used agent systems and benchmarks. The action space design of OpenDevin is highly flexible, requiring LLM agents to generate code on the fly.
|
| 50 |
+
|
| 51 |
+
SWE-featured procedural frameworks typically follow a two-step Localize/Search-Edit approach, as seen in existing literature (Zhang et al., 2023; Wu et al., 2024; Liang et al., 2024; Xia et al., 2024). The localize step focuses on identifying relevant code snippets, while the edit step involves completing or revising the code. Some works introduce additional steps to further enhance performance, such as the Search-Expand-Edit approach (Phan et al., 2024). Retrieval (Lewis et al., 2020) is a popular technique used for localization, allowing models to search for relevant code snippets from large repositories by treating issue descriptions as queries and code snippets as indexed data. Some approaches use a sliding window to ensure completeness (Zhang et al., 2023). Besides, Agentless (Xia et al., 2024) is a recently developed method that uses LLMs to directly identify relevant elements for editing within code repositories. It first recursively traverses the repository structure to generate a format that aligns files and folders vertically, with indices for subdirectories. This structure and the issue description are then input into the LLM, which performs a hierarchical search to identify the top-ranked suspicious files requiring further inspection or modification.
|
| 52 |
+
|
| 53 |
+
# 2.2 REPOSITORY-LEVEL CODING CAPABILITY
|
| 54 |
+
|
| 55 |
+
The evaluation of coding capabilities in AI systems has traditionally focused on function-level or line-level assessments (Lu et al., 2021; Chen et al., 2021; Austin et al., 2021), where individual code snippets or isolated functions are the primary units of analysis. Unlike previous studies, SWE-bench (Jimenez et al., 2024) highlights the trend of repository-level coding, driven by recent advances of coding-specific LLMs (Guo et al., 2024; Li et al., 2023b). It reflects the growing user demand to understand and contribute to entire projects rather than isolated functions (Ouyang et al., 2023), as well as
|
| 56 |
+
|
| 57 |
+
Table 1: Comparison between our approach REPOGRAPH and existing methods for representing the repository on various aspects. *RepoUnderstander (Ma et al., 2024) and CodexGraph (Liu et al., 2024) are concurrent works to ours.
|
| 58 |
+
|
| 59 |
+
<table><tr><td>Model</td><td>Line-level</td><td>File-level</td><td>Repo-level</td></tr><tr><td>DraCo</td><td>X</td><td>✓</td><td>X</td></tr><tr><td>Aider</td><td>✓</td><td>X</td><td>X</td></tr><tr><td>RepoUnderstander*</td><td>X</td><td>✓</td><td>✓</td></tr><tr><td>CodexGraph*</td><td>X</td><td>✓</td><td>✓</td></tr><tr><td>REPOGRAPH</td><td>✓</td><td>✓</td><td>✓</td></tr></table>
|
| 60 |
+
|
| 61 |
+
solving real-world problems in an end-to-end and automatic manner.
|
| 62 |
+
|
| 63 |
+
Long before the LLM era, the software engineering community has been studying the navigation of code repositories, including using eye-tracking data (Busjahn et al., 2015) and exploring interconnections (Begel et al., 2010). Then pre-trained code LLMs incorporate repository-level information such as file dependencies. But tasks at the repository level often involve more intricate call relationships within their context. Recent works like RepoCoder (Zhang et al., 2023) and RepoFuse (Liang et al., 2024) have started integrating RAG modules to harness additional information from repositories. Building on this, subsequent research has focused on embedding repository-level context into their methodologies. For instance, DraCo (Cheng et al., 2024) introduces importing relationships between files, CodePlan maintains the code changes by LLMs with incremental dependency analysis, while Aider (Gauthier, 2024) employs PageRank (Page, 1999) to identify the most significant contextual elements. RepoUnderstander (Ma et al., 2024) and CodexGraph (Liu et al., 2024) model
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
(a) RepoGraph Construction
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
(c) Integration with Agent Frameworks
|
| 70 |
+
Figure 2: An in-depth illustration of (a) the construction, (b) the integration with procedural frameworks, and (c) the integration with agent frameworks of REPOGRAPH. Given a code repository, we first utilize AST to construct $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ , where $\mathcal{G}$ consists of "reference" and "definition" node, $\mathcal{E}$ includes "invoke" and "contain" relations (files and code lines shown in corresponding color). The constructed REPOGRAPH are then used in procedural frameworks by adding sub-retrieval results into each step, and agent frameworks by adding graph retrieval as an additional action "search_repograph". A simplified version can be found in Figure 10.
|
| 71 |
+
|
| 72 |
+
code files as a knowledge graph. Despite similarities in representation, methods vary in how they retrieve information from these structures and utilize it for downstream tasks. Table 1 summarizes the differences between these methods and REPOGRAPH. REPOGRAPH surpasses previous approaches by effectively integrating context at the line, file, and repository levels.
|
| 73 |
+
|
| 74 |
+
# 3 REPOGRAPH
|
| 75 |
+
|
| 76 |
+
This section introduces REPOGRAPH, a novel plug-in module that can be seamlessly integrated into existing research workflows for both agent-based and procedural frameworks. The primary goal of REPOGRAPH is to provide a structured way to analyze and interact with complex codebases, enabling detailed tracing of code dependencies, execution flow, and structural relationships across the repository. In the following sections, we will provide a detailed description of REPOGRAPH's construction, its underlying representation, and its utility across various scenarios. The overall architecture is depicted in Figure 2, highlighting its key components and operational flow.
|
| 77 |
+
|
| 78 |
+
# 3.1 CONSTRUCTION
|
| 79 |
+
|
| 80 |
+
Given a repository-level coding task, the first step is to carefully examine the repository structure so that the necessary information can be collected. The input for REPOGRAPH construction is a repository, i.e., a collection of its folders and files, while the output is a structured graph, where each node is a code line, and each edge represents the dependencies in between. REPOGRAPH enables tracing back to the root cause of the current issue and gathering dependent code context to help solve the problem. The construction process of REPOGRAPH could be divided into three key steps.
|
| 81 |
+
|
| 82 |
+
Step 1: Code line parsing. We first traverse the entire repository using a top-down approach to identify all code files as candidates for next-step parsing. This is accomplished by filtering based on file extensions, retaining only those with relevant code file suffixes (e.g., .py) while excluding other file types (e.g., .git or requirements.txt), which might be noisy and irrelevant for coding tasks. For each code file, we utilize tree-sitter<sup>1</sup> to parse the code, leveraging its Abstract Syntax Tree (AST) framework. The AST provides a tree-based representation of the abstract syntactic structure of the source code, enabling the identification of key elements such as functions, classes, variables, types, and other definitions. While recognizing these definitions is crucial, tracing their usage and references throughout the code is equally important. Tree-sitter facilitates this by capturing the definitions
|
| 83 |
+
|
| 84 |
+
and tracking where they are utilized or referenced within the codebase. For example, in figure 2, we not only identify definitions like class Model and its inherent methods but also references like self._validate_input.units(). After processing each line of code with a tree-sitter, we selectively retain lines that involve function calls and dependency relations, discarding extraneous information. Our focus is primarily on the functions and classes, as these represent the core structural components of the code. By concentrating on these elements and their interrelationships, REPOGRAPH optimizes the analysis process by excluding less significant details, such as individual variables, which tend to be redundant and less relevant for further processing.
|
| 85 |
+
|
| 86 |
+
Step 2: Project-dependent relation filtering. After the previous parsing step, we obtain code lines with calling and dependency relations. However, not all relations are useful for fixing issues. Specifically, many default and built-in function/class calls could distract from the project-related ones. Therefore, we additionally introduce a filtering process that excludes the repository-independent relations. Two types of such relations exist: (i) global relation refers to Python standard and built-in functions and classes. (ii) local relation are introduced by third-party libraries, which are specific to the current code file. For global relations, we maintain a comprehensive list of methods from standard and built-in libraries, excluding any identified relations from this list. The list is empirically constructed by gathering methods of the builtins library and default methods such as "list" and "tuple". For example, in figure 2, line inputs = len(input) is excluded since "len" is a default method. For local relations, we parse import statements in the code to identify third-party methods that are included, and exclude them accordingly. A detailed illustration of this step can be found in Figure 11.
|
| 87 |
+
|
| 88 |
+
Step 3: Graph organization. At this stage, we construct REPOGRAPH using code lines as the fundamental building units. The graph can be represented as $\mathcal{G} = \{\mathcal{V},\mathcal{E}\}$ , where $\mathcal{V}$ represents the set of nodes, with each node corresponding to a line of code, and $\mathcal{E}$ represents the set of edges, capturing the relationships between these code lines. Each node in $\mathcal{V}$ contains attributes to represent its meta-information, such as line_number, file_name, directory, etc. Additionally, we classify each code line as either a "definition" (def) or a "reference" (ref) to a particular module. A "def" node corresponds to the line where a function, class, or variable is initially defined, while a "ref" node indicates a code line where this entity is referenced or invoked elsewhere in the code. Similar to soft links to "def" nodes, "ref" nodes also represent other variations of invoking methods. For example, in Figure 2, the class definition "class Model" would be a "def" node, while any subsequent usages of Model would be "ref" nodes. Each "def" node may have multiple "ref" nodes associated with it, as a single function or class can be referenced in various places throughout the code. We define two types of edges: $\mathcal{E}_{\text{invoke}}$ and $\mathcal{E}_{\text{contain}}$ . The triple $(\mathcal{V}_1,\mathcal{E}_{\text{contain}},\mathcal{V}_2)$ denotes that $\mathcal{V}_1$ (e.g., a function definition) contains another module $\mathcal{V}_2$ (e.g., an internal function or class). The edge $\mathcal{E}_{\text{contain}}$ typically connects a "def" node to its internal components. In contrast, $\mathcal{E}_{\text{invoke}}$ represents an invocation relationship, usually connecting a "def" node to a "ref" node, where the reference node includes a dependency on the definition.
|
| 89 |
+
|
| 90 |
+
# 3.2 UTILITY
|
| 91 |
+
|
| 92 |
+
The constructed REPOGRAPH serves as a structured representation of the current repository and facilitates better-related information collection and aggregation. For information collection based on REPOGRAPH, specifically, we use one search term each time for subgraph retrieval. Search terms are the key functions or classes that are determined by current states. For example, "separability_matrix" is the initial search term in Figure 2(c). We retrieve the $k$ -hop ego-graphs (Hu et al., 2024) with the search term in the centric. The ego-graph is crucial for solving the problem because it focuses on the immediate relationships (Jin et al., 2024) around the search term, capturing the relevant dependencies and interactions within the repository, which is key to understanding the functional context. Additionally, the retrieved content explicitly contains information at both the method and line levels and implicitly expresses the grouping at the file level.
|
| 93 |
+
|
| 94 |
+
This process is abstracted via search_repograph() as illustrated in the middle of Figure 2. The retrieved $k$ -hop ego-graph will be flattened for further processing. We also tried other variants for integration later in Section 5.2 and their performance in Table 4. We narrate how REPOGRAPH could be plugged in with existing representative research lines in the following.
|
| 95 |
+
|
| 96 |
+
Integration with procedural framework. In a procedural framework, LLMs are usually prompted in "localization" and "editing" stages with the given repository context and issue description. In this case, we use search_repograph() before both stages, leveraging our REPOGRAPH to assist in making more informed decisions at each step. For example, in Figure 2, we first include the subgraph of "separability_matrix" for localization, and then use the localized result "Model" to search in the edition stage. To implement the strategy, we flatten the context of retrieved ego-graphs and append it as part of the prompt. As a result, the LLM generation is conditioned on both retrieved ego-graphs and the context provided by baseline methods, helping the model preserve nuances.
|
| 97 |
+
|
| 98 |
+
Integration with agent framework. A significant difference in existing agent frameworks is the action space design, as expounded in Section 2. To leverage the power of REPOGRAPH, we put search_repograph() as an additional action in the action space. The agent decides when and where to use this action. The search term is also determined by the agent accordingly. The returned subgraph will be flattened and used as an observation for the next state.
|
| 99 |
+
|
| 100 |
+
# 4 EXPERIMENTS
|
| 101 |
+
|
| 102 |
+
# 4.1 SETUP
|
| 103 |
+
|
| 104 |
+
We evaluated REPOGRAPH as a plug-in component, i.e., integrated into existing baseline models of the two aforementioned research lines to assess its performance. We use the same baseline settings and configurations when incorporating REPOGRAPH to ensure a fair comparison.
|
| 105 |
+
|
| 106 |
+
Dataset. We test REPOGRAPH in SWE-bench-Lite<sup>2</sup>. Each problem in the dataset requires submitting a patch to solve the underlying issue described in the input issue description. The goal is to generate a patch that accurately revises the relevant portions of the codebase within the repository, ensuring that all test scripts included in the dataset are successfully executed.
|
| 107 |
+
|
| 108 |
+
Baselines. We integrate REPOGRAPH with representative methods from both aforementioned research lines. (i) For procedural frameworks, we evaluate the widely used traditional method, RAG (Lewis et al., 2020), as well as Agentless (Xia et al., 2024), an open-source state-of-the-art approach in this direction. For RAG, we follow its initial setting and use BM25 for file-level retrieval. After that, we append the context of REPOGRAPH after the code files as part of the prompt. Agentless first performs a hierarchical localization in terms of "file-class/function- edits" and then conducts repair based on localization. The context of REPOGRAPH is inserted in every step of Agentless. (ii) For agent frameworks, we consider SWE-agent (Yang et al., 2024) and AutoCodeRover (Zhang et al., 2024). For both frameworks, we add an additional action "search_repograph" for the LLM agent as described in Section 3. All the choices in the two research lines incorporate GPT-4 and GPT-4o-based methods to ensure generalization. Detailed implementations and prompts used can be found in Appendix A.
|
| 109 |
+
|
| 110 |
+
Evaluation metrics. We evaluate all methods across two key dimensions: Accuracy and Average Cost. (i) For accuracy, we report the resolve rate and patch application rate. The resolve rate represents the percentage of issues successfully resolved across all data points. An issue is considered resolved if the submitted patch passes all test scripts. To assess the patch application rate, we attempt to apply the generated patches to the repository using the patch program, counting only successful applications toward this metric. (ii) To evaluate cost efficiency, we report two metrics: average cost and average tokens, which refer to the inference cost and the number of input/output tokens used when querying the LLMs, respectively.
|
| 111 |
+
|
| 112 |
+
Configurations. We use the same GPT version as in the baselines in the experiments. We used GPT-4o (2024-05-13) and GPT-4-Turbo (gpt-4-1106-preview) from OpenAI for evaluation and analyses in our experiments. All evaluation processes are performed in a containerized Docker environment<sup>3</sup>, ensuring stability and reproducibility, made possible through contributions from the open-source community. Plug-ins with procedural frameworks usually take around 2-3 hours to finish. For agent frameworks, the inference time is larger, up to around 10 hours.
|
| 113 |
+
|
| 114 |
+
Table 2: Results of REPOGRAPH with open-source baselines in two research lines, including procedural and agent frameworks. Numbers of accuracy-related metrics are directly taken from the leaderboard, while the cost-related ones are computed from the corresponding trajectories<sup>5</sup>.
|
| 115 |
+
|
| 116 |
+
<table><tr><td>Methods</td><td>LLM</td><td>resolve</td><td>Accuracy # samples</td><td>patch apply</td><td>Avg. Cost $ cost</td><td># tokens</td></tr><tr><td colspan="7">Procedural frameworks</td></tr><tr><td>RAG</td><td>GPT-4</td><td>2.67</td><td>8</td><td>29.33</td><td>$0.13</td><td>11,736</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4</td><td>5.33↑2.66</td><td>16↑8</td><td>47.67↑18.34</td><td>$0.17</td><td>15,439</td></tr><tr><td>Agentless</td><td>GPT-4o</td><td>27.33</td><td>82</td><td>97.33</td><td>$0.34</td><td>42,376</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4o</td><td>29.67↑2.34</td><td>89↑7</td><td>98.00↑0.67</td><td>$0.39</td><td>47,323</td></tr><tr><td colspan="7">Agent frameworks</td></tr><tr><td>AutoCodeRover</td><td>GPT-4</td><td>19.00</td><td>57</td><td>83.00</td><td>$0.45</td><td>38,663</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4</td><td>21.33↑2.33</td><td>64↑7</td><td>86.67↑3.67</td><td>$0.58</td><td>45,112</td></tr><tr><td>SWE-agent</td><td>GPT-4o</td><td>18.33</td><td>55</td><td>87.00</td><td>$2.53</td><td>498,346</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4o</td><td>20.33↑2.00</td><td>61↑6</td><td>90.33↑3.33</td><td>$2.69</td><td>518,792</td></tr></table>
|
| 117 |
+
|
| 118 |
+
# 4.2 EXPERIMENT RESULTS
|
| 119 |
+
|
| 120 |
+
Table 2 presents the main evaluation results of all baseline methods and the corresponding performance with REPOGRAPH (+REPOGRAPH) as a plug-in in the SWE-bench-Lite test set. We also report the number of correct samples for each method. The performance increase is marked by $\uparrow$ num. We also tested other (open-source) LLMs using Claude-3.5-Sonnet (claude-3-5-sonnet-20240620) (Anthropic, 2024) from Anthropic in Appendix C. Based on the results, we have the following key observations:
|
| 121 |
+
|
| 122 |
+
(i) REPOGRAPH brings consistent performance gain for all combinations of frameworks and LLM model bases. Specifically, REPOGRAPH achieves an absolute improvement of $+2.66$ and $+2.34$ in terms of the resolve rate for RAG and Agentless, respectively, which is $99.63\%$ and $8.56\%$ of relative improvement. The notable improvement demonstrates the effectiveness of our REPOGRAPH in adapting to various scenarios by inducing relevant code context and performing precise code editorings. Additionally, our best performance so far by plugging in Agentless, 29.67, achieves the state-of-the-art performance on the benchmark among all open-source methods.
|
| 123 |
+
(ii) Performance gain brought by REPOGRAPH is slightly larger on procedural frameworks than agent ones. With procedural frameworks, REPOGRAPH correctly fixes more issues than agent ones. This could be due to two primary reasons. Firstly, we observed that mature procedural frameworks tend to achieve better baseline performance than agent-based frameworks on SWE-bench. The initial definitive nature of procedural frameworks, with their well-defined running flow and structure, allows them to leverage plug-ins more effectively. Another reason is that this deterministic behavior reduces the complexity that arises from dynamic decision-making, a key characteristic of agent-based systems, thereby enabling a smoother integration of performance improvements.
|
| 124 |
+
(iii) Performance gain brought by REPOGRAPH does not rely on more costs. We also compute and report each method's average cost and token consumption. By introducing REPOGRAPH, we manage to reduce the costs associated with managing the entire repository while achieving comparable or even superior performance. As shown in Table 2, the additional token cost introduced by RepoGraph is justified given the significant performance improvement it enables, particularly when compared to the substantially higher costs incurred by previous methods like SWE-agent. This indicates REPOGRAPH's performance gains are not mainly due to increased token usage.
|
| 125 |
+
(iv) Average costs are generally larger on agent frameworks with REPOGRAPH. This phenomenon is especially obvious with SWE-agent, as it allows the agent to freely determine the next action based on the current observation. We also found that the integration with agent frameworks usually leads to larger cost increases, as exemplified by $+0.13$ and $+0.18$ with AutoCodeRover and SWE-agent, respectively. The reason lies in the large exploration space in agent frameworks. The agents might call the search_repograph() action many times, which leads to the explosion of
|
| 126 |
+
|
| 127 |
+
prompt contexts. We encourage users to be mindful of cost and to adopt a more granular approach to cost control when integrating REPOGRAPH into the agent framework in the future.
|
| 128 |
+
|
| 129 |
+
# 5 ANALYSIS
|
| 130 |
+
|
| 131 |
+
This section presents a detailed analysis to demonstrate that the additional context provided by REPOGRAPH is beneficial for the task. We begin by analyzing localization accuracy in comparison to the gold-standard patch. Next, we explore various REPOGRAPH configurations, focusing on how the additional context can be effectively integrated into the existing system. Finally, we perform an in-depth error analysis, highlighting aspects where REPOGRAPH can be further improved. For more analyses including resolve rate in various aspects and action distributions of agent frameworks, please refer to Appendices C.
|
| 132 |
+
|
| 133 |
+
# 5.1 LOCALIZATION COVERAGE
|
| 134 |
+
|
| 135 |
+
A crucial step in issue resolution is accurately identifying the correct locations within the code that require modification. Proper localization is essential, as it forms the foundation for generating an effective and accurate patch. Without this step, the quality of the fix may be compromised, leading to incomplete or incorrect solutions. We compute the percentage of problems where the edit locations match the ground truth patch in three granularity. Namely, file-level, function-level, and line-level. We report that a
|
| 136 |
+
|
| 137 |
+
Table 3: Percentage of problems for accurate edition localizations with respect to file, function, and line levels. All the numbers are computed from the corresponding generated patches.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Methods</td><td>LLM</td><td>file</td><td>function</td><td>line</td></tr><tr><td>RAG</td><td>GPT-4</td><td>47.3</td><td>23.3</td><td>12.7</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4</td><td>51.7↑4.4</td><td>25.3↑2.0</td><td>14.3↑1.6</td></tr><tr><td>Agentless</td><td>GPT-4o</td><td>68.7</td><td>51.0</td><td>34.3</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4o</td><td>74.3↑5.6</td><td>54.0↑3.0</td><td>36.7↑2.4</td></tr><tr><td colspan="5">Agent frameworks</td></tr><tr><td>AutoCodeRover</td><td>GPT-4</td><td>62.3</td><td>42.3</td><td>29.0</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4</td><td>69.0↑4.7</td><td>45.7↑3.4</td><td>31.7↑2.7</td></tr><tr><td>SWE-agent</td><td>GPT-4o</td><td>61.7</td><td>46.3</td><td>32.3</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4o</td><td>67.3↑5.6</td><td>49.3↑3.0</td><td>35.0↑2.7</td></tr></table>
|
| 140 |
+
|
| 141 |
+
patch contains the correct location if it edits a superset of all locations in the ground truth patch.
|
| 142 |
+
|
| 143 |
+
Table 3 presents the results of our analysis. We observed that integrating REPOGRAPH with all baseline methods significantly improves file-level accuracy, whereas the enhancement of accuracy in line-level is comparatively modest. This result aligns with our expectations, as file-level localization is the most coarse-grained, making it inherently easier to improve. In contrast, line-level localization, being the most fine-grained, poses a greater challenge due to its need for more precise identification of code segments. Additionally, we found that although line-level accuracy improvements are more pronounced for agent frameworks, their overall resolve rate is lower than that of procedural frameworks, as shown in Table 2. This discrepancy can be attributed to the fact that localization still heavily relies on the underlying capabilities of LLMs. Agent frameworks, designed to operate in a trial-and-error fashion, are particularly susceptible to error accumulation. As these frameworks iteratively refine their patches, small inaccuracies in earlier localization steps can propagate and magnify throughout the process, ultimately reducing the overall resolve rate. Procedural frameworks, on the other hand, follow a more structured and deterministic approach to localization and patch generation. They typically localize and fix issues in a single, more direct step, which can help mitigate the compounding of errors.
|
| 144 |
+
|
| 145 |
+
# 5.2 INVESTIGATION OF REPOGRAPH VARIANTS
|
| 146 |
+
|
| 147 |
+
In this section, we investigate the efficacy of various combinations of sub-graph retrieval and integration techniques as outlined in Section 3. We explore two sub-graph retrieval variants and two integration methods. Specifically, for sub-graph retrieval, we index $k$ -hop ego-graphs where $k$ is set to 1 and 2. We limit our exploration to $k$ values up to 2 due to the extensive context required for integration and the potential introduction of noise or irrelevant nodes for $k \geq 3$ . For the integration methods, we employ two distinct approaches: (i) directly flattening the textual sub-graph by explicit
|
| 148 |
+
|
| 149 |
+
Table 4: The number of nodes, edges, and tokens of REPOGRAPH and its variants. For different retrieval and integration variants, we report the average number on the test set. "summ." refers to the summarized version by LLMs of the retrieved ego-graph.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Metrics</td><td>REPOGRAPH</td><td>1-hop + flatten</td><td>1-hop + summ.</td><td>2-hop + flatten</td><td>2-hop + summ.</td></tr><tr><td># Nodes</td><td>1419.3</td><td>11.6</td><td>11.6</td><td>54.5</td><td>54.5</td></tr><tr><td># Edges</td><td>26392.1</td><td>37.1</td><td>37.1</td><td>89.9</td><td>89.9</td></tr><tr><td># tokens</td><td>-</td><td>2310.7</td><td>717.5</td><td>10505.3</td><td>1229.2</td></tr><tr><td>resolve rate</td><td>-</td><td>29.67</td><td>28.33</td><td>26.00</td><td>28.67</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Itly detailing the relationships between the search term and its neighboring nodes, and (ii) leveraging an LLM first to summarize the sub-graph in terms of the core modules and salient dependencies, before proceeding with further processing. Detailed implementations of these variants and prompts used can be found in Appendix B.1.
|
| 154 |
+
|
| 155 |
+
We begin by presenting some statistics for REPOGRAPH and its various configurations. Performance evaluations are conducted on Agentless with REPOGRAPH integrated as a plug-in module. Table 4 reports the number of nodes and edges within the (sub)-graphs. Notably, the average number of nodes and edges for REPOGRAPH across the SWE-bench dataset is quite substantial, featuring over 1,000 nodes and 25,000 edges. This highlights the comprehensive nature of the constructed structure. For the different variants, when $k = 1$ , the information within REPOGRAPH is concentrated around the search term, resulting in an average of 11.6 nodes and 37.1 edges. As $k$ increases to 2, the retrieved ego-graph expands exponentially, reaching an average of 54.5 nodes and 89.9 edges. Moreover, directly flattening the retrieved ego-graph often significantly increases the token count, frequently reaching several thousand tokens. However, utilizing an LLM as an additional summarizer greatly reduces the token count, typically around a thousand.
|
| 156 |
+
|
| 157 |
+
Table 4 presents the resolve rates for four variants of our method. Notably, while the 2-hop variant incorporates additional information, directly flattening this information results in the poorest performance, with a resolve rate of $26.00\%$ , even lower than the original baseline. In contrast, incorporating summarization via the LLM significantly alleviates context length constraints and enhances information organization, thereby improving performance. For the 1-hop variant, however, we observed that adding summarization actually degrades performance, reducing the resolving rate to $28.33\%$ . We hypothesize that this occurs because the flat 1-hop ego-graph already contains comprehensive information that fits within the LLM's context window; thus, summarization may introduce inevitable information loss.
|
| 158 |
+
|
| 159 |
+
# 5.3 TRANSFERIBILITY TEST
|
| 160 |
+
|
| 161 |
+
To demonstrate the representational power of REPOGRAPH for repositories and its transferability to tasks requiring an understanding of repository structures, we conducted experiments using the CrossCodeEval benchmark (Ding et al., 2023). CrossCodeEval is a multilingual code completion benchmark that is derived from real-world repositories. It is designed to emphasize numerous cross-file dependencies. We focus on problems using Python as the evaluation programming lan
|
| 162 |
+
|
| 163 |
+
Table 5: Results on the subset of CrossCodeEval with GPT-4o and Deepseek-Coder-V2-Lite-Instruct as the backbone LLMs.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">Code Match</td><td colspan="2">Identifier Match</td></tr><tr><td>EM</td><td>ES</td><td>EM</td><td>F1</td></tr><tr><td>Deepseek-Coder</td><td>10.2</td><td>57.3</td><td>16.6</td><td>49.1</td></tr><tr><td>+REPOGRAPH</td><td>19.7</td><td>67.8</td><td>29.3</td><td>58.9</td></tr><tr><td>GPT-4o</td><td>10.5</td><td>59.6</td><td>16.8</td><td>47.9</td></tr><tr><td>+REPOGRAPH</td><td>28.7</td><td>68.9</td><td>36.0</td><td>61.3</td></tr></table>
|
| 166 |
+
|
| 167 |
+
guage, leading to 2,665 samples. For evaluation metrics, we follow the settings in the original paper and measure performance with code match and identifier match metrics, assessing accuracy with exact match (EM), edit similarity (ES), and F1 scores. In our experiments, the search terms are determined to be the function within which the current line is to be completed.
|
| 168 |
+
|
| 169 |
+
Table 5 demonstrates the results on CrossCodeEval using GPT-4o and Deepseek-Coder as the backbone language model. The original LLMs struggle with repository-level tasks, evidenced by an EM score of only 10.8 for code matching and 16.7 for identifier matching. These results indicate significant limitations in handling code structure and variable usage in a broader repository context.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 3: Venn diagram of REPOGRAPH and baselines on (a) procedural framework and (b) agent framework on SWE-Bench-Lite. We also plot the error distribution of failing cases against counterparts, e.g., detailed error distribution of 12 cases REPOGRAPH succeeds while Agentless fails.
|
| 173 |
+
|
| 174 |
+
However, with the integration of the REPOGRAPH method, there is a substantial improvement across all metrics with both LLMs. Particularly, we find that the improvement brought by REPOGRAPH is more pronounced when integrated with GPT-4o. A potential reason is that GPT-4o is better at interpreting the additional context information provided for better code reasoning. These improvements suggest that incorporating repository-level knowledge, as facilitated by REPOGRAPH, greatly enhances the model's ability to understand and generate more contextually accurate and semantically consistent code.
|
| 175 |
+
|
| 176 |
+
# 5.4 ERROR ANALYSIS
|
| 177 |
+
|
| 178 |
+
We want to compare REPOGRAPH with the corresponding baselines to see the distribution of resolved cases and analyze the error reasons for unresolved cases. We plot a Venn diagram for representative methods in both procedural and agent frameworks in Figure 3, respectively. We manually examined all the unique error cases and defined three error categories. (i) Incorrect localization refers to the failure in accurately identifying code snippets, (ii) contextual misalignment happens when the generated patch fails to align with the broader context of the codebase, and (iii) regressive fix introduces new issues in resolving the original issues. More examples are in Appendix D.
|
| 179 |
+
|
| 180 |
+
We found that the improvement in agent frameworks is more complementary than procedural frameworks, with larger uniquely resolved cases of 22 compared with 12 in procedural frameworks. Together, they make even larger performance of $31.33\%$ and $22.33\%$ . The reason could also be attributed to the determinism of procedural frameworks. As a plug-in module, REPOGRAPH tends to make modifications on existing deterministic processes, resulting in larger overlaps in resolved issues compared with baselines. Agent frameworks, on the other hand, have quite different action distributions with REPOGRAPH as a plug-in (please refer to Appendix A.2). Therefore, the uniquely resolved cases are more compared with procedural frameworks. For error distributions, contextual misalignment is the most prevalent error type, followed by incorrect localization and regressive fixes for all methods, suggesting that while localization is often correct, the applied solutions may regress or fail to integrate contextually. The phenomenon also echoes the conclusion obtained in Section 5.1. This is intuitive as all the existing methods focus on providing a more comprehensive and desired context for LLMs to solve the task, which fundamentally depends on the power of backbone LLMs. We also found that when integrated with REPOGRAPH, the proportion of all three error types decreases (specifically for "incorrect localization"), indicating that REPOGRAPH is specifically useful in aggregating the related contexts of the current to-be-fixed issue.
|
| 181 |
+
|
| 182 |
+
# 6 CONCLUSION AND DISCUSSION
|
| 183 |
+
|
| 184 |
+
This paper introduces REPOGRAPH, a plug-in module for modern AI software engineering. REPOGRAPH operates at the code-line level and offers desired navigation through code bases by incorporating and aggregating information at the line level, file level, and repository level through subgraph retrieval of ego-graphs. Extensive experiments on real-world SWE tasks show that REPOGRAPH significantly boosts the performance of both procedural and agent frameworks. In addition, REPOGRAPH is proved to be smoothly and effectively transferred to other tasks that require repository-level understanding. Future work could further investigate the generalizability of REPOGRAPH across different programming languages, frameworks, and developer environments. Real-time execution and feedback could also be explored to further enhance REPOGRAPH towards a dynamic version for better AI software engineering abilities.
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Rohan Anil, Sebastian Borgeaud, Yonghui Wu, Jean-Baptiste Alayrac, Jiahui Yu, Radu Soricut, Johan Schalkwyk, Andrew M. Dai, Anja Hauth, Katie Millican, David Silver, Slav Petrov, Melvin Johnson, Ioannis Antonoglou, Julian Schrittwieser, Amelia Glaese, Jilin Chen, Emily Pitler, Timothy P. Lillicrap, Angeliki Lazaridou, Orhan First, James Molloy, Michael Isard, Paul Ronald Barham, Tom Hennigan, Benjamin Lee, Fabio Viola, Malcolm Reynolds, Yuanzhong Xu, Ryan Doherty, Eli Collins, Clemens Meyer, Eliza Rutherford, Erica Moreira, Kareem Ayoub, Megha Goel, George Tucker, Enrique Piqueras, Maxim Krikun, Iain Barr, Nikolay Savinov, Ivo Danihelka, Becca Roelofs, Anaïs White, Anders Andreassen, Tamara von Glehn, Lakshman Yagati, Mehran Kazemi, Lucas Gonzalez, Misha Khalman, Jakub Sygnowski, and et al. Gemini: A family of highly capable multimodal models. CoRR, abs/2312.11805, 2023. doi: 10.48550/ARXIV.2312.11805. URL https://doi.org/10.48550/arXiv.2312.11805.
|
| 189 |
+
Anthropic. Introducing claude 3.5 sonnet. https://www.anthropic.com/news/claude-3-5-sonnet, 2024. Accessed: 2024-10-01.
|
| 190 |
+
Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, et al. Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
|
| 191 |
+
Ramakrishna Bairi, Atharv Sonwane, Aditya Kanade, Arun Iyer, Suresh Parthasarathy, Sriram Rajamani, B Ashok, and Shashank Shet. Codeplan: Repository-level coding using llms and planning. Proceedings of the ACM on Software Engineering, 1(FSE):675-698, 2024.
|
| 192 |
+
Andrew Begel, Yit Phang Khoo, and Thomas Zimmermann. Codebook: discovering and exploiting relationships in software repositories. In Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering - Volume 1, ICSE '10, pp. 125-134, New York, NY, USA, 2010. Association for Computing Machinery. ISBN 9781605587196. doi: 10.1145/1806799.1806821. URL https://doi.org/10.1145/1806799.1806821.
|
| 193 |
+
Teresa Busjahn, Roman Bednarik, Andrew Begel, Martha E. Crosby, James H. Paterson, Carsten Schulte, Bonita Sharif, and Sascha Tamm. Eye movements in code reading: relaxing the linear order. In Andrea De Lucia, Christian Bird, and Rocco Oliveto (eds.), Proceedings of the 2015 IEEE 23rd International Conference on Program Comprehension, ICPC 2015, Florence/Firenze, Italy, May 16-24, 2015, pp. 255-265. IEEE Computer Society, 2015. doi: 10.1109/ICPC.2015.36. URL https://doi.org/10.1109/ICPC.2015.36.
|
| 194 |
+
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidi Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fiotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code. 2021.
|
| 195 |
+
Wei Cheng, Yuhan Wu, and Wei Hu. Dataflow-guided retrieval augmentation for repository-level code completion. In ACL, 2024.
|
| 196 |
+
Cognition. Devin, 2024. URL https://www.cognition.ai/blog/introducing-devin.
|
| 197 |
+
Yangruibo Ding, Zijian Wang, Wasi Uddin Ahmad, Hantian Ding, Ming Tan, Nihal Jain, Murali Krishna Ramanathan, Ramesh Nallapati, Parminder Bhatia, Dan Roth, and Bing Xiang. Crosscodeeval: A diverse and multilingual benchmark for cross-file code completion. In Thirty-seventh Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2023. URL https://openreview.net/forum?id=wgDcbBMSfh.
|
| 198 |
+
|
| 199 |
+
Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, Anirudh Goyal, Anthony Hartshorn, Aobo Yang, Archi Mitra, Archie Sravankumar, Artem Korenev, Arthur Hinsvark, Arun Rao, Aston Zhang, Aurélien Rodriguez, Austen Gregerson, Ava Spataru, Baptiste Rozière, Bethany Biron, Binh Tang, Bobbie Chern, Charlotte Caucheteux, Chaya Nayak, Chloe Bi, Chris Marra, Chris McConnell, Christian Keller, Christophe Touret, Chunyang Wu, Corinne Wong, Cristian Canton Ferrer, Cyrus Nikolaidis, Damien Allonsius, Daniel Song, Danielle Pintz, Danny Livshits, David Esiobu, Dhruv Choudhary, Dhruv Mahajan, Diego Garcia-Olano, Diego Perino, Dieuwke Hupkes, Egor Lakomkin, Ehab AlBadawy, Elina Lobanova, Emily Dinan, Eric Michael Smith, Filip Radenovic, Frank Zhang, Gabriel Synnaeve, Gabrielle Lee, Georgia Lewis Anderson, Graeme Nail, Grégoire Mialon, Guan Pang, Guillem Cucurell, Hailey Nguyen, Hannah Ko-revaar, Hu Xu, Hugo Touvron, Iliyan Zarov, Imanol Arrieta Ibarra, Isabel M. Kloumann, Ishan Misra, Ivan Evtimov, Jade Copet, Jaewon Lee, Jan Geffert, Jana Vranes, Jason Park, Jay Mahadeokar, Jeet Shah, Jelmer van der Linde, Jennifer Billock, Jenny Hong, Jenya Lee, Jeremy Fu, Jianfeng Chi, Jianyu Huang, Jiawen Liu, Jie Wang, Jiecao Yu, Joanna Bitton, Joe Spisak, Jongsoo Park, Joseph Rocca, Joshua Johnstun, Joshua Saxe, Junteng Jia, Kalyan Vasuden Alwala, Kartikeya Upasani, Kate Plawiak, Ke Li, Kenneth Heafield, Kevin Stone, and et al. The llama 3 herd of models. CoRR, abs/2407.21783, 2024. doi: 10.48550/ARXIV.2407.21783. URL https://doi.org/10.48550/arXiv.2407.21783.
|
| 200 |
+
Angela Fan, Belize Gokkaya, Mark Harman, Mitya Lyubarskiy, Shubho Sengupta, Shin Yoo, and Jie M Zhang. Large language models for software engineering: Survey and open problems. In 2023 IEEE/ACM International Conference on Software Engineering: Future of Software Engineering (ICSE-FoSE), pp. 31-53. IEEE, 2023.
|
| 201 |
+
Paul Gauthier. Aider is ai pair programming in your terminal. https://aider chat/, 2024.
|
| 202 |
+
Daya Guo, Qihao Zhu, Dejian Yang, Zhenda Xie, Kai Dong, Wentao Zhang, Guanting Chen, Xiao Bi, Y. Wu, Y.K. Li, Fuli Luo, Yingfei Xiong, and Wenfeng Liang. Deepseek-coder: When the large language model meets programming - the rise of code intelligence, 2024. URL https://arxiv.org/abs/2401.14196.
|
| 203 |
+
Xinyi Hou, Yanjie Zhao, Yue Liu, Zhou Yang, Kailong Wang, Li Li, Xiapu Luo, David Lo, John Grundy, and Haoyu Wang. Large language models for software engineering: A systematic literature review. arXiv preprint arXiv:2308.10620, 2023.
|
| 204 |
+
Yuntong Hu, Zhihan Lei, Zheng Zhang, Bo Pan, Chen Ling, and Liang Zhao. GRAG: graph retrieval-augmented generation. CoRR, abs/2405.16506, 2024. doi: 10.48550/ARXIV.2405.16506. URL https://doi.org/10.48550/arXiv.2405.16506.
|
| 205 |
+
Carlos E Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik R Narasimhan. SWE-bench: Can language models resolve real-world github issues? In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=VTF8yNQM66.
|
| 206 |
+
Bowen Jin, Chulin Xie, Jiawei Zhang, Kashob Kumar Roy, Yu Zhang, Zheng Li, Ruirui Li, Xi-anfeng Tang, Suhang Wang, Yu Meng, and Jiawei Han. Graph chain-of-thought: Augmenting large language models by reasoning on graphs. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Findings of the Association for Computational Linguistics ACL 2024, pp. 163-184, Bangkok, Thailand and virtual meeting, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.findings-acl.11. URL https://aclanthology.org/2024.findings-acl.11.
|
| 207 |
+
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. Retrieval-augmented generation for knowledge-intensive nlp tasks. Advances in Neural Information Processing Systems, 33: 9459-9474, 2020.
|
| 208 |
+
Raymond Li, Loubna Ben Allal, Yangtian Zi, Niklas Muennighoff, Denis Kocetkov, Chenghao Mou, Marc Marone, Christopher Akiki, Jia Li, Jenny Chim, Qian Liu, Evgenii Zheltonozhkii, Terry Yue Zhuo, Thomas Wang, Olivier Dehaene, Mishig Davaadorj, Joel Lamy-Poirier, João Monteiro, Oleh Shliazhko, Nicolas Gontier, Nicholas Meade, Armel Zebaze, Ming-Ho Yee,
|
| 209 |
+
|
| 210 |
+
Logesh Kumar Umapathi, Jian Zhu, Benjamin Lipkin, Muhtasham Oblokulov, Zhiruo Wang, Rudra Murthy V, Jason T. Stillerman, Siva Sankalp Patel, Dmitry Abulkhanov, Marco Zocca, Manan Dey, Zhihan Zhang, Nour Fahmy, Urvashi Bhattacharyya, Wenhao Yu, Swayam Singh, Sasha Luccioni, Paulo Villegas, Maxim Kunakov, Fedor Zhdanov, Manuel Romero, Tony Lee, Nadav Timor, Jennifer Ding, Claire Schlesinger, Hailey Schoelkopf, Jan Ebert, Tri Dao, Mayank Mishra, Alex Gu, Jennifer Robinson, Carolyn Jane Anderson, Brendan Dolan-Gavitt, Danish Contractor, Siva Reddy, Daniel Fried, Dzmitry Bahdanau, Yacine Jernite, Carlos Munoz Ferrandis, Sean Hughes, Thomas Wolf, Arjun Guha, Leandro von Werra, and Harm de Vries. Starcoder: may the source be with you! Trans. Mach. Learn. Res., 2023, 2023a. URL https://openreview.net/forum?id=KoFOg41haE.
|
| 211 |
+
Raymond Li, Loubna Ben Allal, Yangtian Zi, Niklas Muennighoff, Denis Kocetkov, Chenghao Mou, Marc Marone, Christopher Akiki, Jia Li, Jenny Chim, et al. Starcoder: may the source be with you! arXiv preprint arXiv:2305.06161, 2023b.
|
| 212 |
+
Ming Liang, Xiaoheng Xie, Gehao Zhang, Xunjin Zheng, Peng Di, Hongwei Chen, Chengpeng Wang, Gang Fan, et al. Repofuse: Repository-level code completion with fused dual context. arXiv preprint arXiv:2402.14323, 2024.
|
| 213 |
+
Xiangyan Liu, Bo Lan, Zhiyuan Hu, Yang Liu, Zhicheng Zhang, Wenmeng Zhou, Fei Wang, and Michael Shieh. Codexgraph: Bridging large language models and code repositories via code graph databases. arXiv preprint arXiv:2408.03910, 2024.
|
| 214 |
+
Shuai Lu, Daya Guo, Shuo Ren, Junjie Huang, Alexey Svyatkovskiy, Ambrosio Blanco, Colin B. Clement, Dawn Drain, Daxin Jiang, Duyu Tang, Ge Li, Lidong Zhou, Linjun Shou, Long Zhou, Michele Tufano, Ming Gong, Ming Zhou, Nan Duan, Neel Sundaresan, Shao Kun Deng, Shengyu Fu, and Shujie Liu. Codexglue: A machine learning benchmark dataset for code understanding and generation. In Joaquin Vanschoren and Sai-Kit Yeung (eds.), Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual, 2021. URL https://datasets-benchmarks-proceedings.neurips.cc/paper/2021/ hash/c16a5320fa475530d9583c34fd356ef5-AAbstract-round1.html.
|
| 215 |
+
Yingwei Ma, Qingping Yang, Rongyu Cao, Binhua Li, Fei Huang, and Yongbin Li. How to understand whole software repository? arXiv preprint arXiv:2406.01422, 2024.
|
| 216 |
+
OpenAI. GPT-4 technical report. CoRR, abs/2303.08774, 2023. doi: 10.48550/ARXIV.2303.08774. URL https://doi.org/10.48550/arXiv.2303.08774.
|
| 217 |
+
Siru Ouyang, Shuohang Wang, Yang Liu, Ming Zhong, Yizhu Jiao, Dan Iter, Reid Pryzant, Chenguang Zhu, Heng Ji, and Jiawei Han. The shifted and the overlooked: A task-oriented investigation of user-GPT interactions. In Houda Bouamor, Juan Pino, and Kalika Bali (eds.), Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 2375-2393, Singapore, December 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.emnlp-main.146. URL https://aclanthology.org/2023.emnlp-main.146.
|
| 218 |
+
Siru Ouyang, Zhuosheng Zhang, Bing Yan, Xuan Liu, Yejin Choi, Jiawei Han, and Lianhui Qin. Structured chemistry reasoning with large language models. In *Forty-first International Conference on Machine Learning*, ICML 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024.
|
| 219 |
+
L Page. The page-rank citation ranking: Bringing order to the web, 1999.
|
| 220 |
+
Huy N Phan, Hoang N Phan, Tien N Nguyen, and Nghi DQ Bui. Repohyper: Better context retrieval is all you need for repository-level code completion. arXiv preprint arXiv:2403.06095, 2024.
|
| 221 |
+
Baptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, and Guillaume Lample. Unsupervised translation of programming languages. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/black/ed23fbf18c2cd35f8c7f8de44f85c08d-AAbstract.html.
|
| 222 |
+
|
| 223 |
+
Baptiste Rozière, Jonas Gehring, Fabian Gloeckle, Sten Sootla, Itai Gat, Xiaoqing Ellen Tan, Yossi Adi, Jingyu Liu, Tal Remez, Jérémy Rapin, Artyom Kozhevnikov, Ivan Evtimov, Joanna Bitton, Manish Bhatt, Cristian Canton-Ferrer, Aaron Grattafori, Wenhan Xiong, Alexandre Défossez, Jade Copet, Faisal Azhar, Hugo Touvron, Louis Martin, Nicolas Usunier, Thomas Scialom, and Gabriel Synnaeve. Code llama: Open foundation models for code. CoRR, abs/2308.12950, 2023. doi: 10.48550/ARXIV.2308.12950. URL https://doi.org/10.48550/arXiv.2308.12950.
|
| 224 |
+
Disha Shrivastava, Hugo Larochelle, and Daniel Tarlow. Repository-level prompt generation for large language models of code. In International Conference on Machine Learning, pp. 31693-31715. PMLR, 2023.
|
| 225 |
+
Xiangru Tang, Tianyu Hu, Muyang Ye, Yanjun Shao, Xunjian Yin, Siru Ouyang, Wangchunshu Zhou, Pan Lu, Zhuosheng Zhang, Yilun Zhao, Arman Cohan, and Mark Gerstein. Chemagent: Self-updating library in large language models improves chemical reasoning. arXiv preprint arXiv: 2501.06590, 2025.
|
| 226 |
+
Michele Tufano, Cody Watson, Gabriele Bavota, Massimiliano Di Penta, Martin White, and Denys Poshyvanyk. An empirical study on learning bug-fixing patches in the wild via neural machine translation. ACM Transactions on Software Engineering and Methodology (TOSEM), 28(4):1-29, 2019.
|
| 227 |
+
Xingyao Wang, Boxuan Li, Yufan Song, Frank F Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, et al. Opendevin: An open platform for ai software developers as generalist agents. arXiv preprint arXiv:2407.16741, 2024.
|
| 228 |
+
Di Wu, Wasi Uddin Ahmad, Dejiao Zhang, Murali Krishna Ramanathan, and Xiaofei Ma. Repoformer: Selective retrieval for repository-level code completion. arXiv preprint arXiv:2403.10059, 2024.
|
| 229 |
+
Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. Agentless: Demystifying llm-based software engineering agents. arXiv preprint, 2024.
|
| 230 |
+
Zilin Xiao, Ming Gong, Jie Wu, Xingyao Zhang, Linjun Shou, and Daxin Jiang. Instructed language models with retrievers are powerful entity linkers. In Houda Bouamor, Juan Pino, and Kalika Bali (eds.), Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 2267-2282, Singapore, December 2023. Association for Computational Linguistics.
|
| 231 |
+
John Yang, Carlos E Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. Swe-agent: Agent-computer interfaces enable automated software engineering. arXiv preprint arXiv:2405.15793, 2024.
|
| 232 |
+
Ziyu Yao, Jayavardhan Reddy Peddamail, and Huan Sun. Coacor: Code annotation for code retrieval with reinforcement learning. In The world wide web conference, pp. 2203-2214, 2019.
|
| 233 |
+
Fengji Zhang, Bei Chen, Yue Zhang, Jacky Keung, Jin Liu, Daoguang Zan, Yi Mao, Jian-Guang Lou, and Weizhu Chen. Repocoder: Repository-level code completion through iterative retrieval and generation. In The 2023 Conference on Empirical Methods in Natural Language Processing, 2023. URL https://openreview.net/forum?id=q09vTY1Cqh.
|
| 234 |
+
Yuntong Zhang, Haifeng Ruan, Zhiyu Fan, and Abhik Roychoudhury. Autocoderover: Autonomous program improvement, 2024.
|
| 235 |
+
|
| 236 |
+
# Contents of Appendix
|
| 237 |
+
|
| 238 |
+
# A Detailed implementations for each baseline method 16
|
| 239 |
+
|
| 240 |
+
A.1 Procedural frameworks 16
|
| 241 |
+
A.2 Agent frameworks 16
|
| 242 |
+
|
| 243 |
+
# B Detailed implementations for REPOGRAPH 18
|
| 244 |
+
|
| 245 |
+
B.1 REPOGRAPH variant 18
|
| 246 |
+
B.2 REPOGRAPH components 18
|
| 247 |
+
|
| 248 |
+
# C Additional Results 18
|
| 249 |
+
|
| 250 |
+
C.1 Results on other LLMs 18
|
| 251 |
+
C.2 Results on localization for both pass and fail cases 19
|
| 252 |
+
C.3 Resolve rate by repository 20
|
| 253 |
+
C.4 Resolve rate by time 20
|
| 254 |
+
|
| 255 |
+
# D Examples for error analyses 21
|
| 256 |
+
|
| 257 |
+
# E Limitations and Future Work 21
|
| 258 |
+
|
| 259 |
+
# F Impact Statement 22
|
| 260 |
+
|
| 261 |
+
# A DETAILED IMPLEMENTATIONS FOR EACH BASELINE METHOD
|
| 262 |
+
|
| 263 |
+
This section details the implementation of all four methods in procedural and agent research lines mentioned in Section 4.1.
|
| 264 |
+
|
| 265 |
+
# A.1 PROCEDURAL FRAMEWORKS
|
| 266 |
+
|
| 267 |
+
Figure 4 and Figure 5 illustrate the instructions we used for procedural frameworks, including localization and edition, respectively.
|
| 268 |
+
|
| 269 |
+
<table><tr><td>Instruction</td><td colspan="2">Please review the following GitHub problem description and relevant files, and provide a set of locations that need to be edited to fix the issue. You will also be given a list of function/class dependencies to help you understand how functions/classes in relevant files fit into the rest of the codebase. The locations can be specified as class names, function or method names, or exact line numbers that require modification.</td></tr><tr><td rowspan="3">Template</td><td>GitHub Problem Description
|
| 270 |
+
{problem_statement}</td><td>Related Files
|
| 271 |
+
{file Contents}</td></tr><tr><td>Function/Class Dependencies
|
| 272 |
+
{repo_graph}</td><td></td></tr><tr><td>Please provide the class name, function or method name, or the exact line numbers that need to be edited.</td><td></td></tr><tr><td>Demonstrations</td><td>Examples:
|
| 273 |
+
full_path1/file1.py
|
| 274 |
+
line: 10
|
| 275 |
+
class: MyClass1
|
| 276 |
+
line: 51
|
| 277 |
+
Return just the location(s)</td><td>full_path2/file2.py
|
| 278 |
+
function: MyClass2.my_method
|
| 279 |
+
line: 12
|
| 280 |
+
function: my_function
|
| 281 |
+
line: 24
|
| 282 |
+
line: 156</td></tr></table>
|
| 283 |
+
|
| 284 |
+
Figure 4: Instructions used in the procedural framework to localize to detailed files and code lines of edition.
|
| 285 |
+
|
| 286 |
+
We flattened the context of the retrieved ego-graph from REPOGRAPH into the template of the instructions. Specifically, in both "localization" and "edition" stages, REPOGRAPH is flattened in the part of Function/Class Dependencies so that the LLMs could better understand its context.
|
| 287 |
+
|
| 288 |
+
# A.2 AGENT FRAMEWORKS
|
| 289 |
+
|
| 290 |
+
We list all the instructions in every step of agent frameworks. The overall and system instruction is shown in Figure 6.
|
| 291 |
+
|
| 292 |
+
The system instruction defines the task setting and the template for each response. We add "search_recograph" as a new action for the agent to use in the command_docs, with its signature listed in Figure 7.
|
| 293 |
+
|
| 294 |
+
We also plot the frequency for action invoked for both SWE-agent and SWE-agent with REPOGRAPH in Figure 8. We can see that with REPOGRAPH, the maximum turn of finishing the task is reduced from 38 to 35. Also, we computed the average turn to finish the task, which demonstrates a similar trend of 21.47 to 19.12, a significant improvement in efficiency while maintaining effectiveness. We also observe that the action "search_recograph" is invoked mostly in the first 15 rounds of conversation with LLMs. It is more precise than the original action of "search_dir", "search_file", and "find_file".
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 5: Instruction used for fixing an issue based on the identified locations in certain template.
|
| 298 |
+
Figure 6: The signature of our new action "search_repograph" for agent frameworks.
|
| 299 |
+
|
| 300 |
+
# SETTING:
|
| 301 |
+
|
| 302 |
+
You are an autonomous programmer, and you're working directly in the command line with a special interface.
|
| 303 |
+
|
| 304 |
+
The special interface consists of a file editor that shows you {WINDOW} lines of a file at a time.
|
| 305 |
+
|
| 306 |
+
In addition to typical bash commands, you can also use the following commands to help you navigate and edit files.
|
| 307 |
+
|
| 308 |
+
# COMMANDS:
|
| 309 |
+
|
| 310 |
+
{command_docs}
|
| 311 |
+
|
| 312 |
+
Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.
|
| 313 |
+
|
| 314 |
+
If you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.
|
| 315 |
+
|
| 316 |
+
# RESPONSE FORMAT:
|
| 317 |
+
|
| 318 |
+
Your shell prompt is formatted as follows:
|
| 319 |
+
|
| 320 |
+
(Open file: <path>) <cwd> $
|
| 321 |
+
|
| 322 |
+
You need to format your output using two fields; discussion and command.
|
| 323 |
+
|
| 324 |
+
Your output should always include _one_ discussion and _one_ command field EXACTLY as in the following example:
|
| 325 |
+
|
| 326 |
+
# DISCUSSION
|
| 327 |
+
|
| 328 |
+
First I'll start by using ls to see what files are in the current directory. Then maybe we can look at some relevant files to see what they look like.
|
| 329 |
+
|
| 330 |
+
Is -a
|
| 331 |
+
|
| 332 |
+
You should only include a *SINGLE* command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.
|
| 333 |
+
|
| 334 |
+
If you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.
|
| 335 |
+
|
| 336 |
+
You're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.
|
| 337 |
+
|
| 338 |
+
However, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
|
| 342 |
+
# search_recograph
|
| 343 |
+
|
| 344 |
+
```python
|
| 345 |
+
docstring: searches in the current repository with a specific function or class, and returns the def and ref relations for the search term.
|
| 346 |
+
signature: search Repo <search_term>
|
| 347 |
+
arguments:
|
| 348 |
+
|
| 349 |
+
- search_term (string) [required]: function or class to look for in the repository.
|
| 350 |
+
|
| 351 |
+
(a) SWE-agent
|
| 352 |
+
Figure 8: The frequency with which actions are invoked at each turn by (a) SWE-agent and (b) SWE-agent w/REPOGRAPH.
|
| 353 |
+

|
| 354 |
+
create
|
| 355 |
+
find file
|
| 356 |
+
search dir
|
| 357 |
+
open
|
| 358 |
+
■ scroll_down
|
| 359 |
+
goto
|
| 360 |
+
pylint
|
| 361 |
+
pytest
|
| 362 |
+
|
| 363 |
+
Figure 7: The signature of our new action "search_recograph" for agent frameworks.
|
| 364 |
+
(b) RepoGraph
|
| 365 |
+

|
| 366 |
+
edit
|
| 367 |
+
find
|
| 368 |
+
python
|
| 369 |
+
search file
|
| 370 |
+
scroll_up
|
| 371 |
+
submit
|
| 372 |
+
exit_cost
|
| 373 |
+
search
|
| 374 |
+
_repograph
|
| 375 |
+
|
| 376 |
+
# B DETAILED IMPLEMENTATIONS FOR REPOGRAPH
|
| 377 |
+
|
| 378 |
+
# B.1 REPOGRAPH VARIANT
|
| 379 |
+
|
| 380 |
+
In this section, we provide the implementations for variants of REPOGRAPH mentioned in Section 5.2.
|
| 381 |
+
|
| 382 |
+
In addition to directly flattening the retrieved ego-graph, we propose leveraging large language models (LLMs) to first summarize the context. The full prompt, along with sample input and output, is provided in Figure 9.
|
| 383 |
+
|
| 384 |
+
# B.2 REPOGRAPH COMPONENTS
|
| 385 |
+
|
| 386 |
+
We first provide a simplified version of Figure 2 in Figure 10, which helps readers quickly catch the overall pipeline of integration with REPOGRAPH.
|
| 387 |
+
|
| 388 |
+
We also provide an illustration in Figure 11 to explain in detail how we exclude project-independent dependencies mentioned in Section 3.1 Step 2.
|
| 389 |
+
|
| 390 |
+
# C ADDITIONAL RESULTS
|
| 391 |
+
|
| 392 |
+
# C.1 RESULTS ON OTHER LLMS
|
| 393 |
+
|
| 394 |
+
We conduct additional experiments on SWE-Bench-Lite with Claude-3.5-Sonnet, and the results are shown in Table 6. We found that with Claude-3.5-Sonnet, the results of baselines are improved a little. This is intuitive as Claude-3.5-Sonnet is designed for better coding tasks. Additionally, integrating REPOGRAPH with the baseline methods can still boost the performance by a large margin, which further prove the effectiveness and extendability of REPOGRAPH on different foundational models.
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
Figure 9: Instruction used for summarizing the flattened ego-graph.
|
| 398 |
+
|
| 399 |
+

|
| 400 |
+
Figure 10: A conceptual overview of our proposed REPOGRAPH.
|
| 401 |
+
|
| 402 |
+
# C.2 RESULTS ON LOCALIZATION FOR BOTH PASS AND FAIL CASES
|
| 403 |
+
|
| 404 |
+
In order to highlight the improvement in error localization and correction capability of REPOGRAPH, we provide a thorough analysis of both pass and fail cases. Results are shown in Table 7. Interestingly, we found that the localization accuracy for failure cases is largely lower than the overall average results. This indicates that REPOGRAPH fixes the issues by correctly identifying the editing locations, without which the issue is unlikely to be resolved.
|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
Figure 11: A detailed illustration of how we filter the project-dependent relations given a code snippet. Code line colors are illustrated with respect to global and local relations.
|
| 408 |
+
|
| 409 |
+
Table 6: Results of REPOGRAPH on SWE-Bench-Lite test set with Claude-3.5-Sonnet in two research lines, including procedural and agent frameworks. We also report the corresponding cost of each method.
|
| 410 |
+
|
| 411 |
+
<table><tr><td>Methods</td><td>LLM</td><td>resolve</td><td>Accuracy # samples</td><td>patch apply</td><td>Avg. Cost $ cost</td><td># tokens</td></tr><tr><td colspan="7">Procedural frameworks</td></tr><tr><td>Agentless</td><td>GPT-4o</td><td>27.33</td><td>82</td><td>97.33</td><td>$0.34</td><td>42,376</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4o</td><td>29.67 ↑2.34</td><td>89↑7</td><td>98.00 ↑0.67</td><td>$0.39</td><td>47,323</td></tr><tr><td>Agentless</td><td>Claude-3.5-Sonnet</td><td>27.67</td><td>83</td><td>94.33</td><td>$0.28</td><td>40,984</td></tr><tr><td>+REPOGRAPH</td><td>Claude-3.5-Sonnet</td><td>30.33 ↑2.66</td><td>91↑8</td><td>98.67 ↑4.34</td><td>$0.32</td><td>46,238</td></tr><tr><td colspan="7">Agent frameworks</td></tr><tr><td>SWE-agent</td><td>GPT-4o</td><td>18.33</td><td>55</td><td>87.00</td><td>$2.53</td><td>498,346</td></tr><tr><td>+REPOGRAPH</td><td>GPT-4o</td><td>20.33 ↑2.00</td><td>61↑6</td><td>90.33 ↑3.33</td><td>$2.69</td><td>518,792</td></tr><tr><td>SWE-agent</td><td>Claude-3.5-Sonnet</td><td>23.00</td><td>69</td><td>86.67</td><td>$1.62</td><td>521,208</td></tr><tr><td>+REPOGRAPH</td><td>Claude-3.5-Sonnet</td><td>25.33 ↑2.33</td><td>76↑7</td><td>90.67 ↑4.00</td><td>$1.70</td><td>539,942</td></tr></table>
|
| 412 |
+
|
| 413 |
+
# C.3 RESOLVE RATE BY REPOSITORY
|
| 414 |
+
|
| 415 |
+
We plot the results of the resolve rate in terms of repository distribution in Figure 12. From the figure, it is clear that the resolution of issues varies significantly across different repositories. Notably, the Django and Sympy repositories have the most unresolved issues, with 75 and 61 unresolved issues, respectively. This may indicate a higher level of complexity in the issues or a larger backlog compared to the other repositories. On the other hand, Django has the highest number of resolved issues, with 39 cases. This highlights a strong effort to address issues, even though the unresolved count is still high. Sympy follows closely with 16 resolved issues, suggesting a similar trend. Other repositories like Scikit-learn, Sphinx, and Matplotlib have comparatively fewer issues overall, but their resolve rates are more balanced. For instance, Sphinx shows a ratio of 13 resolved to 3 unresolved issues, reflecting a more consistent effort in issue resolution.
|
| 416 |
+
|
| 417 |
+
# C.4 RESOLVE RATE BY TIME
|
| 418 |
+
|
| 419 |
+
We plot the results of the resolve rate in terms of the distribution of releasing time for repositories in Figure 13. Most of the issues were observed in recent years, starting from 2018, with a substantial increase in the total number of issues identified after 2018. In the early years (2012-2016), the number of issues remained relatively low, with both resolved and unresolved counts being minimal. Starting from 2017, there is a noticeable increase in unresolved issues, with 13 unresolved and only 3 resolved issues. In 2019, the number of resolved and unresolved issues significantly increased,
|
| 420 |
+
|
| 421 |
+
Table 7: Percentage of problems for accurate edition localizations for Agentless+REPOGRAPH with respect to file, function, and line levels. All the numbers are computed from the corresponding generated patches. We also report the accuracy for all pass and failure cases, respectively.
|
| 422 |
+
|
| 423 |
+
<table><tr><td>Methods</td><td>LLM</td><td>file</td><td>function</td><td>line</td></tr><tr><td>Agentless+REPOGRAPH</td><td>GPT-4o</td><td>74.3</td><td>54.0</td><td>36.7</td></tr><tr><td>Pass cases</td><td>GPT-4o</td><td>91.0</td><td>79.8</td><td>65.2</td></tr><tr><td>Failure cases</td><td>GPT-4o</td><td>67.3</td><td>43.1</td><td>24.6</td></tr></table>
|
| 424 |
+
|
| 425 |
+

|
| 426 |
+
Figure 12: Distribution of issues resolved by Agentless +REPOGRAPH plotted in terms of different repositories.
|
| 427 |
+
|
| 428 |
+
with 19 resolved out of 59 issues. This trend continued to rise until 2020, where 47 issues remained unresolved, and only 17 were resolved, marking the year with the highest number of unresolved issues in the dataset. By 2021 and 2022, the number of unresolved issues slightly decreased, while the resolve rate increased compared to 2020. This suggests an improvement in the system's ability to address issues in these years. In 2023, although the total number of issues dropped to 30, the proportion of resolved issues remained strong, with 8 resolved out of 22 issues.
|
| 429 |
+
|
| 430 |
+
# D EXAMPLES FOR ERROR ANALYSES
|
| 431 |
+
|
| 432 |
+
To help better understand the error category listed in Section 5.4, we provide one example for each category in Figure 14, Figure 15, and Figure 16.
|
| 433 |
+
|
| 434 |
+
# E LIMITATIONS AND FUTURE WORK
|
| 435 |
+
|
| 436 |
+
(i) We only explored proprietary LLMs, i.e., GPT-4 series. Due to the poor performance of open-source models on this challenging task, we opted for proprietary models that have demonstrated superior results in code-related tasks. However, a comprehensive evaluation of open-source models such as Llama (Dubey et al., 2024) could be a valuable direction for future work, particularly as these models continue to improve.
|
| 437 |
+
(ii) Experiments were only conducted on the Lite set due to the high cost of running large-scale experiments with proprietary models. Exploring more efficient model deployment strategies and alternative cost-effective options for running experiments on larger datasets will be essential for broader applicability.
|
| 438 |
+
(iii) Although REPOGRAPH could be adapted to support other programming languages by adjusting the parsing schemes in the implementation, we only explored Python in our main experiments. Future work could extend this approach to other widely used programming languages, such as JavaScript, Java, or $\mathrm{C + + }$ , to evaluate the generalizability of our methodology across different programming paradigms.
|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
Figure 13: Distribution of issues resolved by Agentless +REPOGRAPH plotted in terms of release time for repositories.
|
| 442 |
+
Figure 14: An example of incorrect localization. The correct patch modifies the "DurationField" in django/db/models/fields/_init__.py. This is the correct place to handle the error message formatting for the "DurationField" used in Django models. REPOGRAPH, however, modifies django/forms/fields.py. This file handles Django form fields, not the model fields. While both model and form fields have overlapping behavior, in this case, the correction is required for the model field (DurationField in _init__.py), not the form field.
|
| 443 |
+
|
| 444 |
+
<table><tr><td rowspan="2">Issue</td><td colspan="2">Correct expected format in invalid DurationField error message</td></tr><tr><td colspan="2">Description
|
| 445 |
+
If you enter a duration "14:00" into a duration field, it translates to "00:14:00" which is 14 minutes. The current error message for invalid DurationField says that this should be the format of durations: "[DD] [HH:][MM:][ss:.uuuuu)". But according to the actual behaviour, it should be: "[DD] [(HH:MM:ss:.uuuuu]", because seconds are mandatory, minutes are optional, and hours are optional if minutes are provided. This seems to be a mistake in all Django versions that support the DurationField. Also the duration fields could have a default help_text with the requested format, because the syntax is not self-explanatory.</td></tr><tr><td>diff --git a/django/forms/fields.py b/django/forms/fields.py index 935044e..bfb3d28 100644
|
| 446 |
+
--- a/django/forms/fields.py
|
| 447 |
+
+++ b/django/forms/fields.py
|
| 448 |
+
@@ -468,9 +468,10 @@ class DateTimeField(BaseTemporalField):</td><td colspan="2">diff --git a/django/db/models/fields/_init__py
|
| 449 |
+
b/django/db/models/fields/_init__py
|
| 450 |
+
index 77ba99e..de7d841 100644
|
| 451 |
+
--- a/django/db/models/fields/_init__py
|
| 452 |
+
+++ b/django/db/models/fields/_init__py
|
| 453 |
+
@@ -1587,7 +1587,7 @@ class DateTimeField(Field):
|
| 454 |
+
empty_strings Allowed = False
|
| 455 |
+
default_errorMessages = {
|
| 456 |
+
"invalid":_(%)(value)s' value has an invalid format.
|
| 457 |
+
It must be in "
|
| 458 |
+
- "[DD] [HH:][MM:][ss:.uuuuu] format."
|
| 459 |
+
+ "[DD] [HH:][MM:][ss:.uuuuu] format."
|
| 460 |
+
}
|
| 461 |
+
description = _.("Duration")</td></tr><tr><td>class DurationField(Field):
|
| 462 |
+
default_error_messages = {
|
| 463 |
+
- "invalid":_(%)(value)s' value has an invalid format.
|
| 464 |
+
+ "invalid":_(%)(value)s' value has an invalid format.
|
| 465 |
+
[HH:MM:ss[.uuuuu]."]
|
| 466 |
+
"overflow":_(The number of days must be between
|
| 467 |
+
{min_DAYS} and {max_DAYS}.")
|
| 468 |
+
}</td><td colspan="2">def prepare_value(self, value):
|
| 469 |
+
def isinstance(value, datetime.timedelta):</td></tr><tr><td>(a) RepoGraph</td><td colspan="2">(b) Groundtruth</td></tr><tr><td rowspan="9">Tests</td><td>test_dumping (model_fields.test_durationfield.TestSerializable)</td><td>✓</td></tr><tr><td>testLoading (model_fields.test_durationfield.TestSerializable)</td><td>✓</td></tr><tr><td>test_formfield (model_fields.test_durationfield.TestFormField)</td><td>✓</td></tr><tr><td>test_exact (model_fields.test_durationfield.TestQuerying)</td><td>✓</td></tr><tr><td>testInvalid_string (model_fields.test_durationfield.TestValidation)</td><td>X</td></tr><tr><td>testgt (model_fields.test_durationfield.TestQuerying)</td><td>✓</td></tr><tr><td>test_create_empty (model_fields.test_durationfield.TestSaveLoad)</td><td>✓</td></tr><tr><td>test_fractionalSeconds (model_fields.test_durationfield.TestSaveLoad)</td><td>✓</td></tr><tr><td>test SIMPLE_roundtrip (model_fields.test_durationfield.TestSaveLoad)</td><td>✓</td></tr></table>
|
| 470 |
+
|
| 471 |
+
# F IMPACT STATEMENT
|
| 472 |
+
|
| 473 |
+
The impact of this paper lies in its substantial contribution to enhancing the capability of AI-driven software engineering, particularly with respect to repository-level code understanding. The introduc
|
| 474 |
+
|
| 475 |
+

|
| 476 |
+
Figure 15: An example of contextual misalignment. The model-generated patch places the __repr__ method in the wrong class DatasetGroupBy, whereas the correct patch modifies it in the GroupBy class. The __repr__ method should be implemented in the GroupBy class because it deals with the general group-by functionality. "DatasetGroupBy" is a subclass and doesn't require a new representation method if "GroupBy" already has one. Additionally, when fixing white space trailing, while functionally similar, REPOGRAPH's generation doesn't exactly match the style or intention of the correct patch.
|
| 477 |
+
|
| 478 |
+
tion of REPOGRAPH not only significantly improves Large Language Models (LLMs) in navigating and comprehending entire codebases, but also showcases the potential of integrating repository-wide structures into AI workflows. By extending the scope from function-level tasks to holistic repository management, REPOGRAPH pushes the boundaries of AI's utility in modern software engineering.
|
| 479 |
+
|
| 480 |
+

|
| 481 |
+
Figure 16: An example of regressive fix. The model-generated patch successfully resolves the issue which requires the return of objects with no args instead of subclasses of Atom by adding the key code line if not expr.args. However, the fix introduces other new issues such as the size of return objects, as exemplified in the unit tests.
|
| 482 |
+
|
| 483 |
+
This advancement opens new opportunities for using LLMs in complex engineering tasks such as automated debugging, repository maintenance, and large-scale refactoring. Furthermore, by highlighting the importance of repository-level context for accurate code generation and maintenance, the paper sets a new trajectory for future research in AI and software engineering. It encourages deeper exploration of AI's ability to not only write code but also understand and manage large-scale software projects more efficiently. We foresee minimal risks or negative societal impacts from this work. All datasets and benchmarks used in the evaluation are publicly available, and we adhered to their respective licenses. Additionally, REPOGRAPH has been open-sourced, making it accessible to the research community, particularly to groups with limited access to extensive computing resources, thus fostering broader adoption and further development.
|
2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5304b61ebb3cbf797115d84e40f70f0d96d97ea261a2a2258eb16bb697603d20
|
| 3 |
+
size 1579709
|
2025/RepoGraph_ Enhancing AI Software Engineering with Repository-level Code Graph/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Representational Similarity via Interpretable Visual Concepts/2112ed29-8c76-4c56-84e8-bba7e682892d_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Representational Similarity via Interpretable Visual Concepts/2112ed29-8c76-4c56-84e8-bba7e682892d_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Representational Similarity via Interpretable Visual Concepts/2112ed29-8c76-4c56-84e8-bba7e682892d_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:617281a9545710f2409d03c18bce4debcc9b4c6eb48a955a9f72b07c11d36413
|
| 3 |
+
size 5603061
|
2025/Representational Similarity via Interpretable Visual Concepts/full.md
ADDED
|
@@ -0,0 +1,655 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REPRESENTATIONAL SIMILARITY VIA INTERPRETABLE VISUAL CONCEPTS
|
| 2 |
+
|
| 3 |
+
Neehar Kondapaneni<sup>1</sup> Oisin Mac Aodha<sup>2</sup> Pietro Perona<sup>1</sup>
|
| 4 |
+
|
| 5 |
+
$^{1}$ Caltech $^{2}$ University of Edinburgh
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
How do two deep neural networks differ in how they arrive at a decision? Measuring the similarity of deep networks has been a long-standing open question. Most existing methods provide a single number to measure the similarity of two networks at a given layer, but give no insight into what makes them similar or dissimilar. We introduce an interpretable representational similarity method (RSVC) to compare two networks. We use RSVC to discover shared and unique visual concepts between two models. We show that some aspects of model differences can be attributed to unique concepts discovered by one model that are not well represented in the other. Finally, we conduct extensive evaluation across different vision model architectures and training protocols to demonstrate its effectiveness.
|
| 10 |
+
|
| 11 |
+
Project Page: RSVC Code: github.com/nkondapa/RSVC
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
The accuracy of deep neural networks has steadily increased over the last few years thanks to improvements in model architectures, dataset size, and pretraining strategies. However, much less is understood regarding how the representations of different models have changed to make the models more effective. Thus, there is growing interest in developing methods that allow practitioners to compare different networks. Comparing the activation matrices of two neural networks over the same set of inputs underpins current representational similarity methods, e.g., CCA (Hotelling, 1936), CKA (Kornblith et al., 2019), RSA (Kriegeskorte et al., 2008), and Brain-score (Schrimpf et al., 2018). While these approaches provide a score denoting the similarity between two different models, they do not identify the specifics of what makes two models' computations similar or dissimilar, and what aspects of a representation lead to differences in model decisions.
|
| 16 |
+
|
| 17 |
+
In parallel, methods for concept-based eXplainable AI (XAI) have improved our ability to understand what features individual models use to arrive at decisions. Understanding these features is critical for ensuring model fairness and identifying potential sources of bias (Kaminski & Urban, 2021; Kop, 2021). In general, XAI methods sacrifice model fidelity to produce explanations that are simple enough for human interpretation (Fel et al., 2023a; Cunningham et al., 2024). Thus, there is a tension between model fidelity and human understanding.
|
| 18 |
+
|
| 19 |
+
We propose that contrasting two models is an effective way to identify and highlight what makes a model unique, so that users can identify critical features that drive differences in model behavior. To investigate this idea we develop a new approach that extends concept-based XAI methods so they can quantitatively measure representational similarity and provide interpretable insights into the differences between models. We name our method Representational Similarity via Interpretable Visual Concepts (RSVC). Our method builds on interpretability approaches in which the activations of a given layer are decomposed into a coefficient matrix and a vector basis. These approaches group images that produce similar activation patterns together. Thus, we define a visual concept to be the equivalence class of images that produce similar activation patterns. After computing visual concepts from each model, our method evaluates whether the visual concepts from one model are also used by the other model. We make three contributions:
|
| 20 |
+
|
| 21 |
+
- RSVC, a new approach for providing human-interpretable insights into model differences (Fig. 1).
|
| 22 |
+
- A validation strategy to link representational differences to model decisions.
|
| 23 |
+
- Experiments to show that RSVC can measure similarity at both coarse- and fine-grained levels.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
# 2.1 REPRESENTATIONAL SIMILARITY
|
| 28 |
+
|
| 29 |
+
Similarity methods attempt to quantify the similarity/dissimilarity between pairs of different models (Hotelling, 1936; Kornblith et al., 2019; Raghu et al., 2017; Li et al., 2015; Huh et al., 2024). Models can be compared based on their functional similarity (i.e., how their outputs relate) or their representational similarity (i.e., how the activations of intermediate layers relate) (Klabunde et al., 2023). While functional similarity can tell us about how model outputs vary, two models can achieve the same performance with significantly different representations. These differences matter, e.g., while two different forms of pretraining can achieve similar performance on certain datasets, they may transfer poorly to others (Xie et al., 2023).
|
| 30 |
+
|
| 31 |
+
Representational similarity metrics have successfully been used to analyze the differences between architectures (Nguyen et al., 2021; Raghu et al., 2021), explore the effects of different kinds of pretraining (Xie et al., 2023; Neyshabur et al., 2020; Park et al., 2024), develop novel strategies for efficient ensembling (Zhang et al., 2020), or perform ensembling that is robust to distribution shifts (Lee et al., 2023). Some methods have leveraged representational similarity to build tools for text-to-image generation (Rombach et al., 2020) or model-to-model translation (Dravid et al., 2023). In neuro- and cognitive science, representational similarity is used to measure how well models are able to approximate the neural recordings of the brain and/or the behavior of humans (Schrimpf et al., 2018; Muttenhaler et al., 2023; Fel et al., 2022b; Ahlert et al., 2024; Kriegeskorte et al., 2008). In the disentanglement literature, representational similarity has been used to evaluate how well the learned representation matches known ground truth latent factors. A popular approach is to use regularized linear predictors to map learned factors to ground truth latent factors (Eastwood & Williams, 2018; Eastwood et al., 2023; Locatello et al., 2019; Roth et al., 2023; Duan et al., 2020). Recently, Dravid et al. (2023) proposed a method that uses correlated activation patterns across networks to mine for "Rosetta Neurons". These neurons provide insights about features that re-occur consistently in many models. In contrast to our proposed method, Rosetta Neurons do not quantify the overall similarity between networks and do not identify neurons that explain model differences. Most closely related to our work is that of (Schrimpf et al., 2018) and (Li et al., 2015) which use a linear regression model as a similarity metric between the activations of two networks. We describe these methods in more detail in Sec. 3.2.
|
| 32 |
+
|
| 33 |
+
The primary limitation of most existing representational similarity methods is that they can quantify how similar the representations of two models are, but can not tell users what makes the models similar or dissimilar. We propose a new approach that aims to address this question. Our approach leverages concept-based explainability as an intermediate step to measure representational similarity.
|
| 34 |
+
|
| 35 |
+
# 2.2 EXPLAINABLE AI (XAI)
|
| 36 |
+
|
| 37 |
+
XAI methods aim to answer the questions (1) what features did a model use to arrive at a decision and (2) where is the relevant information in the input. Local explanation methods focus on pixel-based attribution, in which a heatmap indicates the region of the image that is most relevant to the model's decision (Selvaraju et al., 2020; Ribeiro et al., 2016; Lundberg & Lee, 2017). While local explanations are able to answer the "where" question, it can be challenging to interpret "what" is being highlighted as attributions can be noisy.
|
| 38 |
+
|
| 39 |
+
To better address the "what" question, global concept-based explanations can be used (Kim et al., 2018; Ghorbani et al., 2019; Zhang et al., 2021; Fel et al., 2023a; Kowal et al., 2024; Poeta et al., 2023; Bau et al., 2020). These approaches discover groups of images (or image regions) that share some visual feature that is relevant to the model's decision making. In addition, "glocal" methods have been developed to answer both questions simultaneously (Schrouff et al., 2021; Fel et al., 2023b; Achtibat et al., 2023; Kondapaneni et al., 2024).
|
| 40 |
+
|
| 41 |
+
Ilyas et al. (2022) take a different approach to explaining model decisions whereby linear surrogate models are trained to reproduce the output of a deep neural network. Then, each training image is given a score that reflects how much it contributed to the final weights of the learned model. In (Shah et al., 2023), this approach was extended to analyze the differences between two models by identifying the differences in training images that each model relies on to arrive at different decisions. While our work also aims to compare two models in an interpretable manner, our approach uses
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: Representational Similarity via interpretable Visual Concepts (RSVC). (Concept Extraction): First, activations for a set of image patches, $\mathcal{I}^c$ , are computed for each model ( $M_1$ and $M_2$ ). Second, the activation matrix for $M_1$ is factorized into the concept coefficient matrix $\mathbf{U}_1$ and the concept basis $\mathbf{W}_1$ , i.e., $\mathbf{A}_1 \approx \mathbf{U}_1 \mathbf{W}_1$ . Each entry in a column vector of the coefficient matrix $\mathbf{U}_1$ represents the strength of a concept in an image. Concepts are visualized by the image patches that correspond to the top $n$ coefficients. Here, we highlight only two concepts, $u_1^a$ and $u_1^b$ . The top four images for these concepts indicate that $u_1^a$ represents bluejay tail and $u_1^b$ represents sky background. (Concept Regression): To measure concept similarity, we learn a weight matrix $\mathbf{W}_{2 \rightarrow 1}^*$ to map $\mathbf{A}_2$ to the concept coefficient matrix $\mathbf{U}_2$ . We denote the predicted coefficient matrix as $\mathbf{U}_{2 \rightarrow 1}$ . (Concept Similarity): Finally, we compute the correlation between columns of $\mathbf{U}_{2 \rightarrow 1}$ and $\mathbf{U}_1$ . If $\mathbf{A}_2$ contains a concept in $\mathbf{U}_1$ , then the predicted coefficient vector should be highly correlated to the real coefficient vector. In this example, we see that the bluejay tail concept is poorly represented in $M_2$ , but both models share the sky background concept.
|
| 45 |
+
|
| 46 |
+
the activations of the original model itself. This gives RSVP the advantage of being able to link representational changes to functional model behavior.
|
| 47 |
+
|
| 48 |
+
# 3 METHOD
|
| 49 |
+
|
| 50 |
+
We propose a new approach to compare the representations of two models using concepts. Our approach is closely related to methods for computing representational similarity, such as BrainScore (Schrimpf et al., 2018) and the metric in (Li et al., 2015), and builds upon prior work in concept extraction (Fel et al., 2023b; Ghorbani et al., 2019; Fel et al., 2023a). We bridge approaches from these two fields, resulting in an interpretable method to measure representational similarity for deep neural networks (Fig. 1).
|
| 51 |
+
|
| 52 |
+
# 3.1 CONCEPT EXTRACTION
|
| 53 |
+
|
| 54 |
+
Fel et al. (2023a) showed that many concept based explainability approaches can be generalized as dictionary learning methods. In these approaches, a set of $n$ input images $\mathcal{I}$ is used to compute activations from a specific layer $l$ of a neural network resulting in an activation matrix $\mathbf{A} \in \mathbb{R}^{n \times d}$ , where each row is an activation vector of dimensionality $d$ . Then, a dictionary learning algorithm can be used to approximate the activations as $\mathbf{A} \approx \mathbf{U}\mathbf{W}$ . The row vectors of the vector basis $\mathbf{W} \in \mathbb{R}^{k \times d}$ can be interpreted as a set of $k$ concepts. Similarly, the rows of the coefficient matrix $\mathbf{U} \in \mathbb{R}^{n \times k}$ represent the importance of a particular concept vector in $\mathbf{W}$ for a given image. By visualizing the images that have the largest concept coefficients for a given concept, we are able to understand what visual concepts the network has identified in the data. The effectiveness of such concept based XAI methods has been demonstrated via user studies in previous work (Fel et al., 2023b; Ghorbani et al., 2019; Kim et al., 2018).
|
| 55 |
+
|
| 56 |
+
Our goal is to develop a method to compare the representational similarity between two models, not just in terms of a single numerical score, but via interpretable concepts. For each model, we use the concept extraction approach proposed in CRAFT (Fel et al., 2023b). We denote the first model as $M_1$ , and the second as $M_2$ . Importantly, we make no assumption that these two models are from the same model family, e.g., one could be a CNN and the other a Vision Transformer. We outline the concept extraction process for $M_1$ , but the same process is applied to $M_2$ .
|
| 57 |
+
|
| 58 |
+
For a specific object class $c$ , we select the set of images $\mathcal{I}_1^c$ that $M_1$ predicted to contain class $c$ . By grouping images according to model predictions, as opposed to only the ground truth labels, we are able to identify concepts used in all images that the model believes are part of class $c$ . This allows the method to provide better insight into both correct and incorrect predictions. Images are usually composed of several visual concepts, so we extract evenly spaced patches from the image to form a set of "concept proposal" images. These patches are more likely to contain a single visual concept and are easier to interpret. We re-use $\mathcal{I}_1^c$ to refer to the set of concept proposal images.
|
| 59 |
+
|
| 60 |
+
Each concept proposal is resized to the model's input resolution and passed through the network. Note that all networks are trained with cropping augmentation, such that patches are in the domain of training images. We denote the activations from a specific layer $l$ and class $c$ as $\mathbf{A}_1 \in \mathbb{R}^{|\mathcal{I}_1^c| \times d}$ , where $d$ is the dimension of the activations of the layer. We then use a dictionary learning algorithm with $k$ components to decompose $\mathbf{A}_1$ into a matrix $\mathbf{U}_1 \in R^{|\mathcal{I}_1^c| \times k}$ and $\mathbf{W}_1 \in \mathbb{R}^{k \times d}$ , such that $\mathbf{A}_1 \approx \mathbf{U}_1\mathbf{W}_1$ . We refer to $\mathbf{U}_1$ as the concept coefficient matrix and $\mathbf{W}_1$ as the concept basis. We repeat this process for $M_2$ , resulting in $\mathbf{U}_2$ and $\mathbf{W}_2$ . Intuitively, each row of a concept coefficient matrix $\mathbf{U}$ encodes the contribution of each concept vector in $\mathbf{W}$ to the activation vector of a particular image in $\mathcal{I}$ .
|
| 61 |
+
|
| 62 |
+
To measure concept similarity between two models, we need to understand how each concept reacts to the same set of images. For example, if both networks have discovered a concept that reacts to the color red, they would both have an activation pattern that spikes when red objects are presented. Following this logic, we propose that if two concept vectors are encoding the same information, their concept coefficients over the same set of images should be correlated. To obtain a shared set of images, we take the union over the image sets $\mathcal{I}_1^c \cup \mathcal{I}_2^c$ to form $\mathcal{I}^c$ . The proposals are passed through the model $M_1$ to produce $\mathbf{A}_1$ for the shared concept set. Given the concept basis $\mathbf{W}_1$ (which is specific to $M_1$ ), we re-compute $\mathbf{U}_1$ over the shared set of images. We repeat this process for $M_2$ to compute $\mathbf{U}_2$ . In practice, we use a non-negative least squares solver, since the original coefficient matrices are non-negative (Appendix B).
|
| 63 |
+
|
| 64 |
+
# 3.2 CONCEPT SIMILARITY
|
| 65 |
+
|
| 66 |
+
Here we address the following question: in a specific pair of layers, does $M_{1}$ encode the same concepts as $M_{2}$ ? In the following sections, we make use of $\mathbf{A}_1$ , $\mathbf{A}_2$ , $\mathbf{U}_1$ and $\mathbf{U}_2$ to compute the similarity between concepts encoded in $M_{1}$ and $M_{2}$ . We consider two different approaches that trade-off computational cost and error. In Appendix A.1 we describe a correlation based metric that has a low computational cost that we use to coarsely compare many layers of two neural networks.
|
| 67 |
+
|
| 68 |
+
In order to more accurately measure similarity in a single layer, we propose a regression based metric similar to the strategy in (Li et al., 2015) and the BrainScore (Schrimpf et al., 2018), which was originally introduced to compare artificial neural networks to biological neural networks. In (Li et al., 2015), the outputs of a convolutional layer in one model are mapped to the outputs of a convolutional layer in another network using a sparse weight matrix. The prediction error between the predicted outputs and true outputs are used as a metric for the similarity between the two layers. In BrainScore, for a set of $n$ stimuli (e.g., images), the activations from a layer of the DNN are stored in a matrix $\mathbf{A} \in \mathbb{R}^{n \times d}$ , where $d$ is the dimensionality of the layer activations. For the same set of stimuli, neural recordings are measured from an animal and processed forming a vector $\mathbf{y} \in \mathbb{R}^n$ for each target "neurooid". A linear mapping is introduced to predict the neural responses from the DNN activations, $\mathbf{y} = \mathbf{A}\mathbf{w}^{*} + b$ , where $\mathbf{w}^{*}$ are the weights of the regressor and $b$ is the bias. The regression model is trained on a set of training images and evaluated on held out test images where the predicted outputs of the regressor are compared to the true neural responses using Pearson correlation, giving a score between -1 and 1.
|
| 69 |
+
|
| 70 |
+
To compare two neural networks using these methods, each column of $\mathbf{A}_2$ would serve as prediction targets for regression with $\mathbf{A}_1$ resulting in a similarity score for each column of $\mathbf{A}_2$ . However,
|
| 71 |
+
|
| 72 |
+
visualizing and interpreting each neuron results in an explanation that is too complex for users. Instead, a more interpretable result can be achieved by setting the coefficient matrix $\mathbf{U}_2$ as regression targets for $\mathbf{A}_1$ (Fig. 1). Essentially, RSVC encodes similarity by measuring how well $M_1$ can predict the concept coefficients of $M_2$ and vice-versa,
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbf {A} _ {1} \mathbf {W} _ {1 \rightarrow 2} ^ {*} = \mathbf {U} _ {1 \rightarrow 2} \quad \text {a n d} \quad \mathbf {A} _ {2} \mathbf {W} _ {2 \rightarrow 1} ^ {*} = \mathbf {U} _ {2 \rightarrow 1}, \tag {1}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where we learn $\mathbf{W}^*$ such that the following regularized $(l_1)$ mean-squared error is minimized.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\min _ {\mathbf {W} ^ {*}} \frac {1}{n} \sum_ {i = 1} ^ {n} \left(\mathbf {A} \mathbf {W} ^ {*} - \mathbf {U}\right) ^ {2} + \lambda \| \mathbf {W} ^ {*} \| _ {1}. \tag {2}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
$l_{1}$ regularization guides the regression model to seek a sparse set of neurons in $M_{1}$ that can be used to predict $U_{2}$ and reduces over-fitting to the regression training data. We also compute baselines for each model from their own activation matrices, learning $\mathbf{W}_{1\rightarrow 1}^{*}$ and $\mathbf{W}_{2\rightarrow 2}^{*}$ . Finally, we compute the Pearson and Spearman correlation between columns of the predicted coefficient matrix and columns of the true coefficient matrix to get a similarity score for each concept between -1 and 1. We refer to the score as cross-model concept similarity (CMCS) when computed across two models, and as same-model concept similarity (SMCS) when computed within the same model.
|
| 85 |
+
|
| 86 |
+
Finally, we investigate whether similar or dissimilar concepts are more important to model decisions by applying concept integrated gradients (Fel et al., 2023a). Concept integrated gradients measure the contribution of each concept to a model's decision (Appendix B.1.1).
|
| 87 |
+
|
| 88 |
+
# 3.3 REPLACEMENT TEST
|
| 89 |
+
|
| 90 |
+
To link differences in predicted concept coefficients and real concept coefficients to model behavior, we conduct a "replacement test". For each model comparison, we conduct a replacement
|
| 91 |
+
|
| 92 |
+
1: for each $i = 1$ to $K$ do
|
| 93 |
+
2: $\bar{\mathbf{U}}_{2\rightarrow 1}^{i} = \mathrm{Copy}\mathbf{U}_{1}$
|
| 94 |
+
3: $\overline{\mathbf{U}}_{2\rightarrow 1}^{i}[:,i] = \mathbf{U}_{2\rightarrow 1}[:,i]$
|
| 95 |
+
4: $\bar{\mathbf{A}}_{2\to 1}^{i} = \bar{\mathbf{U}}_{2\to 1}^{i}W_{1}$
|
| 96 |
+
5: $\overline{\mathbf{z}}_{2\to 1}^{i} = h(\overline{\mathbf{A}}_{2\to 1}^{i})$
|
| 97 |
+
6: $\bar{\mathbf{y}}_{2\rightarrow 1}^{i} = \arg \max (\bar{\mathbf{z}}_{2\rightarrow 1}^{i})$
|
| 98 |
+
7: end for
|
| 99 |
+
|
| 100 |
+
operation over each column of the coefficient matrix and keep track of the resultant reconstructed activation matrix, model logits, and model predictions (as seen in the pseudocode on the left). We perform the replacement operation using the same model predicted coefficients $\mathbf{U}_{1\rightarrow 1}$ (baseline) and also the cross-model predicted coefficients $\mathbf{U}_{2\rightarrow 1}$ . We measure the impact of replacement at three levels during a classification task. We denote $h$ as the classification head that produces logits $(\mathbf{z})$ for each input
|
| 101 |
+
|
| 102 |
+
image. We compute the mean $l_{2}$ -distance between each row of $\bar{\mathbf{A}}_{2\rightarrow 1}^{i}$ and $\bar{\mathbf{A}}_{1\rightarrow 1}^{i}$ , the mean KL-divergence over the logits $\bar{\mathbf{z}}_{2\rightarrow 1}^{i}$ and $\bar{\mathbf{z}}_{1\rightarrow 1}^{i}$ , and the match accuracy between $\bar{\mathbf{y}}_{2\rightarrow 1}^{i}$ and $\bar{\mathbf{y}}_{1\rightarrow 1}^{i}$ .
|
| 103 |
+
|
| 104 |
+
# 3.4 INTERPRETING LOW SIMILARITY CONCEPTS
|
| 105 |
+
|
| 106 |
+
How should we visually compare predicted and real concepts? Concept based XAI methods like CRAFT (Fel et al., 2023b) and CRP (Achtibat et al., 2023) visualize the $n$ images with the largest concept coefficient as representatives of the visual feature encoded by the concept. The same approach can be used to visualize similar concepts, since, by definition, similar concepts have highly correlated activation patterns over the shared set of concept proposal images. However, this approach is misleading when low similarity concepts are discovered. When a concept is dissimilar it may share the same top $n$ images, but have entirely uncorrelated coefficients over the remaining images. This possibility is further amplified due to the mean squared error (MSE) loss used to estimate the regression matrix $\mathbf{W}_{1\rightarrow 2}^{*}$ . The MSE loss penalizes prediction error on the largest coefficients disproportionately, leading to a higher chance the two models share the same top $n$ images.
|
| 107 |
+
|
| 108 |
+
To address this, we develop a new approach to specifically visualize how two models are dissimilar with respect to a concept. We start by visualizing the target concept by using an image collage corresponding to the top $n$ concept coefficients. The target concept is compared to the predicted concept by visualizing the top $n$ over-predicted coefficients and top $n$ under-predicted coefficients. This allows users to reason about visual features that one model entangles or disentangles with the target concept, improving their overall understanding of the compared models. To ensure sample diversity, we enforce that we visualize one patch per image. We also exclude the top-10 real concept images when selecting the over and under predicted points. In Figs. 2 and 5, we demonstrate our proposed approach for interpreting the dissimilarity of the concepts. We include more visualizations in Appendix A.2.
|
| 109 |
+
|
| 110 |
+
# 3.5 IMPLEMENTATION DETAILS
|
| 111 |
+
|
| 112 |
+
We choose a ResNet-18 (RN18), ResNet-50 (RN50) (He et al., 2016), ViT-S, ViT-L (Dosovitskiy, 2021), DINO ViT-B (DINO) (Caron et al., 2021), and MAE ViT-B (MAE) (He et al., 2022) from the timm library (Wightman, 2019) for our experiments. All models were trained on ImageNet (Deng et al., 2009). For our exploration with DINO and MAE, we finetune the models on NABirds (Van Horn et al., 2015). We compare four pairs of models: RN18 vs. RN50, ViT-S vs. ViT-L, RN50 vs. ViT-S, and DINO vs. MAE. Model performance on their respective datasets are reported in Tab. A1. The first two pairs have a clear difference in performance, implying that there are significant representational differences between the models. The second two pairs are roughly equal in overall performance, allowing us to explore how representational differences may result in different behavior even when overall performance is the same. For the $l_{1}$ penalty, we sweep $\lambda$ on a subset of data and find $\lambda = 0.1$ to be a reasonable choice (Fig. A13). Additionally, we set the number of concepts $k = 10$ to balance reconstruction error and computational cost (Fig. A14). We provide further details on the concept extraction, concept comparison and computational cost in Appendix B.
|
| 113 |
+
|
| 114 |
+
# 4 RESULTS
|
| 115 |
+
|
| 116 |
+
# 4.1 DISCOVERING A "TOY" CONCEPT
|
| 117 |
+
|
| 118 |
+
While understanding models on real data is closely related to real-world use cases, it results in complex concepts that can be more challenging to interpret. To better understand the properties of RSVC, we design an experiment in which we train a model on images modified with a simple toy visual concept. In this experiment, we are able to control what the model learns and explore how RSVC works in a more controlled setting.
|
| 119 |
+
|
| 120 |
+
We train two ResNet-18 models from scratch on all classes from a modified NABirds dataset (Van Horn et al., 2015). The first model, $M_{ps}$ , is trained to make use of the toy concept in its decisions and the second, $M_{nc}$ is trained to become invariant to the toy concept. The toy concept is a $20px \times 20px$ pink square that is stochastically placed on the images at a random location. For $M_{ps}$ , the concept appears on images from the Common Eider class with a $70\%$ probability, giving the concept predictive power. For $M_{nc}$ , the concept appears on images from any class with a $50\%$ probability, giving the concept no predictive value. Thus, $M_{ps}$ should learn to attend to the visual concept while $M_{nc}$ should learn to ignore the concept, since it is simply noise. Finally, both models are tested on a dataset in which the concept appears on images from the Common Eider class with a $100\%$ probability. Provided that $M_{nc}$ successfully learns to ignore the concept, RSVC should have a low similarity score to any concept in $M_{ps}$ that primarily fixates on the pink square. Recall that concepts are visualized using image patches. This allows us to break the $100\%$ correlation between the pink square and the image during testing, such that only some patches contain the added concept. Both models achieve $\sim 34\%$ classification accuracy on the test set of NABirds.
|
| 121 |
+
|
| 122 |
+
In Fig. 2, we visualize the similarity from $M_{nc}$ to Concept 1 in $M_{ps}$ . We find that $M_{nc}$ has a near zero similarity to Concept 1 in $M_{ps}$ , which we visually identify to be a concept that fixates on the pink square. Importantly, the modified training paradigm does not affect the similarity scores between other concepts in the two models. In Fig. A5, we show that $M_{nc}$ has high similarity to two other concepts in $M_{ps}$ . Thus, we show that RSVP clearly identifies the primary conceptual difference between the two models in this controlled experiment.
|
| 123 |
+
|
| 124 |
+
# 4.2 CONCEPT SIMILARITY VS. CONCEPT IMPORTANCE
|
| 125 |
+
|
| 126 |
+
To analyze real data, we start by exploring the relationship between concept similarity and importance in the penultimate layers of different models trained on ImageNet (Deng et al., 2009). We compute the cross-model concept similarity (CMCS) and the concept importance (CI) for every extracted concept. In Fig. 3, we plot the concept similarity from $M_{1}$ to $M_{2}$ against the concept importance for $M_{2}$ across four pairs of models. In this figure, a point with low similarity and high importance would indicate that in layer $l$ , $M_{1}$ can not predict the coefficients of a concept that $M_{2}$ finds important in decision making. We use color to indicate the density of points in a region (warmer colors indicate more density). In Appendix A.7, we compare same-model concept simi
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 2: Adding and Discovering a Toy Concept. Here we train two ResNet-18 models, $M_{ps}$ and $M_{nc}$ . $M_{ps}$ is trained to associate a pink square (i.e., Concept 1) with the Common Eider class, while $M_{nc}$ is trained to be invariant to the pink square concept. We find that the similarity score from $M_{nc} \rightarrow M_{ps}$ for Concept 1 is $\sim 0.0$ , indicating that $M_{nc}$ is unable to predict Concept 1 from $M_{ps}$ . To understand various aspects of the differences between the two models, RSVC inspects three distinct regions of the predicted vs. real coefficient scatter plot (Sec. 3.4). (Green): RSVC visualizes images corresponding to the top-10 $M_{ps}$ target concept coefficients. This allows the user to understand what the target concept is encoding. This concept clearly reacts strongly to the pink square visual feature. (Blue): RSVC visualizes the image patches with the largest $M_{nc}$ under-predicted coefficients. $M_{nc}$ under-reacts to the pink square when compared to $M_{ps}$ . (Orange): RSVC visualizes the image patches corresponding to the top-10 $M_{nc}$ over-predicted coefficients. The over-predicted patches show that $M_{nc}$ cannot distinguish between background and the pink square.
|
| 130 |
+
|
| 131 |
+
larity (SMCS) to CI. As expected, we find that SMCS values are significantly higher than CMCS values, since the model is predicting its own concepts.
|
| 132 |
+
|
| 133 |
+
In cross-model comparisons, we observe that models tend to have medium/high similarity for most concepts, since dense regions in the plot tend to be above 0.6 similarity. We also notice that the similarity scores from ViTs and ResNets have a different overall structure, with ResNets having a longer tail of low similarity and low importance concepts. Finally, except for DINO vs. MAE we find that there are several low/medium similarity concepts that also have a medium/high importance. In Appendix A.5, we systematically vary the training protocol (seed and data) for a ResNet-18 model and measure the impact of the changes on model similarity. We find that changes in model training lead to intuitive changes in similarity and use RSVP to reveal some concepts that suggest how the two models differ (Fig. A7). In summary, we observe two key results: (1) model differences are largely driven by medium similarity, medium importance concepts, jointly contributing to significant changes in model behavior and (2) some models do learn "unique" low similarity, high importance concepts. In the following sections we explore both of these results further.
|
| 134 |
+
|
| 135 |
+
# 4.3 REPLACEMENT TEST
|
| 136 |
+
|
| 137 |
+
In order to better understand how variations in similarity impact model behavior we conduct a replacement test (described in Sec. 3.3). This test allows us to measure how changes in concept similarity impacts the $l_{2}$ -distance of the activations, KL-divergence of the logits, and match accuracy of the predictions. We investigate this question because it is possible that changes in Pearson correlation are due to changes in predicted coefficients on unimportant images for a particular concept,
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 3: Concept Similarity vs. Concept Importance. We compare four pairs of models using CMCS: (A) RN18 vs. RN50, (B) RN50 vs. ViT-S, (C) ViT-S vs. ViT-L, and (D) DINO vs. MAE. The y-axis represents the concept importance (CI) measured using concept integrated gradients. Warmer colors represent the density of points in a region. We highlight several regions in the plots: (1) low similarity and low importance concepts that are unique to a model but contribute little to its decisions, (2) high importance and high similarity concepts that are shared across both models and also contribute greatly to decision making, (3) low similarity, high importance concepts that only one model has discovered, but are very important to that model's decisions.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
|
| 152 |
+
leading to no change in model behavior. In Fig. 4, we visualize the change in Pearson correlation $(\Delta \mathrm{Pearson})$ against the change in the three aforementioned metrics. We use color to indicate concept importance (warmer colors are more important). As expected, we observe a trend showing that $l_{2}$ -distance increases as similarity decreases. For the KL-divergence, we observe two trends: (1) when the importance is sufficiently high, the KL-divergence increases as similarity decreases and (2) when the importance is low, there is no effect on the model's logits. Finally, we observe a trend that shows that model predictions change as a function of both similarity and importance. We find that these trends roughly hold for all models, although the structure of the plots changes for ViTs. See Appendix A.8 for more results.
|
| 153 |
+
|
| 154 |
+
# 4.4 LOW SIMILARITY CONCEPTS
|
| 155 |
+
|
| 156 |
+
In Fig. 3 we observe that model comparisons identify low similarity, high importance concepts. These concepts are particularly interesting because they identify visual features that one model has constructed that the other has not. In Fig. 5 we apply our proposed approach for understanding the dissimilarity between predicted and real concepts (see Sec. 3.4). We analyze a RN50 concept used on the barbell class, which primarily reacts to images containing hands/arms lifting a barbell. When a regression model is trained on the ViT-S activations to predict the coefficients of the RN50 concept, the model becomes over-sensitive to any image with weight plates or gym equipment and remains under-sensitive to images of people around gym equipment. This result suggests that the ViT-S does not have a feature encoding "hands lifting weights". In Fig. A3, we show some more examples of important low similarity concepts that are visually interpretable.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 4: Replacement Test. We determine whether poorly predicted coefficients for concepts actually impact model behavior (Sec. 4.3). We use color to represent the concept importance (warmer is higher importance). When ignoring low importance concepts, we observe expected trends, i.e., decreases in similarity ( $\Delta$ Pearson) result in increases in the $l_{2}$ -distance, increases in KL-divergence on the classifier logits, and decreases in model accuracy. The effect also seems to be scaled by importance, for example, changes to low importance concepts (black) has no impact on $\Delta$ KL.
|
| 160 |
+
|
| 161 |
+
# 4.5 LLVM GENERATED CONCEPT DIFFERENCE ANALYSIS
|
| 162 |
+
|
| 163 |
+
Fig. 5 contains a manual analysis of the difference between a visual concept for the barbell class from two different models. Here we use an LLVM (ChatGPT-4o Achiam et al. (2023)) to analyze image collages and describe them. This approach has a similar goal to Gandelsman et al. (2024), in which the authors use an LLVM to interpret specific MLP heads in a CLIP ViT model. The input and output structure for this experiment is provided in Fig. A4. We do not emphasize differences in the system prompt, instead we ask the model to describe both similarities and differences. We provide the top-k image collage (IC1) and the over-predicted image collage (IC2) as input to the LLVM. The LLVM outputs for the barbell concept are presented below. We observe that the LLVM description is similar to the manual description in the caption:
|
| 164 |
+
|
| 165 |
+
# LLVM Analysis of a Visual Concept from the Barbell class
|
| 166 |
+
|
| 167 |
+
IC1: A collage of people engaging in strength training exercises, with a focus on lifting dumbbells, barbells, and performing weightlifting movements.
|
| 168 |
+
|
| 169 |
+
IC2: A collage showcasing gym equipment and weights, with some emphasis on exercises involving barbells and dumbbells but with fewer people depicted.
|
| 170 |
+
|
| 171 |
+
Similarity: Both collages center on weightlifting and gym-related activities, featuring equipment and exercises.
|
| 172 |
+
|
| 173 |
+
Difference: IC1 highlights people actively performing weightlifting exercises, while IC2 primarily focuses on the gym equipment and setup with minimal human involvement.
|
| 174 |
+
|
| 175 |
+
Semantically different: [Yes] IC1 emphasizes the activity of weightlifting, whereas IC2 focuses more on the tools and environment of the gym.
|
| 176 |
+
|
| 177 |
+
# 5 LIMITATIONS
|
| 178 |
+
|
| 179 |
+
We limit our analysis to computer vision models. In practice, there is nothing restricting the application of the RSVC approach to large language models, but we leave this for future work. Our work builds on concept-based XAI methods, and thus inherits the trade-off between fidelity and interpretability. In particular, we note that the reconstruction error varies for each model, which may explain some properties of concept similarity in our experiments. However, we are agnostic to the precise concept extraction method used and thus our approach will benefit from further ad
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 5: Interpreting Low Similarity Concepts. In this example, we find a RN50 concept for the barbell class that the ViT-S is not able to predict. (Green): The RN50 concept reacts to images of hands lifting barbells. Additionally, many images contain vertical supports for a squat rack. We train a regression model on the ViT-S activations to predict the RN50 concept coefficients. (Blue): The ViT-S regression model under-reacts to images containing hands, people, and squat racks. (Orange): It over-reacts to images that have a greater focus on weight plates. These results suggest that the specific concept of hands lifting barbells is not represented in the ViT-S. In Sec. 4.5 we use an LLVM to analyze the image collages (IC1 and IC2) and find that it detects similar differences in the visualizations.
|
| 183 |
+
|
| 184 |
+
vances in these methods. For example, incorporating a recursive strategy like the one presented in CRAFT (Fel et al., 2023b), may significantly improve the number of interpretable comparisons discovered. Outside of overly artificial settings whereby two models are trained on completely different datasets, we note that it can be challenging to compare the representations of two models trained on the same or similar datasets (e.g., ImageNet) as done in this work. However, we believe that this more challenging setting is of most interest and relevance.
|
| 185 |
+
|
| 186 |
+
# 6 CONCLUSION
|
| 187 |
+
|
| 188 |
+
We introduced a new method for exploring representational similarity via interpretable visual concepts (RSVC). In contrast to existing representational similarity methods that simply provide a single numerical score to denote similarity, our approach fuses ideas from concept-based explainability and shows us what visual concepts make two models similar or dissimilar. In particular, we demonstrate that comparing models can be an effective path towards understanding what concepts a model is missing. In future, this may be helpful in identifying sources of model failures. We presented experiments on a range of different vision models and demonstrated that our approach is general and can be applied across a variety of different backbone models, irrespective of the pretraining objective used by the model. Finally, we suggest that explaining the functional differences in two models' behavior could serve as a valuable testbed for future XAI research. We hope that our work opens the door to further investigation into how concepts are represented inside of deep networks.
|
| 189 |
+
|
| 190 |
+
# ACKNOWLEDGMENTS
|
| 191 |
+
|
| 192 |
+
NK and PP were supported by the Simons Foundation and the Resnick Sustainability Institute. OMA was supported by a Royal Society Research Grant. The authors thank Rogério Guimares, Markus Marks, Atharva Sehgal, and the anonymous reviewers for their valuable feedback.
|
| 193 |
+
|
| 194 |
+
# REFERENCES
|
| 195 |
+
|
| 196 |
+
Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv:2303.08774, 2023.
|
| 197 |
+
Reduan Achtibat, Maximilian Dreyer, Ilona Eisenbraun, Sebastian Bosse, Thomas Wiegand, Wojciech Samek, and Sebastian Lapuschkin. From attribution maps to human-understandable explanations through concept relevance propagation. Nature Machine Intelligence, 2023.
|
| 198 |
+
Jannis Ahlert, Thomas Klein, Felix Wichmann, and Robert Geirhos. How aligned are different alignment metrics? In ICLR Workshop on Representational Alignment (Re-Align), 2024.
|
| 199 |
+
David Bau, Jun-Yan Zhu, Hendrik Strobelt, Agata Lapedriza, Bolei Zhou, and Antonio Torralba. Understanding the role of individual units in a deep neural network. PNAS, 2020.
|
| 200 |
+
Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In ICCV, 2021.
|
| 201 |
+
Hoagy Cunningham, Aidan Ewart, Logan Riggs, Robert Huben, and Lee Sharkey. Sparse autoencoders find highly interpretable features in language models. In ICLR, 2024.
|
| 202 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 203 |
+
Chris HQ Ding, Tao Li, and Michael I Jordan. Convex and semi-nonnegative matrix factorizations. PAMI, 2008.
|
| 204 |
+
Alexey Dosovitskiy. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
|
| 205 |
+
Amil Dravid, Yossi Gandelsman, Alexei A Efros, and Assaf Shocher. Rosetta neurons: Mining the common units in a model zoo. In ICCV, 2023.
|
| 206 |
+
Sunny Duan, Loic Matthew, Andre Saraiva, Nicholas Watters, Christopher P Burgess, Alexander Lerchner, and Irina Higgins. Unsupervised model selection for variational disentangled representation learning. In ICLR, 2020.
|
| 207 |
+
Cian Eastwood and Christopher KI Williams. A framework for the quantitative evaluation of disentangled representations. In *ICLR*, 2018.
|
| 208 |
+
Cian Eastwood, Andrei Liviu Nicolicioiu, Julius Von Kugelgen, Armin Kekic, Frederik Träuble, Andrea Dittadi, and Bernhard Schölkopf. Dci-es: An extended disentanglement framework with connections to identifiability. In ICLR, 2023.
|
| 209 |
+
Thomas Fel, Lucas Hervier, David Vigouroux, Antonin Poche, Justin Plakoo, Remi Cadene, Mathieu Chalvidal, Julien Colin, Thibaut Boissin, Louis Bethune, Agustin Picard, Claire Nicodeme, Laurent Gardes, Gregory Flandin, and Thomas Serre. Xplique: A deep learning explainability toolbox. Workshop on Explainable Artificial Intelligence for Computer Vision at CVPR, 2022a.
|
| 210 |
+
Thomas Fel, Ivan F Rodriguez Rodriguez, Drew Linsley, and Thomas Serre. Harmonizing the object recognition strategies of deep neural networks with humans. NeurIPS, 2022b.
|
| 211 |
+
Thomas Fel, Victor Boutin, Louis Béthune, Rémi Cadène, Mazda Moayeri, Léo Andéol, Mathieu Chalvidal, and Thomas Serre. A holistic approach to unifying automatic concept extraction and concept importance estimation. NeurIPS, 2023a.
|
| 212 |
+
|
| 213 |
+
Thomas Fel, Agustin Picard, Louis Bethune, Thibaut Boissin, David Vigouroux, Julien Colin, Rémi Cadène, and Thomas Serre. CRAFT: Concept recursive activation factorization for explainability. In CVPR, 2023b.
|
| 214 |
+
Yossi Gandelsman, Alexei A. Efros, and Jacob Steinhardt. Interpreting CLIP's image representation via text-based decomposition. In *ICLR*, 2024.
|
| 215 |
+
Amirata Ghorbani, James Wexler, James Y Zou, and Been Kim. Towards automatic concept-based explanations. NeurIPS, 2019.
|
| 216 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 217 |
+
Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dólár, and Ross Girshick. Masked autoencoders are scalable vision learners. In CVPR, 2022.
|
| 218 |
+
Harold Hotelling. Relations between two sets of variates. In Biometrika, 1936.
|
| 219 |
+
Minyoung Huh, Brian Cheung, Tongzhou Wang, and Phillip Isola. The platonic representation hypothesis. In ICML, 2024.
|
| 220 |
+
Andrew Ilyas, Sung Min Park, Logan Engstrom, Guillaume Leclerc, and Aleksander Madry. Data-models: Predicting predictions from training data. In ICML, 2022.
|
| 221 |
+
Margot E Kaminski and Jennifer M Urban. The right to contest ai. Columbia Law Review, 2021.
|
| 222 |
+
Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, et al. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (TACV). In ICML, 2018.
|
| 223 |
+
Max Klabunde, Tobias Schumacher, Markus Strohmaier, and Florian Lemmerich. Similarity of neural network models: A survey of functional and representational measures. arXiv:2305.06329, 2023.
|
| 224 |
+
Neehar Kondapaneni, Markus Marks, Oisin Mac Aodha, and Pietro Perona. Less is more: Discovering concise network explanations. In *ICLR Workshop on Representational Alignment*, 2024.
|
| 225 |
+
Mauritz Kop. Eu artificial intelligence act: the european approach to ai. Stanford-Vienna Transatlantic Technology Law Forum, Transatlantic Antitrust and IPR Developments, 2021.
|
| 226 |
+
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In ICML, 2019.
|
| 227 |
+
Matthew Kowal, Achal Dave, Rares Ambrus, Adrien Gaidon, Konstantinos G Derpanis, and Pavel Tokmakov. Understanding video transformers via universal concept discovery. In CVPR, 2024.
|
| 228 |
+
Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In ICCV Workshops, 2013.
|
| 229 |
+
Nikolaus Kriegeskorte, Marieke Mur, and Peter A Bandettini. Representational similarity analysis connecting the branches of systems neuroscience. Frontiers in systems neuroscience, 2008.
|
| 230 |
+
Yoonho Lee, Huaxiu Yao, and Chelsea Finn. Diversify and disambiguate: Out-of-distribution robustness via disagreement. In ICLR, 2023.
|
| 231 |
+
Yixuan Li, Jason Yosinski, Jeff Clune, Hod Lipson, and John Hopcroft. Convergent learning: Do different neural networks learn the same representations? In International Workshop on Feature Extraction: Modern Questions and Challenges at NeurIPS, 2015.
|
| 232 |
+
Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Schölkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learning of disentangled representations. In ICML, 2019.
|
| 233 |
+
Scott M. Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In NeurIPS, 2017.
|
| 234 |
+
|
| 235 |
+
Mathurin Massias, Alexandre Gramfort, and Joseph Salmon. Celer: a fast solver for the lasso with dual extrapolation. In ICML, 2018.
|
| 236 |
+
Lukas Mutenthaler, Jonas Dippel, Lorenz Linhardt, Robert A Vandermeulen, and Simon Kornblith. Human alignment of neural network representations. In ICLR, 2023.
|
| 237 |
+
Behnam Neyshabur, Hanie Sedghi, and Chiyuan Zhang. What is being transferred in transfer learning? NeurIPS, 2020.
|
| 238 |
+
Thao Nguyen, Maithra Raghu, and Simon Kornblith. Do wide and deep networks learn the same things? uncovering how neural network representations vary with width and depth. In *ICLR*, 2021.
|
| 239 |
+
Young-Jin Park, Hao Wang, Shervin Ardeshir, and Navid Azizan. Quantifying representation reliability in self-supervised learning models. In UAI, 2024.
|
| 240 |
+
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. JMLR, 2011.
|
| 241 |
+
Eleonora Poeta, Gabriele Ciravegna, Eliana Pastor, Tania Cerquitelli, and Elena Baralis. Concept-based explainable artificial intelligence: A survey. arXiv:2312.12936, 2023.
|
| 242 |
+
Maithra Raghu, Justin Gilmer, Jason Yosinski, and Jascha Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. NeurIPS, 2017.
|
| 243 |
+
Maithra Raghu, Thomas Unterthiner, Simon Kornblith, Chiyuan Zhang, and Alexey Dosovitskiy. Do vision transformers see like convolutional neural networks? NeurIPS, 2021.
|
| 244 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "Why should I trust you?" Explaining the predictions of any classifier. In KDD, 2016.
|
| 245 |
+
Robin Rombach, Patrick Esser, and Bjorn Ommer. Network-to-network translation with conditional invertible neural networks. NeurIPS, 2020.
|
| 246 |
+
Karsten Roth, Mark Ibrahim, Zeynep Akata, Pascal Vincent, and Diane Bouchacourt. Disentangle-ment of correlated factors via hausdorff factorized support. In ICLR, 2023.
|
| 247 |
+
Martin Schrimpf, Jonas Kubilius, Ha Hong, Najib J Majaj, Rishi Rajalingham, Elias B Issa, Kohitij Kar, Pouya Bashivan, Jonathan Prescott-Roy, Franziska Geiger, et al. Brain-score: Which artificial neural network for object recognition is most brain-like? bioRxiv, 2018.
|
| 248 |
+
Jessica Schrouff, Sebastien Baur, Shaobo Hou, Diana Mincu, Eric Loreaux, Ralph Blanes, James Wexler, Alan Karthikesalingam, and Been Kim. Best of both worlds: local and global explanations with human-understandable concepts. arXiv:2106.08641, 2021.
|
| 249 |
+
Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: visual explanations from deep networks via gradient-based localization. IJCV, 2020.
|
| 250 |
+
Harshay Shah, Sung Min Park, Andrew Ilyas, and Aleksander Madry. Modeldiff: A framework for comparing learning algorithms. In ICML, 2023.
|
| 251 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In ICML, 2017.
|
| 252 |
+
Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society Series B: Statistical Methodology, 1996.
|
| 253 |
+
Grant Van Horn, Steve Branson, Ryan Farrell, Scott Haber, Jessie Barry, Panos Ipeirotis, Pietro Perona, and Serge Belongie. Building a bird recognition app and large scale dataset with citizen scientists: The fine print in fine-grained dataset collection. In CVPR, 2015.
|
| 254 |
+
Ross Wightman. Pytorch image models. https://github.com/rwrightman/pytorch-image-models, 2019.
|
| 255 |
+
|
| 256 |
+
Zhenda Xie, Zigang Geng, Jingcheng Hu, Zheng Zhang, Han Hu, and Yue Cao. Revealing the dark secrets of masked image modeling. In CVPR, 2023.
|
| 257 |
+
Ruihan Zhang, Prashan Madumal, Tim Miller, Krista A Ehinger, and Benjamin IP Rubinstein. Invertible concept-based explanations for cnn models with non-negative concept activation vectors. In AAAI, 2021.
|
| 258 |
+
Wentao Zhang, Jiawei Jiang, Yingxia Shao, and Bin Cui. Efficient diversity-driven ensemble for deep neural networks. In ICDE, 2020.
|
| 259 |
+
|
| 260 |
+
# Appendix
|
| 261 |
+
|
| 262 |
+
# A Additional Experiments 15
|
| 263 |
+
|
| 264 |
+
A.1 Layerwise Concept Similarity 15
|
| 265 |
+
A.2 Analyzing Concepts 17
|
| 266 |
+
A.3 LLVM Generated Concept Difference Analysis 19
|
| 267 |
+
A.4 Specificity of RSVP on the Toy Concept Experiment 21
|
| 268 |
+
A.5 Varying ResNet-18 Training 22
|
| 269 |
+
A.6 DINO and MAE Seed Variation Experiments 25
|
| 270 |
+
A.7 Same Model Concept Similarity vs. Concept Importance 25
|
| 271 |
+
A.8 Additional Replacement Tests 25
|
| 272 |
+
|
| 273 |
+
# B Additional Implementation Details 29
|
| 274 |
+
|
| 275 |
+
B.1 Concept Extraction 29
|
| 276 |
+
B.2 Concept Similarity 30
|
| 277 |
+
B.3 Computational Cost 31
|
| 278 |
+
|
| 279 |
+
# A ADDITIONAL EXPERIMENTS
|
| 280 |
+
|
| 281 |
+
# A.1 LAYERWISE CONCEPT SIMILARITY
|
| 282 |
+
|
| 283 |
+
# A.1.1 CORRELATION
|
| 284 |
+
|
| 285 |
+
We propose a correlation based comparison method that has a lower computational cost than the regression method presented in the main text (Sec. 3.2). This approach allows us to efficiently compare many concepts and layers for two models. Recall that each column of $\mathbf{U}$ contains the concept coefficients of a specific concept for each image. If the concepts encode the same information, they should have highly correlated activation patterns since they would react similarly to the same proposal images. Thus, we compute the correlation for each vector $\mathbf{u}_1^i \in \mathrm{Columns}(\mathbf{U}_1)$ and $\mathbf{u}_2^j \in \mathrm{Columns}(\mathbf{U}_2)$ . We measure both Pearson and Spearman correlation to form the correlation matrices $\mathbf{R}^\rho \in \mathbb{R}^{k \times k}$ and $\mathbf{R}^S \in \mathbb{R}^{k \times k}$ . Since concepts extracted from each network do not have a direct correspondence, MCS measures the concept similarity between a concept from $M_1$ and all of the concepts from $M_2$ and keeps the maximum. We compute the maximum concept similarity $(\mathrm{MCS}^c)$ over each dimension of the correlation matrix for each concept and class
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\mathbf {M C S} _ {1} ^ {c} = \max _ {i} \mathbf {R} _ {i j} \quad \text {a n d} \quad \mathbf {M C S} _ {2} ^ {c} = \max _ {j} \mathbf {R} _ {i j}. \tag {3}
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
MCS is fast to compute and can be done with relatively few image samples (Appendix B.2). Thus, we use it to compute layerwise concept similarity which gives us coarse-grained insights into the similarity between each layer of two different models. For layerwise concept similarity, we compute the correlation matrix $\mathbf{R}^c$ between $M_1$ and $M_2$ at each pair of layers for every class $c$ . Then, for each correlation matrix we compute the mean maximum concept similarity (MMCS) over each dimension and then take the average of the two matrices
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\mathrm {M M C S} _ {m} = \frac {1}{k \cdot c} \sum_ {c = 1} ^ {c} \sum_ {i = 1} ^ {k} \mathrm {M C S} _ {m} ^ {c, i}, \tag {4}
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\mathrm {M M C S} = \left(\mathrm {M M C S} _ {1} + \mathrm {M M C S} _ {2}\right) / 2.
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
However, correlation based similarity can be affected by confounds from concept extraction. For example, extracted concepts can entangle or disentangle visual features that are encoded by the respective models. Suppose $\mathbf{U}_1$ encodes features for both ears and snouts of a dog together in a single concept, but these two features are disentangled into two concepts in $\mathbf{U}_2$ , the maximum match between these concepts would be lower even though both networks are encoding the same information. Additionally, extracted concepts do not contain all the information in the network since there is some reconstruction error when learning the decomposition. Thus, correlation matrices can tell us when two concepts are highly similar, but do not tell us if a concept is missing in a layer. However, they can serve as a noisy lower bound for measuring concept similarity (Appendix A.1.3).
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure A1: Layerwise Mean-Max Concept Similarity. We compare four pairs of models across many selected layers using Pearson correlation. Each entry in the matrix is the mean maximum concept similarity (MMCS) between $M_{1}$ and $M_{2}$ at a particular pair of layers. Brighter colors represent higher MMCS values. We see that, in general, concept similarity is highest in earlier layers and decays as networks get deeper. We also notice that there is a slight increase in similarity towards the final layers (Appendix A.1).
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
|
| 312 |
+
# A.1.2 COMPARING MODEL LAYERS
|
| 313 |
+
|
| 314 |
+
In Fig. A1, we explore how concept similarity arises across many layers of each network. We compute the MMCS at each pair of layers and visualize the resulting matrix. For all models, we find that concept similarity is highest at the early layers of each model and decays gradually as network depth increases. In all model comparisons, we see a slight increase in similarity towards the final layers relative to the preceding layers, suggesting that the way networks organize information converges as the network get closer to producing a final decision. Interestingly, (Fel et al., 2022b) also found the last layer to have better properties for concept extraction.
|
| 315 |
+
|
| 316 |
+
We also notice several properties unique to each comparison. When comparing different sized models with the same architecture, the similarity is related to the relative depth of the layer. For ResNets, we notice that matrices show a pattern of increased similarity after residual blocks and lower similarity for layers within blocks. For the ViT-S and ViT-L we find that there is a broad band of concept similarity in the middle of each network in which the ViT-S layers 4 through 9 have higher similarity to ViT-L layers 5 through 20. In addition, there is an increase in concept similarity between the last layer of the ViT-S and the last three layers of the ViT-L. When comparing the RN50 to ViT-S we find that concept similarity of layers 0 through 25 are most similar to layers 0 through 3. This finding matches observations found in previous work, in which relatively earlier layers in the ViT match relatively later layers in the ResNet (Raghu et al., 2021). Finally, when comparing the MAE to DINO, we see high concept similarity between the first 3 layers of DINO and the first 8 layers of the MAE. However, this similarity decays significantly as the layer index of DINO increases. This divergence in concept similarity may be due to differences between supervised and self-supervised training, but further research is needed.
|
| 317 |
+
|
| 318 |
+
# A.1.3 COMPARING MCS (PEARSON) TO LASSO REGRESSION (PEARSON)
|
| 319 |
+
|
| 320 |
+
In Appendix A.1.1, we claimed that MCS (Pearson) could serve as a noisy lower bound to better measurements of similarity like CMCS (Pearson). This is because MCS is computed over concepts extracted by the decomposition method, which introduces its own entanglements, disentanglements, and reconstruction error. In Fig. A2, we compare the penultimate layers of the four pairs of models and compute both MCS (Pearson) and the CMCS (Pearson). We find that MCS is correlated to CMCS, but, as expected, under-predicts the concept similarity. For this experiment only, due to the fact that we computed Pearson correlation over images in the training set of the deep neural network, we compare to the mean similarity score that is computed from the held-out folds of the five lasso regression models. The held-out folds are not part of the training set for the regression models, but
|
| 321 |
+
|
| 322 |
+
were part of the training set of the deep neural network. However, this comparison is more fair, since we compare the two methods on the same set of images.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure A2: MCS (Pearson) vs. Lasso Regression. We see that the most points lie above the redline. This means that lasso regression (followed by Pearson correlation on the predicted and real coefficients) usually predicts a higher similarity value than the MCS values directly on the columns of the coefficient matrix. Thus, we experimentally validate that the Pearson correlation acts as a noisy lower bound on concept similarity.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
|
| 341 |
+
# A.2 ANALYZING CONCEPTS
|
| 342 |
+
|
| 343 |
+
In Fig. A3 we display some more examples of dissimilar concepts found through RSVP. We also provide interpretations of the dissimilarities between the concepts. Note that these dissimilarities do not necessarily indicate worse performance on images from this class because there are many possible correct strategies when trying to make a decision about an image.
|
| 344 |
+
|
| 345 |
+
# Rugby Ball | RN18 → RN50
|
| 346 |
+
|
| 347 |
+
The RN50 has learned a visual concept that entangles the arms of a rugby player and the rugby ball. We see in the under-predicted samples that the regression model under-predicts samples with the players' limbs and rugby balls together. When visualizing the over-predicted samples we can see that the regression model increases sensitivity to both close-ups of rugby balls and to the legs of the players. These results suggest that the RN18 encodes for the legs of the rugby players independently of the rugby ball and the regression model is using these independent features to try and reproduce the RN50's concept. It also suggests that the RN18 is not encoding the arms as an independent feature.
|
| 348 |
+
|
| 349 |
+
# Grey Whale | ViT-S $\rightarrow$ ViT-L
|
| 350 |
+
|
| 351 |
+
It appears that the ViT-L has learned a visual concept for whales surfacing parallel to the surface of the water. We can see that the regression model under-predicts images of the whales back and also images of its eye in a horizontal orientation. The regression model seems to have increased sensitivity to breaching whales, either raising their tails or their heads. This suggests that the ViT-S has entangled calm whales floating at the surface with active whales breaching the water.
|
| 352 |
+
|
| 353 |
+
# Strawberry | RN50 → ViT-S
|
| 354 |
+
|
| 355 |
+
This concept is one of the lowest similarity concepts that causes a meaningful change in model behavior (as seen by the KL-Divergence). We can see that the ViT-S has learned a concept for mixed fruits that include strawberries. The under-predicted and over-predicted samples show that the RN50 has no ability to reproduce this pattern, suggesting that it ignores mixed fruits entirely.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure A3: Qualitative Samples. In each row, we show visualizations for selected concepts from different model comparisons. In the first column of each row, we show scatter plots between real and predicted concept coefficients. Colored points mark the top-9 images in different subregions of the scatterplot. Each subregion indicates a different aspect of dissimilarity. (Green): Top-9 images for the real concept. These images are used to help the user understand what the target concept pays attention to. (Orange): Top-9 images that are over-predicted by the contrasted model. You may need to zoom in to best analyze the image grids. (Blue): Top-9 images that are underpredicted by the contrasted model. We discuss possible interpretations of the concepts in Appendix A.2. See Sec. 3.4 for a detailed breakdown of how to interpret these plots.
|
| 359 |
+
|
| 360 |
+
# Volleyball | RN18 → RN50
|
| 361 |
+
|
| 362 |
+
The RN50 has learned to encode volleyball players in a variety of active positions. There seems to be an emphasis on hands and arms near or above the net. The RN18 under-predicts close-up images of volleyballs and players at the net and it tends to over-predict images containing balls high in the air and close-ups of nets/grids. This suggests that the regression model is trying to reproduce the behavior of the RN50 concept using a variety of related features learned by the RN18. We explore the top-6 neurons that most contribute to the regression model's prediction of this concept in Fig. A6. We compute the neuron contribution using permutation feature importance (Appendix B). We find that the regression model uses RN18 neurons that are highly sensitive to volleyballs in the air, players near nets, and close-ups of nets qualitatively explaining some of the differences between the predicted and real concept.
|
| 363 |
+
|
| 364 |
+
# Bluejay | ViT-B MAE $\rightarrow$ ViT-B DINO
|
| 365 |
+
|
| 366 |
+
The DINO model has isolated the tail of the bluejay as an important visual feature. The regression model under-predicts images with bluejay tails and over-predicts random images, suggesting that this concept is not independently encoded in the feature space of the MAE.
|
| 367 |
+
|
| 368 |
+
# A.3 LLVM GENERATED CONCEPT DIFFERENCE ANALYSIS
|
| 369 |
+
|
| 370 |
+
In Sec. 4.5, we provide an example that uses an LLVM for analyzing the image collages produced by RSVC. In Fig. A4, we describe the procedure in detail. We apply this method to the concept comparisonsin Fig. A3 and report the results below. We find that the LLVM annotations are fairly similar to the manual annotations.
|
| 371 |
+
|
| 372 |
+
# Rugby Ball | RN18 $\rightarrow$ RN50
|
| 373 |
+
|
| 374 |
+
IC1: A collage featuring various close-ups of players holding rugby balls during gameplay, emphasizing hands and ball contact.
|
| 375 |
+
|
| 376 |
+
IC2: A collage with mixed shots of rugby gameplay, focusing on players' lower bodies, shorts, and action involving the rugby ball from different perspectives.
|
| 377 |
+
|
| 378 |
+
Similarity: Both collages depict scenes from rugby games and include elements of players and rugby balls in action.
|
| 379 |
+
|
| 380 |
+
Difference: IC1 focuses on hand interactions with the rugby ball, while IC2 emphasizes lower body dynamics and broader gameplay elements.
|
| 381 |
+
|
| 382 |
+
Semantically different: [Yes] IC1 highlights ball handling, whereas IC2 portrays physical movement and positioning.
|
| 383 |
+
|
| 384 |
+
# Grey Whale | ViT-S $\rightarrow$ ViT-L
|
| 385 |
+
|
| 386 |
+
IC1: A collage featuring close-up views of whales, focusing on surface water interaction and detailed textures of their bodies.
|
| 387 |
+
|
| 388 |
+
IC2: A collage showing whales from various perspectives, including body parts like tails, heads, and fins, with more diverse settings and details.
|
| 389 |
+
|
| 390 |
+
Similarity: Both collages depict whales and highlight different parts of their bodies in aquatic environments.
|
| 391 |
+
|
| 392 |
+
Difference: IC1 emphasizes close-up textures and water interaction, while IC2 provides broader views of whales, showing distinct body parts and their environment.
|
| 393 |
+
|
| 394 |
+
Semantically different: [Yes] IC1 focuses on textures and surface detail, while IC2 captures a wider perspective of whale features and behaviors.
|
| 395 |
+
|
| 396 |
+
# Strawberry | RN50 → ViT-S
|
| 397 |
+
|
| 398 |
+
IC1: A collage featuring various fruits, with a focus on strawberries along with other fruits like grapes, blueberries, and kiwi, emphasizing vibrant colors and diversity.
|
| 399 |
+
|
| 400 |
+
IC2: A collage entirely centered on strawberries, showing detailed close-ups of their textures and seeds in different lighting and angles.
|
| 401 |
+
|
| 402 |
+
Similarity: Both collages prominently showcase strawberries and their textures.
|
| 403 |
+
|
| 404 |
+
Difference: IC1 includes a mix of other fruits alongside strawberries, while IC2 exclusively focuses on strawberries and their intricate details.
|
| 405 |
+
|
| 406 |
+
Semantically different: [Yes] IC1 presents a broader context of mixed fruits, whereas IC2 isolates strawberries as the sole subject.
|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
Figure A4: LLVM Concept Difference Analysis. We use ChatGPT-4o (Achiam et al., 2023) to analyze concept differences. We provide a general system prompt asking the LLVM to describe the collages, provide a description of the similarities and differences between the collages, and provide a final judgement on whether there is a semantic difference between the collages. We provide an example for the rugby ball class. The LLVM receives the image collage (IC) corresponding the top-k concept images (IC1) and the over-predicted concept images (IC2), see Fig. 5 for more details on image collages. Here, the LLVM notices that IC1 focuses on hands and ball contact, whereas the IC2 focuses more on lower bodies. The described difference matches the manual annotation provided in Appendix A.2.
|
| 410 |
+
|
| 411 |
+
# Volleyball | RN18 → RN50
|
| 412 |
+
|
| 413 |
+
IC1: A collage depicting volleyball gameplay, focusing on players' hands, the volleyball, and interactions around the net during action-packed moments.
|
| 414 |
+
|
| 415 |
+
IC2: A collage showing volleyball gameplay as well but with a wider variety of scenes, including players near the net, different environments, and more casual setups.
|
| 416 |
+
|
| 417 |
+
Similarity: Both collages revolve around volleyball and the central theme of gameplay near the net. Difference: IC1 emphasizes action shots with players and the ball in dynamic moments, while IC2 includes a mix of gameplay contexts and less action-oriented scenes.
|
| 418 |
+
|
| 419 |
+
Semantically different: [Yes] IC1 focuses on the intensity and dynamics of volleyball action, whereas IC2 portrays a broader variety of volleyball scenarios and contexts.
|
| 420 |
+
|
| 421 |
+
# Bluejay | ViT-B MAE $\rightarrow$ ViT-B DINO
|
| 422 |
+
|
| 423 |
+
IC1: A collage of close-up views of blue jay feathers, primarily showcasing the distinctive blue and black patterns on their wings and tails.
|
| 424 |
+
|
| 425 |
+
IC2: A collage of blue jays in various settings, including full-body shots, close-ups of their heads, and natural habitats like branches and foliage.
|
| 426 |
+
|
| 427 |
+
Similarity: Both collages feature blue jays and focus on their unique physical features and natural environment.
|
| 428 |
+
|
| 429 |
+
Difference: IC1 highlights detailed patterns on blue jay feathers, while IC2 captures a broader context of the bird's appearance and behavior in its habitat.
|
| 430 |
+
|
| 431 |
+
Semantically different: [Yes] IC1 emphasizes feather patterns, whereas IC2 provides a holistic view of blue jays in their environment.
|
| 432 |
+
|
| 433 |
+

|
| 434 |
+
Common Eider | Concept 2 | $\mathsf{M}_{\mathrm{nc}}\rightarrow M_{ps}$
|
| 435 |
+
|
| 436 |
+

|
| 437 |
+
Top-10 $M_{ps}$ Concept Patches
|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
Common Eider | Concept 3 | $M_{\mathrm{inv}} \to M_{ps}$
|
| 441 |
+
|
| 442 |
+

|
| 443 |
+
Top-10 $M_{ps}$ Concept Patches
|
| 444 |
+
light blue ocean background
|
| 445 |
+
Figure A5: Specificity of Toy Concept. In Fig. 2, we showed that $M_{nc}$ is not able to predict the pink square concept from $M_{ps}$ . In this figure, we show that the toy concept does not impact the similarity between other concepts learned by the networks. We visualize the top-10 patches from Concept 2 and Concept 3 of $M_{ps}$ in the same class (Common Eider). These concepts correspond to the white and black color pattern of the bird and a water background. Note that these models have been trained from scratch on NABirds resulting in a relatively low $34\%$ accuracy. This leads to noisier concepts that are more challenging to interpret. Importantly, we can see that $M_{nc}$ still has a very high similarity score for these two concepts, highlighting the specificity of RSVP.
|
| 446 |
+
|
| 447 |
+
# A.4 SPECIFICITY OF RSVP ON THE TOY CONCEPT EXPERIMENT
|
| 448 |
+
|
| 449 |
+
In Sec. 4.1 we showed how RSVP can be used to distinguish between a model trained to use the pink square concept and a model trained to ignore the pink square concept. However, training with the pink square concept could have undesirable effects on other model concepts for the Common Eider class. In Fig. A5, we show two shared concepts that are unaffected by the pink square. This experiment suggests that our toy concept training procedure does not impact other concepts learned by the networks.
|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
Volleyball | ResNet18 → ResNet50
|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
ResNet18 Neurons
|
| 458 |
+
|
| 459 |
+

|
| 460 |
+
|
| 461 |
+

|
| 462 |
+
Figure A6: Neuron Analysis For Volleyball Concept Difference In Fig. A3 we visualized a RN50 concept for the volleyball class that the RN18 did not contain. In this figure, we explore the top-6 neurons used by the regression model to predict the RN50 concept. We find that Neuron 465 is sensitive to edges between a volleyball net and the background. It seems to mistake some grid-like textures for nets as well (image [1, 0], [1, 1], and [2, 0]). In addition, it seems to be sensitive to volleyballs high in the air. Neuron 340 seems to activate for athletes in indoor gyms and seems partial to lower bodies. Neuron 297 is sensitive to close-ups of nets with hands or arms in the frame. In summary, these neuron visualizations help to explain some of the images over-predicted by the regression model.
|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
|
| 466 |
+

|
| 467 |
+
|
| 468 |
+
# A.5 VARYING RESNET-18 TRAINING
|
| 469 |
+
|
| 470 |
+
Next, we conduct controlled variations of model training and measure how it effects model concept similarity in the last layer. We train a ResNet-18 model on variations of the NABirds dataset.
|
| 471 |
+
|
| 472 |
+
We start by comparing two ResNet-18 models trained on NABirds with different seeds, 4834586 (R18 s483) and 87363356 (R18 s873). We find that, despite varying the seed during training, both
|
| 473 |
+
|
| 474 |
+

|
| 475 |
+
|
| 476 |
+

|
| 477 |
+
NAB R18 (s483) $\rightarrow$ NAB+SC R18
|
| 478 |
+
|
| 479 |
+

|
| 480 |
+
|
| 481 |
+

|
| 482 |
+
|
| 483 |
+

|
| 484 |
+
|
| 485 |
+

|
| 486 |
+
NAB+SC R18 $\rightarrow$ NAB R18 (s483)
|
| 487 |
+
|
| 488 |
+

|
| 489 |
+
|
| 490 |
+

|
| 491 |
+
|
| 492 |
+

|
| 493 |
+
|
| 494 |
+

|
| 495 |
+
|
| 496 |
+

|
| 497 |
+
|
| 498 |
+

|
| 499 |
+
|
| 500 |
+

|
| 501 |
+
|
| 502 |
+

|
| 503 |
+
|
| 504 |
+

|
| 505 |
+
|
| 506 |
+

|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
Figure A7: Impact of Training on Stanford Cars. In each row, we show visualizations for selected concepts from comparing R18 NAB+SC to R18 s483. In the first two rows, we visualize two R18 NAB+SC concepts that R18 s483 cannot reproduce. The first concept is a racing stripe that is associated with the Shelby Mustang. The R18 s483 model appears to sometimes entangle this concept with a blue color, irrespective of the car model. The second concept appears to be common features associated with Mercedes cars. For this concept, the difference between the two models is more abstract and challenging to interpret. We visualize NAB R18 s483 concepts in the next three rows. First, we show a R18 s483 concept that R18 NAB+SC is unable to predict. We see that this concept is very abstract without a clear pattern, but is generally related to sandy textures. Next, we visualize two car-related concepts from R18 s483. We find that these concepts are sensitive to the combination of the presence of a car and a specific color. For the orange car concept, the R18 NAB+SC makes small over-predictions with different shades of orange. For the yellow car concept, the over-predicted group shows a different shade of yellow and a specific style of car. A discussion of these results is available in Appendix A.5.
|
| 510 |
+
|
| 511 |
+

|
| 512 |
+
Top-9 Concept Patches
|
| 513 |
+
|
| 514 |
+

|
| 515 |
+
Overpredicted
|
| 516 |
+
|
| 517 |
+

|
| 518 |
+
Underpredicted
|
| 519 |
+
|
| 520 |
+
models discover highly similar concepts (Fig. A8A). Then, we train a ResNet-18 model on a modified version of the NABirds dataset in which waterbirds (169 classes) have been excluded during training (R18 NAB-WB). After training, the backbone is frozen and just the classification head is trained on the full dataset. We compare this model to R18 s483 trained on the full dataset $(34\%)$ . We find that training without waterbirds results in a significant decrease in performance $(25\%)$ and, surprisingly, only a slight increase in dissimilar concepts (Fig. A8B).
|
| 521 |
+
|
| 522 |
+
We then explore if introducing novel features from an out-of-domain dataset would result in more dissimilar concepts. In this experiment, we train one model (R18 NAB+SC) on a combined dataset of NABirds and Stanford Cars (Krause et al., 2013) achieving $37\%$ accuracy on the combined classification task. To compare to R18 s483, we freeze the backbone and re-train the model head on both NABirds and Stanford Cars, achieving $26\%$ accuracy. We find training the backbone on Stanford Cars significantly increases concept dissimilarity (Fig. A8C). Interestingly, we find that the increase in dissimilarity is bi-directional, both models are less able to predict the concepts of their contrasted pair. In order to better understand the bi-directional nature of this dissimilarity, we visualize a few concepts from each model in Figure A7. These concepts were selected by (1) filtering concepts above the 75th percentile in delta KL-divergence, (2) visualizing the 15 lowest delta Pearson concepts and (3) manually selecting concepts that were easiest to interpret. We find dissimilar concepts from the R18 NAB+SC model that seem to be semantic concepts specific to car models. In contrast, we found no dissimilar car related concepts that met the criteria from R18 s483. Instead, we find that concepts that meet this criteria are from NABirds classes and tend to be challenging to interpret. We then visualize R18 s483 concepts that result in the largest kl-divergence when replaced by the predictions from R18 NAB+SC. When visualizing these concepts we find two car related concepts that seem to be primarily driven by color, but not car model. These results match the intuition that R18 NAB+SC should contain more complex, car model aligned concepts that can be used to better classify images from Stanford Cars. However, it is not a complete explanation of model behavior and further analysis is needed to make concrete statements about concept dissimilarity.
|
| 523 |
+
|
| 524 |
+
Finally, we compare a ResNet-18 trained on ImageNet and fine-tuned on NABirds to a NABirds model (R18 ImgNet PT). Unsurprisingly, this results in the most dissimilar concepts (Fig. A8D). In sum, we find that larger changes during training results in more dissimilar concepts.
|
| 525 |
+
|
| 526 |
+

|
| 527 |
+
Figure A8: Effect of Seed and Dataset on ResNet-18 Similarity. We compare several pairs of ResNet-18 models while varying their training protocols. We use the same base model in all comparisons, a ResNet-18 model trained with the seed set to 4834586 (R18 s483). (A) We compare the base model to a model trained with seed 87363356 (R18 s873) and find that the two models are highly similar despite the change in seed. (B) We train a ResNet-18 on a modified dataset where we exclude 169 classes that belong to the coarse category of waterbirds (R18 NAB-WB). When comparing to the seed variation experiment, we see a slight increase in the number of dissimilar concepts. (C) We train a ResNet-18 on a combined dataset of NABirds and Stanford Cars (R18 NAB+SC). To compare to the base model, we freeze the base model's backbone and re-train the linear classifier on this combined dataset. We find that introducing Stanford Cars results in a significant increase in dissimilar concepts. (Right) Finally, we compare to a model pre-trained on ImageNet and fine-tuned on NABirds (R18 ImgNet PT). We find that training on ImageNet introduces many novel concepts that are dissimilar to the features of the base model.
|
| 528 |
+
|
| 529 |
+

|
| 530 |
+
Figure A9: DINO and MAE Seed Variation. We explore the effects of varying seed on finetuning a DINO and MAE model on the NABirds dataset. (Left): We show layerwise and last layer comparisons of MAE_s483 vs. DINO_s483. These plots are reproductions from the main text. The black line denotes the average concept similarity. For this comparison, the average similarity in both directions is 0.80. (Center): We compare DINO_s873 vs. MAE_s873. We see a similar layerwise matrix and last layer similarity to DINO_s483 vs. MAE_s483. The average similarity for both models is, once again, 0.80. (Right): We compare DINO_s483 vs. DINO_s873 and find that there is a better layer-to-layer mapping in the layerwise comparison matrix. In addition, the average similarity in both directions is 0.89, higher than comparisons across the different pretraining strategies. Taken together, these results indicate that individual concepts change due to different seeds, but the global structure of the relationship between these models is not affected by seed.
|
| 531 |
+
|
| 532 |
+
# A.6 DINO AND MAE SEED VARIATION EXPERIMENTS
|
| 533 |
+
|
| 534 |
+
In Section 4, we compared a DINO pretrained model and a MAE pretrained model that were finetuned on the NABirds dataset. In those experiments, models were finetuned with the seed set to 4834586. In this section, we explore comparisons to models finetuned with a different seed, 87363356. The models finetuned with the new seed are denoted as DINO_s873 and MAE_s873. We compare two pairs of models, DINO_s873 to MAE_s873 and DINO_s483 to DINO_s873. In Figure A9, we show that changing the seed does change the concepts learned, but that the general relationship between the different pretraining strategies is preserved. In particular, we find that comparing DINO models finetuned with different seeds results in a higher average similarity ( $\sim0.89$ ) than models with different pretraining strategies ( $\sim0.80$ ), indicating that the seed has a smaller impact on finetuning than the initialization.
|
| 535 |
+
|
| 536 |
+
# A.7 SAME MODEL CONCEPT SIMILARITY VS. CONCEPT IMPORTANCE
|
| 537 |
+
|
| 538 |
+
In this section, we validate the feasibility of the regression task. Due to the reconstruction error inherent in decomposition methods, it is not possible to perfectly predict the concept coefficients from the activation matrix. However, in Fig. A10, we show that the regression models do well when trying to do same-model concept regression and significantly better than cross-model concept regression.
|
| 539 |
+
|
| 540 |
+
# A.8 ADDITIONAL REPLACEMENT TESTS
|
| 541 |
+
|
| 542 |
+
In Figs. A11 and A12 we visualize the replacement tests for the three pairs of models not presented in the main text. We see the same effects as before, with a decrease in similarity corresponding to increasing changes in model behavior. Notably, although DINO and MAE models (finetuned on NABirds) have high similarity relative to the other models, they show stronger changes in model behavior for smaller changes in similarity. However, it is not clear whether these differences are due to changes in dataset or changes in pretraining.
|
| 543 |
+
|
| 544 |
+

|
| 545 |
+
ResNet-18 $\rightarrow$ ResNet-18 Concept Similarity
|
| 546 |
+
|
| 547 |
+

|
| 548 |
+
ViT-S $\rightarrow$ ViT-S Concept Similarity
|
| 549 |
+
|
| 550 |
+

|
| 551 |
+
ResNet-50 $\rightarrow$ ResNet-50 Concept Similarity
|
| 552 |
+
|
| 553 |
+

|
| 554 |
+
ResNet-50 $\rightarrow$ ResNet-50 Concept Similarity
|
| 555 |
+
|
| 556 |
+

|
| 557 |
+
|
| 558 |
+

|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
ViT-S $\rightarrow$ ViT-S Concept Similarity
|
| 562 |
+
ViT-L $\rightarrow$ ViT-L Concept Similarity
|
| 563 |
+
Figure A10: SMCS vs CI. We visualize same-model concept similarity (SMCS) against the concept importance. We find that reconstructing more important concepts tends to be easier for ResNets. However, for some ViT models, there can be important learned concepts that are hard to predict. Importantly, SMCS is significantly higher than CMCS indicating that the regression task is feasible.
|
| 564 |
+
|
| 565 |
+

|
| 566 |
+
DINO $\rightarrow$ DINO Concept Similarity
|
| 567 |
+
MAE $\rightarrow$ MAE Concept Similarity
|
| 568 |
+
|
| 569 |
+

|
| 570 |
+
Figure A11: Replacement Test for DINO vs. MAE (NABirds). We find that for the DINO vs. MAE comparison. As Pearson correlation decreases the $l_{2}$ -distance increases, KL-divergence increases, and the match accuracy decreases. Notably, the Pearson correlation decreases a smaller amount than for the other three pairs of models, but the change in the three metrics is on the same order as the other comparisons. This suggests that these two models are more sensitive to changes in a concept.
|
| 571 |
+
|
| 572 |
+

|
| 573 |
+
|
| 574 |
+

|
| 575 |
+
|
| 576 |
+

|
| 577 |
+
|
| 578 |
+

|
| 579 |
+
Figure A12: Replacement Test for ViT-S vs. ViT-L and RN50 vs. ViT-S. We find that for these model comparisons, as Pearson correlation decreases the $l_{2}$ -distance increases, KL-divergence increases, and the match accuracy decreases.
|
| 580 |
+
|
| 581 |
+

|
| 582 |
+
Figure A13: Impact of Regularization on Regression. Here we vary the $\lambda$ for the $l_{1}$ penalty on the regression model. We use the first 200 classes of ImageNet for these visualizations. In the left column, we visualize the distribution of similarity values for each value of $\lambda$ . In the center, we visualize the number of non-zero coefficients. In the right column, we visualize the similarity vs. importance plots for $\lambda = 0.1$ and $\lambda = 0.5$ . We find that, as expected, increasing the $l_{1}$ penalty reduces similarity by increasing the number of zeroed coefficients. In all experiments in the paper, we use an $l_{1}$ penalty of 0.1.
|
| 583 |
+
|
| 584 |
+
# B ADDITIONAL IMPLEMENTATION DETAILS
|
| 585 |
+
|
| 586 |
+
# B.1 CONCEPT EXTRACTION
|
| 587 |
+
|
| 588 |
+
For each model considered in this study, we provide information about concept extraction in Tab. A2. First, images are resized to $224 \times 224$ and then processed into 16 evenly spaced $64 \times 64$ pixel patches. Patches are then resized back to the image resolution of the network. We sample 100 images per model for concept extraction. All models taken from the timm library were trained with Inception style random cropping. Custom trained models were trained using random resized cropping with horizontal flipping. This ensures that the resized patches are in-domain for the network. To produce an activation matrix $\mathbf{A}$ that can be decomposed, the outputs of the network are processed. The ResNets (He et al., 2016) produce outputs with a batch $b$ , channel $c$ , height $h$ and width $w$ dimension. To create a matrix that can be decomposed, we use global average pooling over the $h$ and $w$ dimensions. The ViTs (Dosovitskiy, 2021) produce outputs with a batch $b$ , sequence $s$ , and feature dimension $d$ . We select the class token from the sequence dimension resulting in a two-dimensional matrix. We use NNMF for ResNets since they contain ReLU layers and can produce positive only activations. NNMF restricts the $\mathbf{U}$ and $\mathbf{W}$ matrix to be positive. For, ViT models, we use Semi-NMF (Ding et al., 2008) which allows for both positive and negative values in the $\mathbf{W}$ matrix, but requires positive values in the $\mathbf{U}$ matrix. We use a non-negative least squares solver to fit coefficients to a new set of data points:
|
| 589 |
+
|
| 590 |
+
$$
|
| 591 |
+
\min _ {\mathbf {U} _ {1}} \| \mathbf {A} _ {1} - \mathbf {U} _ {1} \mathbf {W} _ {1} \| _ {2} ^ {2}, \tag {5}
|
| 592 |
+
$$
|
| 593 |
+
|
| 594 |
+
subject to $\mathbf{U}_1\geq 0$
|
| 595 |
+
|
| 596 |
+
# B.1.1 CONCEPT INTEGRATED GRADIENTS
|
| 597 |
+
|
| 598 |
+
Integrated gradients measures the importance of each pixel by averaging the gradients of the input image, as the input image is varied from a baseline value to its true value (Sundararajan et al., 2017). To compute concept integrated gradients the formulation is modified. Let $h_1$ represent the head of $M_1$ , i.e., the final layer(s), and $\mathbf{A}_1$ be the output activations from the layer preceding $h_1$ . As
|
| 599 |
+
|
| 600 |
+

|
| 601 |
+
|
| 602 |
+

|
| 603 |
+
|
| 604 |
+

|
| 605 |
+
Figure A14: Impact of Number of Concepts on Similarity. Here we vary $k$ , the number of concepts in the dictionary and explore the impact on the similarity distribution. We use the first 200 classes of ImageNet for these visualizations. In the left column, we plot the distribution of similarity scores for 5, 10, 15, and 20 concepts. In the center column, we visualize the distribution of reconstruction errors for different number of concepts. As expected, increasing the number of concepts results in lower reconstruction errors. In the right column, we visualize similarity vs. importance for 10 and 20 concepts. We observe that increasing the number of concepts disproportionately increases the number of dissimilar concepts. For all results in the paper we use 10 concepts.
|
| 606 |
+
|
| 607 |
+

|
| 608 |
+
|
| 609 |
+
described earlier, we factorize $\mathbf{A}_1\approx \mathbf{U}_1\mathbf{W}_1$ . We denote row vectors of $\mathbf{U}_1$ as $\mathbf{r}_1^i\in \mathrm{Rows}(\mathbf{U}_1)$ , such that $\mathbf{r}_1^i\in \mathbb{R}^{1\times d}$ . To link model predictions to learned concepts, we compute model predictions as
|
| 610 |
+
|
| 611 |
+
$$
|
| 612 |
+
\hat {\mathbf {z}} _ {1} ^ {i} = h _ {1} \left(\mathbf {r} _ {1} ^ {i} \mathbf {W} _ {1}\right), \tag {6}
|
| 613 |
+
$$
|
| 614 |
+
|
| 615 |
+
where $\hat{\mathbf{z}}_1^i\in \mathbb{R}^{1\times d}$ is a row vector of prediction probabilities. Then, to compute concept integrated gradients, we average over the gradients as we linearly step from a baseline vector $\mathbf{r}^b = 0$ to $\mathbf{r}_1^i$
|
| 616 |
+
|
| 617 |
+
$$
|
| 618 |
+
\varphi \left(\mathbf {r} _ {1} ^ {i}\right) = \left(\mathbf {r} _ {1} ^ {i} - \mathbf {r} ^ {b}\right) \times \int_ {0} ^ {1} \nabla_ {\mathbf {r} _ {1} ^ {i}} h _ {1} \left(\left(\alpha \mathbf {r} ^ {b} + (1 - \alpha) \left(\mathbf {r} _ {1} ^ {i} - \mathbf {r} ^ {b}\right)\right) \mathbf {W}\right) d \alpha . \tag {7}
|
| 619 |
+
$$
|
| 620 |
+
|
| 621 |
+
Thus, for each class and concept we have a single value that represents the importance of that concept to model decisions. We implement concept integrated gradients based on the implementation in the xplique library (Fel et al., 2022a). For all experiments we integrate over 30 steps.
|
| 622 |
+
|
| 623 |
+
# B.2 CONCEPT SIMILARITY
|
| 624 |
+
|
| 625 |
+
Correlation. Pearson and Spearman are computed using scikit-learn (Pedregosa et al., 2011). We use 50 images for each class from the training set of the model. Images are resized to $224 \times 224$ . We use a patch size of $64 \times 64$ resulting in 16 patches per image. Thus, Pearson and Spearman correlation is computed using 800 total patches per class. The patches are resized and passed through the model to generate activations at a given layer.
|
| 626 |
+
|
| 627 |
+
Regression. We use lasso-regression (Tibshirani, 1996) with a 0.1 weight on the $l_{1}$ penalty. We visualize the effect of this parameter on similarity in Fig. A13. Regression models are trained on the activations from at least 5 images (80 patches) and at most 200 images (3200 patches) sourced from the original training split of the dataset. For each concept and class, we train five lasso-regression models on different equally sized folds. The regression model weights are averaged and then the model is evaluated on images from the validation/test split of the original dataset. The inputs and targets are standardized to have a mean of zero and a standard deviation of one. The regression is trained using the Celer library (Massias et al., 2018). Finally, the predicted coefficients are unnormalized before the Pearson and Spearman correlation are computed. To compute feature importance
|
| 628 |
+
|
| 629 |
+
scores for regression models, we use the permutation feature importance implementation from scikit-learn (Pedregosa et al., 2011). We use the default parameters with 5 repeats and the random state set to 0.
|
| 630 |
+
|
| 631 |
+
Layerwise Comparisons. We list all of the layers used in the layerwise comparisons in Tab. A4.
|
| 632 |
+
|
| 633 |
+
Spearman Correlation. In all experiments, we found Spearman correlation to be very similar to Pearson correlation, thus we have excluded these results.
|
| 634 |
+
|
| 635 |
+
Visualizing Dis-similar Concepts. We select one patch per image in order of maximum concept coefficient. The top $n$ patches for the real images are excluded from the pool of images used to visualize the under-predicted and over-predicted coefficients.
|
| 636 |
+
|
| 637 |
+
# B.3 COMPUTATIONAL COST
|
| 638 |
+
|
| 639 |
+
All experiments were conducted using on a machine with an AMD Ryzen 7 3700X 8-Core Processor and a single GeForce RTX 4090 GPU. In Table A3, we detail the computational cost of each step of our proposed method. For a comparison between a ResNet-18 and a ResNet-50 on all 1000 classes of ImageNet, RSVP takes approximately 20 hours.
|
| 640 |
+
|
| 641 |
+
Table A1: Model performance.
|
| 642 |
+
|
| 643 |
+
<table><tr><td>Model</td><td>timm Model</td><td>ImageNet Accuracy</td><td>NaBirds Accuracy</td></tr><tr><td>ResNet-18</td><td>resnet18.a2_in1k</td><td>70.6%</td><td>-</td></tr><tr><td>ResNet-50</td><td>resnet50.a2_in1k</td><td>79.8%</td><td>-</td></tr><tr><td>ViT-S</td><td>vit_small_batch16_224.augreg_in21k_ft_in1k</td><td>81.3%</td><td>-</td></tr><tr><td>ViT-L</td><td>vit_large_batch16_224.augreg_in21k_ft_in1k</td><td>85.8%</td><td>-</td></tr><tr><td>DINO ViT-B</td><td>vit_base_batch16_224.dino</td><td>-</td><td>71.2%</td></tr><tr><td>MAE ViT-B</td><td>vit_base_batch16_224.mae</td><td>-</td><td>71.2%</td></tr></table>
|
| 644 |
+
|
| 645 |
+
Table A2: Concept extraction.
|
| 646 |
+
|
| 647 |
+
<table><tr><td>Model</td><td>Layer Post-processing</td><td>Method</td><td>Number of Concepts</td><td>Patch Size</td><td>Recon. Error (Last Layer)</td></tr><tr><td>ResNet-18</td><td>GAP</td><td>NNMF</td><td>10</td><td>64</td><td>176.2</td></tr><tr><td>ResNet-50</td><td>GAP</td><td>NNMF</td><td>10</td><td>64</td><td>205.5</td></tr><tr><td>ViT-S</td><td>Class Token</td><td>Semi-NMF</td><td>10</td><td>64</td><td>926.9</td></tr><tr><td>ViT-L</td><td>Class Token</td><td>Semi-NMF</td><td>10</td><td>64</td><td>1650.8</td></tr><tr><td>DINO ViT-B</td><td>Class Token</td><td>Semi-NMF</td><td>10</td><td>64</td><td>191.0</td></tr><tr><td>MAE ViT-B</td><td>Class Token</td><td>Semi-NMF</td><td>10</td><td>64</td><td>656.5</td></tr></table>
|
| 648 |
+
|
| 649 |
+
Table A3: Computational cost for ResNet18 vs. ResNet-50 on ImageNet.
|
| 650 |
+
|
| 651 |
+
<table><tr><td>Step</td><td>sec/it</td><td>Total Time</td></tr><tr><td>Activation Extraction (RN50)</td><td>1.50</td><td>25m</td></tr><tr><td>Concept Extraction (RN50)</td><td>2.00</td><td>33m</td></tr><tr><td>Concept Comparison (CMCS) Last Layer</td><td>9.00</td><td>2h30m</td></tr><tr><td>Concept Comparison (MCS) All Layers</td><td>14.56</td><td>4h</td></tr><tr><td>Concept Int. Grad</td><td>41.56</td><td>11h 30m</td></tr><tr><td>Regression Evaluation</td><td>2.30</td><td>38m</td></tr><tr><td>Total Time</td><td>-</td><td>19h36m</td></tr></table>
|
| 652 |
+
|
| 653 |
+
Table A4: Selected layers.
|
| 654 |
+
|
| 655 |
+
<table><tr><td>Model</td><td>Layers</td></tr><tr><td>ResNet-18</td><td>act1, layer1.0.act1, layer1.0.act2, layer1.1.act1, layer1.1.act2, layer2.0.act1, layer2.0.act2, layer2.1.act1, layer2.1.act2, layer3.0.act1, layer3.0.act2, layer4.1.act1, layer4.1.act2</td></tr><tr><td>ResNet-50</td><td>act1, layer1.0.act1, layer1.0.act2, layer1.0.act3, layer1.1.act1, layer1.1.act2, layer1.1.act3, layer1.2.act1, layer1.2.act2, layer1.2.act3, layer1.2.act1, layer2.0.act2, layer2.0.act3, layer2.0.act1, layer2.2.act1, layer2.2.act2, layer2.2.act3, layer2.3.act1, layer2.3.act2, layer3.1.act1, layer3.1.act2, layer3.1.act3, layer3.1.act2, layer3.3.act1, layer3.3.act2, layer3.3.act3, layer3.4.act1, layer3.4.act2, layer3.4.act3, layer3.5.act1, layer3.5.act2, layer3.5.act3, layer3.5.act2, layer4.0.act1, layer4.0.act2, layer4.0.act3, layer4.0.act1, layer4.2.act1, layer4.2.act2, layer4.2.act3</td></tr><tr><td>ViT-S</td><td>block0, block1, block2, block3, block4, block5, block6, block7, block8, block9, block10, block11</td></tr><tr><td>ViT-L</td><td>block0, block1, block2, block3, block4, block5, block6, block7, block8, block9, block10, block11, block12, block13, block14, block15, block16, block17, block18, block19, block20, block21, block22, block23</td></tr><tr><td>DINO ViT-B</td><td>block0, block1, block2, block3, block4, block5, block6, block7, block8, block9, block10, block11</td></tr><tr><td>MAE ViT-B</td><td>block0, block1, block2, block3, block4, block5, block6, block7, block8, block9, block10, block11</td></tr></table>
|
2025/Representational Similarity via Interpretable Visual Concepts/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:821ca0d8a3be91c61a489a2981f25ee45571cd7576dc82c616e2ba937176dbbb
|
| 3 |
+
size 2514948
|
2025/Representational Similarity via Interpretable Visual Concepts/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Repulsive Latent Score Distillation for Solving Inverse Problems/b01edac8-dfb7-4a0d-bf86-d41f21b22210_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Repulsive Latent Score Distillation for Solving Inverse Problems/b01edac8-dfb7-4a0d-bf86-d41f21b22210_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Repulsive Latent Score Distillation for Solving Inverse Problems/b01edac8-dfb7-4a0d-bf86-d41f21b22210_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:80d1423ccb4e407480f0a96bdf82b187cc3579cad25abb54811dfde4d38c4eae
|
| 3 |
+
size 50758610
|
2025/Repulsive Latent Score Distillation for Solving Inverse Problems/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Repulsive Latent Score Distillation for Solving Inverse Problems/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7dbbd038660397395c44022df99551a3f62c2d6582a24bfa383de5a27f93dc9b
|
| 3 |
+
size 3219895
|
2025/Repulsive Latent Score Distillation for Solving Inverse Problems/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/d709add5-526d-468b-a950-f8446de182da_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/d709add5-526d-468b-a950-f8446de182da_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/d709add5-526d-468b-a950-f8446de182da_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8d9928b92d0570524fcf87618be889e5dcde0ab5b283ac278b580e1beed1cccb
|
| 3 |
+
size 699140
|
2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e3d7878402272f6005fc6d369953b864ae6c91ab981d31dd4a3d0b735e89ab0
|
| 3 |
+
size 1157395
|
2025/Residual Connections and Normalization Can Provably Prevent Oversmoothing in GNNs/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/d1f0fb8d-9179-45cf-a4f3-2da7a6c2ae85_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/d1f0fb8d-9179-45cf-a4f3-2da7a6c2ae85_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/d1f0fb8d-9179-45cf-a4f3-2da7a6c2ae85_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b3cc71998d27eff9782bd5e8933368483d6ed7a9e5f069b8f19c2b549ad7a87a
|
| 3 |
+
size 9383986
|
2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/full.md
ADDED
|
@@ -0,0 +1,680 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RESIDUAL KERNELPOLICY NETWORK:ENHANCING STABILITYANDROBUSTNESSINRKHS-BASEDREINFORCEMENTLEARNING
|
| 2 |
+
|
| 3 |
+
Yixian Zhang, Huaze Tang *& Huijing Lin
|
| 4 |
+
|
| 5 |
+
Tsinghua Shenzhen International Graduate School, Tsinghua University {yixian-z24,tanghz24,linhj24}@mails.tsinghua.edu.cn
|
| 6 |
+
|
| 7 |
+
Wenbo Ding†
|
| 8 |
+
|
| 9 |
+
Tsinghua Shenzhen International Graduate School, Tsinghua University
|
| 10 |
+
|
| 11 |
+
Shanghai Artificial Intelligence Laboratory
|
| 12 |
+
|
| 13 |
+
ding.wenbo@sz.tsinghua.edu.cn
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Achieving optimal performance in reinforcement learning requires robust policies supported by training processes that ensure both sample efficiency and stability. Modeling the policy in reproducing kernel Hilbert space (RKHS) enables efficient exploration of local optimal solutions. However, the stability of existing RKHS-based methods is hindered by significant variance in gradients, while the robustness of the learned policies is often compromised due to the sensitivity of hyperparameters. In this work, we conduct a comprehensive analysis of the significant instability in RKHS policies and reveal that the variance of the policy gradient increases substantially when a wide-bandwidth kernel is employed. To address these challenges, we propose a novel RKHS policy learning method integrated with representation learning to dynamically process observations in complex environments, enhancing the robustness of RKHS policies. Furthermore, inspired by the advantage functions, we introduce a residual layer that further stabilizes the training process by significantly reducing gradient variance in RKHS. Our novel algorithm, the Residual Kernel Policy Network (ResKPN), demonstrates state-of-the-art performance, achieving a $30\%$ improvement in episodic rewards across complex environments.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Reproducing Kernel Hilbert Space (RKHS) methods have emerged as powerful tools in reinforcement learning (RL) due to their ability to model policies nonparametrically, allowing for flexible function approximation and efficient exploration of the solution space (Lever & Stafford, 2015; Paternain et al., 2020). By leveraging kernels, RKHS-based policies can capture complex relationships in high-dimensional observation spaces, leading to expressive models that adapt well to diverse environments (Paternain et al., 2022). However, despite these advantages, RKHS-based policies face significant challenges that limit their practical applicability. A critical issue is the high variance in policy gradients inherent to RKHS methods (Smith & Egeland, 2024). This excessive variance arises because the RKHS gradient updates do not fully exploit all previously sampled episodes, leading to instability during training and difficulties in converging to optimal policies (Dastider et al., 2022). Additionally, the robustness of RKHS models is often compromised due to hyperparameter sensitivity. Different environments may require distinct hyperparameter settings, making it challenging for RKHS policies to maintain consistent performance across varied and complex environments (Liu & Lian, 2024). In environments with large action spaces, such as the Humanoid environment (Todorov et al., 2012), RKHS methods struggle to scale effectively.
|
| 22 |
+
|
| 23 |
+
From our review of existing approaches, grid search methods are commonly employed for hyperparameter tuning to align the data distribution with the RKHS kernel (Montesinos López et al., 2022; Hsu & Lin, 2002; Wilson et al., 2016). The requirement for meticulous hyperparameter tuning introduces additional computational complexity and limits the adaptability of RKHS policies to new tasks. Regarding variance reduction, various techniques such as learning rate search (Le et al., 2019), symmetric estimation (Paternain et al., 2020), and policy search (Chen et al., 2016) are proposed to stabilize the training process, while the effectiveness of these variance reduction methods is often constrained to specific environments. Alternatively, variance can be mitigated by introducing bias into the estimation process, such as leveraging predefined kernel orthogonal basis (Mazoure et al., 2020) or employing an online clustering approach to aggregate similar kernel orthogonal bases into central representations (Wang & Principe, 2021). Despite their promise, the implementation of these methods in high-dimensional spaces poses significant challenges due to computational inefficiencies.
|
| 24 |
+
|
| 25 |
+
To fully leverage the advantages of RKHS methods and develop stable, robust policies across diverse environments, we introduce the Residual Kernel Policy Network (ResKPN). Our approach integrates representation learning with RKHS policy models to dynamically process observations, enhancing the adaptability and robustness of RKHS policies in complex environments. By incorporating a neural network for feature extraction, we adjust the distribution of inputs to better align with the chosen kernel, mitigating hyperparameter sensitivity. Furthermore, inspired by the variance reduction capabilities of advantage functions, we introduce a residual layer (He et al., 2016b) that significantly reduces gradient variance within RKHS. This addition stabilizes the training process and enables the discovery of high-performing policies with improved robustness. Specifically, the following key contributions are made:
|
| 26 |
+
|
| 27 |
+
- We propose a novel RKHS policy learning algorithm that employs a neural network to dynamically represent observations, enhancing the adaptability and robustness of RKHS policies across diverse environments by aligning observation distributions with the chosen kernel.
|
| 28 |
+
- We conduct an in-depth analysis of the high variance issue in RKHS policy gradients. Our findings reveal that learning with traditional RKHS policies, particularly in wide-bandwidth kernels, leads to significant instability and high variance during training.
|
| 29 |
+
- We introduce a variance reduction technique by designing a residual layer for the RKHS policy. Our analysis demonstrates that this approach effectively reduces gradient variance and stabilizes the training process. Combined with representation learning, our ultimate algorithm, ResKPN, achieves superior performance across various challenging environments, including a $30\%$ episodic rewards improvement in the Humanoid environment.
|
| 30 |
+
|
| 31 |
+
# 2 BACKGROUND
|
| 32 |
+
|
| 33 |
+
In this section, we review previous studies on reinforcement learning within RKHS. Additionally, we provide a brief overview of variance reduction techniques in reinforcement learning to facilitate the subsequent introduction of the variance reduction methods designed for RKHS policies. To describe the methodology of the ResKPN algorithm, we also examine prior research on the integration of kernel methods and deep learning techniques.
|
| 34 |
+
|
| 35 |
+
# 2.1 REINFORCEMENT LEARNING WITHIN RKHS
|
| 36 |
+
|
| 37 |
+
Reinforcement learning algorithms attempt to learn the optimal $Q$ -function for the cumulative rewards or the optimal policy (Sutton & Barto, 2018). This paper concentrates on the latter one, which leads to the policy gradient algorithm. The cumulative rewards (Bedi et al., 2024) is defined as
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
U (\pi_ {w}) = \mathbb {E} _ {\tau \sim p (\tau ; \pi_ {w})} \left[ \sum_ {t = 1} ^ {\infty} \gamma^ {t - 1} r (s _ {t}, a _ {t}) \right],
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $p(\tau; \pi_w) = p(s_1) \prod_{t=1}^{\infty} p(s_{t+1}|s_t, a_t) \pi_w(a_t|s_t)$ represents the distribution of the trajectory $\tau = ((s_1, a_1), (s_2, a_2), \ldots)$ following the policy $\pi_w$ and $r(s_t, a_t)$ denotes the instant reward of state-action pair $(s_t, a_t)$ . $\gamma$ is the discounted factor of reward. The policy gradient is to find the gradient
|
| 44 |
+
|
| 45 |
+
direction to maximize $U(\pi_w)$ that
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\nabla_ {w} U (\pi_ {w}) = \frac {1}{1 - \gamma} \mathbb {E} _ {a \sim \pi (a | s), s \sim \rho_ {\pi_ {w}} (s)} [ Q ^ {\pi_ {w}} (a, s) \nabla_ {w} \log \pi_ {w} (a | s) ], \tag {1}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $Q^{\pi_w}(a,s) = \mathbb{E}_{\tau \sim p(\tau ;\pi_w)}\left[\sum_{t = 1}^{\infty}\gamma^{t - 1}r(a_t,s_t)|a_1 = a,s_1 = s\right]$ is the $Q$ -function and $\rho_{\pi_w}(s)$ represents the marginal density of the state under policy $\pi_w$
|
| 52 |
+
|
| 53 |
+
Reproducing Kernel Hilbert Space (RKHS) is the vector valued Hilbert Space $\mathcal{H}_K$ where an elements $K(x,\cdot)\in \mathcal{H}$ satisfies the reproducing property $\langle K(x,\cdot),K(y,\cdot)\rangle = K(x,y)$ . Despite the policy is modeled by the parameter $w$ with particular parameterized functions, the stochastic policy is directly modeled as a function $h$ in RKHS $\mathcal{H}_K$ , where the updating gradient for it is also a function. In detail, the action is chosen from a multivariate normal distribution $\mathcal{N}(h(s),\Sigma)$
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\pi_ {h, \boldsymbol {\Sigma}} (a | s) := \frac {1}{Z} e ^ {- \frac {1}{2} (h (s) - a) ^ {\top} \boldsymbol {\Sigma} ^ {- 1} (h (s) - a)}, \tag {2}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where the mean value is dependent on the function $h \in \mathcal{H}_K$ . The gradient for the RKHS policy is then derived (Paternain et al., 2020; Lever & Stafford, 2015) as
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\nabla_ {h} U \left(\pi_ {h}\right) = \frac {1}{1 - \gamma} \mathbb {E} _ {a, s} \left[ Q ^ {\pi_ {h}} (a, s) K (s, \cdot) \boldsymbol {\Sigma} ^ {- 1} (a - h (s)) \right],
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where the derivative with respect to function $h$ uses the Fréchet derivative (Mcgillivray & Oldenburg, 1990). To compute the stochastic gradient $\nabla_h U(\pi_h)$ , a common approach is to use Monte Carlo approximation (Lever & Stafford, 2015), which incurs high computational costs, particularly in complex environments. In (Pontil et al., 2005; Paternain et al., 2020), a pair $(s, a)$ is sampled from trajectories to obtain an unbiased estimate of $\nabla_h U(\pi_h)$ . The accuracy of this estimate depends on the precision of the $Q$ -function approximation $Q^{\pi_h}(z)$ , for which actor-critic methods (Dastider & Lin, 2022) are employed to ensure more stable estimations. In this paper, the estimation of $\nabla_h U(\pi_h)$ is obtained from the one pair estimation in (Cervino et al., 2021)
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\nabla_ {h} \hat {U} (\pi_ {h}) = \eta K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} (a _ {k} - h (s _ {k})) \hat {Q} ^ {\pi_ {h}} (a _ {k}, s _ {k}), \tag {3}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\eta$ represents the learning rate.
|
| 72 |
+
|
| 73 |
+
# 2.2 VARIANCE REDUCTION AND DEEP KERNEL LEARNING
|
| 74 |
+
|
| 75 |
+
Variance in policy gradient is seen as the main factor influencing the performance of policy gradient algorithms (Hafner & Riedmiller, 2011). Aiming to reduce the variance, a series of classic reinforcement learning algorithms are proposed. Designed with the famous actor-critic framework (Grondman et al., 2012), baseline control variate is proposed for leveraging the vibration in $Q$ -function (Greensmith et al., 2004). It introduces a baseline function, which is mainly chosen as the state value function $V(s) = \mathbb{E}_a[Q(a,s)]$ , to eliminate unnecessary variance introduced by state values, which formulates as
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\nabla_ {w} \hat {U} (\pi_ {w}) = A ^ {\pi_ {w}} (a _ {k}, s _ {k}) \nabla_ {w} \log \pi_ {w} (a _ {k} | s _ {k}),
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $A^{\pi_w}(a_k, s_k) = Q^{\pi_w}(a_k, s_k) - V^{\pi_w}(s_k)$ is known as the advantage function. The update size of the policy gradient is further limited in the generalized advantage estimation method (Schulman et al., 2016) by introducing an iteration optimization algorithm for trust region policy optimization (Schulman et al., 2015). Combining the well-performance variance techniques, the proximal policy optimization (PPO) algorithm is proposed (Wu et al., 2021), achieving the overall best performance, which is viewed as the baseline algorithm in the successive research. The ultimate gradient $\nabla_w U(\pi_w)$ in PPO is formulated as
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
A ^ {\pi_ {w}} \left(a _ {k}, s _ {k}\right) \min \left(\frac {\pi_ {w} \left(a _ {k} \mid s _ {k}\right)}{\pi_ {w _ {-}} \left(a _ {k} \mid s _ {k}\right)}, \operatorname {c l i p} \left(\frac {\pi_ {w} \left(a _ {k} \mid s _ {k}\right)}{\pi_ {w _ {-}} \left(a _ {k} \mid s _ {k}\right)}, 1 - \epsilon , 1 + \epsilon\right)\right) \nabla_ {w} \log \pi_ {w} \left(a _ {k} \mid s _ {k}\right), \tag {4}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $\pi_{w_-(a|s)}$ represents the policy in the last iteration, and $\epsilon$ is the ratio of the clip, limiting the update size of the new policy. Based on this, the discovered policy optimisation (DPO) algorithm (Lu et al., 2022) is designed to further smooth the training process while encouraging the exploration, achieving the overall best performance.
|
| 88 |
+
|
| 89 |
+
Deep Kernel Learning is widely studied with the development of kernel methods and neural networks. Kernel methods can learn a wide range of conditional distributions and predictive functions conditioned on context sets of arbitrary sizes (Kim et al., 2019). However, their applicability is often constrained by the necessity of designing task-specific kernels. To address this limitation, deep learning techniques are introduced to parameterize observations through learnable network layers, giving rise to deep kernel learning (Wilson et al., 2016), which enhances the scalability and performance of the model on complex tasks. For example, (Papamarkou et al., 2024) employs deep kernel processes to improve digit classification accuracy, while (Kristiadi et al., 2020) incorporates kernels into ReLU networks for more efficient predictions. Moreover, wide residual networks can be interpreted as performing kernel regression within the associated RKHS (Lai et al., 2023), offering a theoretical explanation for the smoother functions they learn. This smoothness contributes to the networks' superior generalization capabilities (Tirer et al., 2022).
|
| 90 |
+
|
| 91 |
+
Despite the strong performance of deep kernel learning in typical deep learning tasks, few studies integrate deep learning methods with kernels in RKHS for policy gradient. To the best of our knowledge, this is the first paper to incorporate representation learning through neural networks into RKHS policy gradient methods for the rapid identification of locally optimal policies. We present a novel formulation of the RKHS policy gradient and provide a detailed analysis of the algorithm's stability.
|
| 92 |
+
|
| 93 |
+
# 3 PROPOSED METHOD: THE RESIDUAL KERNELPOLICY NETWORK
|
| 94 |
+
|
| 95 |
+
In this section, we introduce the proposed RKHS policy gradient method, ensuring a stable training process across multiple environments. We begin by analyzing the limitations in the current RKHS policy gradient: the insufficient representational capacity and the excessive variance. In order to enhance representational capacity for learning in complex environments, we describe representation learning in Section 3.2. This representation learning is integrated with a neural network updated using the Proximal Policy Optimization (PPO) algorithm, enabling the adaptive adjustment of observation distributions across different environments. In Section 3.3, we introduce advantage functions to reduce the variance in the RKHS gradient. Additionally, based on the representation learning, we design a residual layer as the baseline function for the RKHS policy to further minimize variance.
|
| 96 |
+
|
| 97 |
+
# 3.1 THE LIMITATIONS IN RKHS POLICY GRADIENT
|
| 98 |
+
|
| 99 |
+
In this section, a detailed analysis is conducted to illustrate two main drawbacks in the RKHS policy gradient: the insufficient representational capacity (Wilson et al., 2016) and excessive variance (Le et al., 2019).
|
| 100 |
+
|
| 101 |
+
Insufficient representational capacity is the primary issue limiting the learning adaptability of kernel methods (Wu & Wang, 2009). The hyperparameters of a kernel are highly sensitive to the distribution of input data, leading to under-fitting in uneven data distributions (Wang et al., 2020). A straightforward method to select hyperparameters is grid search (Hsu & Lin, 2002), while the computational complexity limits its use in high dimensional spaces. To adaptively learn the hyperparameters, they are modeled with linear functions or separation index. In (Wilson et al., 2016), the input of kernel is directly learned by neural networks, which achieves excellent performance in orientation extraction and magnitude recovery tasks. To illustrate the insufficient representational capacity of RKHS policies, we investigate their learning performance under different hyperparameter settings. Specifically, we employ the Gaussian kernel defined as $K(x,y) = \exp \left(-\frac{\|x - y\|^2}{\sigma^2}\right)$ to learn from observations, applying the gradient as described in Equation (3). As demonstrated in Figure 1a, the RKHS policy fails to update when $\sigma^2 = 0.01$ and 5.0. In contrast, episodic returns improve during training for $\sigma^2 = 0.05, 0.1, 0.5$ , and 1.0. To the best of our knowledge, there is currently no general method for performing RKHS policy learning across various environments that offers strong robustness and insensitivity to hyperparameters.
|
| 102 |
+
|
| 103 |
+
Excessive variance is a prevalent issue in policy gradient methods (Greensmith et al., 2004). When applying the RKHS policy gradient, the problem becomes more prominent. We now compare the variance of gradient between the RKHS policy and the linear policy $\pi_{\theta}(a|s)$ defined in Appendix.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
(a)
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
(b)
|
| 110 |
+
Figure 1: The insufficient representational capacity and excessive variance in RKHS policy gradient within Inverted Pendulum environment. (a) The learning performance choosing different $\sigma^2$ . (b) The variance in training for different kernels compared with linear policy.
|
| 111 |
+
|
| 112 |
+
A.1, where the corresponding estimated gradient is denoted as $\nabla_{\theta}\hat{U} (\pi_{\theta})$ . We can prove that the variance ratio $\mathcal{R} = \frac{\mathrm{Var}_{a_k}(\nabla_h\hat{U}(\pi_h))}{\mathrm{Var}_{a_k}(\nabla_\theta\hat{U}(\pi_\theta))}$ is highly dependent on the choice of kernel $K(\cdot ,\cdot)$ .
|
| 113 |
+
|
| 114 |
+
Lemma 3.1 (A.1) Assuming that $\hat{Q}^{\pi_{\theta}}(a,s)$ and $\hat{Q}^{\pi_h}(a,s)$ conditioned on $s_k$ are linear functions, i.e., $\hat{Q}^{\pi_{\theta}}(a,s_k) = c_1^\top a + d_1,\hat{Q}^{\pi_h}(a,s_k) = c_2^\top a + d_2,$ where $c_{1},d_{1},c_{2},d_{2}$ are learnable parameters. Then, when the dimension of the action space is 1, the variance ratio $\mathcal{R}$ satisfies:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathbb {E} _ {s _ {k}} \left[ \frac {\mathrm {V a r} _ {a _ {k}} (\nabla_ {h} \hat {U} (\pi_ {h}))}{\mathrm {V a r} _ {a _ {k}} (\nabla_ {\theta} \hat {U} (\pi_ {\theta}))} \right] \geq \mathbb {E} _ {s _ {k}} \left[ \frac {K ^ {2} (s _ {k} , s _ {k})}{s _ {k} ^ {2}} \frac {2 c _ {1} ^ {2}}{2 c _ {2} ^ {2} + \Sigma^ {- 1} (c _ {2} \theta^ {\top} s _ {k} + d _ {2}) ^ {2}} \right].
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
We prove Lemma 3.1 in Appendix. A.1. Following this, it is observed that the variance of the RKHS policy is highly dependent on the chosen kernel, which leads to excessive variance when a wide-bandwidth kernel is selected. We test three different kernels in the Inverted Pendulum environment, comparing them with linear policy in Figure 1b. The results illustrate that the variance of all three kernels is significantly higher than that of linear policy, which coincides with the findings in Lemma 3.1.
|
| 121 |
+
|
| 122 |
+
# 3.2 LEARNING REPRESENTATIONS FOR RKHS KERNEL
|
| 123 |
+
|
| 124 |
+
The neural networks enable the learning model to extract multiple features from data using the backpropagation algorithm (LeCun et al., 2015). In order to adjust the data distribution for compatibility with the RKHS kernel, observations are initially input into a neural network for feature representation, and the subsequently distribution-adjusted representations are utilized for gradient iteration in the RKHS policy. Without loss of generality, we use $\psi_{\vartheta}(\cdot)$ to represent the neural networks with parameters $\vartheta$ for representation learning, where the RKHS policy in Equation (2) is adapted as
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\pi_ {\vartheta , h, \boldsymbol {\Sigma}} (a | s) := \frac {1}{Z} e ^ {- \frac {1}{2} (h (\psi_ {\vartheta} (s)) - a) ^ {\top} \boldsymbol {\Sigma} ^ {- 1} (h (\psi_ {\vartheta} (s)) - a)}. \tag {5}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
For the sake of clarity, the parameters of the policy are defined as $\varpi = (\vartheta, h, \Sigma)$ . We update $\psi_{\vartheta}(\cdot)$ using the actor-critic scheme similar to the PPO algorithm, the critic $V_{\delta}^{\pi \varpi}$ is also modeled as neural networks with parameters $\delta$ , where the gradient derived from $TD$ error is formulated as
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\nabla_ {\delta} \widehat {T D} (\pi_ {\varpi}) = \frac {1}{N} \sum_ {t = 1} ^ {N} \nabla_ {\delta} \left[ \left(\hat {V} _ {\delta} ^ {\pi_ {\varpi}} (s _ {t}) - \hat {R} _ {t}\right) ^ {2} \right],
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where $\hat{R}_t$ is the target value (Wu et al., 2021). We use the operator $\mathcal{T}_{\pi_{\varpi}}(a_k,s_k)$ to represent the minimum calculation $\min \left(\frac{\pi_{\varpi}(a_k|s_k)}{\pi_{\varpi}(a_k|s_k)},\mathrm{clip}\left(\frac{\pi_{\varpi}(a_k|s_k)}{\pi_{\varpi}(a_k|s_k)},1 - \epsilon ,1 + \epsilon\right)\right)$ in Equation (4). Based on the chain rule in derivative, the gradient of the neural networks $\psi_{\vartheta}(\cdot)$ is also derived as
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\nabla_ {\vartheta} \hat {U} (\pi_ {\varpi}) = A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}) \mathcal {T} _ {\pi_ {\varpi}} (a _ {k}, s _ {k}) \Sigma^ {- 1} (a _ {k} - h (\psi_ {\vartheta} (s _ {k}))) \nabla_ {\vartheta} h (\psi_ {\vartheta} (s _ {k})).
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
This formulation resembles the loss function of the PPO algorithm, differing primarily in the inclusion of the RKHS function $h(\psi_{\vartheta}(s_k))$ , where $h$ is updated using the RKHS gradient with the only modification being that the state $s_k$ is represented by the neural network $\psi_{\vartheta}(s_k)$ :
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\nabla_ {h} \hat {U} (\pi_ {\varpi}) = \eta K (\psi_ {\vartheta} (s _ {k}), \cdot) \Sigma^ {- 1} (a _ {k} - h (\psi_ {\vartheta} (s _ {k}))) \hat {Q} ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}). \tag {6}
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
Following the gradient estimation, the Kernel Policy Network (KPN) algorithm is shown in Algorithm 1. It should be noticed that the $h$ function only updates for $L$ times to avoid the explosion of the gradient. Meanwhile, the update epoch is set to update parameters of neural networks for $J$ times in each training, ensuring sufficient learning of critic and representation networks. With the integration of representation neural networks $\psi_{\vartheta}(\cdot)$ , the RKHS policy can update dynamically during each training epoch. Experiment results show that the KPN algorithm achieves further better performance than pure RKHS policy even with tuned hyperparameters. Nevertheless, the excessive variance problem still exists, leading to the extreme reward cliff (Sullivan et al., 2022) in the training process.
|
| 149 |
+
|
| 150 |
+
# Algorithm 1 KPN algorithm
|
| 151 |
+
|
| 152 |
+
Hyperparameters: Total number of training steps $L$ , mini-batch size $N$ , step times of agent each training $T$ and the update epoch $J$ of critic and neural networks $\psi_{\vartheta}(\cdot)$ each training.
|
| 153 |
+
|
| 154 |
+
1: Initialize critic $V_{\delta}^{\pi_h}(s)$ , RKHS function $h = 0$ , actor $\pi_{\varpi}$ and replay buffer $\mathcal{B}$ .
|
| 155 |
+
2: Start with the initial state $s_0$
|
| 156 |
+
3: for $l = 1, \dots, L$ do
|
| 157 |
+
4: Using policy $\pi_{\varpi}$ , collect and store transitions $(s_t, a_t, r_t, s_{t+1})$ in replay buffer $\mathcal{B}$ .
|
| 158 |
+
5: for $j = 1,\dots ,J$ do
|
| 159 |
+
6: Sample mini-batch $\{(s_i, a_i, r_i, s_{i+1}) \mid i = 1, \dots, N\}$ from $\mathcal{B}$ .
|
| 160 |
+
7: Estimate the critic gradient $\nabla_{\delta}\widetilde{T}D$ ( $\pi_{\varpi}$ ) and update the parameters $\delta$ .
|
| 161 |
+
8: Estimate the neural networks $\psi_{\vartheta}(\cdot)$ gradient $\nabla_{\vartheta}\hat{U} (\pi_{\varpi})$ and update the parameters $\vartheta$
|
| 162 |
+
9: end for
|
| 163 |
+
10: Sample a transition $(s_i, a_i, r_i, s_{i+1})$ from $\mathcal{B}$ .
|
| 164 |
+
11: Estimate the RKHS gradient $\nabla_h\hat{U} (\pi_{\varpi})$ and update the function $h = h + \nabla_h\hat{U} (\pi_{\varpi})$
|
| 165 |
+
12: end for
|
| 166 |
+
|
| 167 |
+
# 3.3 THE RESIDUAL LAYER FOR VARIANCE REDUCTION
|
| 168 |
+
|
| 169 |
+
In this section, we introduce two proposed variance reduction methods designed for the KPN algorithm, attaining a stable training process.
|
| 170 |
+
|
| 171 |
+
The advantage function is widely used as a surrogate for the $Q$ -function in policy gradient methods. It is proven in (Weaver & Tao, 2001) that using the advantage function does not introduce bias into the estimation of the policy gradient $\nabla_w U(\pi_w)$ . In this paper, we introduce the advantage function to decrease the variance for RKHS policy gradient $\nabla_h \hat{U}(\pi_{\varpi})$ in the KPN algorithm. We adopt the gradient estimation in Equation 6 as:
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\nabla_ {h} \hat {U} _ {A} ^ {\pi \infty} (\pi_ {\varpi}) = \eta K (\psi_ {\vartheta} (s _ {k}), \cdot) \Sigma^ {- 1} \left(a _ {k} - h \left(\psi_ {\vartheta} (s _ {k})\right)\right) A ^ {\pi \infty} \left(a _ {k}, s _ {k}\right), \tag {7}
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
where $A^{\pi_{\varpi}}(a_k, s_k) = Q^{\pi_{\varpi}}(a_k, s_k) - V^{\pi_{\varpi}}(s_k)$ . We denote the introduced algorithm with advantage functions as AdvKPN. Moreover, based on the representation networks in KPN algorithm, the residual layer is specifically designed to diminish the variance in RKHS gradient.
|
| 178 |
+
|
| 179 |
+
The residual layer is initially introduced in resnet structure to address the vanishing gradient problem (He et al., 2016b). The key idea of the residual layer is to learn the additive residual function $\mathcal{F}(x) + f(x)$ , where $f(x)$ is usually chosen as the identity mapping $f(x) = x$ . It is assumed that when the $x$ is the optimal value, $\mathcal{F}$ will converge to the zero mapping to skip the network layer (He et al., 2016a). In this paper, inspired by the convergence property of the residual layer, we also design a fully connected layer for the AdvKPN algorithm to form the final ResKPN algorithm. The complete algorithmic scheme is illustrated in Figure 2, with step-by-step details provided in the subsequent text. The policy integrated with the residual layer is expressed as follows:
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\pi_ {\varpi , \iota} (a | s) := \frac {1}{Z} e ^ {- \frac {1}{2} (h (\psi_ {\vartheta} (s)) + \mu_ {\iota} (\psi_ {\vartheta} (s)) - a) ^ {\top} \Sigma^ {- 1} (h (\psi_ {\vartheta} (s)) + \mu_ {\iota} (\psi_ {\vartheta} (s)) - a)},
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 2: The scheme of the ResKPN algorithm.
|
| 187 |
+
|
| 188 |
+
where $\mu_{\iota}(\cdot)$ is the fully connected layer with parameters $\iota$ . Therefore, it is easily derived that our ultimate RKHS gradient:
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} (\pi_ {\varpi , \iota}) = \eta K (\psi_ {\vartheta} (s _ {k}), \cdot) \pmb {\Sigma} ^ {- 1} (a _ {k} - h (\psi_ {\vartheta} (s _ {k})) - \mu_ {\iota} (\psi_ {\vartheta} (s _ {k}))) A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}). \tag {8}
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
It should be noticed that the gradient of the representation network is also changed to $\nabla_{\vartheta}\hat{U} (\pi_{\varpi ,\iota})$ due to the integration of residual layer:
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
A ^ {\pi_ {\varpi}} \left(a _ {k}, s _ {k}\right) \mathcal {T} _ {\pi_ {\varpi}} \left(a _ {k}, s _ {k}\right) \boldsymbol {\Sigma} ^ {- 1} \left(a _ {k} - h \left(\psi_ {\vartheta} \left(s _ {k}\right)\right) - \mu_ {\iota} \left(\psi_ {\vartheta} \left(s _ {k}\right)\right)\right) \nabla_ {\vartheta} \left(h \left(\psi_ {\vartheta} \left(s _ {k}\right)\right) + \mu_ {\iota} \left(\psi_ {\vartheta} \left(s _ {k}\right)\right)\right). \tag {9}
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
Following this, the ResKPN algorithm is obtained by substituting the gradient of RKHS and the representation network in Algorithm 1 with Equation (9) and Equation (8). The advantage value $A^{\pi \varpi}(a_k,s_k)$ is computed by combining the state value $V(s_{k})$ , represented by the critic networks, with the reward $r(a_{k},s_{k})$ . The detailed methodology, along with supplementary explanations for Figure 2, is provided in Appendix B.1. Meanwhile, we can prove that the variance of the RKHS gradient above follows the following order:
|
| 201 |
+
|
| 202 |
+
Theorem 3.2 (A.2) Assuming that $Q^{\pi \varpi}(a_k, s_k) \geq \frac{1}{2} \mathbb{E}_{a_k} [Q^{\pi \varpi}(a_k, s_k)] = \frac{1}{2} V^{\pi \varpi}(s_k)$ and $a_k - h(\psi_{\vartheta}(s_k)) \geq \frac{1}{2} \mu_\iota(\psi_{\vartheta}(s_k))$ when they following the same policy $\pi_{\varpi,\iota}$ , the variance of the RKHS policy gradient gradually decreases as:
|
| 203 |
+
|
| 204 |
+
$$
|
| 205 |
+
\mathrm {V a r} _ {a _ {k}} (\nabla_ {h} \hat {U} (\pi_ {\varpi})) \geq \mathrm {V a r} _ {a _ {k}} (\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} (\pi_ {\varpi})) \geq \mathrm {V a r} _ {a _ {k}} (\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} (\pi_ {\varpi , \iota}))
|
| 206 |
+
$$
|
| 207 |
+
|
| 208 |
+
We prove Theorem 3.2 in Appendix. A.2. The introduction of the residual layer is motivated by the variance reduction properties observed in the advantage function. Specifically, by incorporating a baseline function $V^{\pi \varpi}(s_k) = \mathbb{E}_{a_k}[Q^{\pi \varpi}(a_k,s_k)]$ , which exhibits greater stability compared to $Q^{\pi \varpi}(a_k,s_k)$ , the variance during training can be decreased. Similarly, for RKHS policies, a stable baseline function can be leveraged to reduce the variance of the RKHS gradient, which is shown in the proof of Theorem 3.2. An ideal candidate for this baseline is the residual network $\mu_{\iota}(\cdot)$ . Furthermore, the integration of a fully connected layer enhances representation learning, and together, these two components jointly contribute to ResKPN's superior overall performance. To directly illustrate the variance reduction effect of this baseline function, an intuitive comparison is provided in Appendix C.
|
| 209 |
+
|
| 210 |
+
Based on the aforementioned adaptation, the RKHS policy retains non-parametric representations suitable for high-dimensional environments and enhances its representational capacity. Meanwhile, the excessive variance in the RKHS policy gradient is mitigated, resulting in a more stable learning process. The incorporation of a residual layer introduces an additional learner, leveraging the advantages of ensemble learning as well. In order to achieve the overall best performance, the techniques in PPO and DPO algorithms are also integrated into all algorithms proposed above to stabilize the training process, where the technique details are described in Appendix B.1.
|
| 211 |
+
|
| 212 |
+
# 4 EXPERIMENTAL RESULTS
|
| 213 |
+
|
| 214 |
+
In this section, various experiments are employed to verify the effectiveness of the representation learning and the variance reduction residual layer. We divide this section into three parts: (1) the environment setting of our experiment, (2) the comparison results including ablation study across multiple environments for the aforementioned algorithms, and (3) the analysis of the effectiveness of the proposed methods.
|
| 215 |
+
|
| 216 |
+
# 4.1 EXPERIMENT SETTING
|
| 217 |
+
|
| 218 |
+

|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 3: The episodic reward in multiple MuJoCo environments for proposed algorithms.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
|
| 231 |
+
We evaluate our proposed algorithm on six continuous control tasks from the MuJoCo environments (Todorov et al., 2012), including the Inverted Pendulum, Hopper, Half Cheetah, Walker2D, Humanoid, and Humanoid Standup. These tasks are ordered by increasing complexity, ranging from low to high. The primary objective of these environments is to optimize the performance of simulated robotic agents to enhance the forward progress and maintain stability with minimized energy consumption (Batra et al., 2024). The detailed setup of our experiment is described in Appendix B.
|
| 232 |
+
|
| 233 |
+
# 4.2 COMPARISONS
|
| 234 |
+
|
| 235 |
+
We compare our results with the original RKHS policy (Origin-Kernel), DPO algorithm and the widely used baseline PPO algorithm in the comparison. The episodic reward of the training agents serves as the primary metric for assessing the effectiveness of the algorithms. We show the training performance of different methods in Figure 3.
|
| 236 |
+
|
| 237 |
+
As illustrated in the figure, our ultimate model, ResKPN, achieves the overall best performance. It converges faster than other baseline algorithms in the Inverted Pendulum, Hopper, Humanoid, and Humanoid Standup environments, achieving up to $30\%$ higher episodic rewards compared to the DPO algorithm. In the Walker2D and Half Cheetah environments, ResKPN also attains comparable results, while both the PPO and DPO algorithms struggle to perform well in these settings. The RKHS policy with representation networks takes more time to explore initially, leading to lower episodic returns at the start of training, as shown in the Inverted Pendulum, Hopper, and Humanoid environments. However, after sufficient exploration of the environment space, the RKHS policy achieves higher episodic rewards due to its sampling efficiency.
|
| 238 |
+
|
| 239 |
+
Considering the ablation results, it is significant that the AdvKPN and KPN fail to learn effective policies in complex environments such as Humanoid and Humanoid Standup. This reflects how the ResKPN algorithm leverages the advantages of ensemble learning with integrated representation networks. In contrast, the original RKHS method can only achieve similar performance to other
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 4: The standard deviation in MuJoCo environments for proposed algorithms.
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
|
| 254 |
+
algorithms in the simpler Inverted Pendulum environment, while it fails to learn effectively in more complex scenarios.
|
| 255 |
+
|
| 256 |
+
We also present the training variance in Figure 4. We observe that when all algorithms succeed in learning the local optimal policy in the Inverted Pendulum environment, the ResKPN algorithm exhibits the most stable training process overall. After integrating the advantage functions, the variance in AdvKPN decreases significantly compared to the KPN algorithm, which exhibits the highest variance similar to that of the PPO algorithm. For the insufficient learning observed in KPN and AdvKPN algorithms within complex environments, their variances in these situations are abnormally lower than those of algorithms that successfully learn a good policy, indicated by dashed lines in the figure. When considering the learned policies, it is observed that the ResKPN algorithm achieves relatively low variance, except in the Humanoid environment. More experiment comparisons are shown in Appendix D.
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
(a)
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
(b)
|
| 263 |
+
Figure 5: The comparison of distributions and the learning performance after adjusting hyperparameters (a) The boxplot demonstrates the distribution differences of the observations (obs) and representations (rep) in different dimensions. (b) Comparison of episodic rewards for the RKHS policy with optimized hyperparameters versus alternative settings. The performance of the KPN algorithm is also illustrated.
|
| 264 |
+
|
| 265 |
+
# 4.3 ANALYSE FOR EFFECTIVENESS
|
| 266 |
+
|
| 267 |
+
In this section, we conduct a comprehensive evaluation addressing two key questions: (1) How effectively does representation learning adjust the observations of the original environment to align with the RKHS kernel? (2) Does the integration of advantage functions and the residual layer lead to a reduction in the variance of the RKHS gradient?
|
| 268 |
+
|
| 269 |
+
To answer (1), we consider the Gaussian kernel $K(x,y) = \exp \left(-\frac{\|x - y\|^2}{\sigma^2}\right)$ , where the hyperparameter $\sigma$ can be viewed as an scaling of the variance of the observation distribution. The setting of the hyperparameter can imitate the scaling of observation embedding learned by the representation learning approach. In detail, let $\mathrm{mean}(\mathrm{var}_{obs})$ denote the mean variance of the original observations, and $\mathrm{mean}(\mathrm{var}_{rep})$ represent the mean variance of the representations. Then the controller $\sigma$ is set as $\sigma^{*} = \sqrt{\frac{\mathrm{mean}(\mathrm{var}_{obs})}{\mathrm{mean}(\mathrm{var}_{rep})}}$ . The comparison of the distributions between observations and representations is illustrated in Figure 5a. It is shown that the representation networks tend to reduce the variance in the distribution of observations while maintaining a relatively unchanged mean. After tuning the hyperparameter, we observe a significant improvement in the learning performance of the RKHS policy, as shown in Figure 5b. The results indicate that the original RKHS policy achieves the best overall performance compared to other hyperparameter settings, although it still underperforms relative to the KPN, which dynamically processes observations through neural networks.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 6: The estimated variance in MuJoCo environments for proposed algorithms.
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
|
| 284 |
+
To answer (2), we utilize a classic variance estimation formula, with detailed methodology provided in Appendix B.2. The variance of the RKHS gradient across various environments is illustrated in Figure 6.
|
| 285 |
+
|
| 286 |
+
The results indicate that the introduction of advantage functions significantly reduces the variance in KPN. Nevertheless, ephemeral fluctuations are still observed, particularly in the Inverted Pendulum, Hopper, and Humanoid Standup environments. The ResKPN further mitigates these fluctuations during training, demonstrating a rapid decrease in gradient variance at the beginning of the training process, notably in the Humanoid and Walker2D environments.
|
| 287 |
+
|
| 288 |
+
# 5 CONCLUSION
|
| 289 |
+
|
| 290 |
+
In this paper, we examine the limitations of RKHS policies, focusing on how inadequate representation learning and excessive variance cause unstable training and low robustness across environments. To address these issues, we introduce the ResKPN model, which capitalizes on the high sample efficiency of RKHS policies. Our theoretical analysis of ResKPN is validated, confirming the effectiveness of the proposed variance reduction methods. Comprehensive experiments demonstrate that our algorithm outperforms baseline methods.
|
| 291 |
+
|
| 292 |
+
However, several challenges remain. Unlike gradient updates in neural networks, which use minibatches for averaging gradients, RKHS gradient updates cannot currently leverage minibatches due to computational complexity. Additionally, the kernel's separate learning of high-dimensional spaces may hinder performance in multi-agent settings. Future research will focus on kernel embedding techniques to enable batch RKHS gradient updates and on approximating kernel computations to improve sample efficiency and reduce variance.
|
| 293 |
+
|
| 294 |
+
# ACKNOWLEDGMENTS
|
| 295 |
+
|
| 296 |
+
We would like to acknowledge the support from the National Key R&D Program of China under Grant No. 2022ZD0160504 and the Shenzhen Key Laboratory of Ubiquitous Data Enabling under Grant No. ZDSYS20220527171406015.
|
| 297 |
+
|
| 298 |
+
# REFERENCES
|
| 299 |
+
|
| 300 |
+
Sumeet Batra, Bryon Tjanaka, Matthew Christopher Fontaine, Aleksei Petrenko, Stefanos Nikolaidis, and Gaurav S. Sukhatme. Proximal policy gradient arborescence for quality diversity reinforcement learning. In International Conference on Learning Representations, 2024.
|
| 301 |
+
Amrit Singh Bedi, Anjaly Parayil, Junyu Zhang, Mengdi Wang, and Alec Koppel. On the sample complexity and metastability of heavy-tailed policy search in continuous control. Journal of Machine Learning Research, 25(39):1-58, 2024.
|
| 302 |
+
Juan Cervino, Juan Andres Bazerque, Miguel Calvo-Fullana, and Alejandro Ribeiro. Multi-task reinforcement learning in reproducing kernel hilbert spaces via cross-learning. IEEE Transactions on Signal Processing, 69:5947-5962, 2021.
|
| 303 |
+
Zhitang Chen, Pascal Poupart, and Yanhui Geng. Online relative entropy policy search using reproducing kernel Hilbert space embeddings. In Artificial Intelligence and Statistics, pp. 573-581, 2016.
|
| 304 |
+
Apan Dastider and Mingjie Lin. Non-parametric stochastic policy gradient with strategic retreat for non-stationary environment. In 2022 IEEE 18th International Conference on Automation Science and Engineering, pp. 1377-1384, 2022.
|
| 305 |
+
Apan Dastider, Sayyed Jaffar Ali Raza, and Mingjie Lin. Learning adaptive control in dynamic environments using reproducing kernel priors with bayesian policy gradients. In Proceedings of the 37th ACM/SIGAPP Symposium on Applied Computing, pp. 748-757, 2022.
|
| 306 |
+
Daniel Freeman, Erik Frey, Anton Raichuk, Sertan Girgin, Igor Mordatch, and Olivier Bachem. Brax - a differentiable physics engine for large scale rigid body simulation. In Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks, 2021.
|
| 307 |
+
Evan Greensmith, Peter L Bartlett, and Jonathan Baxter. Variance reduction techniques for gradient estimates in reinforcement learning. The Journal of Machine Learning Research, 5:1471-1530, 2004.
|
| 308 |
+
Ivo Grondman, Lucian Busoniu, Gabriel AD Lopes, and Robert Babuska. A survey of actor-critic reinforcement learning: Standard and natural policy gradients. IEEE Transactions on Systems, Man, and Cybernetics, part C, 42(6):1291-1307, 2012.
|
| 309 |
+
Roland Hafner and Martin Riedmiller. Reinforcement learning in feedback control: Challenges and benchmarks from technical process control. Machine learning, 84:137-169, 2011.
|
| 310 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In Computer Vision-ECCV 2016: 14th European Conference 2016, Proceedings, Part IV 14, pp. 630-645, 2016a.
|
| 311 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770-778, 2016b.
|
| 312 |
+
Chih-Wei Hsu and Chih-Jen Lin. A comparison of methods for multiclass support vector machines. IEEE transactions on Neural Networks, 13(2):415-425, 2002.
|
| 313 |
+
Hyunjik Kim, Andriy Mnih, Jonathan Schwarz, Marta Garnelo, Ali Eslami, Dan Rosenbaum, Oriol Vinyals, and Yee Whye Teh. Attentive neural processes. arXiv preprint arXiv:1901.05761, 2019.
|
| 314 |
+
Agustinus Kristiadi, Matthias Hein, and Philipp Hennig. Being bayesian, even just a bit, fixes overconfidence in relu networks. In International conference on machine learning, pp. 5436-5446, 2020.
|
| 315 |
+
|
| 316 |
+
Jianfa Lai, Zixiong Yu, Songtao Tian, and Qian Lin. Generalization ability of wide residual networks. arXiv preprint arXiv:2305.18506, 2023.
|
| 317 |
+
Tuyen Pham Le, Vien Anh Ngo, P Marlith Jaramillo, and TaeChoong Chung. Importance sampling policy gradient algorithms in reproducing kernel hilbert space. Artificial Intelligence Review, 52: 2039-2059, 2019.
|
| 318 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436-444, 2015.
|
| 319 |
+
Guy Lever and Ronnie Stafford. Modelling policies in MDPS in Reproducing Kernel Hilbert Space. In Artificial intelligence and statistics, pp. 590-598, 2015.
|
| 320 |
+
Jiamin Liu and Heng Lian. Kernel-based decentralized policy evaluation for reinforcement learning. IEEE Transactions on Neural Networks and Learning Systems, pp. 1-10, 2024.
|
| 321 |
+
Chris Lu, Jakub Kuba, Alistair Letcher, Luke Metz, Christian Schroeder de Witt, and Jakob Foerster. Discovered policy optimisation. Advances in Neural Information Processing Systems, 35:16455-16468, 2022.
|
| 322 |
+
Bogdan Mazoure, Thang Doan, Tianyu Li, Vladimir Makarenkov, Joelle Pineau, Doina Precup, and Guillaume Rabusseau. Representation of reinforcement learning policies in reproducing kernel hilbert spaces. arXiv preprint arXiv:2002.02863, 2020.
|
| 323 |
+
Peter R Mcgillivray and DW Oldenburg. Methods for calculating fréchet derivatives and sensitivities for the non-linear inverse problem: A comparative study 1. Geophysical prospecting, 38(5):499-524, 1990.
|
| 324 |
+
Osval Antonio Montesinos López, Abelardo Montesinos López, and Jose Crossa. Reproducing kernel Hilbert spaces regression and classification methods. In Multivariate Statistical Machine Learning Methods for Genomic Prediction, pp. 251-336. 2022.
|
| 325 |
+
Theodore Papamarkou, Maria Skoularidou, Konstantina Palla, and Laurence et al. Aitchison. Position: Bayesian deep learning is needed in the age of large-scale AI. In Proceedings of the 41st International Conference on Machine Learning, pp. 39556-39586, 2024.
|
| 326 |
+
Santiago Paternain, Juan Andres Bazerque, Austin Small, and Alejandro Ribeiro. Stochastic policy gradient ascent in Reproducing Kernel Hilbert Spaces. IEEE Transactions on Automatic Control, 66(8):3429-3444, 2020.
|
| 327 |
+
Santiago Paternain, Juan Andres Bazerque, and Alejandro Ribeiro. Policy gradient for continuing tasks in discounted markov decision processes. IEEE Transactions on Automatic Control, 67(9): 4467-4482, 2022.
|
| 328 |
+
Massimiliano Pontil, Yiming Ying, and Ding-Xuan Zhou. Error analysis for online gradient descent algorithms in reproducing kernel hilbert spaces. Proceedings of Technical Report, pp. 1-20, 2005.
|
| 329 |
+
Xin Qian and Diego Klabjan. The impact of the mini-batch size on the variance of gradients in stochastic gradient descent. arXiv preprint arXiv:2004.13146, 2020.
|
| 330 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning, pp. 1889-1897, 2015.
|
| 331 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. High-dimensional continuous control using generalized advantage estimation. In International Conference on Learning Representations, 2016.
|
| 332 |
+
Torbjørn Smith and Olav Egeland. Learning of Hamiltonian dynamics with Reproducing Kernel Hilbert Spaces. In 2024 European Control Conference, pp. 3876-3883, 2024.
|
| 333 |
+
Ryan Sullivan, Jordan K Terry, Benjamin Black, and John P Dickerson. Cliff diving: Exploring reward surfaces in reinforcement learning environments. In International Conference on Machine Learning, pp. 20744-20776, 2022.
|
| 334 |
+
|
| 335 |
+
Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, 2018.
|
| 336 |
+
Tom Tirer, Joan Bruna, and Raja Giryes. Kernel-based smoothness analysis of residual networks. In Mathematical and Scientific Machine Learning, pp. 921-954. PMLR, 2022.
|
| 337 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026-5033, 2012.
|
| 338 |
+
Hailun Wang, Daxing Xu, and Alexander Martinez. Parameter selection method for support vector machine based on adaptive fusion of multiple kernel functions and its application in fault diagnosis. Neural Computing and Applications, 32(1):183-193, 2020.
|
| 339 |
+
Yiwen Wang and Jose C Principe. Reinforcement learning in reproducing kernel hilbert spaces. IEEE Signal Processing Magazine, 38(4):34-45, 2021.
|
| 340 |
+
Lex Weaver and Nigel Tao. The optimal reward baseline for gradient-based reinforcement learning. In Proceedings of the Seventeenth Conference on Uncertainty in Artificial Intelligence, pp. 538-545, 2001.
|
| 341 |
+
Andrew Gordon Wilson, Zhiting Hu, Ruslan Salakhutdinov, and Eric P Xing. Deep kernel learning. In Artificial intelligence and statistics, pp. 370-378, 2016.
|
| 342 |
+
Kuo-Ping Wu and Sheng-De Wang. Choosing the kernel parameters for support vector machines by the inter-cluster distance in the feature space. Pattern Recognition, 42(5):710-717, 2009.
|
| 343 |
+
Zifan Wu, Chao Yu, Deheng Ye, Junge Zhang, haiyin piao, and Hankz Hankui Zhuo. Coordinated proximal policy optimization. In Advances in Neural Information Processing Systems, pp. 26437-26448, 2021.
|
| 344 |
+
Tingting Zhao, Hirotaka Hachiya, Gang Niu, and Masashi Sugiyama. Analysis and improvement of policy gradient estimation. Advances in Neural Information Processing Systems, 24:262-270, 2011.
|
| 345 |
+
|
| 346 |
+
# A VARIANCE ANALYSE
|
| 347 |
+
|
| 348 |
+
# A.1 THE VARIANCE RATIO
|
| 349 |
+
|
| 350 |
+
In this section, we provide a proof to Lemma 3.1, which indicates that the variance ratio $\mathcal{R}$ satisfies:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\mathbb {E} _ {s _ {k}} \left[ \frac {\operatorname {V a r} _ {a _ {k}} (\nabla_ {h} \hat {U} (\pi_ {h}))}{\operatorname {V a r} _ {a _ {k}} (\nabla_ {\theta} \hat {U} (\pi_ {\theta}))} \right] \geq \mathbb {E} _ {s _ {k}} \left[ \frac {K ^ {2} (s _ {k} , s _ {k})}{s _ {k} ^ {2}} \frac {2 c _ {1} ^ {2}}{2 c _ {2} ^ {2} + \Sigma^ {- 1} (c _ {2} \theta^ {\top} s _ {k} + d _ {2}) ^ {2}} \right].
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
First, we define the linear policy.
|
| 357 |
+
|
| 358 |
+
Definition A.1 (Linear policy) The linear policy $\pi_{\theta}(a|s)$ is modeled as
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\pi_ {\theta} (a | s) = \frac {1}{Z} e ^ {- \frac {1}{2} (\theta^ {\top} s - a) ^ {\top} \Sigma^ {- 1} (\theta^ {\top} s - a)},
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
where $\theta$ is the trainable parameter for policy. Linear policy embeds state $s$ in a linear manner as $\theta^{\top}s$ .
|
| 365 |
+
|
| 366 |
+
Comparing with RKHS policy in Equation (2), the only difference of lienar policy is the modeling of the mean vector $\theta^{\top}s$ and $h(s)$ . Therefore, the estimated gradient of linear policy $\nabla_{\theta}\hat{U} (\pi_{\theta})$ is derived (Zhao et al., 2011) as
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\nabla_ {\theta} \hat {U} (\pi_ {\theta}) = \eta \cdot s _ {k} \pmb {\Sigma} ^ {- 1} (a _ {k} - \theta^ {\top} s _ {k}) \hat {Q} ^ {\pi_ {\theta}} (a _ {k}, s _ {k}).
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
Then, we apply this definition in the variance ratio $\mathcal{R}$ . Considering the expectation of variance ratio conditioned on $\vartheta$ , combine with Eq. 3, we can have the variance ratio $\mathcal{R}$ as
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\begin{array}{l} \mathcal {R} = \frac {\mathrm {V a r} _ {a _ {k}} (\nabla_ {h} \hat {U} (\pi_ {h}))}{\mathrm {V a r} _ {a _ {k}} (\nabla_ {\theta} \hat {U} (\pi_ {\theta}))} = \frac {\eta^ {2} \mathrm {V a r} _ {a _ {k}} (K (s _ {k} , \cdot) \Sigma^ {- 1} (a _ {k} - h (s _ {k})) \hat {Q} ^ {\pi_ {h}} (a _ {k} , s _ {k}))}{\eta^ {2} \mathrm {V a r} _ {a _ {k}} (s _ {k} \Sigma^ {- 1} (a _ {k} - \theta^ {\top} s _ {k}) \hat {Q} ^ {\pi_ {\theta}} (a _ {k} , s _ {k}))} \\ = \frac {\left\langle K (s _ {k} , \cdot) , K (s _ {k} , \cdot) \right\rangle \operatorname {V a r} _ {a _ {k}} \left(K (s _ {k} , \cdot) \Sigma^ {- 1} (a _ {k} - h (s _ {k})) \hat {Q} ^ {\pi_ {h}} (a _ {k} , s _ {k})\right)}{s _ {k} ^ {2} \operatorname {V a r} _ {a _ {k}} (\Sigma^ {- 1} (a _ {k} - \theta^ {\top} s _ {k}) \hat {Q} ^ {\pi_ {\theta}} (a _ {k} , s _ {k}))} \\ = \frac {K (s _ {k} , s _ {k}) \operatorname {V a r} _ {a _ {k}} (K (s _ {k} , \cdot) \Sigma^ {- 1} (a _ {k} - h (s _ {k})) \hat {Q} ^ {\pi_ {h}} (a _ {k} , s _ {k}))}{s _ {k} ^ {2} \operatorname {V a r} _ {a _ {k}} (\Sigma^ {- 1} (a _ {k} - \theta^ {\top} s _ {k}) \hat {Q} ^ {\pi_ {\theta}} (a _ {k} , s _ {k}))}, \\ \end{array}
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
where the last step uses the reproducing kernel property that $\forall x,y,\langle K(x,\cdot),K(y,\cdot)\rangle = K(x,y)$
|
| 379 |
+
|
| 380 |
+
Considering the Assumption A.1 that $\hat{Q}^{\pi_{\theta}}(a_k,s_k)$ and $\hat{Q}^{\pi_h}(a_k,s_k)$ are linear functions conditioned on $s_k$ , i.e., $\hat{Q}^{\pi_{\theta}}(a,s_k) = c_1^\top a + d_1$ , $\hat{Q}^{\pi_h}(a,s_k) = c_2^\top a + d_2$ , we can have that
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
\mathcal {R} = \frac {K (s _ {k} , s _ {k}) \operatorname {V a r} _ {a _ {k}} (\Sigma^ {- 1} (a _ {k} - h (s _ {k})) (c _ {1} a _ {k} + d _ {1}))}{s _ {k} ^ {2} \operatorname {V a r} _ {a _ {k}} (\Sigma^ {- 1} (a _ {k} - \theta^ {\top} s _ {k}) (c _ {2} a _ {k} + d _ {2}))}.
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
We first consider the variance in the numerator part. Denote $y = \Sigma^{-\frac{1}{2}}(a_k - h(s_k))$ , then we have that $y \sim \mathcal{N}(0,1)$ , then we can write $\mathrm{Var}\left(\Sigma^{-1}(a_k - h(s_k))(c_1a_k + d_1)\right) = \mathrm{Var}\left(\Sigma^{-\frac{1}{2}}y(c_1a_k + d_1)\right)$ . Further, we have
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\begin{array}{l} \operatorname {V a r} \left(\Sigma^ {- \frac {1}{2}} y \left(c _ {1} a _ {k} + d _ {1}\right)\right) \\ = \mathbb {E} \left[ \left(\Sigma^ {- \frac {1}{2}} y \left(c _ {1} a _ {k} + d _ {1}\right)\right) ^ {2} \right] - \left(\mathbb {E} \left[ \Sigma^ {- \frac {1}{2}} y \left(c _ {1} a _ {k} + d _ {1}\right) \right]\right) ^ {2} \\ = \Sigma^ {- 1} \mathbb {E} \left[ \left(y (c _ {1} (\Sigma^ {\frac {1}{2}} y + h (s _ {k})) + d _ {1})\right) ^ {2} \right] - \left(\mathbb {E} \left[ \Sigma^ {- \frac {1}{2}} y (c _ {1} (\Sigma^ {\frac {1}{2}} y + h (s _ {k})) + d _ {1}) \right]\right) ^ {2} \\ = \Sigma^ {- 1} \left[ c _ {1} ^ {2} \Sigma \mathbb {E} [ y ^ {4} ] + 2 c _ {1} \Sigma^ {\frac {1}{2}} \left(c _ {1} h \left(s _ {k}\right) + d _ {1}\right) \mathbb {E} [ y ^ {3} ] + \left(c _ {1} h \left(s _ {k}\right) + d _ {1}\right) ^ {2} \mathbb {E} [ y ^ {2} ] \right] \\ \left. - \left(c _ {1} \mathbb {E} [ y ^ {2} ] + \left(c _ {1} h (s _ {k}) + d _ {1}\right) \mathbb {E} [ y ]\right) ^ {2} \right. \\ = \Sigma^ {- 1} \left[ c _ {1} ^ {2} \Sigma \cdot 3 + 2 c _ {1} \Sigma^ {\frac {1}{2}} \left(c _ {1} h \left(s _ {k}\right) + d _ {1}\right) \cdot 0 + \left(c _ {1} h \left(s _ {k}\right) + d _ {1}\right) ^ {2} \cdot 1 \right] \\ - \left(c _ {1} \cdot 1 + \left(c _ {1} h \left(s _ {k}\right) + d _ {1}\right) \cdot 0\right) ^ {2} \\ = 3 c _ {1} ^ {2} + \Sigma^ {- 1} \left(c _ {1} h \left(s _ {k}\right) + d _ {1}\right) ^ {2} - c _ {1} ^ {2} \\ = 2 c _ {1} ^ {2} + \Sigma^ {- 1} \left(c _ {1} h \left(s _ {k}\right) + d _ {1}\right) ^ {2}. \\ \end{array}
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
Using the similar method, the variance $\mathrm{Var}_{a_k}(\nabla_\theta \hat{U} (\pi_\theta))$ is derived as $2c_2^2 +\Sigma^{-1}(c_2\theta^\top s_k + d_2)^2$ Therefore, the variance ratio is
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\mathcal {R} = \frac {K ^ {2} (s _ {k} , s _ {k})}{s _ {k} ^ {2}} \frac {2 c _ {1} ^ {2} + \Sigma^ {- 1} (c _ {1} h (s _ {k}) + d _ {1}) ^ {2}}{2 c _ {2} ^ {2} + \Sigma^ {- 1} (c _ {2} s _ {k} + d _ {2}) ^ {2}} \geq \frac {K ^ {2} (s _ {k} , s _ {k})}{s _ {k} ^ {2}} \frac {2 c _ {1} ^ {2}}{2 c _ {2} ^ {2} + \Sigma^ {- 1} (c _ {2} \theta^ {\top} s _ {k} + d _ {2}) ^ {2}}.
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
In this case,
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\mathbb {E} _ {s _ {k}} \left[ \frac {\mathrm {V a r} _ {a _ {k}} (\nabla_ {h} \hat {U} (\pi_ {h}))}{\mathrm {V a r} _ {a _ {k}} \nabla_ {\theta} \hat {U} (\pi_ {\theta}))} \right] \geq \mathbb {E} _ {s _ {k}} \left[ \frac {K ^ {2} (s _ {k} , s _ {k})}{s _ {k} ^ {2}} \frac {2 c _ {1} ^ {2}}{2 c _ {2} ^ {2} + \Sigma^ {- 1} (c _ {2} \theta^ {\top} s _ {k} + d _ {2}) ^ {2}} \right].
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
# A.2 THE VARIANCE IN DIFFERENT RKHS GRADIENT ALGORITHMS
|
| 405 |
+
|
| 406 |
+
In this section, we prove the Theorem 3.2.
|
| 407 |
+
|
| 408 |
+
Advantage Function Effect First, we prove that $\operatorname{Var}_{a_k}(\nabla_h\hat{U} (\pi_{\varpi}))\geq \operatorname{Var}_{a_k}(\nabla_h\hat{U}_{A^{\pi_\infty}}(\pi_{\varpi}))$
|
| 409 |
+
|
| 410 |
+
For simplification of notations, we denote $\mathrm{Var}_{a_k}(\nabla_h\hat{U}_{A^{\pi_{\varpi}}}\left(\pi_{\varpi}\right)) = \mathbb{E}_{a_k}\left[(\Gamma_A - \mathbb{E}_{a_k}\left[\Gamma_A\right])^2\right]$ with
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\Gamma_ {A} = \nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} (\pi_ {\varpi}) = \nabla \log \pi_ {\varpi} (a _ {k} | s _ {k}) A ^ {\pi_ {\varpi}},
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
and $\mathrm{Var}_{a_k}(\nabla_h\hat{U} (\pi_{\varpi})) = \mathbb{E}_{a_k}[(\Gamma_Q - \mathbb{E}_{a_k}[\Gamma_Q])^2 ]$ with
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\Gamma_ {Q} = \nabla_ {h} \hat {U} (\pi_ {\varpi}) = \nabla \log \pi_ {\varpi} (a _ {k} | s _ {k}) Q ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}).
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
Similarly, we can denote that $\Gamma_V = \mathbb{E}_{a_k}[(\Gamma_V)^2]$ with $\nabla \log \pi_{\varpi}(a_k|s_k)V^{\pi_{\varpi}}(s_k)$ . Since $A^{\pi_{\varpi}} = Q^{\pi_{\varpi}}(a_k,s_k) - V^{\pi_{\varpi}}(s_k)$ , we can derive that:
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\begin{array}{l} \Gamma_ {A} - \mathbb {E} _ {a _ {k}} \left[ \begin{array}{c} \Gamma_ {A} \end{array} \right] \\ = \nabla \log \pi_ {\varpi} \left(a _ {k} | s _ {k}\right) A ^ {\pi_ {\varpi}} - \mathbb {E} _ {a _ {k}} \left[ \nabla \log \pi_ {\varpi} \left(a _ {k} | s _ {k}\right) A ^ {\pi_ {\varpi}} \right] \\ = \nabla \log \pi_ {\varpi} (a _ {k} | s _ {k}) \left(Q ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}) - V ^ {\pi_ {\varpi}} (s _ {k})\right) - \mathbb {E} _ {a _ {k}} \left[ \nabla \log \pi_ {\varpi} (a _ {k} | s _ {k}) \left(Q ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}) - V ^ {\pi_ {\varpi}} (s _ {k})\right) \right] \\ = \left(\nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) Q ^ {\pi_ {\varpi}} \left(a _ {k}, s _ {k}\right) - \mathbb {E} _ {a _ {k}} \left[ \nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) Q ^ {\pi_ {\varpi}} \left(a _ {k}, s _ {k}\right) \right]\right) - \\ \left(\nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) V ^ {\pi_ {\varpi}} \left(s _ {k}\right) - \mathbb {E} _ {a _ {k}} \left[ \nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) V ^ {\pi_ {\varpi}} \left(s _ {k}\right) \right]\right) \\ = \left(\Gamma_ {Q} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {Q} \right]\right) - \left(\Gamma_ {V} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {V} \right]\right). \\ \end{array}
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
Therefore, we have that
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\begin{array}{l} \operatorname {V a r} _ {a _ {k}} \left(\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} \left(\pi_ {\varpi}\right)\right) \\ = \mathbb {E} _ {a _ {k}} \left[ \left(\Gamma_ {A} - \mathbb {E} _ {a _ {k}} [ \Gamma_ {A} ]\right) ^ {2} \right] \\ = \mathbb {E} _ {a _ {k}} \left[ \left(\left(\Gamma_ {Q} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {Q} \right]\right) - \left(\Gamma_ {V} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {V} \right]\right)\right) ^ {2} \right] \\ = \mathbb {E} _ {a _ {k}} \left[ \left(\Gamma_ {Q} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {Q} \right]\right) ^ {2} - 2 \left(\Gamma_ {Q} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {Q} \right]\right) \left(\Gamma_ {V} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {V} \right]\right) + \left(\Gamma_ {V} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {V} \right]\right) ^ {2} \right] \\ = \operatorname {V a r} _ {a _ {k}} \left(\nabla_ {h} \hat {U} (\pi_ {\varpi})\right) + \mathbb {E} _ {a _ {k}} \left[ - 2 \left(\Gamma_ {Q} - \mathbb {E} _ {a _ {k}} [ \Gamma_ {Q} ]\right) (\Gamma_ {V}) + (\Gamma_ {V}) ^ {2} \right] \\ = \operatorname {V a r} _ {a _ {k}} \left(\nabla_ {h} \hat {U} \left(\pi_ {\varpi}\right)\right) + \mathbb {E} _ {a _ {k}} \left[ \left(\Gamma_ {V}\right) ^ {2} - 2 \Gamma_ {Q} \Gamma_ {V} \right] \\ = \operatorname {V a r} _ {a _ {k}} \left(\nabla_ {h} \hat {U} (\pi_ {\varpi})\right) + \left(V ^ {\pi_ {\varpi}}\right) ^ {2} (s _ {k}) \mathbb {E} _ {a _ {k}} \left[ \left\langle \nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right), \nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) \right\rangle \right] - \\ 2 V ^ {\pi_ {\infty}} \left(s _ {k}\right) \mathbb {E} _ {a _ {k}} \left[ \left\langle \nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) Q ^ {\pi_ {\infty}} \left(a _ {k}, s _ {k}\right), \nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) \right\rangle \right], \\ \end{array}
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
where we use the $\mathbb{E}_{a_k}\left[\nabla \log \pi_{\varpi}(a_k|s_k)V^{\pi_{\varpi}}(s_k)\right] = 0$ property for $\nabla \log \pi_{\varpi}(a_k|s_k)$ (Weaver & Tao, 2001). Therefore, it is easily derived that
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\begin{array}{l} \Gamma_ {Q} ^ {2} - \Gamma_ {A} ^ {2} = - \left(V ^ {\pi_ {\infty}}\right) ^ {2} \mathbb {E} _ {a _ {k}} \left[ \left\langle \nabla \log \pi_ {\varpi} \left(a _ {k} | s _ {k}\right), \nabla \log \pi_ {\varpi} \left(a _ {k} | s _ {k}\right) \right\rangle \right] + \\ 2 V ^ {\pi_ {\infty}} \left(s _ {k}\right) \mathbb {E} _ {a _ {k}} \left[ \left\langle \nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) Q ^ {\pi_ {\infty}} \left(a _ {k}, s _ {k}\right), \nabla \log \pi_ {\varpi} \left(a _ {k} \mid s _ {k}\right) \right\rangle \right] \\ \geq 0, \\ \end{array}
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
where the last inequality uses the assumption $Q^{\pi_{\varpi}}(a_k, s_k) \geq \frac{1}{2} \mathbb{E}_{a_k} [Q^{\pi_{\varpi}}(a_k, s_k)] = \frac{1}{2} V^{\pi_{\varpi}}(s_k)$ .
|
| 441 |
+
|
| 442 |
+
Therefore, it is shown that $\mathrm{Var}_{a_k}(\nabla_h\hat{U} (\pi_{\varpi}))\geq \mathrm{Var}_{a_k}(\nabla_h\hat{U}_{A^{\pi_\varpi}}(\pi_{\varpi}))$
|
| 443 |
+
|
| 444 |
+
Residual Effect Now we consider the variance of $\nabla_h\hat{U}_{A^{\pi \varpi}}(\pi_{\varpi ,\iota})$ . Similarly, we write $\mathrm{Var}_{a_k}(\nabla_h\hat{U}_{A^{\pi \varpi}}(\pi_{\varpi ,\iota})) = \mathbb{E}_{a_k}\left[(\Gamma_{h,\mu} - \mathbb{E}_{a_k}\left[\Gamma_{h,\mu}\right])^2\right],$ where $\Gamma_{h,\mu} = \nabla_{h}\hat{U}_{A^{\pi \varpi}}(\pi_{\varpi ,\iota}) =$ $\mathrm{K}(s_k,\cdot)\Sigma^{-1}(a_k - h(\psi_\vartheta (s_k)) - \mu_\iota (\psi_\vartheta (s_k)))A^{\pi \varpi}(a_k,s_k).$ Additionally, we denote that $\mathrm{Var}_{a_k}(\nabla_h\hat{U}_{A^{\pi \varpi}}(\pi_{\varpi})) = \mathbb{E}_{a_k}\left[(\Gamma_h - \mathbb{E}_{a_k}\left[\Gamma_h\right])^2\right]$ with $\Gamma_h = \mathrm{K}(s_k,\cdot)\Sigma^{-1}(a_k -$ $h(\psi_{\vartheta}(s_k)))A^{\pi \varpi}(a_k,s_k)$ and $\Gamma_{\mu} = \mathrm{K}(s_k,\cdot)\Sigma^{-1}(\mu_{\iota}(\psi_{\vartheta}(s_k)))A^{\pi \varpi}(a_k,s_k)$ . Like the derivations in the advantage function effect, it is easily observed that
|
| 445 |
+
|
| 446 |
+
$$
|
| 447 |
+
\Gamma_ {h, \mu} - \mathbb {E} _ {a _ {k}} [ \Gamma_ {h, \mu} ] = (\Gamma_ {h} - \mathbb {E} _ {a _ {k}} [ \Gamma_ {h} ]) - (\Gamma_ {\mu} - \mathbb {E} _ {a _ {k}} [ \Gamma_ {\mu} ]).
|
| 448 |
+
$$
|
| 449 |
+
|
| 450 |
+
Based on the definition, we have that
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
\begin{array}{l} \operatorname {V a r} _ {a _ {k}} \left(\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} \left(\pi_ {\varpi , \iota}\right)\right) \\ = \mathbb {E} _ {a _ {k}} \left[ \left(\Gamma_ {h, \mu} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {h, \mu} \right]\right) ^ {2} \right] \\ = \mathbb {E} _ {a _ {k}} \left[ \left(\left(\Gamma_ {h} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {h} \right]\right) - \left(\Gamma_ {\mu} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {\mu} \right]\right)\right) ^ {2} \right] \\ = \operatorname {V a r} _ {a _ {k}} \left(\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} \left(\pi_ {\varpi}\right)\right) + \mathbb {E} _ {a _ {k}} \left[ - 2 \left(\Gamma_ {h} - \mathbb {E} _ {a _ {k}} \left[ \Gamma_ {h} \right]\right) \left(\Gamma_ {\mu}\right) + \left(\Gamma_ {\mu}\right) ^ {2} \right] \\ = \Gamma_ {A} ^ {2} + \mathbb {E} _ {a _ {k}} \left[ \langle - 2 K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} (a _ {k} - h (\psi_ {\vartheta} (s _ {k}))) A ^ {\pi_ {\infty}} (a _ {k}, s _ {k}), K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} \mu_ {\iota} (\psi_ {\vartheta} (s _ {k})) A ^ {\pi_ {\infty}} (a _ {k}, s _ {k}) \rangle \right. \\ \left. \right.\left. + \left\langle \mathrm {K} \left(s _ {k}, \cdot\right) \Sigma^ {- 1} \mu_ {\iota} \left(\psi_ {\vartheta} \left(s _ {k}\right)\right) A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}), \mathrm {K} \left(s _ {k}, \cdot\right) \Sigma^ {- 1} \mu_ {\iota} \left(\psi_ {\vartheta} \left(s _ {k}\right)\right) A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}) \right\rangle\right], \\ \end{array}
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
where we use the property $\mathbb{E}_{a_k}\left[\mathrm{K}(s_k,\cdot)\Sigma^{-1}\mu_\iota (\psi_\vartheta (s_k))A^{\pi_{\varpi}}(a_k,s_k)\right] = 0$ due to $\mathbb{E}_{a_k}[A^{\pi_{\varpi}}(a_k,s_k)] = 0$ , then we can derive that
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
\begin{array}{l} \operatorname {V a r} _ {a _ {k}} \left(\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\infty}}} (\pi_ {\varpi})\right) - \operatorname {V a r} _ {a _ {k}} \left(\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} (\pi_ {\varpi , t})\right) \\ = \mathbb {E} _ {a _ {k}} \left[ \left\langle 2 K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} (a _ {k} - h (\psi_ {\vartheta} (s _ {k}))) A ^ {\pi_ {\infty}} (a _ {k}, s _ {k}), K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} \mu_ {\iota} (\psi_ {\vartheta} (s _ {k})) A ^ {\pi_ {\infty}} (a _ {k}, s _ {k}) \right\rangle \right. \\ \left. \right.\left. - \left\langle K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} \mu_ {\iota} (\psi_ {\vartheta} (s _ {k})) A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}), K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} \mu_ {\iota} (\psi_ {\vartheta} (s _ {k})) A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}) \right\rangle\right] \\ \geq \mathbb {E} _ {a _ {k}} \left[ \langle K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} \mu_ {\iota} (\psi_ {\vartheta} (s _ {k})) A ^ {\pi_ {\infty}} (a _ {k}, s _ {k}), K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} \mu_ {\iota} (\psi_ {\vartheta} (s _ {k})) A ^ {\pi_ {\infty}} (a _ {k}, s _ {k}) \rangle \right. \\ \left. \right.\left. - \left\langle K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} \mu_ {\iota} (\psi_ {\vartheta} (s _ {k})) A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}), K (s _ {k}, \cdot) \boldsymbol {\Sigma} ^ {- 1} \mu_ {\iota} (\psi_ {\vartheta} (s _ {k})) A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}) \right\rangle\right] \\ \geq 0 \\ \end{array}
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
Therefore we can attain that $\operatorname{Var}_{a_k}(\nabla_h\hat{U} (\pi_{\varpi}))\geq \operatorname{Var}_{a_k}(\nabla_h\hat{U}_{A^{\pi_{\varpi}}}\left(\pi_{\varpi}\right))\geq$ $\operatorname{Var}_{a_k}(\nabla_h\hat{U}_{A^{\pi_{\varpi}}}\left(\pi_{\varpi ,\iota}\right))$ where the last inequality uses the assumption $a_{k} - h(\psi_{\vartheta}(s_{k}))\geq$ $\frac{1}{2}\mu_{\iota}(\psi_{\vartheta}(s_k))$
|
| 463 |
+
|
| 464 |
+
# B DETAILS IN EXPERIMENT
|
| 465 |
+
|
| 466 |
+
The experimental details are shown in this section, including a scheme figure of the ResKPN algorithm, the techniques in PPO and DPO integrated with the proposed algorithms, the function to estimate the variance of the RKHS gradient, and the hyperparameters in the experiments.
|
| 467 |
+
|
| 468 |
+
Without loss of generality, we adopt the Gaussian kernel for the experiments due to its well-established properties in capturing smooth and continuous relationships in high-dimensional spaces. To leverage GPU acceleration for training and simulation, we utilize the Brax simulator, which is developed using Jax (Freeman et al., 2021). The experiments are conducted on a cluster server, with each experiment utilizing an NVIDIA RTX A6000 GPU and 32 cores of an Intel(R) Xeon(R) Gold 5218 CPU running at $2.30\mathrm{GHz}$ .
|
| 469 |
+
|
| 470 |
+
# B.1 THE IMPLEMENTATION DETAILS IN RESKPN
|
| 471 |
+
|
| 472 |
+
The methodology scheme of ResKPN is shown in Figure 7, where $\nabla_{\iota}\hat{U} (\pi_{\varpi ,\iota})$ represents the gradient in the residual layer $\mu_{\iota}(\psi_{\vartheta}(\cdot))$ , and the notation FC means the Fully Connected layer, which composes the representation networks. The observations are initially input into the representation networks for distribution adjustment. Both RKHS function $h(\psi_{\vartheta}(s_k))$ and residual layer
|
| 473 |
+
|
| 474 |
+

|
| 475 |
+
Figure 7: The scheme of the ResKPN algorithm.
|
| 476 |
+
|
| 477 |
+
$\mu_{\iota}(\psi_{\vartheta}(s_k)))$ uses the representations for action choosing. Additionally, the covariance matrix $\Sigma^{-1}$ is parameterized as the network parameters, which are updated through the backpropagation. The main difference between ResKPN and AdvKPN algorithm is the usage of the residual layer, stabilizing the training process.
|
| 478 |
+
|
| 479 |
+
To leverage the classic variance reduction techniques, We employ the techniques of Proximal Policy Optimization (PPO) algorithms in the KPN, AdvKPN, and ResKPN algorithms to reduce variance. Specifically, the optimization objective in PPO utilizes Trust Region Policy Optimization (TRPO) (Schulman et al., 2015), which we adapt to optimize our gradient. The optimization objective in TRPO is given by
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\underset {\theta} {\text {m a x i m i z e}} \quad \hat {\mathbb {E}} _ {k} \left[ \frac {\pi_ {\theta} \left(a _ {k} \mid s _ {k}\right)}{\pi_ {\theta_ {\mathrm {o l d}}} \left(a _ {k} \mid s _ {k}\right)} \hat {A} _ {k} \right]
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
\text {s u b j e c t} \quad \hat {\mathbb {E}} _ {k} \left[ \mathrm {K L} \left[ \pi_ {\theta_ {\text {o l d}}} (\cdot | s _ {k}), \pi_ {\theta} (\cdot | s _ {k}) \right] \right] \leq \delta ,
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
where $\theta_{\mathrm{old}}$ represents the parameters before the update. Inspired by this formulation, since
|
| 490 |
+
|
| 491 |
+
$$
|
| 492 |
+
\frac {\nabla \pi_ {h} (a _ {k} \mid s _ {k})}{\pi_ {h _ {\mathrm {o l d}}} (a _ {k} \mid s _ {k})} = \frac {\pi_ {h} (a _ {k} \mid s _ {k})}{\pi_ {h _ {\mathrm {o l d}}} (a _ {k} \mid s _ {k})} \nabla \log \pi_ {h} (a _ {k} \mid s _ {k}),
|
| 493 |
+
$$
|
| 494 |
+
|
| 495 |
+
we adapt the RKHS policy gradient by scaling the original gradient with the policy ratio $\frac{\pi_h(a_k|s_k)}{\pi_{h_{\mathrm{old}}}(a_k|s_k)}$ . Additionally, we incorporate the clipping technique used in PPO, where the policy ratio is clipped as follows:
|
| 496 |
+
|
| 497 |
+
$$
|
| 498 |
+
\min \left(\frac {\pi_ {h} (a _ {k} \mid s _ {k})}{\pi_ {h _ {\mathrm {o l d}}} (a _ {k} \mid s _ {k})}, \operatorname {c l i p} \left(\frac {\pi_ {h} (a _ {k} \mid s _ {k})}{\pi_ {h _ {\mathrm {o l d}}} (a _ {k} \mid s _ {k})}, 1 - \epsilon , 1 + \epsilon\right)\right).
|
| 499 |
+
$$
|
| 500 |
+
|
| 501 |
+
The threshold value $\epsilon$ is set to 0.2 in the PPO algorithm. In contrast, we set $\epsilon$ to 1 in the RKHS policy to encourage more exploration, leveraging the high sample efficiency of the RKHS gradient. To balance the exploration-exploitation trade-off, we introduce the drift function $\mathcal{D}$ from Discovered Policy Optimization (DPO). The main difference between DPO and the PPO algorithm is the inclusion of a drift function that depends on the advantage function values, allowing the adjustment of hyperparameters to control the degree of exploration and exploitation in the policy. The drift function is calculated as:
|
| 502 |
+
|
| 503 |
+
$$
|
| 504 |
+
\mathcal {D} = \left\{ \begin{array}{l l} \max \left(0, \left(\frac {\pi_ {h} (a _ {k} \mid s _ {k})}{\pi_ {h _ {\mathrm {o l d}}} (a _ {k} \mid s _ {k})} - 1\right) A ^ {\pi_ {\varpi}} - \alpha_ {\mathcal {D}} \tanh \left(\frac {\left(\frac {\pi_ {h} (a _ {k} \mid s _ {k})}{\pi_ {h _ {\mathrm {o l d}}} (a _ {k} \mid s _ {k})} - 1\right) A ^ {\pi_ {\varpi}}}{\alpha_ {\mathcal {D}}}\right)\right), & \text {i f} A ^ {\pi_ {\varpi}} \geq 0, \\ \max \left(0, \frac {\pi_ {h} (a _ {k} \mid s _ {k})}{\pi_ {h _ {\mathrm {o l d}}} (a _ {k} \mid s _ {k})} A ^ {\pi_ {\varpi}} - \beta_ {\mathcal {D}} \tanh \left(\frac {\frac {\pi_ {h} (a _ {k} \mid s _ {k})}{\pi_ {h _ {\mathrm {o l d}}} (a _ {k} \mid s _ {k})} A ^ {\pi_ {\varpi}}}{\beta_ {\mathcal {D}}}\right)\right), & \text {o t h e r w i s e}, \end{array} \right.
|
| 505 |
+
$$
|
| 506 |
+
|
| 507 |
+
where the hyperparameters $\alpha_{\mathcal{D}}$ and $\beta_{\mathcal{D}}$ balance the exploration and exploitation of the policy. The drift function $\mathcal{D}$ is integrated into the RKHS gradient as:
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\nabla_ {h} \hat {U} _ {A ^ {\pi_ {\varpi}}} (\pi_ {\varpi , \iota}) = \eta K (\psi_ {\vartheta} (s _ {k}), \cdot) \pmb {\Sigma} ^ {- 1} \left(a _ {k} - h (\psi_ {\vartheta} (s _ {k})) - \mu_ {\iota} (\psi_ {\vartheta} (s _ {k}))\right) \left(A ^ {\pi_ {\varpi}} (a _ {k}, s _ {k}) - \mathcal {D}\right).
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
Table 1: Comparison of Hyperparameters among ResKPN, PPO, and DPO.
|
| 514 |
+
|
| 515 |
+
<table><tr><td>Parameter</td><td>ResKPN</td><td>PPO</td><td>DPO</td></tr><tr><td>Optimization</td><td></td><td></td><td></td></tr><tr><td>Learning Rate</td><td>3 × 10-4</td><td>3 × 10-4</td><td>3 × 10-4</td></tr><tr><td>Learning Rate for RKHS</td><td>1 × 10-1</td><td>N/A</td><td>N/A</td></tr><tr><td>Adam for RKHS</td><td>0.9</td><td>N/A</td><td>N/A</td></tr><tr><td>Max Gradient Norm</td><td>0.5</td><td>0.5</td><td>0.5</td></tr><tr><td>Environment</td><td></td><td></td><td></td></tr><tr><td>Number of Environments in Parallel</td><td>2048</td><td>2048</td><td>2048</td></tr><tr><td>Training Schedule</td><td></td><td></td><td></td></tr><tr><td>Number of Steps per Update</td><td>10</td><td>10</td><td>10</td></tr><tr><td>Total Timesteps</td><td>5 × 107</td><td>5 × 107</td><td>5 × 107</td></tr><tr><td>Number of minibatches</td><td>32</td><td>32</td><td>32</td></tr><tr><td>Algorithm Specific</td><td></td><td></td><td></td></tr><tr><td>GAE Lambda</td><td>0.95</td><td>0.95</td><td>0.95</td></tr><tr><td>Clip Epsilon</td><td>0.2</td><td>0.2</td><td>0.2</td></tr><tr><td>Clip Epsilon for RKHS</td><td>1</td><td>N/A</td><td>N/A</td></tr><tr><td>DPO Alpha</td><td>2.0</td><td>N/A</td><td>2.0</td></tr><tr><td>DPO Beta</td><td>0.6</td><td>N/A</td><td>0.6</td></tr><tr><td>DPO Alpha RKHS</td><td>1</td><td>N/A</td><td>N/A</td></tr><tr><td>DPO Beta RKHS</td><td>0.6</td><td>N/A</td><td>N/A</td></tr><tr><td>Model Architecture</td><td></td><td></td><td></td></tr><tr><td>Feature Dimension</td><td>256</td><td>N/A</td><td>N/A</td></tr><tr><td>Activation Function</td><td>tanh</td><td>tanh</td><td>tanh</td></tr></table>
|
| 516 |
+
|
| 517 |
+
# B.2 THE ESTIMATION OF VARIANCE IN THE RKHS GRADIENT
|
| 518 |
+
|
| 519 |
+
To estimate the variance of RKHS gradient in the experiment, we conduct $\mathcal{G}$ parallel experiments. It is observed that the RKHS gradient can be denoted as $\alpha_{t}K(s_{t},\cdot)$ , where $\alpha_{t}$ represents the coefficient including the learning rate, the derivative of log policy and the $Q$ -function value or advantage function, and the kernel is determined by the observations $s_t$ . Therefore, we can derive the following
|
| 520 |
+
|
| 521 |
+
variance estimation equation:
|
| 522 |
+
|
| 523 |
+
$$
|
| 524 |
+
\begin{array}{l} \widehat {\operatorname {V a r}} _ {a _ {k}, s _ {k}} (\nabla_ {\theta} \hat {U} (\pi_ {h})) = \frac {1}{\mathcal {G}} \sum_ {t = 1} ^ {\mathcal {G}} \langle \alpha_ {t} K (s _ {t}, \cdot) - \frac {1}{\mathcal {G}} \sum_ {i = 1} ^ {\mathcal {G}} \alpha_ {i} K (s _ {i}, \cdot), \alpha_ {t} K (s _ {t}, \cdot) - \frac {1}{\mathcal {G}} \sum_ {i = 1} ^ {\mathcal {G}} \alpha_ {i} K (s _ {i}, \cdot) \rangle \\ = \frac {1}{\mathcal {G}} \sum_ {t = 1} ^ {\mathcal {G}} \left[ \alpha_ {t} K \left(s _ {t}, s _ {t}\right) \alpha_ {t} ^ {\top} - 2 \alpha_ {t} \frac {1}{\mathcal {G}} \sum_ {i = 1} ^ {\mathcal {G}} K \left(s _ {i}, s _ {t}\right) \alpha_ {i} ^ {\top} + \frac {1}{\mathcal {G} ^ {2}} \sum_ {i = 1} ^ {\mathcal {G}} \sum_ {j = 1} ^ {\mathcal {G}} \alpha_ {i} K \left(s _ {i}, s _ {j}\right) \alpha_ {j} ^ {\top} \right], \tag {10} \\ \end{array}
|
| 525 |
+
$$
|
| 526 |
+
|
| 527 |
+
where we use the reproducing property of the RKHS kernel.
|
| 528 |
+
|
| 529 |
+
# B.3 HYPERPARAMETERS IN THE EXPERIMENT
|
| 530 |
+
|
| 531 |
+
The hyperparameters for PPO, DPO and ResKPN are shown in Table 1. The Max Gradient Norm only limits the gradient update of the representation networks in ResKPN. We run environments in parallel based on the JAX, which supports the acceleration of simulation in GPUs. All experiments run for $5 \times 10^{7}$ steps to compare the learning speed and convergence performance.
|
| 532 |
+
|
| 533 |
+
# C MORE EXPLANATIONS FOR THE VARIANCE REDUCTION EFFECT IN THE RESIDUAL LAYER
|
| 534 |
+
|
| 535 |
+
One of the main reasons that the advantage function $A^{\pi \varpi}(a_k, s_k) = Q^{\pi \varpi}(a_k, s_k) - V^{\pi \varpi}(s_k)$ can reduce the variance of the gradient is the natural properties that $V^{\pi \varpi}(s_k) = \mathbb{E}_{a_k}[Q^{\pi \varpi}(a_k, s_k)]$ , which indicates that the state value function $V^{\pi \varpi}(s_k)$ is potentially stable than the Q-function $Q^{\pi \varpi}(a_k, s_k)$ (Greensmith et al., 2004). We compare these three values in the Hopper environment, which is shown in Figure 8. It can be seen that after subtracting the state value function $V^{\pi \varpi}(s_k)$ , the advantage function shows more stability and a low-value curve, which avoids the overestimation (Greensmith et al., 2004).
|
| 536 |
+
|
| 537 |
+

|
| 538 |
+
Figure 8: The variance reduction by introducing the advantage function in Hopper environment.
|
| 539 |
+
|
| 540 |
+
Inspired by the baseline function in the advantage framework, we introduce the residual layer $\mu_{\iota}(\cdot)$ as a "baseline function" within the RKHS policy. This addition significantly enhances training stability compared to the RKHS function $h(\cdot)$ . To demonstrate the variance reduction achieved by the residual layer, we compare the values of $a_{k} - h(\psi_{\vartheta}(s_{k})) - \mu_{\iota}(\psi_{\vartheta}(s_{k}))$ , $a_{k} - h(\psi_{\vartheta}(s_{k}))$ , and $\mu_{\iota}(\psi_{\vartheta}(s_{k}))$ in Figures 9 and 10, across the Inverted Pendulum and Hopper environments. These comparisons reveal that introducing the residual layer as a "baseline function" stabilizes the product term $(a_{k} - h(\psi_{\vartheta}(s_{k})) - \mu_{\iota}(\psi_{\vartheta}(s_{k})))$ relative to the original RKHS term $(a_{k} - h(\psi_{\vartheta}(s_{k})))$ . This stabilization directly contributes to the variance reduction in the RKHS gradient:
|
| 541 |
+
|
| 542 |
+
$$
|
| 543 |
+
\nabla_ {h} \hat {U} _ {A ^ {\pi \infty}} (\pi_ {\varpi , \iota}) = \eta K (\psi_ {\vartheta} (s _ {k}), \cdot) \boldsymbol {\Sigma} ^ {- 1} (a _ {k} - h (\psi_ {\vartheta} (s _ {k})) - \mu_ {\iota} (\psi_ {\vartheta} (s _ {k}))) A ^ {\pi \infty} (a _ {k}, s _ {k}).
|
| 544 |
+
$$
|
| 545 |
+
|
| 546 |
+
This also provides additional evidence supporting the correctness of Theorem 3.2.
|
| 547 |
+
|
| 548 |
+

|
| 549 |
+
(a)
|
| 550 |
+
|
| 551 |
+

|
| 552 |
+
(b)
|
| 553 |
+
|
| 554 |
+

|
| 555 |
+
Figure 9: Variance reduction achieved by introducing the residual layer $\mu_{\iota}(\cdot)$ in the Inverted Pendulum environment. (a) Comparison of $a_{k} - h(\psi_{\vartheta}(s_{k}))$ and $\mu_{\iota}(\psi_{\vartheta}(s_k))$ . (b) Comparison of $a_{k} - h(\psi_{\vartheta}(s_{k}))$ and $a_{k} - h(\psi_{\vartheta}(s_{k})) - \mu_{\iota}(\psi_{\vartheta}(s_{k}))$ .
|
| 556 |
+
(a)
|
| 557 |
+
|
| 558 |
+

|
| 559 |
+
(b)
|
| 560 |
+
Figure 10: Variance reduction achieved by introducing the residual layer $\mu_{\iota}(\cdot)$ in the Hopper environment. (a) Comparison of $a_{k} - h(\psi_{\vartheta}(s_{k}))$ and $\mu_{\iota}(\psi_{\vartheta}(s_k))$ . (b) Comparison of $a_{k} - h(\psi_{\vartheta}(s_{k}))$ and $a_{k} - h(\psi_{\vartheta}(s_{k})) - \mu_{\iota}(\psi_{\vartheta}(s_{k}))$ .
|
| 561 |
+
|
| 562 |
+
# D MORE EXPERIMENT COMPARISONS
|
| 563 |
+
|
| 564 |
+
# D.1 MORE VARIANCE REDUCTION METHODS COMPARISON
|
| 565 |
+
|
| 566 |
+
In this section, we delve into variance reduction techniques from related literature and present an experiment on the minibatch method to highlight the distinctions and advantages of our approach compared to prior research.
|
| 567 |
+
|
| 568 |
+
Table 2: Variance Reduction Methods for RKHS Policies.
|
| 569 |
+
|
| 570 |
+
<table><tr><td>Paper</td><td>Variance Reduction Method</td><td>Tested Environment</td><td>State</td><td>Action</td></tr><tr><td>(Le et al., 2019)</td><td>Learning rate search / Kernel matching pursuit</td><td>Quadrotor Navigation</td><td>13</td><td>3</td></tr><tr><td>(Paternain et al., 2020)</td><td>Symmetric estimation</td><td>Self-Charging Surveillance Robot</td><td>3</td><td>2</td></tr><tr><td>(Mazoure et al., 2020)</td><td>Predefined kernel orthogonal basis</td><td>Pendulum</td><td>3</td><td>1</td></tr><tr><td>(Wang & Principe, 2021)</td><td>Kernel orthogonal bases clustering</td><td>Nonhuman primate performing an obstacle-avoidance task</td><td>/</td><td>1</td></tr></table>
|
| 571 |
+
|
| 572 |
+
Table 2 summarizes various variance reduction methods for RKHS-based reinforcement learning policies, highlighting their tested environments, techniques, and applicable state-action dimensions. These approaches, while effective in specific scenarios, face significant challenges when applied to high-dimensional environments like MuJoCo. For instance, the model-based method in (Paternain et al., 2020) reduces gradient variance by averaging gradients of symmetric transitions, a strategy
|
| 573 |
+
|
| 574 |
+
that is effective in simple tasks such as self-charging surveillance robots but struggles in complex settings where symmetric transitions are difficult to identify. Similarly, (Le et al., 2019) introduces a kernel matching pursuit method that reduces variance through gradient regression, yet it suffers from computational instability in tasks with large state-action spaces, such as those found in MuJoCo environments.
|
| 575 |
+
|
| 576 |
+
The method in (Mazoure et al., 2020) proposes truncating RKHS embeddings to represent policies using kernel orthogonal bases, theoretically reducing Q-function variance. However, its reliance on partitioning the state space into fixed bins renders it impractical for high-dimensional environments. For example, in the Hopper environment with a 17-dimensional state space, even simple binary division across dimensions leads to an exponential number of kernel bases, making the approach computationally infeasible. Similarly, (Wang & Principe, 2021) employs an online clustering method to aggregate kernel orthogonal bases, reducing computational costs and variance in neural signal processing tasks. While this technique offers valuable insights, its focus on Q-function learning rather than policy gradient optimization, coupled with the bias introduced by clustering, limits its applicability to RKHS policy frameworks in high-dimensional settings. These methods collectively underscore the challenges of applying variance reduction techniques effectively in complex environments like MuJoCo, where computational efficiency and scalability remain critical obstacles.
|
| 577 |
+
|
| 578 |
+
Although variance reduction techniques have been specifically designed for RKHS gradients, minibatch gradient computation (Qian & Klabjan, 2020) is widely adopted in deep learning and many machine learning tasks due to its effectiveness in stabilizing gradient updates. However, applying minibatch gradients directly to RKHS methods introduces significant computational challenges. The mean of RKHS gradients must be explicitly expressed as $\sum_{i=1}^{n} \alpha_i K(s_i, \cdot)$ , where $n$ represents the minibatch size. This results in a quadratic increase in computational complexity as $n$ grows, making minibatch gradients computationally prohibitive for RKHS-based methods.
|
| 579 |
+
|
| 580 |
+
To evaluate the impact of minibatch size on computational cost, we conducted experiments with varying minibatch sizes in two environments, and the results are summarized in Table 3.
|
| 581 |
+
|
| 582 |
+
Table 3: Training Time for Different Minibatch Sizes Across Environments (in minutes).
|
| 583 |
+
|
| 584 |
+
<table><tr><td rowspan="2">Environment</td><td colspan="5">Training Time (min.)/ Minibatch Size n</td></tr><tr><td>n = 1</td><td>n = 2</td><td>n = 3</td><td>n = 4</td><td>n = 5</td></tr><tr><td>Half Cheetah</td><td>13.19</td><td>61.25</td><td>140.74</td><td>199.49</td><td>205.07</td></tr><tr><td>Hopper</td><td>10.83</td><td>58.91</td><td>123.12</td><td>169.03</td><td>202.61</td></tr></table>
|
| 585 |
+
|
| 586 |
+
The results demonstrate that training time increases quadratically with minibatch size in both the Hopper and Half Cheetah environments. For example, using a minibatch size of $n = 5$ requires over three additional hours of computation compared to $n = 1$ . These findings underscore the computational infeasibility of employing minibatch gradients in RKHS-based methods for high-dimensional environments. Despite the significant computational cost, using minibatches remains important due to their ability to reduce training variance. We conducted experiments with a minibatch size of $n = 2$ (as larger sizes are prohibitively slow) to evaluate training performance and variance, as shown in Figures 11 and 12. These figures indicate that the training performance with $n = 2$ minibatches shows minimal differences compared to the original approach. However, incorporating an additional transition per training period effectively reduces the variance of both AdvKPN and ResKPN, highlighting the potential of the minibatch approach.
|
| 587 |
+
|
| 588 |
+
If the computational cost associated with minibatches can be addressed, we believe that this design has the potential to further reduce variance in RKHS policy methods, offering a promising direction for future research.
|
| 589 |
+
|
| 590 |
+
# D.2 EXPERIMENTS ON OTHER ENVIRONMENTS
|
| 591 |
+
|
| 592 |
+
In this section, we extend the experimental evaluation of our proposed algorithms to two additional environments: Pusher and Reacher. The episodic rewards obtained during training are presented in Figure 13.
|
| 593 |
+
|
| 594 |
+

|
| 595 |
+
Figure 11: The episodic reward in Hopper environment for minibatch size $n = 2$ .
|
| 596 |
+
|
| 597 |
+

|
| 598 |
+
Figure 12: The standard deviation in Hopper environment for minibatch size $n = 2$ .
|
| 599 |
+
|
| 600 |
+

|
| 601 |
+
Figure 13: The episodic reward in Pusher and Reacher environments for proposed algorithms.
|
| 602 |
+
|
| 603 |
+
It is illustrated in the Figure 13 that the ResKPN consistently achieves the best performance in the Pusher environment. In the Reacher environment, all algorithms except KPN and Origin-Kernel converge to the optimal reward. This demonstrates the robustness of ResKPN, particularly in complex environments requiring precise control. To further analyze stability during training, the standard deviations of the episodic rewards for the proposed algorithms are shown in Figure 14. From Fig-
|
| 604 |
+
|
| 605 |
+

|
| 606 |
+
Figure 14: The standard deviation in Pusher and Reacher environments for proposed algorithms.
|
| 607 |
+
|
| 608 |
+
ure 14, it is evident that ResKPN, DPO, and AdvKPN achieve the smallest overall variance in the Pusher environment, indicating stable learning dynamics. In the Reacher environment, while all algorithms (except KPN) converge, the PPO algorithm exhibits significant oscillations in the final phase of training. In contrast, algorithms such as ResKPN maintain high stability throughout training. These supplementary results further demonstrate the efficacy and robustness of the proposed ResKPN algorithm.
|
| 609 |
+
|
| 610 |
+
# D.3 OTHER ABLATION EXPERIMENTS
|
| 611 |
+
|
| 612 |
+
In this section, we investigate whether the integration of a residual layer can enhance the performance or reduce the training variance of PPO and DPO algorithms. The episodic rewards during training across multiple MuJoCo environments are illustrated in Figure 15.
|
| 613 |
+
|
| 614 |
+

|
| 615 |
+
Figure 15: The episodic reward in multiple MuJoCo environments for additional baseline algorithms.
|
| 616 |
+
|
| 617 |
+
The results show that the PPO-res algorithm exhibits improvements in Walker2D and Hopper, maintains similar performance in Half Cheetah and Humanoid Standup, but experiences a decline in performance in Inverted Pendulum and Humanoid. For DPO-res, its performance remains largely
|
| 618 |
+
|
| 619 |
+
unchanged, with a slight decrease observed in Half Cheetah. A plausible explanation for this trend is that the existing neural network structures in PPO and DPO may already provide sufficiently well-learned representations, rendering the addition of a residual layer less impactful. The residual layer might only offer benefits in specific cases, such as addressing issues of overfitting or gradient dispersion. However, it does not function as an additional representation learning component, as it does in ResKPN, to further enhance performance.
|
| 620 |
+
|
| 621 |
+
The variance reduction effect of integrating the residual layer with AdvKPN is another significant consideration. The standard deviations during training for the additional baseline algorithms are presented in Figure 16.
|
| 622 |
+
|
| 623 |
+

|
| 624 |
+
|
| 625 |
+

|
| 626 |
+
|
| 627 |
+

|
| 628 |
+
|
| 629 |
+

|
| 630 |
+
Figure 16: The standard deviation in multiple MuJoCo environments for additional baseline algorithms.
|
| 631 |
+
|
| 632 |
+

|
| 633 |
+
|
| 634 |
+

|
| 635 |
+
|
| 636 |
+
As shown in Figure 16, the addition of the residual layer has minimal impact on training variance across all tested environments. Both PPO-res and DPO-res maintain similar variance levels to their respective baselines, PPO and DPO. This can be attributed to the similar gradient calculation mechanisms used in PPO, DPO, and their residual-layer variants. Adding a residual layer directly into the neural network architecture may not effectively reduce variance in these cases.
|
| 637 |
+
|
| 638 |
+
In contrast, for policies with inherently high variance, such as KPN and AdvKPN, integrating a stable learner, like the residual network, significantly stabilizes training, as demonstrated in our theoretical analysis and the visualizations provided in Appendix C. This highlights the effectiveness of the residual layer in scenarios where the original policy struggles with variance-related instability.
|
| 639 |
+
|
| 640 |
+
# D.4 ALTERNATIVE KERNEL CHOICES
|
| 641 |
+
|
| 642 |
+
In this section, we evaluate alternative kernel choices within the ResKPN algorithm by testing Linear, Laplacian, and Sigmoid kernels, and comparing their performance against the Gaussian kernel and the PPO algorithm. The episodic rewards achieved by ResKPN with different kernels across multiple MuJoCo environments are presented in Figure 17. As shown in the figure, the Gaussian kernel achieves the best overall performance, with the Laplacian kernel yielding comparable episodic rewards. The Sigmoid kernel performs slightly worse but still outperforms PPO in most environments, except for Half Cheetah. The Linear kernel, however, produces the lowest performance due to its inability to capture non-linear relationships, which are critical for complex tasks requiring intricate patterns and interactions. We also examine the variance in episodic rewards, as shown in Figure 18.
|
| 643 |
+
|
| 644 |
+
Observing the figure, it is evident that ResKPN with Gaussian, Sigmoid, and Laplacian kernels exhibits similar stability, with relatively low variance across episodes in most environments. In contrast, the Linear kernel demonstrates significantly higher variance, especially in complex environments such as Half Cheetah and Hopper. This elevated variance underscores the limitations of the Linear kernel, as its inability to model non-linear relationships results in less stable and reliable performance.
|
| 645 |
+
|
| 646 |
+

|
| 647 |
+
|
| 648 |
+

|
| 649 |
+
|
| 650 |
+

|
| 651 |
+
|
| 652 |
+

|
| 653 |
+
Figure 17: The episodic reward in multiple MuJoCo environments for ResKPN within different kernels.
|
| 654 |
+
|
| 655 |
+

|
| 656 |
+
|
| 657 |
+

|
| 658 |
+
|
| 659 |
+

|
| 660 |
+
|
| 661 |
+

|
| 662 |
+
|
| 663 |
+

|
| 664 |
+
|
| 665 |
+

|
| 666 |
+
Figure 18: The standard deviation in multiple MuJoCo environments for ResKPN within different kernels.
|
| 667 |
+
|
| 668 |
+

|
| 669 |
+
|
| 670 |
+

|
| 671 |
+
|
| 672 |
+
# E THE COMPUTATIONAL COST
|
| 673 |
+
|
| 674 |
+
In this section, we show the computational cost in Table 4. All algorithms are accelerated using JAX, significantly reducing computation time (Freeman et al., 2021). Among the tested methods, PPO and DPO exhibit the lowest overall computational costs. Integrating the RKHS policy with representation learning increases computation time due to the additional computational requirements of the RKHS function, which vary depending on the chosen kernel. Specifically, Linear ResKPN and Sigmoid ResKPN achieve moderate computation times, whereas Gaussian ResKPN and Laplacian ResKPN exhibit the highest computational costs, attributed to the intensive calculations required for these kernels.
|
| 675 |
+
|
| 676 |
+
A comparison of episodic reward performance and computational costs reveals a trade-off between performance and efficiency. For applications prioritizing policy performance, the Gaussian or Laplacian kernel may be preferred due to their superior episodic rewards. Conversely, for scenarios emphasizing computational efficiency while maintaining reasonable policy performance, the Sigmoid kernel offers a balanced alternative. The choice of kernel should be guided by the specific requirements and constraints of the application environment.
|
| 677 |
+
|
| 678 |
+
Table 4: Runtime Comparison Across Different Algorithms and Environments (in minutes).
|
| 679 |
+
|
| 680 |
+
<table><tr><td>Environment</td><td>KPN</td><td>Gaussian ResKPN</td><td>PPO</td><td>DPO</td><td>Laplacian ResKPN</td><td>Linear ResKPN</td><td>Sigmoid ResKPN</td></tr><tr><td>Half Cheetah</td><td>13.09</td><td>13.18</td><td>3.95</td><td>4.68</td><td>14.21</td><td>6.08</td><td>6.24</td></tr><tr><td>Humanoid Standup</td><td>13.70</td><td>13.77</td><td>2.08</td><td>2.14</td><td>12.56</td><td>7.37</td><td>6.61</td></tr><tr><td>Inverted Pendulum</td><td>10.29</td><td>10.31</td><td>3.50</td><td>3.86</td><td>11.22</td><td>2.60</td><td>2.63</td></tr><tr><td>Walker2d</td><td>11.00</td><td>11.06</td><td>3.69</td><td>4.12</td><td>10.59</td><td>3.55</td><td>3.69</td></tr><tr><td>Hopper</td><td>10.69</td><td>10.80</td><td>1.54</td><td>1.55</td><td>13.56</td><td>3.30</td><td>3.34</td></tr><tr><td>Humanoid</td><td>13.07</td><td>13.23</td><td>2.13</td><td>2.28</td><td>15.43</td><td>5.96</td><td>6.12</td></tr></table>
|
2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4271d2a69c40deefcea07bfe41734c87d1e3fe433fc1ce72408ecef0bc854037
|
| 3 |
+
size 1610698
|
2025/Residual Kernel Policy Network_ Enhancing Stability and Robustness in RKHS-Based Reinforcement Learning/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Stream Analysis with Multi-Layer SAEs/c5f0cfd3-597a-4802-9eab-e315341b6fe2_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Stream Analysis with Multi-Layer SAEs/c5f0cfd3-597a-4802-9eab-e315341b6fe2_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual Stream Analysis with Multi-Layer SAEs/c5f0cfd3-597a-4802-9eab-e315341b6fe2_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3dd600ca5bcb5a1581aa3d52a497110acfe0b08335cbca473035656edc7bbd2a
|
| 3 |
+
size 8595885
|
2025/Residual Stream Analysis with Multi-Layer SAEs/full.md
ADDED
|
@@ -0,0 +1,748 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RESIDUAL STREAM ANALYSIS WITH MULTI-LAYER SAES
|
| 2 |
+
|
| 3 |
+
Tim Lawson* Lucy Farnik Conor Houghton Laurence Aitchison
|
| 4 |
+
|
| 5 |
+
School of Engineering Mathematics and Technology
|
| 6 |
+
|
| 7 |
+
University of Bristol
|
| 8 |
+
|
| 9 |
+
Bristol, UK
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Sparse autoencoders (SAEs) are a promising approach to interpreting the internal representations of transformer language models. However, SAEs are usually trained separately on each transformer layer, making it difficult to use them to study how information flows across layers. To solve this problem, we introduce the multi-layer SAE (MLSAE): a single SAE trained on the residual stream activation vectors from every transformer layer. Given that the residual stream is understood to preserve information across layers, we expected MLSAE latents to 'switch on' at a token position and remain active at later layers. Interestingly, we find that individual latents are often active at a single layer for a given token or prompt, but the layer at which an individual latent is active may differ for different tokens or prompts. We quantify these phenomena by defining a distribution over layers and considering its variance. We find that the variance of the distributions of latent activations over layers is about two orders of magnitude greater when aggregating over tokens compared with a single token. For larger underlying models, the degree to which latents are active at multiple layers increases, which is consistent with the fact that the residual stream activation vectors at adjacent layers become more similar. Finally, we relax the assumption that the residual stream basis is the same at every layer by applying pre-trained tuned-lens transformations, but our findings remain qualitatively similar. Our results represent a new approach to understanding how representations change as they flow through transformers. We release our code to train and analyze MLSAEs at https://github.com/tim-lawson/mlsae.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Sparse autoencoders (SAEs) learn interpretable directions or 'features' in the representation spaces of language models (Elhage et al., 2022; Cunningham et al., 2023; Bricken et al., 2023). Typically, SAEs are trained on the activation vectors from a single model layer (Gao et al., 2024; Templeton et al., 2024; Lieberum et al., 2024). This approach illuminates the representations within a layer. However, Olah (2024); Templeton et al. (2024) believe that models may encode meaningful concepts by simultaneous activations in multiple layers, which SAEs trained at a single layer do not address. Furthermore, it is not straightforward to automatically identify correspondences between features from SAEs trained at different layers, which may complicate circuit analysis (e.g. He et al., 2024).
|
| 18 |
+
|
| 19 |
+
To solve this problem, we take inspiration from the residual stream perspective, which states that transformers (Vaswani et al., 2017) selectively write information to and read information from token positions with self-attention and MLP layers (Elhage et al., 2021; Ferrando et al., 2024). The results of subsequent circuit analyses, like the explanation of the indirect object identification task presented by Wang et al. (2022), support this viewpoint and cause us to expect the activation vectors at adjacent layers in the residual stream to be relatively similar (Lad et al., 2024).
|
| 20 |
+
|
| 21 |
+
To capture the structure shared between layers in the residual stream, we introduce the multi-layer SAE (MLSAE): a single SAE trained on the residual stream activation vectors from every layer of a transformer language model. Importantly, the autoencoder itself has a single hidden layer - it is
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: The mean cosine similarities between the residual stream activation vectors at adjacent layers of transformers, over 10 million tokens from the test set. To compare transformers with different numbers of layers, we divide the lower of each pair of adjacent layers by the number of pairs. This 'relative layer' is the $x$ -axis of the plot. We subtract the dataset mean from the activation vectors at each layer before computing cosine similarities to control for changes in the norm between layers (Heimersheim & Turner, 2023), which we demonstrate in Figure 4.
|
| 25 |
+
|
| 26 |
+
multi-layer only in the sense that it is trained on activations from multiple layers of the underlying transformer. In particular, we consider the activation vectors from each layer as separate training examples, which is equivalent to training a single SAE at each layer individually but with the parameters tied across layers. We briefly discuss alternative methods in Section 5.
|
| 27 |
+
|
| 28 |
+
We show that multi-layer SAEs achieve comparable reconstruction error and downstream loss to single-layer SAEs while allowing us to directly identify and analyze features that are active at multiple layers (Section 4.1). When aggregating over a large sample of tokens, we find that individual latents are likely to be active at multiple layers, and this measure increases with the number of latents. However, for a single token, latent activations are more likely to be isolated to a single layer. For larger underlying transformers, we show that the residual stream activation vectors at adjacent layers are more similar and that the degree to which latents are active at multiple layers increases.
|
| 29 |
+
|
| 30 |
+
Finally, we relax the assumption that the residual stream basis is the same at every layer by applying pre-trained tuned-lens transformations to activation vectors before passing them to the encoder. Surprisingly, this does not obviously increase the extent of multi-layer latent activations.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
A sparse code represents many signals, such as sensory inputs, by simultaneously activating a relatively small number of elements, such as neurons (Olshausen & Field, 1996; Bell & Sejnowski, 1997). Sparse dictionary learning (SDL) approximates each input vector by a linear combination of a relatively small number of learned basis vectors. The learned basis is usually overcomplete: it has a greater dimension than the inputs. Independent Component Analysis (ICA) achieves this aim by maximizing the statistical independence of the learned basis vectors by iterative optimization or training (Bell & Sejnowski, 1995; 1997; Hyvarinen & Oja, 2000; Le et al., 2011). Sparse autoencoders (SAEs) can be understood as ICA with the addition of a noise model optimized by gradient descent (Lee et al., 2006; Ng, 2011; Makhzani & Frey, 2014)
|
| 35 |
+
|
| 36 |
+
The activations of language models have been hypothesized to be a dense, compressed version of a sparse, expanded representation space (Elhage et al., 2021; 2022). Under this view, there are interpretable directions in the dense representation spaces corresponding to distinct semantic concepts, whereas their basis vectors (neurons) are 'polysemantic' (Park et al., 2023). It has been shown theoretically (Wright & Ma, 2022) and empirically (Elhage et al., 2022; Sharkey et al., 2022; Whittington et al., 2023) that SDL recovers ground-truth features in toy models, and that learned dictionary elements are more interpretable than the basis vectors of language models (Cunningham et al., 2023; Bricken et al., 2023) or dense embeddings (O'Neill et al., 2024). Notably, 'features' are not necessarily linear (Wattenberg & Viégas, 2024; Engels et al., 2024; Hernandez et al., 2024).
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for MLSAEs trained on Pythia models with an expansion factor of $R = 64$ and sparsity $k = 32$ . The latents are sorted in ascending order of the expected value of the layer index (Eq. 10).
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 3: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for MLSAEs trained on Pythia models with an expansion factor of $R = 64$ and sparsity $k = 32$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We exclude latents with maximum activation below $1 \times 10^{-3}$ and sort latents in ascending order of the expected value of the layer index (Eq. 10).
|
| 43 |
+
|
| 44 |
+
The standard SAE architecture is a single hidden layer with a ReLU activation function and an $L^1$ sparsity penalty in the training loss (Bricken et al., 2023), but various activation functions (Makhzani & Frey, 2014; Konda et al., 2015; Rajamanoharan et al., 2024b;a) and objectives (Braun et al., 2024) have been proposed. The prevailing approach is to train an SAE on the activation vectors from a single transformer layer, except for Kissane et al. (2024), who concatenate the outputs of multiple attention heads in a single layer, and Yun et al. (2021), who learn a sparse dictionary for the residual stream at multiple layers, albeit by iterative optimization instead of with an autoencoder.
|
| 45 |
+
|
| 46 |
+
Mechanistic interpretability research often attempts to identify circuits: computational subgraphs of neural networks that implement specific behaviors (Olah et al., 2020; Wang et al., 2022; Conmy et al., 2023; Dunefsky et al., 2024; García-Carrasco et al., 2024; Marks et al., 2024). Representing networks in terms of SAE latents may help to improve circuit discovery (He et al., 2024; O'Neill & Bui, 2024), and these latents can be used to construct steering vectors (Subramani et al., 2022; Templeton et al., 2024; Makelov, 2024), but it is unclear whether SAEs outperform baselines for causal analysis (Chaudhary & Geiger, 2024; Huang et al., 2024). Importantly, SAEs can be scaled up to the activations of large language models, where we expect the number of distinct semantic concepts to be extremely large (Templeton et al., 2024; Gao et al., 2024; Lieberum et al., 2024).
|
| 47 |
+
|
| 48 |
+
The 'logit lens' is a method to interpret directions in the residual stream by projecting them onto the vocabulary space to elicit token predictions, i.e., multiplying them by the unembedding matrix (nostalgebraist, 2020). However, the residual stream basis is not fixed, so Belrose et al. (2023) introduce the 'tuned lens' approach, where a linear transformation is learned for each layer in the residual stream. The objective is to minimize the KL divergence between the probability distribution over tokens generated by the transformed activations and the 'true' distribution of the model. This approach draws on the perspective of iterative inference (Jastrzebski et al., 2018).
|
| 49 |
+
|
| 50 |
+
The key difference between previous work (Bricken et al., 2023; Cunningham et al., 2023; Templeton et al., 2024; Gao et al., 2024) and our work is that we introduce the multi-layer SAE, i.e., we train a single SAE at all layers of the residual stream.
|
| 51 |
+
|
| 52 |
+
# 3 METHODS
|
| 53 |
+
|
| 54 |
+
The key idea with a multi-layer SAE is to train a single SAE on the residual stream activation vectors from every layer. In particular, we consider the activations at each layer to be different training examples. Hence, for residual stream activation vectors of model dimension $d$ , the inputs to the multi-layer SAE also have dimension $d$ . For $n_T$ tokens and $n_L$ layers, we train the multi-layer SAE on $n_T n_L$ activation vectors. We use the terms 'SAE feature' and 'latent' interchangeably.
|
| 55 |
+
|
| 56 |
+
# 3.1 SETUP
|
| 57 |
+
|
| 58 |
+
We train MLSAEs primarily on GPT-style language models from the Pythia suite (Biderman et al., 2023); see Appendix B.3 for others. We are interested in the computation performed by self-attention and MLP layers on intermediate representations (Valeriani et al., 2023). Hence, we take the residual stream activation vectors after a given transformer block has been applied, excluding the input embeddings before the first block and taking the last-layer activations before the final layer norm.
|
| 59 |
+
|
| 60 |
+
We use a $k$ -sparse autoencoder (Makhzani & Frey, 2014; Gao et al., 2024), which directly controls the sparsity of the latent space by introducing a TopK activation function that keeps only the $k$ largest latents. The $k$ largest latents are almost always positive for $k \ll d$ , but we follow Gao et al. (2024) in applying a ReLU activation function to guarantee non-negativity. This setup effectively fixes the sparsity ( $L^0$ norm) of the latents at $k$ per activation vector (layer and token) throughout training. For input vectors $\mathbf{x} \in \mathbb{R}^d$ and latent vectors $\mathbf{h} \in \mathbb{R}^n$ , the encoder and decoder are defined by:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathbf {h} = \operatorname {R e L U} \left(\operatorname {T o p K} \left(\mathbf {W} _ {\text {e n c}} \mathbf {x} - \mathbf {b} _ {\text {p r e}}\right)\right) \tag {1}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\hat {\mathbf {x}} = \mathbf {W} _ {\mathrm {d e c}} \mathbf {h} + \mathbf {b} _ {\mathrm {p r e}} \tag {2}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\mathbf{W}_{\mathrm{enc}} \in \mathbb{R}^{d \times n}$ , $\mathbf{W}_{\mathrm{dec}} \in \mathbb{R}^{n \times d}$ , and $\mathbf{b}_{\mathrm{pre}} \in \mathbb{R}^d$ . We constrain the pre-encoder bias $\mathbf{b}_{\mathrm{pre}}$ to be the negative of the post-decoder bias, following Bricken et al. (2023); Gao et al. (2024), and standardize activation vectors to zero mean and unit variance before passing them to the encoder.
|
| 71 |
+
|
| 72 |
+
# 3.2 TRAINING
|
| 73 |
+
|
| 74 |
+
We use the fraction of variance unexplained (FVU) as the reconstruction error:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\operatorname {F V U} (\mathbf {x}, \hat {\mathbf {x}}) = \frac {\| \mathbf {x} - \hat {\mathbf {x}} \| _ {2} ^ {2}}{\operatorname {V a r} (\mathbf {x})} \tag {3}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Here, Var is the variance. We chose the FVU because the input vectors from different layers may have different magnitudes; choosing the mean squared error (MSE) would encourage the autoencoder to prioritize minimizing the reconstruction errors of the layers with the greatest magnitudes.
|
| 81 |
+
|
| 82 |
+
A potential issue when training SAEs is the occurrence of 'dead' latents, i.e., latent dimensions that are almost always zero. With a $k$ -sparse autoencoder, this means latent dimensions that almost never appear among the $k$ largest latent activations. We follow Bricken et al. (2023); Cunningham et al. (2023) by considering a latent 'dead' if it is not activated within the last 10 million tokens during training. In the multi-layer setting, a latent may be activated by the input vectors from any layer.
|
| 83 |
+
|
| 84 |
+
Gao et al. (2024, Appendix A.2) propose an auxiliary loss term to minimize the occurrence of dead latents. This AuxK term models the MSE reconstruction error using the $k_{\mathrm{aux}}$ largest dead latents:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\operatorname {A u x K} (\mathbf {x}, \hat {\mathbf {x}}) = \| \mathbf {e} - \hat {\mathbf {e}} \| _ {2} ^ {2} \tag {4}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
Here, $\mathbf{e} = \mathbf{x} - \hat{\mathbf{x}}$ is the reconstruction error of the main model, and $\hat{\mathbf{e}}$ is its reconstruction using the top- $k_{\mathrm{aux}}$ dead latents. Let Dead be an 'activation function' that keeps only the dead latents. Then:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\mathbf {h} _ {\text {d e a d}} = \operatorname {R e L U} \left(\operatorname {T o p K} _ {\text {a u x}} (\operatorname {D e a d} \left(\mathbf {W} _ {\text {e n c}} \mathbf {x} - \mathbf {b} _ {\text {p r e}}\right))\right) \tag {5}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\hat {\mathbf {e}} = \mathbf {W} _ {\mathrm {d e c}} \mathbf {h} _ {\mathrm {d e a d}} + \mathbf {b} _ {\mathrm {p r e}} \tag {6}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
The full loss is the FVU plus the auxiliary loss term, multiplied by a small coefficient $\alpha$ :
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathcal {L} = \operatorname {F V U} (\mathbf {x}, \hat {\mathbf {x}}) + \alpha \cdot \operatorname {A u x K} (\mathbf {x}, \hat {\mathbf {x}}) \tag {7}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Following Gao et al. (2024), we choose $k_{\mathrm{aux}}$ as a power of 2 close to $d / 2$ and $\alpha = 1 / 32$ .
|
| 107 |
+
|
| 108 |
+
Our hyperparameters are the expansion factor $R = n / d$ , the ratio of the number of latents to the model dimension, and the sparsity $k$ , the number of largest latents to keep in the TopK activation function. We choose expansion factors as powers of 2 between 1 and 256, yielding autoencoders with between 512 and 131072 latents for Pythia-70m, and $k$ as powers of 2 between 16 and 512 (Appendix B).
|
| 109 |
+
|
| 110 |
+
The computational expense of training a single multi-layer SAE on $n_{L}$ layers of the residual stream is approximately equal to training $n_{L}$ single-layer SAEs on the same number of tokens. We trained most MLSAEs on a single NVIDIA GeForce RTX 3090 GPU for between 12 and 24 hours; we trained the largest MLSAEs (e.g., with Pythia-1b or an expansion factor of $R = 256$ ) on a single NVIDIA A100 80GB GPU for up to three days.
|
| 111 |
+
|
| 112 |
+
The implementation is based on Gao et al. (2023); Belrose (2024); see Appendix A for details.
|
| 113 |
+
|
| 114 |
+
# 3.3 TUNED LENS
|
| 115 |
+
|
| 116 |
+
In the tuned lens method, an affine transformation is learned from the output space of layer $\ell$ to the output space of the final layer, called the translator for layer $\ell$ (Belrose et al., 2023). With our setup, we want to transform the residual stream activation vectors at each layer into more similar bases before passing them to the encoder and invert that transformation after the decoder.
|
| 117 |
+
|
| 118 |
+
Importantly, the authors note that their implementation<sup>1</sup> uses a residual connection:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathbf {x} ^ {\prime} = \mathbf {x} + \left(\mathbf {W} _ {\text {l e n s}, \ell} \mathbf {x} + \mathbf {b} _ {\text {l e n s}, \ell}\right) \tag {8}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Here, $\mathbf{x}$ is the input vector to the encoder, and $\mathbf{x}'$ is the transformed input vector. This parameterization ensures that $L_{2}$ regularization (weight decay) pushes the transformation towards the identity matrix instead of zero. Hence, to invert the transformation, we need:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\hat {\mathbf {x}} = \left(\mathbf {I} + \mathbf {W} _ {\text {l e n s}, \ell}\right) ^ {- 1} \left(\hat {\mathbf {x}} ^ {\prime} - \mathbf {b} _ {\text {l e n s}, \ell}\right) \tag {9}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Model</td><td>FVU</td><td>L1Norm</td><td>Loss ↑</td></tr><tr><td>Pythia-70m</td><td>0.097</td><td>66.5</td><td>0.565</td></tr><tr><td>Pythia-160m</td><td>0.106</td><td>76.1</td><td>0.432</td></tr><tr><td>Pythia-410m</td><td>0.081</td><td>84.6</td><td>0.414</td></tr><tr><td>Pythia-1b</td><td>0.095</td><td>109.7</td><td>0.404</td></tr><tr><td>Pythia-1.4b</td><td>0.106</td><td>124.7</td><td>0.487</td></tr><tr><td>Gemma 2 2B</td><td>0.210</td><td>255.5</td><td>1.483</td></tr><tr><td>Llama 3.2 3B</td><td>0.299</td><td>141.4</td><td>0.347</td></tr><tr><td>GPT-2 small</td><td>0.093</td><td>196.9</td><td>0.759</td></tr></table>
|
| 131 |
+
|
| 132 |
+
(a) Standard
|
| 133 |
+
|
| 134 |
+
<table><tr><td>Model</td><td>FVU</td><td>L1Norm</td><td>Loss ↑</td></tr><tr><td>Pythia-70m</td><td>0.030</td><td>61.5</td><td>0.274</td></tr><tr><td>Pythia-160m</td><td>0.088</td><td>89.6</td><td>-0.080</td></tr><tr><td>Pythia-410m</td><td>0.073</td><td>80.5</td><td>0.827</td></tr></table>
|
| 135 |
+
|
| 136 |
+
(b) With tuned lens
|
| 137 |
+
|
| 138 |
+
Table 1: The mean FVU, $L^1$ norm, and increase in the cross-entropy loss (Loss ↑) for MLSAEs with an expansion factor of $R = 64$ and sparsity $k = 32$ , over 1 million tokens from the test set. We provide details of the evaluation metrics and transformer architectures in Appendix B.
|
| 139 |
+
|
| 140 |
+
In Eq. 9, $\hat{\mathbf{x}}'$ is the transformed output vector of the decoder, $\hat{\mathbf{x}}$ is the output vector, $\mathbf{W}_{\mathrm{lens},\ell} \in \mathbb{R}^{d \times d}$ , and $\mathbf{b}_{\mathrm{lens},\ell} \in \mathbb{R}^d$ . With our setup, $\mathbf{x}'$ and $\hat{\mathbf{x}}'$ replace the input and output vectors that we pass to the encoder and use to compute the loss. Notably, we use the transformed vectors to compute reconstruction errors (Figure 12), and we compute the inverse $(\mathbf{I} + \mathbf{W}_{\mathrm{lens},\ell})^{-1}$ for each layer once at the start of training. The pre-trained tuned lenses used were provided by the authors of Belrose et al. (2023), which did not include Pythia-1b at the time of writing.
|
| 141 |
+
|
| 142 |
+
# 4 RESULTS
|
| 143 |
+
|
| 144 |
+
# 4.1 EVALUATION
|
| 145 |
+
|
| 146 |
+
The key advantage of a multi-layer SAE is to be able to study how information flows across layers in the residual stream. However, this approach is only useful if the MLSAE performs comparably to single-layer SAEs. The FVU reconstruction error term in the loss (Section 3.2) is a proxy for the degree to which an SAE explains the behavior of the underlying model. Hence, we also measured the increase in the cross-entropy loss when the residual stream activations at a given layer are replaced by their reconstruction, following Braun et al. (2024); Gao et al. (2024); Lieberum et al. (2024).
|
| 147 |
+
|
| 148 |
+
Table 1 summarizes the evaluation results for MLSAEs trained with our default hyperparameters. The FVU and delta cross-entropy (CE) loss remain consistent across model sizes for Pythia transformers. In most cases, applying tuned-lens transformations decreases the FVU and delta CE loss (see Section 4.4 and Figure 12). We provide results for other hyperparameters, breakdowns by the layer of the input activation vectors, and explicit comparisons to single-layer SAEs in Appendix B.
|
| 149 |
+
|
| 150 |
+
# 4.2 REPRESENTATION DRIFT
|
| 151 |
+
|
| 152 |
+
Guided by the residual stream perspective (Elhage et al., 2021; Ferrando et al., 2024), we expected dense activation vectors to be relatively similar across layers. As an approximate measure of the degree to which information is preserved in the residual stream, we computed the cosine similarities between the activation vectors at adjacent layers, similarly to Lad et al. (2024, Appendix A). A similarity of one means that the information represented at a token position is unchanged by the intervening residual block, whereas a similarity of zero means the activation vectors on either side of the block are orthogonal. We had expected changes in the residual stream to become smaller as the model size increased, and the mean cosine similarities increased as expected (Figure 1).
|
| 153 |
+
|
| 154 |
+
Given that the residual stream activation vectors are relatively similar between adjacent layers, we expected to find many MLSAE latents active at multiple layers. We confirmed this prediction over a large sample of 10 million tokens from the test set (Figure 2). Interestingly, we found that for individual prompts, a much greater proportion of latents are active at only a single layer (Figure 3).
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 4: The mean $L^2$ norm of the residual stream activation vectors at every layer, over 10 million tokens from the test set. To compare transformers with different numbers of layers, we divide the layer index $\ell$ by the number of layers $n_L$ . This 'relative layer' is the $x$ -axis of the plot.
|
| 158 |
+
|
| 159 |
+
Following Heimersheim & Turner (2023), we verified that the mean $L^2$ norm of the activation vectors increases across layers, which prompted us to center the vectors at each layer by subtracting the dataset mean before computing the similarities between vectors (Figure 4).
|
| 160 |
+
|
| 161 |
+
# 4.3 LATENT DISTRIBUTIONS OVER LAYERS
|
| 162 |
+
|
| 163 |
+
Given a dataset and MLSAE, each combination of a token and latent produces a distribution of activations over layers. We want to understand the degree to which the variance of that distribution depends on the token versus the latent to quantify the intuition gleaned from Figures 2 and 3.
|
| 164 |
+
|
| 165 |
+
Consider the layer index $L$ , token $T$ , and latent index $J$ to be random variables. We take $P(J)$ to be a uniform discrete distribution, $P(T \mid J)$ to be a uniform discrete distribution over tokens for which the latent is active (at any layer), and $L$ to be sampled from a conditional distribution proportional to the total latent activation at that layer, aggregating over tokens:
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
P (L = \ell \mid T = t, J = j) = \frac {h _ {j} \left(\mathbf {x} _ {t , \ell}\right)}{\sum_ {\ell^ {\prime}} h _ {j} \left(\mathbf {x} _ {t , \ell^ {\prime}}\right)} \tag {10}
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
Here, $\mathbf{x}_{t,\ell}$ is the dense residual stream activation vector at token $t$ and layer $\ell$ , while $h_j(\mathbf{x}_{t,\ell})$ is the activation of the $j$ -th MLSAE latent at that token and layer.
|
| 172 |
+
|
| 173 |
+
We order latents in all heatmaps using the expected value of the layer index for a single latent $\mathbb{E}[L\mid J = j]$ . The variance of the distribution over layers measures the degree to which a latent is active at a single layer (in which case, it is zero) versus multiple layers (in which case, it is positive). We are interested in the following variances of the distribution over layers:
|
| 174 |
+
|
| 175 |
+
- $\operatorname{Var}[L \mid J = j, T = t]$ , for a single latent and token
|
| 176 |
+
- $\operatorname{Var}[L \mid J = j]$ , for a single latent, aggregating over tokens
|
| 177 |
+
- $\operatorname{Var}[L]$ , aggregating over both latents and tokens
|
| 178 |
+
|
| 179 |
+
These quantities are related by the law of total variance (see Appendix C.2). For the moment, we note that the variance of the distribution over layers naturally depends on the number of layers $n_{L}$ . Hence, to compare different models, we look at ratios between these variances:
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\text {V a r i a n c e} \quad \text {a s a p r o p o r t i o n o f t h e t o t a l v a r i a n c e o v e r a l l t a l e t s} = \frac {\mathbb {E} [ \operatorname {V a r} (L \mid J) ]}{\operatorname {V a r} (L)} \tag {11}
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\text {V a r i a n c e} = \frac {\mathbb {E} [ \operatorname {V a r} (L \mid J , T) ]}{\mathbb {E} [ \operatorname {V a r} (L \mid J) ]} \tag {12}
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
The former measures the degree to which latents are active at multiple layers when aggregating over tokens, and the latter compares this to the case for a single token. We explore alternative measures of aggregate multi-layer activity in Appendix C.
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 5: The fraction of the total variance explained by individual latents and the fraction of the variance for an individual latent explained by individual tokens (Eqs. 11 and 12) for MLSAEs with an expansion factor of $R = 64$ and sparsity $k = 32$ , over 10 million tokens from the test set. The absence of bars for tuned-lens MLSAEs indicates the absence of results, not that the values are zero.
|
| 195 |
+
|
| 196 |
+
The degree to which latents are active at multiple layers when aggregating over tokens is relatively large, between 54 and $88\%$ , and broadly increases with the model size for fixed hyperparameters (Figure 5). This measure quantifies the observation that, in the aggregate heatmaps (Figure 2), the distributions of latent activations over layers become more 'spread out' as the model size increases. Conversely, we find that the fraction of the variance for an individual latent explained by individual tokens is relatively small, on the order of 1 to $10\%$ . This quantifies the observation that, in the single-prompt heatmaps (Figure 3), the distributions over layers are much less 'spread out' than in the aggregate heatmaps.
|
| 197 |
+
|
| 198 |
+
# 4.4 TUNED LENS
|
| 199 |
+
|
| 200 |
+
Thus far, we have assumed that the residual stream basis is the same at every layer. We relaxed this assumption by applying pre-trained tuned-lens transformations to the residual stream activations at each layer before the encoder (Section 3.3). We had expected that these transformations would increase the degree to which latents were active at multiple layers because they translate the activations at every layer into a basis more similar to the basis of the output layer. The aggregate and single-prompt heatmaps (Figures 6 and 7) indicate a modest increase in the degree to which latents are active at multiple layers compared with the standard approach.
|
| 201 |
+
|
| 202 |
+
The variance ratios in Figure 5 clarify that the tuned-lens approach decreases the degree to which latents are active at multiple layers when aggregating over tokens. This ratio remains approximately constant as the expansion factor increases, between $37\%$ and $41\%$ (Figure 27). Conversely, the variances for a single token relative to a single latent are larger, i.e., the single-prompt heatmaps are more 'spread out' compared with the standard approach.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 6: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for tuned-lens MLSAEs trained on Pythia models with an expansion factor of $R = 64$ and sparsity $k = 32$ . For standard MLSAEs, see Figure 2. We note that a pre-trained tuned lens was not available for Pythia-1b (Section 3.3).
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Figure 7: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for tuned-lens MLSAEs trained on Pythia models with an expansion factor of $R = 64$ and sparsity $k = 32$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). For standard MLSAEs, see Figure 3. We note that a pre-trained tuned lens was not available for Pythia-1b (Section 3.3).
|
| 209 |
+
|
| 210 |
+
# 5 DISCUSSION
|
| 211 |
+
|
| 212 |
+
We considered the activation vectors from different layers as different training examples, so we passed $n_{L}n_{T}$ vectors of length $d$ to the autoencoder, where $n_{T}$ is the number of tokens, $n_{L}$ is the number of layers, and $d$ is the dimension of the residual stream. This approach might be called a 'data-stacked' MLSAE. An alternative would be a 'feature-stacked' MLSAE, i.e., to concatenate the activation vectors from different layers into a single vector of dimension $n_{L}d$ . This alternative might be better suited to capturing the notion of 'cross-layer superposition,' which we take to mean a small number of simultaneously active sparse features at multiple layers encoding a single meaningful concept (Olah, 2024; Templeton et al., 2024).
|
| 213 |
+
|
| 214 |
+
We began by pursuing the feature-stacked approach but discarded it. The essential issue is that a single set of sparse features describes the residual stream activations at every layer, which makes it difficult to understand how information flows through a transformer. For example, it would not be possible to plot the activations of sparse features across layers. Moreover, to compute this set of features, one must first compute the activations at every layer, which makes it more difficult to evaluate performance by traditional measures like single-layer reconstruction errors. Finally, the information encoded at one token position may differ substantially between layers due to self-attention. In the early layers, the representation is likely to primarily encode the input token and position embedding, whereas in the later layers, the representation may encode more complex properties of the surrounding context. It is not immediately apparent that jointly encoding this information by a single SAE is sensible. Instead, one might wish to separately capture the different information present at a token position across layers, which is allowed with our data-stacked approach.
|
| 215 |
+
|
| 216 |
+
# 6 CONCLUSION
|
| 217 |
+
|
| 218 |
+
We introduced the multi-layer SAE (MLSAE), where we train a single SAE on the activations at every layer of the residual stream. This allowed us to study both how information is represented within a single transformer layer and how information flows through the residual stream.
|
| 219 |
+
|
| 220 |
+
We confirmed that residual stream activations are relatively similar across layers by looking at cosine similarities before considering the distributions of latent activations over layers. When aggregating over a large sample of ten million tokens, we observed that most latents were active at multiple layers, but for a single prompt, most latent activations were isolated to a single layer. To quantify these observations, we computed the fraction of the total variance explained by individual latents and the fraction of the variance for an individual latent explained by individual tokens. This analysis confirmed that the degree to which latents are active at multiple layers when aggregating over tokens was large, increasing with the model size and expansion factor, and that the fraction of the variance explained by individual tokens was small.
|
| 221 |
+
|
| 222 |
+
Understanding how representations change as they flow through transformers is critical to identifying meaningful circuits, which is a core task of mechanistic interpretability. Despite the utility of the residual stream perspective, our results demonstrate that representation drift, and perhaps the increasing magnitude of changes to the residual stream across layers, is a significant obstacle to identifying meaningful computational variables with SAEs. Nevertheless, we argue that an approach such as the MLSAE, which considers the representations at multiple layers in parallel, is necessary for future methods that seek to interpret the internal computations of transformer language models.
|
| 223 |
+
|
| 224 |
+
# 7 ACKNOWLEDGEMENTS
|
| 225 |
+
|
| 226 |
+
Tim Lawson and Lucy Farnik were supported by the UKRI Centre for Doctoral Training in Interactive Artificial Intelligence (EP/S022937/1). This work was carried out with HPC systems provided by the Advanced Computing Research Centre at the University of Bristol. We also thank Dr. Stewart, whose philanthropy supported the compute resources used.
|
| 227 |
+
|
| 228 |
+
# 8 REPRODUCIBILITY STATEMENT
|
| 229 |
+
|
| 230 |
+
We release our code to train and analyze MLSAEs at https://github.com/tim-lawson/msaes, and the models described in the paper at https://huggingface.co/papers/2409.04185. Section 3 and Appendix A describe the training setup, Section 4.1 and Appendix B describe the evaluation metrics, and Section 4.3 and Appendix C describe our analyses.
|
| 231 |
+
|
| 232 |
+
# REFERENCES
|
| 233 |
+
|
| 234 |
+
Anthony J. Bell and Terrence J. Sejnowski. An Information-Maximization Approach to Blind Separation and Blind Deconvolution. Neural Computation, 7(6):1129-1159, November 1995. ISSN 0899-7667. doi: 10.1162/neco.1995.7.6.1129. URL https://ieeexplore.ieee.org/abstract/document/6796129. Conference Name: Neural Computation.
|
| 235 |
+
Anthony J. Bell and Terrence J. Sejnowski. The "independent components" of natural scenes are edge filters. Vision Research, 37(23):3327-3338, December 1997. ISSN 0042-6989. doi: 10.1016/S0042-6989(97)00121-1. URL https://www.sciencedirect.com/science/article/pii/S00426989997001211.
|
| 236 |
+
Nora Belrose. EleutherAI/sae, May 2024. URL https://github.com/EleutherAI/sae.
|
| 237 |
+
Nora Belrose, Zach Furman, Logan Smith, Danny Halawi, Igor Ostrovsky, Lev McKinney, Stella Biderman, and Jacob Steinhardt. Eliciting Latent Predictions from Transformers with the Tuned Lens, November 2023. URL http://arxiv.org/abs/2303.08112. arXiv:2303.08112 [cs].
|
| 238 |
+
Stella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley, Kyle O'Brien, Eric Hallahan, Mohammad Aflah Khan, Shivanshu Purohit, Usvsn Sai Prashanth, Edward Raff, Aviya Skowron, Lintang Sutawika, and Oskar Van Der Wal. Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling. In Proceedings of the 40th International Conference on Machine Learning, pp. 2397-2430. PMLR, July 2023. URL https://proceedings.mlr.press/v202/biderman23a.html. ISSN: 2640-3498.
|
| 239 |
+
Dan Braun, Jordan Taylor, Nicholas Goldowsky-Dill, and Lee Sharkey. Identifying Functionally Important Features with End-to-End Sparse Dictionary Learning, May 2024. URL http://arxiv.org/abs/2405.12241.arXiv:2405.12241 [cs].
|
| 240 |
+
Trenton Bricken, Adly Templeton, Joshua Batson, Brian Chen, Adam Jermyn, Tom Conerly, Nick Turner, Cem Anil, Carson Denison, and Amanda Askell. Towards Monosemanticity: Decomposing Language Models With Dictionary Learning, 2023. URL https://transformer-circuits.pub/2023/monosemantic-features.
|
| 241 |
+
Maheep Chaudhary and Atticus Geiger. Evaluating Open-Source Sparse Autoencoders on Disentangling Factual Knowledge in GPT-2 Small, September 2024. URL http://arxiv.org/abs/2409.04478.arXiv:2409.04478 [cs].
|
| 242 |
+
Arthur Conmy, Augustine Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and Adrià Garriga-Alonso. Towards Automated Circuit Discovery for Mechanistic Interpretability. Advances in Neural Information Processing Systems, 36:16318-16352, December 2023. URL https://proceedings.neurips.cc/paper_files/paper/2023/hash/34e1dbe95d34d7ebaf99b9bcaeb5b2be-Abstract-Conference.html.
|
| 243 |
+
Hoagy Cunningham, Aidan Ewart, Logan Riggs, Robert Huben, and Lee Sharkey. Sparse Autoencoders Find Highly Interpretable Features in Language Models, October 2023. URL http://arxiv.org/abs/2309.08600.arXiv:2309.08600 [cs].
|
| 244 |
+
Jacob Dunefsky, Philippe Chlenski, and Neel Nanda. Transcoders Find Interpretable LLM Feature Circuits, June 2024. URL http://arxiv.org/abs/2406.11944. arXiv:2406.11944 [cs].
|
| 245 |
+
Nelson Elhage, Neel Nanda, Catherine Olsson, T. Henighan, N. Joseph, B. Mann, A. Askell, Y. Bai, A. Chen, and T. Conerly. A Mathematical Framework for Transformer Circuits, 2021. URL https://transformer-circuits.pub/2021/framework/index.html.
|
| 246 |
+
|
| 247 |
+
Nelson Elhage, Tristan Hume, Catherine Olsson, Nicholas Schiefer, Tom Henighan, Shauna Kravec, Zac Hatfield-Dodds, Robert Lasenby, Dawn Drain, Carol Chen, Roger Grosse, Sam McCandlish, Jared Kaplan, Dario Amodei, Martin Wattenberg, and Christopher Olah. Toy Models of Superposition, September 2022. URL http://arxiv.org/abs/2209.10652. arXiv:2209.10652 [cs].
|
| 248 |
+
Joshua Engels, Isaac Liao, Eric J. Michaud, Wes Gurnee, and Max Tegmark. Not All Language Model Features Are Linear, May 2024. URL http://arxiv.org/abs/2405.14860. arXiv:2405.14860 [cs].
|
| 249 |
+
Javier Ferrando, Gabriele Sarti, Arianna Bisazza, and Marta R. Costa-jussa. A Primer on the Inner Workings of Transformer-based Language Models, May 2024. URL http://arxiv.org/abs/2405.00208.arXiv:2405.00208 [cs].
|
| 250 |
+
Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, Shawn Presser, and Connor Leahy. The Pile: An 800GB Dataset of Diverse Text for Language Modeling, December 2020. URL http://arxiv.org/abs/2101.00027.arXiv:2101.00027 [cs].
|
| 251 |
+
Leo Gao, Tom Dupré la Tour, and Jeffrey Wu. openai/sparse-autoencoder, December 2023. URL https://github.com/openai/sparse-autoencoder.
|
| 252 |
+
Leo Gao, Tom Dupré la Tour, Henk Tillman, Gabriel Goh, Rajan Troll, Alec Radford, Ilya Sutskever, Jan Leike, and Jeffrey Wu. Scaling and evaluating sparse autoencoders, June 2024. URL http://arxiv.org/abs/2406.04093. arXiv:2406.04093 [cs].
|
| 253 |
+
Jorge García-Carrasco, Alejandro Mate, and Juan Carlos Trujillo. How does GPT-2 Predict Acronyms? Extracting and Understanding a Circuit via Mechanistic Interpretability. In Proceedings of The 27th International Conference on Artificial Intelligence and Statistics, pp. 3322-3330. PMLR, April 2024. URL https://proceedings.mlr.press/v238/garcia-carrasco24a.htm1. ISSN: 2640-3498.
|
| 254 |
+
Aaron Grattafori, Abhimanyu Dubey, Abhinav Jauhri, et al. The Llama 3 Herd of Models, November 2024. URL http://arxiv.org/abs/2407.21783.
|
| 255 |
+
Zhengfu He, Xuyang Ge, Qiong Tang, Tianxiang Sun, Qinyuan Cheng, and Xipeng Qiu. Dictionary Learning Improves Patch-Free Circuit Discovery in Mechanistic Interpretability: A Case Study on Othello-GPT, February 2024. URL http://arxiv.org/abs/2402.12201.arXiv:2402.12201 [cs].
|
| 256 |
+
Stefan Heimersheim and Alex Turner. Residual stream norms grow exponentially over the forward pass, May 2023. URL https://wwwalignmentforum.org/posts/8mizBCm3dyc432nK8/residual-stream-norms-grow-exponentially-over-the-forward.
|
| 257 |
+
Evan Hernandez, Arnab Sen Sharma, Tal Haklay, Kevin Meng, Martin Wattenberg, Jacob Andreas, Yonatan Belinkov, and David Bau. Linearity of Relation Decoding in Transformer Language Models, February 2024. URL http://arxiv.org/abs/2308.09124. arXiv:2308.09124 [cs].
|
| 258 |
+
Jing Huang, Zhengxuan Wu, Christopher Potts, Mor Geva, and Atticus Geiger. RAVEL: Evaluating Interpretability Methods on Disentangling Language Model Representations, August 2024. URL http://arxiv.org/abs/2402.17700.arXiv:2402.17700 [cs].
|
| 259 |
+
A. Hyvarinen and E. Oja. Independent component analysis: algorithms and applications. Neural Networks, 13(4):411-430, June 2000. ISSN 0893-6080. doi: 10.1016/S0893-6080(00)00026-5. URL https://www.sciencedirect.com/science/article/pii/S0893608000000265.
|
| 260 |
+
Stanisław Jastrzebski, Devansh Arpit, Nicolas Ballas, Vikas Verma, Tong Che, and Yoshua Bengio. Residual Connections Encourage Iterative Inference, March 2018. URL http://arxiv.org/abs/s/1710.04773.arXiv:1710.04773 [cs].
|
| 261 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization, January 2017. URL http://arxiv.org/abs/1412.6980.arXiv:1412.6980 [cs].
|
| 262 |
+
|
| 263 |
+
Connor Kissane, Robert Krzyzanowski, Joseph Isaac Bloom, Arthur Conmy, and Neel Nanda. Interpreting Attention Layer Outputs with Sparse Autoencoders. June 2024. URL https://openreview.net/forum?id=fewUBDwjji.
|
| 264 |
+
Kishore Konda, Roland Memisevic, and David Krueger. Zero-bias autoencoders and the benefits of co-adapting features, April 2015. URL http://arxiv.org/abs/1402.3337. arXiv:1402.3337 [cs, stat].
|
| 265 |
+
Vedang Lad, Wes Gurnee, and Max Tegmark. The Remarkable Robustness of LLMs: Stages of Inference?, June 2024. URL http://arxiv.org/abs/2406.19384. arXiv:2406.19384 [cs].
|
| 266 |
+
Quoc Le, Alexandre Karpenko, Jiquan Ngiam, and Andrew Ng. ICA with Reconstruction Cost for Efficient Overcomplete Feature Learning. In Advances in Neural Information Processing Systems, volume 24. Curran Associates, Inc., 2011. URL https://proceedings.neurips.cc/paper/2011/bitstream/233509073ed3432027d48b1a83f5fbd2-Abstract.html.
|
| 267 |
+
Honglak Lee, Alexis Battle, Rajat Raina, and Andrew Ng. Efficient sparse coding algorithms. In Advances in Neural Information Processing Systems, volume 19. MIT Press, 2006. URL https://proceedings.neurips.cc/paper_files/paper/2006/black/2d71b2ae158c7c5912cc0bbde2bb9d95-Abstract.html.
|
| 268 |
+
Tom Lieberum, Senthooran Rajamanoharan, Arthur Conmy, Lewis Smith, Nicolas Sonnerat, Vikrant Varma, János Kramár, Anca Dragan, Rohin Shah, and Neel Nanda. Gemma Scope: Open Sparse Autoencoders Everywhere All At Once on Gemma 2, August 2024. URL http://arxiv.org/abs/2408.05147.arXiv:2408.05147 [cs].
|
| 269 |
+
Aleksandar Makelov. Sparse Autoencoders Match Supervised Features for Model Steering on the IOI Task. June 2024. URL https://openreview.net/forum?id=JdrVuEQih5.
|
| 270 |
+
Alireza Makhzani and Brendan Frey. k-Sparse Autoencoders, March 2014. URL http://arxiv.org/abs/1312.5663.arXiv:1312.5663 [cs].
|
| 271 |
+
Samuel Marks, Can Rager, Eric J. Michaud, Yonatan Belinkov, David Bau, and Aaron Mueller. Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language Models, March 2024. URL http://arxiv.org/abs/2403.19647. arXiv:2403.19647 [cs].
|
| 272 |
+
Andrew Ng. Sparse autoencoder, 2011. URL https://graphics.stanford.edu/courses/cs23-3-21-spring/ReferencedPapers/SAE.pdf.
|
| 273 |
+
nostalgebraist. Interpreting GPT: the logit lens, August 2020. URL https://www. lesswrong.com/ posts/AcKRB8wDpdaN6v6ru/interpreting-gpt-the-logit-lens.
|
| 274 |
+
Chris Olah. The Next Five Hurdles, July 2024. URL https://transformer-circuits.pub/2024/july-update/index.html#hurdles.
|
| 275 |
+
Chris Olah, Nick Cammarata, Ludwig Schubert, Gabriel Goh, Michael Petrov, and Shan Carter. Zoom In: An Introduction to Circuits. Distill, 5(3), March 2020. ISSN 2476-0757. doi: 10.23915/distill.00024.001. URL https://distill.pub/2020/circuits/zoom-in.
|
| 276 |
+
Bruno A. Olshausen and David J. Field. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature, 381(6583):607-609, June 1996. ISSN 1476-4687. doi: 10.1038/381607a0. URL https://www.nature.com/articles/381607a0. Publisher: Nature Publishing Group.
|
| 277 |
+
Charles O'Neill and Thang Bui. Sparse Autoencoders Enable Scalable and Reliable Circuit Identification in Language Models, May 2024. URL http://arxiv.org/abs/2405.12522.arXiv:2405.12522 [cs].
|
| 278 |
+
Charles O'Neill, Christine Ye, Kartheik Iyer, and John F. Wu. Disentangling Dense Embeddings with Sparse Autoencoders, August 2024. URL http://arxiv.org/abs/2408.00657.arXiv:2408.00657 [cs].
|
| 279 |
+
|
| 280 |
+
Kiho Park, Yo Joong Choe, and Victor Veitch. The Linear Representation Hypothesis and the Geometry of Large Language Models, November 2023. URL http://arxiv.org/abs/2311.03658.arXiv:2311.03658 [cs, stat].
|
| 281 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language Models are Unsupervised Multitask Learners, 2019. URL https://cdn.openai.com/better-language-models/language_models_are_unsupervisedMULTITASK_learners.pdf.
|
| 282 |
+
Senthooran Rajamanoharan, Arthur Conmy, Lewis Smith, Tom Lieberum, Vikrant Varma, Janos Kramar, Rohin Shah, and Neel Nanda. Improving Sparse Decomposition of Language Model Activations with Gated Sparse Autoencoders. June 2024a. URL https://openreview.net/for um?id=Ppj5KvzU8Q.
|
| 283 |
+
Senthooran Rajamanoharan, Tom Lieberum, Nicolas Sonnerat, Arthur Conmy, Vikrant Varma, János Kramár, and Neel Nanda. Jumping Ahead: Improving Reconstruction Fidelity with JumpReLU Sparse Autoencoders, July 2024b. URL http://arxiv.org/abs/2407.14435.arXiv:2407.14435 [cs].
|
| 284 |
+
Morgane Riviere, Shreya Pathak, Pier Giuseppe Sessa, et al. Gemma 2: Improving Open Language Models at a Practical Size, October 2024. URL http://arxiv.org/abs/2408.00118.
|
| 285 |
+
Lee Sharkey, Dan Braun, and Beren Millidge. Taking features out of superposition with sparse autoencoders, December 2022. URL https://wwwalignmentforum.org/posts/z6QQJbtpkEA X3Aojj/interim-research-report-taking-features-out-of-superposition.
|
| 286 |
+
Nishant Subramani, Nivedita Suresh, and Matthew Peters. Extracting Latent Steering Vectors from Pretrained Language Models. In Smaranda Muresan, Preslav Nakov, and Aline Villavicencio (eds.), Findings of the Association for Computational Linguistics: ACL 2022, pp. 566-581, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022-findings-acl.48. URL https://aclanthology.org/2022-findings-acl.48.
|
| 287 |
+
Adly Templeton, Tom Conerly, Jonathan Marcus, Jack Lindsey, Trenton Bricken, Brian Chen, Adam Pearce, Craig Citro, Emmanuel Ameisen, Andy Jones, Hoagy Cunningham, Nicholas L. Turner, Callum McDougall, Monte MacDiarmid, Alex Tamkin, Esin Durmus, Tristan Hume, Francesco Mosconi, C. Daniel Freeman, Theodore R. Sumers, Edward Rees, Joshua Batson, Adam Jermyn, Shan Carter, Chris Olah, and Tom Henighan. Scaling Monoseismicity: Extracting Interpretable Features from Claude 3 Sonnet, May 2024. URL https://transformer-circuits.pub/2024/scaling-monoseismicity/index.html.
|
| 288 |
+
Lucrezia Valeriani, Diego Doimo, Francesca Cuturello, Alessandro Laio, Alessio Ansuini, and Alberto Cazzaniga. The geometry of hidden representations of large transformer models. Advances in Neural Information Processing Systems, 36:51234-51252, December 2023. URL https://proceedings.neurips.cc/paper_files/paper/2023/bitical/7168b40246af1cddc025daa-Abscract-Conference.html.
|
| 289 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://papers.nips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.htm1.
|
| 290 |
+
Kevin Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt. Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small, November 2022. URL http://arxiv.org/abs/2211.00593. arXiv:2211.00593 [cs].
|
| 291 |
+
Martin Wattenberg and Fernanda Viégas. Relational Composition in Neural Networks: A Survey and Call to Action. June 2024. URL https://openreview.net/forum?id=zzCEiUIPK9.
|
| 292 |
+
James C. R. Whittington, Will Dorrell, Surya Ganguli, and Timothy E. J. Behrens. Disentanglement with Biological Constraints: A Theory of Functional Cell Types, March 2023. URL http://arxiv.org/abs/2210.01768.arXiv:2210.01768 [cs, q-bio].
|
| 293 |
+
|
| 294 |
+
John Wright and Yi Ma. High-Dimensional Data Analysis with Low-Dimensional Models: Principles, Computation, and Applications. Cambridge University Press, 1 edition, January 2022. ISBN 978-1-108-77930-2 978-1-108-48973-7. doi: 10.1017/9781108779302. URL https://www.cambridge.org/highereducation/product/9781108779302/book.
|
| 295 |
+
Zeyu Yun, Yubei Chen, Bruno Olshausen, and Yann LeCun. Transformer visualization via dictionary learning: contextualized embedding as a linear superposition of transformer factors. In Eneko Agirre, Marianna Apidianaki, and Ivan Vulic (eds.), Proceedings of Deep Learning Inside Out (DeeLIO): The 2nd Workshop on Knowledge Extraction and Integration for Deep Learning Architectures, pp. 1-10, Online, June 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.deelio-1.1. URL https://aclanthology.org/2021.deelio-1.1.
|
| 296 |
+
|
| 297 |
+
# A TRAINING
|
| 298 |
+
|
| 299 |
+
We train each autoencoder on 1 billion tokens from the Pile (Gao et al., 2020), excluding the copyrighted Books3 dataset, for a single epoch. Specifically, we concatenate a batch of 1024 text samples with the end-of-sentence token, tokenize the concatenated text, and divide the output into sequences of 2048 tokens, discarding the final incomplete sequence. We use an effective batch size of 131072 tokens (64 sequences) for all experiments.
|
| 300 |
+
|
| 301 |
+
We do not compute activation vectors and cache them to disk before training, which minimizes storage overhead at the expense of repeated computation. We construct a batch of activation vectors to input to the autoencoder by performing the forward pass of the underlying transformer for a sequence of tokens, collecting the residual stream activation vectors at every layer, and stacking them together. Following Lieberum et al. (2024), we exclude activation vectors corresponding to special tokens (end-of-sentence, beginning-of-sentence, and padding). Hence, each batch has an equal number of activation vectors from each layer, which is the number of non-special tokens.
|
| 302 |
+
|
| 303 |
+
Following the optimization guidelines in Bricken et al. (2023); Gao et al. (2024), we initialize the pre-encoder bias $\mathbf{b}_{\mathrm{pre}}$ to the geometric median of the first training batch; we initialize the decoder weight matrix $\mathbf{W}_{\mathrm{dec}}$ to the transpose of the encoder $\mathbf{W}_{\mathrm{enc}}$ ; we scale the decoder weight vectors to unit norm at initialization and after each training step; and we remove the component of the gradient of the decoder weight matrix parallel to its weight vectors after each training step.
|
| 304 |
+
|
| 305 |
+
We use the Adam optimizer (Kingma & Ba, 2017) with the default $\beta$ parameters, a constant learning rate of $1\times 10^{-4}$ , and $\epsilon = 6.25\times 10^{-10}$ . Unlike Gao et al. (2024), we do not use gradient clipping or weight averaging, and we use FP16 mixed precision to reduce memory use.
|
| 306 |
+
|
| 307 |
+
# B EVALUATION
|
| 308 |
+
|
| 309 |
+
# B.1 RECONSTRUCTION ERROR AND SPARSITY
|
| 310 |
+
|
| 311 |
+
While we use the FVU instead of MSE as the reconstruction error in the training loss, we record both metrics for the inputs from each transformer layer and the mean over all layers (Figure 8). The $L^0$ norm of the latents is fixed at $k$ per activation vector (layer and token), but we record the $L^1$ norm (Figure 9). We report the values of these metrics over one million tokens from the test set.
|
| 312 |
+
|
| 313 |
+
For Pythia-70m, the FVU at each layer is comparable to Marks et al. (2024, p. 21), who trained separate SAEs with $n = 32768$ and $L^0$ norms between 54 and 108, as well as Cunningham et al. (2023, p. 13). For Pythia-160m, the FVU is similar to Gao et al. (2024), who report the normalized MSE on layer 8 of GPT-2 small.
|
| 314 |
+
|
| 315 |
+
# B.2 DOWNSSTREAM LOSS
|
| 316 |
+
|
| 317 |
+
In addition to the increase in cross-entropy (CE) loss, we record the Kullback-Leibler (KL) divergence between probability distributions when the residual stream activations at a given layer are replaced by their reconstruction (Section 4.1). We report the values of these metrics over one million tokens from the test set (Figure 10). The increase in cross-entropy loss is comparable to Marks et al. (2024, p. 21) for Pythia-70m, Gao et al. (2024, p. 5) and Braun et al. (2024) for GPT-2 small, and Lieberum et al. (2024, p. 7-8) for layer 20 of Gemma 2 2B and 9B.
|
| 318 |
+
|
| 319 |
+
# B.3 OTHER TRANSFORMER ARCHITECTURES
|
| 320 |
+
|
| 321 |
+
We predominantly study transformers from the Pythia suite because it affords a controlled setting to study how our results scale across model sizes (Biderman et al., 2023). While we do not expect our results to depend strongly on the underlying transformer architecture, we validated this assumption by training MLSAEs on Gemma 2 2B (Riviere et al., 2024), Llama 3.2 3B (Grattafori et al., 2024), and GPT-2 small (Radford et al., 2019) with our default hyperparameters, i.e., an expansion factor of $R = 64$ and sparsity $k = 32$ . We note that Gemma 2 2B and Llama 3.2 3B are similar in size to Pythia-2.8b, and GPT-2 small is similar in size to Pythia-160m.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
(a) Pythia-70m
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
(b) Pythia-160m
|
| 328 |
+
Figure 8: With fixed sparsity $k = 32$ , the FVU and MSE generally decrease as the expansion factor $R$ increases. For inputs from the last layer, they increase for the largest expansion factors, which we attribute to fluctuations in the percentage of dead latents (Figure 11). With fixed expansion factor $R = 64$ , the FVU and MSE decrease as the sparsity $k$ increases. While all inputs are standardized before passing them to the encoder, the decoder outputs are rescaled afterward. Hence, the MSE increases across layers because it is not divided by the variance of the inputs.
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
(a) Pythia-70m
|
| 332 |
+
|
| 333 |
+

|
| 334 |
+
(b) Pythia-160m
|
| 335 |
+
Figure 9: With fixed sparsity $k = 32$ , the $L^1$ norm per token (the sum of absolute activations) generally decreases as the expansion factor $R$ increases. With fixed expansion factor $R = 64$ , the $L^1$ norm increases as the sparsity $k$ increases. Recall that the $L^0$ norm per token (the count of non-zero activations) is fixed at $k$ .
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
(a) Pythia-70m
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
(b) Pythia-160m
|
| 342 |
+
Figure 10: With fixed sparsity $k = 32$ , the delta CE loss and KL divergence generally decrease as the expansion factor increases, except for inputs from the last layer. With fixed expansion factor $R = 64$ both metrics decrease as the sparsity $k$ increases, similarly to the FVU and MSE (Figure 8).
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 11: An illustration of the FVU for inputs from the last layer, compared to the auxiliary loss and percentage of dead latents, for MLSAEs trained on Pythia-70m with fixed sparsity $k = 32$ . An increase in dead latents correlates with a decrease in the auxiliary loss and an increase in the FVU at the last layer. We attribute this to the increased scale of the inputs because the auxiliary loss depends on the MSE (Figure 8). The auxiliary loss is multiplied by its coefficient $\alpha = 1/32$ in the training loss.
|
| 346 |
+
|
| 347 |
+
We include quantitative results for Gemma 2 2B, Llama 3.2 3B, and GPT-2 small in Table 1, Figure 5, and throughout Appendix B. We include heatmaps of the distributions of latent activations over layers in Figures 13, 14, 15, 16, 17, and 18, which are qualitatively similar to the Pythia models. Interestingly, we observed that our validation metrics improved at a slower rate for Gemma 2 2B, so we continued to train this MLSAE up to a total of approximately 2.5 billion tokens. Nevertheless, the increase in the cross-entropy loss remains larger than other models of similar sizes (Table 1).
|
| 348 |
+
|
| 349 |
+
# B.4 SINGLE-LAYER SAES
|
| 350 |
+
|
| 351 |
+
While we compare the performance of our multi-layer SAEs to single-layer SAEs from the literature in Appendix B.1 and B.2, we also trained multiple single-layer SAEs on Pythia-70m, 160m, and 410m with our default hyperparameters, leaving the remainder of the experimental setup unchanged.
|
| 352 |
+
|
| 353 |
+
Predictably, we find that a single-layer SAE trained on data from a given layer performs best on test data from the same layer (Figures 19, 20, and 21). A multi-layer SAE trained on data from every layer performs comparably to the corresponding single-layer SAE, and more consistently across test data from different layers. Interestingly, applying the corresponding tuned-lens transformation to the input activations from each layer during training and evaluation degrades the performance of single-layer SAEs on test data from different layers of Pythia-70m, unlike multi-layer SAEs (Figure 12).
|
| 354 |
+
|
| 355 |
+
Importantly, the results for the last layer are excluded from these figures. This is because we take the residual stream activation vectors after a given layer has been applied (Section 3.1), such that the last-layer activations represent only the next-token predictions of the model and not intermediate computational variables. Hence, we expect these activations to have a significantly different structure to the preceding layers, which could distort comparisons between layers (Lad et al., 2024).
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 12: For Pythia-70m, applying tuned-lens transformations decreases the mean FVU and delta cross-entropy loss but not the KL divergence. Importantly, we compute reconstruction errors before applying the inverse transformation and downstream loss metrics afterward (Section 3.3). Unlike Figure 10, we use a linear scale for the delta cross-entropy loss because, surprisingly, it is negative for tuned-lens MLSAEs with a large expansion factor $R$ or sparsity $k$ ; see also Figure 22.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 13: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for MLSAEs trained on GPT-2 small with an expansion factor of $R = 64$ . We provide further details in Figure 2.
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 14: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for MLSAEs trained on GPT-2 small with an expansion factor of $R = 64$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 15: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for MLSAEs trained on Gemma 2 2B with an expansion factor of $R = 64$ . We provide further details in Figure 2.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 16: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for MLSAEs trained on Gemma 2 2B with an expansion factor of $R = 64$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 17: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for MLSAEs trained on Llama 3.2 3B with an expansion factor of $R = 64$ . We provide further details in Figure 2. Notably, a greater proportion of latents are only active at the first layer compared with other transformer architectures.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 18: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for MLSAEs trained on Llama 3.2 3B with an expansion factor of $R = 64$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Figure 19: The FVU reconstruction error and delta cross-entropy loss for single-layer SAEs trained on each layer of Pythia-70m, compared with a single multi-layer SAE trained on every layer. The single-layer SAEs trained on data from a given layer perform best on test data from the same layer (the diagonal elements of the matrix plot); a multi-layer SAE trained on data from every layer performs comparably to the corresponding single-layer SAEs (the row beneath the matrix plot).
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 20: The FVU reconstruction error and delta cross-entropy loss for single-layer SAEs trained on each layer of Pythia-160m, compared with a single multi-layer SAE trained on every layer. The single-layer SAEs trained on data from a given layer perform best on test data from the same layer (the diagonal elements of the matrix plot); a multi-layer SAE trained on data from every layer performs comparably to the corresponding single-layer SAEs (the row beneath the matrix plot).
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 21: The FVU reconstruction error and delta cross-entropy loss for single-layer SAEs trained on each layer of Pythia-410m, compared with a single multi-layer SAE trained on every layer. The single-layer SAEs trained on data from a given layer perform best on test data from the same layer (the diagonal elements of the matrix plot); a multi-layer SAE trained on data from every layer performs comparably to the corresponding single-layer SAEs (the row beneath the matrix plot). Interestingly, there is a sharp change in the FVU between single-layer SAEs trained on layers 4 and 5.
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 22: The FVU reconstruction error and delta cross-entropy loss for single-layer SAEs trained on each layer of Pythia-70m compared with a single multi-layer SAE trained on every layer, applying tuned-lens transformations during training and evaluation (Section 3.3).
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
|
| 398 |
+
# B.5 MEAN MAX COSINE SIMILARITY
|
| 399 |
+
|
| 400 |
+
Sharkey et al. (2022) define the Mean Max Cosine Similarity (MMCS) between a learned dictionary $X$ and a ground-truth dictionary $X'$ . There is no ground-truth dictionary for language models, so a larger learned dictionary or the $k$ nearest neighbors to each dictionary element are commonly used.
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
\operatorname {M M C S} \left(X, X ^ {\prime}\right) = \frac {1}{| X |} \sum_ {\mathbf {x} \in X} \max _ {\mathbf {x} ^ {\prime} \in X ^ {\prime}} \cos \sin (\mathbf {x}, \mathbf {x} ^ {\prime}) \tag {13}
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
The MMCS serves as a proxy measure for 'feature splitting' (Bricken et al., 2023; Braun et al., 2024): as the number of features increases, we expect the decoder weight vectors to be more similar to their nearest neighbors. We compute the MMCS with $k = 1$ after training, finding it decreases slightly as the model size increases with fixed hyperparameters (Table 2).
|
| 407 |
+
|
| 408 |
+
# B.6 PAIRWISE COSINE SIMILARITIES
|
| 409 |
+
|
| 410 |
+
A potential issue when training multi-layer SAEs is learning multiple versions of 'the same' latent, i.e., multiple latents with similar interpretable functions but which are active at different layers. In this case, we would expect to find pairs of latents with relatively large cosine similarities between their decoder weight vectors but different observed distributions of activations over layers (Section 4.3). We investigated this possibility by comparing the distributions of pairwise cosine similarities between decoder weight vectors for trained MLSAEs to reference distributions.
|
| 411 |
+
|
| 412 |
+
As a negative control, we generated an equal number (the number of latents $n$ ) of normal independently and identically distributed (i.i.d.) vectors $\mathbf{x} \sim \mathcal{N}(\mathbf{0},\mathbf{I})$ of the same length (the model dimension $d$ ). In this case, the pairwise cosine similarities follow a normal distribution $\cos \sin (\mathbf{x},\mathbf{x}^{\prime}) \sim \mathcal{N}(0,1 / d)$ . As a positive control, we generated a smaller number of normal i.i.d. vectors (the number of latents $n$ divided by the number of layers $n_L$ ), copied the vectors $n_L$ times, and added noise $\sim \mathcal{N}(0,1)$ to each copy. In this case, we expect an additional frequency peak for large positive cosine similarities.
|
| 413 |
+
|
| 414 |
+
Figure 24 shows that the distributions of pairwise cosine similarities for decoder weight vectors are slightly heavier-tailed and right-shifted compared with the negative control, i.e., a pair of MLSAE latents are slightly more likely to have high cosine similarity than a pair of i.i.d. normal vectors. However, the number of pairs with large positive cosine similarities is small compared to the positive control, which has a second peak around 0.5 (visible only with the logarithmic $y$ -axis scale).
|
| 415 |
+
|
| 416 |
+
<table><tr><td>Model</td><td>Mean</td><td>Std. Dev.</td></tr><tr><td>Pythia-70m</td><td>0.275</td><td>0.0843</td></tr><tr><td>Pythia-160m</td><td>0.250</td><td>0.0928</td></tr><tr><td>Pythia-410m</td><td>0.221</td><td>0.0868</td></tr><tr><td>Pythia-1b</td><td>0.201</td><td>0.0989</td></tr><tr><td>Pythia-1.4b</td><td>0.180</td><td>0.0861</td></tr><tr><td>Gemma 2 2B</td><td>0.249</td><td>0.1052</td></tr><tr><td>Llama 3.2 3B</td><td>0.215</td><td>0.1187</td></tr><tr><td>GPT-2 small</td><td>0.258</td><td>0.0703</td></tr></table>
|
| 417 |
+
|
| 418 |
+
(a) Standard
|
| 419 |
+
|
| 420 |
+
<table><tr><td>Model</td><td>Mean</td><td>Std. Dev.</td></tr><tr><td>Pythia-70m</td><td>0.261</td><td>0.0763</td></tr><tr><td>Pythia-160m</td><td>0.206</td><td>0.0734</td></tr><tr><td>Pythia-410m</td><td>0.216</td><td>0.0864</td></tr></table>
|
| 421 |
+
|
| 422 |
+
(b) Tuned lens
|
| 423 |
+
|
| 424 |
+
Table 2: The mean and standard deviation of the maximum cosine similarity between decoder weight vectors for MLSAEs with an expansion factor of $R = 64$ and sparsity $k = 32$ . The MMCS decreases as the model size increases for Pythia transformers.
|
| 425 |
+
|
| 426 |
+

|
| 427 |
+
Figure 23: The Mean Max Cosine Similarity between decoder weight vectors for standard and tuned-lens MLSAEs. The MMCS increases as the expansion factor $R$ increases and decreases as the sparsity $k$ increases. Applying tuned-lens transformations slightly decreases the MMCS relative to standard MLSAEs.
|
| 428 |
+
|
| 429 |
+

|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
|
| 433 |
+

|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
|
| 437 |
+

|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
|
| 445 |
+
Figure 24: Histograms of the frequencies of pairwise cosine similarities between decoder weight vectors, compared to an equal number of normal i.i.d. vectors of the same length, and $n_{L}$ copies of a smaller number of normal i.i.d. vectors with added noise $\sim \mathcal{N}(0,1)$ . Here, we report the frequencies for MLSAEs trained on Pythia models with an expansion factor of $R = 64$ and sparsity $k = 32$ . The left-hand $y$ -axis scale is linear, the right-hand is logarithmic.
|
| 446 |
+

|
| 447 |
+
Decoder weight vectors
|
| 448 |
+
Normal i.i.d. vectors (negative control)
|
| 449 |
+
|
| 450 |
+

|
| 451 |
+
Paired normal i.i.d. vectors plus noise (positive control)
|
| 452 |
+
|
| 453 |
+
# C MEASURES OF LATENTS ACTIVE AT MULTIPLE LAYERS
|
| 454 |
+
|
| 455 |
+
# C.1 HEATMAP NORMALIZATION
|
| 456 |
+
|
| 457 |
+
In the aggregate and single-prompt heatmaps such as Figures 2 and 3, we plot the distributions of latent activations over layers, which we take to be proportional to the total activations when aggregating over a large sample of tokens (Eq. 10). We normalized the latent activations in this way to visually compare the aggregate and single-prompt heatmaps, as well as individual latents within a heatmap, due to the wide range of activation counts and totals across latents.
|
| 458 |
+
|
| 459 |
+
Normalizing the activations discards the relative frequencies and magnitudes of activations for different latents, so we reproduce Figures 2 and 3 with the un-normalized totals of latent activations in Figures 25 and 26. We use power-law normalization for the colormaps, i.e., $y = x^{\gamma}$ , to account for the wide range of values; all other heatmaps have linear colormaps. As with all other single-prompt heatmaps, we exclude latents from Figure 26 that never activate. In both cases, the un-normalized results are qualitatively similar to the normalized results.
|
| 460 |
+
|
| 461 |
+
# C.2 VARIANCE OF THE LAYER INDEX
|
| 462 |
+
|
| 463 |
+
Recall that we consider the layer $L$ , token $T$ , and latent index $J$ as random variables (Section 4.3). For a single latent, we have, by the law of total variance:
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\operatorname {V a r} [ L ] = \mathbb {E} [ \operatorname {V a r} [ L \mid T ] ] + \operatorname {V a r} [ \mathbb {E} [ L \mid T ] ] \tag {14}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
We are interested in the first two terms:
|
| 470 |
+
|
| 471 |
+
- Var $[L]$ is the variance of the distribution over layers, aggregating over tokens;
|
| 472 |
+
- $\mathbb{E}[\operatorname{Var}[L \mid T]]$ is the mean variance of the distributions over layers for each token; and
|
| 473 |
+
- Var $\left[\mathbb{E}[L\mid T]\right]$ is the variance of the mean layers for each token.
|
| 474 |
+
|
| 475 |
+
Aggregating over latents, we have:
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\mathbb {E} [ \operatorname {V a r} [ L \mid J ] ] = \mathbb {E} [ \operatorname {V a r} [ L \mid T, J ] ] + \mathbb {E} [ \operatorname {V a r} [ \mathbb {E} [ L \mid T, J ] \mid J ] ] \tag {15}
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
# C.3 NUMBER OF LAYERS ABOVE A THRESHOLD
|
| 482 |
+
|
| 483 |
+
The count of layers at which a latent is non-zero ('active') does not necessarily positively correlate with the variance of the layer index considered in Section 4.3. For example, the variance of 0 and 5 (two distinct values) is greater than the variance of 2, 3, and 4 (three distinct values). Strictly speaking, the layer index is ordinal data, but we implicitly treat it as interval data by taking the arithmetic mean and variance. We chose this approach because we expected latents to be active over a contiguous range of layers, which is validated qualitatively by the heatmaps such as Figures 2 and 3.
|
| 484 |
+
|
| 485 |
+
For comparison, we computed the number of layers at which each latent has a count of non-zero activations above a threshold ('active layers') divided by the total number of model layers $n_{L}$ . We selected a threshold count of 10k tokens (0.1% of a sample of 10M tokens). When aggregating over latents, the relative mean active layers decreases as the model size increases for Pythia models (Figure 28a) and as the number of latents increases relative to the model dimension (Figure 28b). Importantly, this measure depends strongly on the choice of threshold, unlike our variance ratios.
|
| 486 |
+
|
| 487 |
+
# C.4 ENTROPY
|
| 488 |
+
|
| 489 |
+
A further measure of the degree to which a latent is active at multiple layers is the statistical distance between the observed discrete distribution of activations over layers (Eq. 10) and a reference distribution. At one extreme is a Dirac distribution with probability mass 1 for a single layer index and 0 elsewhere, in which case the latent is active at a single layer. The other extreme is the discrete uniform distribution $\mathcal{U}(0, n_L)$ , in which case the latent is equally active at every layer. Hence, the entropy of the observed distribution ranges between 0 and $\ln n_L$ . Notably, the entropy of the observed distribution is agnostic with respect to the numeric values of the layer indices and their ordering.
|
| 490 |
+
|
| 491 |
+

|
| 492 |
+
Figure 25: Heatmaps of the total latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the totals for MLSAEs trained on Pythia models with an expansion factor of $R = 64$ and sparsity $k = 32$ . We provide further details in Figure 2. The colormaps use power-law normalization with $\gamma = 1/4$ .
|
| 493 |
+
|
| 494 |
+

|
| 495 |
+
Figure 26: Heatmaps of the total latent activations over layers for a single example prompt. Here, we plot the totals for MLSAEs with an expansion factor of $R = 64$ and sparsity $k = 32$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3. The colormaps use power-law normalization with $\gamma = 1/2$ .
|
| 496 |
+
|
| 497 |
+

|
| 498 |
+
Figure 27: The fraction of the total variance explained by individual latents and the fraction of the variance for an individual latent explained by individual tokens (Eqs. 11 and 12). Here, we plot the variance ratios for standard and tuned-lens MLSAEs over 10 million tokens from the test set.
|
| 499 |
+
|
| 500 |
+

|
| 501 |
+
(a) Varying the model with an expansion factor of $R = 64$ and sparsity $k = 32$
|
| 502 |
+
|
| 503 |
+

|
| 504 |
+
(b) Varying the expansion factor $R$ with sparsity $k = 32$ and $k$ with $R = 64$
|
| 505 |
+
Figure 28: The mean number of layers at which latents have a count of non-zero activations above a threshold divided by the total number of model layers, over 10 million tokens from the test set. The threshold is 10 thousand tokens (0.1%). As in Figure 5, the absence of bars for tuned-lens MLSAEs indicates the absence of results, not that the values are zero. The mean active layers decreases as the expansion factor $R$ increases, and increases as the sparsity $k$ increases up to a point. There is no clear trend with respect to the model size. Notably, applying tuned-lens transformations to the input activations from each layer decreases the mean active layers (Section 3.3).
|
| 506 |
+
|
| 507 |
+

|
| 508 |
+
(a) Varying the model with an expansion factor of $R = 64$ and sparsity $k = 32$
|
| 509 |
+
|
| 510 |
+

|
| 511 |
+
(b) Varying the expansion factor $R$ with sparsity $k = 32$ and $k$ with $R = 64$
|
| 512 |
+
Figure 29: The mean entropy of the observed discrete distributions of latent activations over layers (Eq. 10) divided by the maximum entropy $\ln n_{L}$ , over 10 million tokens from the test set. As in Figure 5, the absence of bars for tuned-lens MLSAEs indicates the absence of results, not that the values are zero. The entropy tends to decrease as the expansion factor $R$ increases, to increase as the sparsity $k$ increases, and to increase as the model size increases for Pythia transformers.
|
| 513 |
+
|
| 514 |
+
We computed the entropy of the observed distributions of activations over layers, took the mean over latents, and divided it by $\ln n_{L}$ to compare models with different numbers of layers. The normalized mean entropy increases slightly as the model size increases for Pythia models (Figure 29a), similarly to the variance of the layer index (Section 4.3). However, it decreases as the number of latents increases relative to the model dimension, similarly to the mean active layers (Figure 29b).
|
| 515 |
+
|
| 516 |
+
# D ADDITIONAL HEATMAPS
|
| 517 |
+
|
| 518 |
+
For completeness, we include equivalent aggregate and single-prompt heatmaps to Figures 2 and 3 for different models and combinations of hyperparameters:
|
| 519 |
+
|
| 520 |
+
- Varying $R$ for Pythia-70m and $k = 32$ (Figures 30 and 31)
|
| 521 |
+
- Varying $k$ for Pythia-70m and $R = 64$ (Figures 32 and 33)
|
| 522 |
+
- Varying $R$ for Pythia-160m and $k = 32$ (Figures 34 and 35)
|
| 523 |
+
- Varying $k$ for Pythia-160m and $R = 64$ (Figures 36 and 37)
|
| 524 |
+
- Varying $R$ for Pythia-70m with tuned lens and $k = 32$ (Figures 38 and 39)
|
| 525 |
+
- Varying $k$ for Pythia-70m with tuned lens and $R = 64$ (Figures 40 and 41)
|
| 526 |
+
|
| 527 |
+

|
| 528 |
+
$R = 2$
|
| 529 |
+
|
| 530 |
+

|
| 531 |
+
|
| 532 |
+

|
| 533 |
+
$R = 4$
|
| 534 |
+
|
| 535 |
+

|
| 536 |
+
$R = 8$
|
| 537 |
+
|
| 538 |
+

|
| 539 |
+
$R = 16$
|
| 540 |
+
|
| 541 |
+

|
| 542 |
+
$R = 32$
|
| 543 |
+
|
| 544 |
+

|
| 545 |
+
$R = 64$
|
| 546 |
+
|
| 547 |
+

|
| 548 |
+
$R = 128$
|
| 549 |
+
|
| 550 |
+

|
| 551 |
+
$R = 256$
|
| 552 |
+
Latent
|
| 553 |
+
Figure 30: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for MLSAEs trained on Pythia-70m with sparsity $k = 32$ . We provide further details in Figure 2.
|
| 554 |
+
|
| 555 |
+

|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
|
| 559 |
+

|
| 560 |
+
|
| 561 |
+

|
| 562 |
+
|
| 563 |
+

|
| 564 |
+
|
| 565 |
+

|
| 566 |
+
|
| 567 |
+

|
| 568 |
+
|
| 569 |
+

|
| 570 |
+
|
| 571 |
+

|
| 572 |
+
Figure 31: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for MLSAEs trained on Pythia-70m with sparsity $k = 32$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
| 573 |
+
|
| 574 |
+

|
| 575 |
+
|
| 576 |
+

|
| 577 |
+
$k = 32$
|
| 578 |
+
|
| 579 |
+

|
| 580 |
+
$k = 64$
|
| 581 |
+
|
| 582 |
+

|
| 583 |
+
$k = 128$
|
| 584 |
+
|
| 585 |
+

|
| 586 |
+
$k = 256$
|
| 587 |
+
|
| 588 |
+

|
| 589 |
+
$k = 512$
|
| 590 |
+
Figure 32: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for MLSAEs trained on Pythia-70m with an expansion factor of $R = 64$ . We provide further details in Figure 2.
|
| 591 |
+
|
| 592 |
+

|
| 593 |
+
|
| 594 |
+

|
| 595 |
+
|
| 596 |
+

|
| 597 |
+
|
| 598 |
+

|
| 599 |
+
|
| 600 |
+

|
| 601 |
+
|
| 602 |
+

|
| 603 |
+
Figure 33: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for MLSAEs trained on Pythia-70m with an expansion factor of $R = 64$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
| 604 |
+
|
| 605 |
+

|
| 606 |
+
|
| 607 |
+

|
| 608 |
+
$R = 2$
|
| 609 |
+
|
| 610 |
+

|
| 611 |
+
$R = 4$
|
| 612 |
+
|
| 613 |
+

|
| 614 |
+
$R = 8$
|
| 615 |
+
|
| 616 |
+

|
| 617 |
+
$R = 16$
|
| 618 |
+
|
| 619 |
+

|
| 620 |
+
$R = 32$
|
| 621 |
+
|
| 622 |
+

|
| 623 |
+
$R = 64$
|
| 624 |
+
|
| 625 |
+

|
| 626 |
+
$R = 128$
|
| 627 |
+
|
| 628 |
+

|
| 629 |
+
$R = 256$
|
| 630 |
+
Latent
|
| 631 |
+
Figure 34: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for MLSAEs trained on Pythia-160m with sparsity $k = 32$ . We provide further details in Figure 2.
|
| 632 |
+
|
| 633 |
+

|
| 634 |
+
|
| 635 |
+

|
| 636 |
+
|
| 637 |
+

|
| 638 |
+
|
| 639 |
+

|
| 640 |
+
|
| 641 |
+

|
| 642 |
+
|
| 643 |
+

|
| 644 |
+
|
| 645 |
+

|
| 646 |
+
|
| 647 |
+

|
| 648 |
+
|
| 649 |
+

|
| 650 |
+
Figure 35: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for MLSAEs trained on Pythia-160m with sparsity $k = 32$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
| 651 |
+
|
| 652 |
+

|
| 653 |
+
|
| 654 |
+

|
| 655 |
+
$k = 32$
|
| 656 |
+
|
| 657 |
+

|
| 658 |
+
$k = 64$
|
| 659 |
+
|
| 660 |
+

|
| 661 |
+
$k = 128$
|
| 662 |
+
|
| 663 |
+

|
| 664 |
+
$k = 256$
|
| 665 |
+
|
| 666 |
+

|
| 667 |
+
$k = 512$
|
| 668 |
+
Figure 36: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for MLSAEs trained on Pythia-160m with an expansion factor of $R = 64$ . We provide further details in Figure 2.
|
| 669 |
+
|
| 670 |
+

|
| 671 |
+
|
| 672 |
+

|
| 673 |
+
|
| 674 |
+

|
| 675 |
+
|
| 676 |
+

|
| 677 |
+
|
| 678 |
+

|
| 679 |
+
|
| 680 |
+

|
| 681 |
+
Figure 37: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for MLSAEs trained on Pythia-160m with an expansion factor of $R = 64$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
| 682 |
+
|
| 683 |
+

|
| 684 |
+
Figure 38: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for tuned-lens MLSAEs trained on Pythia-70m with sparsity $k = 32$ . We provide further details in Figure 2.
|
| 685 |
+
|
| 686 |
+

|
| 687 |
+
|
| 688 |
+

|
| 689 |
+
$R = 2$
|
| 690 |
+
|
| 691 |
+

|
| 692 |
+
$R = 4$
|
| 693 |
+
|
| 694 |
+

|
| 695 |
+
$R = 8$
|
| 696 |
+
|
| 697 |
+

|
| 698 |
+
$R = 16$
|
| 699 |
+
|
| 700 |
+

|
| 701 |
+
$R = 32$
|
| 702 |
+
|
| 703 |
+

|
| 704 |
+
$R = 64$
|
| 705 |
+
|
| 706 |
+

|
| 707 |
+
$R = 128$
|
| 708 |
+
|
| 709 |
+

|
| 710 |
+
$R = 256$
|
| 711 |
+
Latent
|
| 712 |
+
Figure 39: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for tuned-lens MLSAEs trained on Pythia-70m with sparsity $k = 32$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
| 713 |
+
|
| 714 |
+

|
| 715 |
+
|
| 716 |
+

|
| 717 |
+
$k = 32$
|
| 718 |
+
|
| 719 |
+

|
| 720 |
+
$k = 64$
|
| 721 |
+
|
| 722 |
+

|
| 723 |
+
$k = 128$
|
| 724 |
+
|
| 725 |
+

|
| 726 |
+
$k = 256$
|
| 727 |
+
|
| 728 |
+

|
| 729 |
+
$k = 512$
|
| 730 |
+
Figure 40: Heatmaps of the distributions of latent activations over layers when aggregating over 10 million tokens from the test set. Here, we plot the distributions for tuned-lens MLSAEs trained on Pythia-70m with an expansion factor of $R = 64$ . We provide further details in Figure 2.
|
| 731 |
+
|
| 732 |
+

|
| 733 |
+
|
| 734 |
+

|
| 735 |
+
$k = 32$
|
| 736 |
+
|
| 737 |
+

|
| 738 |
+
$k = 64$
|
| 739 |
+
|
| 740 |
+

|
| 741 |
+
$k = 128$
|
| 742 |
+
|
| 743 |
+

|
| 744 |
+
$k = 256$
|
| 745 |
+
|
| 746 |
+

|
| 747 |
+
$k = 512$
|
| 748 |
+
Figure 41: Heatmaps of the distributions of latent activations over layers for a single example prompt. Here, we plot the distributions for tuned-lens MLSAEs trained on Pythia-70m with an expansion factor of $R = 64$ . The example prompt is "When John and Mary went to the store, John gave" (Wang et al., 2022). We provide further details in Figure 3.
|
2025/Residual Stream Analysis with Multi-Layer SAEs/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d462c37ba3117cec1f3b6b2a943f3f7f596fe81342b751789a8018129a589357
|
| 3 |
+
size 3957347
|
2025/Residual Stream Analysis with Multi-Layer SAEs/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Residual-MPPI_ Online Policy Customization for Continuous Control/625fdd9e-3614-412b-932f-3c849bf63d56_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|