PyTorch module for memory-efficient Transformers, based on the Titans paper
Top 29.2% on sourcepulse
This repository provides an unofficial PyTorch implementation of Titans, a state-of-the-art memory mechanism for transformers designed to enhance their ability to learn and adapt at test time. It targets researchers and engineers working on advanced transformer architectures seeking improved performance and adaptability in sequence modeling tasks.
How It Works
The core of the implementation is the NeuralMemory
module, which acts as an external memory for transformers. It utilizes a multi-layer perceptron (MLP) for its neural memory component, allowing transformers to store and retrieve information efficiently. The MemoryAsContextTransformer
class integrates this memory directly into the transformer architecture, enabling it to condition its output on the learned memory states, thereby improving context retention and learning during inference.
Quick Start & Requirements
pip install titans-pytorch
.cuda()
calls).Highlighted Details
MemoryAsContextTransformer
for direct integration into transformer models.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
This is an unofficial implementation, meaning it may not perfectly mirror the original Titans paper or receive official support. The use of .cuda()
implies a dependency on NVIDIA GPUs and CUDA, and no CPU fallback is evident.
2 months ago
1 day