#807 · Primary category: Education & Research
memorizing-transformers-pytorch
Implementation of Memorizing Transformers (ICLR 2022), attention net augmented with indexing and retrieval of memories using approximate nearest neighbors, in Pytorch
Project last updated:07/17/23
GitHub Stars
646
Forks
49
Contributors
2
License
MIT
Why we included this project
Researchers and ML engineers experimenting with memory-augmented attention will find a clean, self-contained PyTorch implementation of the Memorizing Transformers idea from ICLR 2022. Instead of relying only on the current context window, the model indexes past token representations in an approximate-nearest-neighbor store and pulls relevant memories back into attention, a direction worth exploring for long-context and continual-learning work. The code follows the paper closely but with two deliberate changes: hybrid attention over local and distant logits rather than the sigmoid gate, and cosine-similarity attention with a learned temperature. It wraps faiss for the ANN index, shows how to pair the approach with Transformer-XL style memory, and ships an enwik8 training script. If you are reproducing or extending retrieval-augmented transformer research rather than shipping a production system, this is a handy reference to study and adapt.
Articles for this project
No articles for this project yet.
To suggest a topic or contribute an article, contact us.
Related projects in this category
prompts.chat
f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.
JavaGuide
Java Interview & Backend General Interview Guide, covering computer fundamentals, databases, distributed systems, high concurrency, system design, and AI application development.
system-prompts-and-models-of-ai-tools
A curated collection of system prompts, internal tools, and AI models from popular AI assistants and coding agents.
30-seconds-of-code
Coding articles to level up your development skills
generative-ai-for-beginners
21 Lessons, Get Started Building with Generative AI