Itamarzimm/UnifiedImplicitAttnRepr

[ICLR 2025] Official Code Release for Explaining Modern Gated-Linear RNNs via a Unified Implicit Attention Formulation

50

stars

18

commits

Python

primary language

Mar 1, 2025

updated

arxiv.org/abs/2405.16504

README

Explaining Modern Gated-Linear RNNs via a Unified Implicit Attention Formulation

Itamar Zimerman1 *, Ameen Ali1 * and Lior Wolf1
itamarzimm@gmail.com, ameenali023@gmail.com, liorwolf@gmail.com
1 Tel Aviv University, (*) equal contribution


This repository provides the official implementation for Explaining Modern Gated-Linear RNNs via A Unified Implicit Attention Formulation.

The purpose of this repository is to provide tools for the explainability and interpretability of modern sub-quadratic architectures, based on implicit attention representation.

Supported Models:



Left Image
Left Image

Usage:

We provide the following Jupyter notebooks ('I' denotes installation instructions.):

Vision

  • For the segmentation experiemt:
    1. Download the data gtsegs_ijcv.mat and put it under '/UnifiedImplicitAttnRepr/MambaVision'
    2. Configure Checkpoint path at line 466 in imagenet_seg.eval.py (You can download the checkpoint from vim_s_midclstok_80p5acc.pth and put it under '/UnifiedImplicitAttnRepr/MambaVision')
    3. run 'python ./UnifiedImplicitAttnRepr/MambaVision/imagenet_seg_eval.py'
  • For Heatmap Extraction follow the notebook in './UnifiedImplicitAttnRepr/MambaVision/Inference.ipynb'

Citation

If you use this codebase, or otherwise found our work valuable, please cite:

@inproceedings{
zimerman2025explaining,
title={Explaining Modern Gated-Linear {RNN}s via a Unified Implicit Attention Formulation},
author={Itamar Zimerman and Ameen Ali Ali and Lior Wolf},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=wnT8bfJCDx}
}

Acknowledgement:

This repository is heavily based on Transformers and Mamba. Thanks for their wonderful works.

Contributors

Itamarzimm

11 commits

AmeenAli

6 commits

Itamarzimm/UnifiedImplicitAttnRepr

[ICLR 2025] Official Code Release for Explaining Modern Gated-Linear RNNs via a Unified Implicit Attention Formulation

50

stars

18

commits

Python

primary language

Mar 1, 2025

updated

arxiv.org/abs/2405.16504

README

Explaining Modern Gated-Linear RNNs via a Unified Implicit Attention Formulation

Itamar Zimerman1 *, Ameen Ali1 * and Lior Wolf1
itamarzimm@gmail.com, ameenali023@gmail.com, liorwolf@gmail.com
1 Tel Aviv University, (*) equal contribution


This repository provides the official implementation for Explaining Modern Gated-Linear RNNs via A Unified Implicit Attention Formulation.

The purpose of this repository is to provide tools for the explainability and interpretability of modern sub-quadratic architectures, based on implicit attention representation.

Supported Models:



Left Image
Left Image

Usage:

We provide the following Jupyter notebooks ('I' denotes installation instructions.):

Vision

  • For the segmentation experiemt:
    1. Download the data gtsegs_ijcv.mat and put it under '/UnifiedImplicitAttnRepr/MambaVision'
    2. Configure Checkpoint path at line 466 in imagenet_seg.eval.py (You can download the checkpoint from vim_s_midclstok_80p5acc.pth and put it under '/UnifiedImplicitAttnRepr/MambaVision')
    3. run 'python ./UnifiedImplicitAttnRepr/MambaVision/imagenet_seg_eval.py'
  • For Heatmap Extraction follow the notebook in './UnifiedImplicitAttnRepr/MambaVision/Inference.ipynb'

Citation

If you use this codebase, or otherwise found our work valuable, please cite:

@inproceedings{
zimerman2025explaining,
title={Explaining Modern Gated-Linear {RNN}s via a Unified Implicit Attention Formulation},
author={Itamar Zimerman and Ameen Ali Ali and Lior Wolf},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=wnT8bfJCDx}
}

Acknowledgement:

This repository is heavily based on Transformers and Mamba. Thanks for their wonderful works.

Contributors

Itamarzimm

11 commits

AmeenAli

6 commits

Languages

Python

97.9%