# lucidrains/titans-pytorch

Unofficial implementation of Titans, SOTA memory for transformers, in Pytorch

Repository: https://github.com/lucidrains/titans-pytorch
Canonical: https://ross.abutalabs.com/products/titans-pytorch
Language: Python
License: MIT
License Family: permissive
Topics: artificial-intelligence, deep-learning, long-term-memory, test-time-training
Last push: 2026-07-13T14:26:28+00:00

## Health v2 (maintenance only)
Score: 70/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 92, release rhythm 57, longevity 43
- inputs: {"age_days": 602, "days_push": 51, "days_rel": 205, "gap_med": 0.0, "n_releases_24m": 161}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1980, forks 208 (observed 2026-08-28T04:06:01.675321+00:00)

## What it is
An unofficial PyTorch implementation of the Titans architecture, a neural long-term memory module for transformers that learns to memorize at test time. It provides the NeuralMemory module and a MemoryAsContextTransformer for training and sampling.

## Use cases
- implement the Titans neural memory architecture in pytorch
- train a transformer with long-term memory at test time
- experiment with memory-as-context transformer architectures
- research test-time training and linear attention memory
- build transformers that handle very long sequences

## When to choose
- you want to experiment with or reproduce the Titans paper in PyTorch
- you need a drop-in neural memory module for custom transformer research
- you are exploring architectures beyond standard attention for long contexts

## When to avoid
- you need a production-ready, officially supported LLM implementation
- you want a pretrained model rather than components to train yourself
- you need guaranteed fidelity to the paper since this is unofficial

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning, llm-training
- domain: deep-learning, large-language-models, artificial-intelligence
- platform: python
- tags: transformers, neural-memory, test-time-training, long-context, research-implementation, pytorch, gpu

## Member repositories
- lucidrains/titans-pytorch (main) score 70

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:01.675321+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:04:00.461452+00:00, confidence not recorded.
  - readme: https://github.com/lucidrains/titans-pytorch (fetched 2026-08-28T04:06:01.675321+00:00, sha b141fc6d947d)
  - registry_pypi: https://pypi.org/pypi/titans-pytorch/json (fetched 2026-08-29T10:43:24.934806+00:00, sha 937b2f800a67)
- Data as of 2026-08-30T08:39:29.467469+00:00.
