# test-time-training/ttt-lm-pytorch

Official PyTorch implementation of Learning to (Learn at Test Time): RNNs with Expressive Hidden States

Repository: https://github.com/test-time-training/ttt-lm-pytorch
Canonical: https://ross.abutalabs.com/products/ttt-lm-pytorch
Language: Python
License: MIT
License Family: permissive
Last push: 2024-07-14T21:32:57+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 56
- inputs: {"age_days": 796, "days_push": 780, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1388, forks 81 (observed 2026-08-28T04:04:35.274942+00:00)

## What it is
Official PyTorch implementation of Test-Time Training (TTT) layers, a sequence modeling layer with linear complexity whose hidden state is itself a small ML model updated via self-supervised learning. It provides TTT-Linear and TTT-MLP causal language models integrated with Huggingface Transformers.

## Use cases
- run a language model with linear-complexity TTT layers instead of self-attention
- experiment with TTT-Linear and TTT-MLP architectures in PyTorch
- load and generate text with TTTForCausalLM via Huggingface Transformers
- study the implementation of learning-at-test-time sequence layers
- prototype long-context sequence models without quadratic attention cost

## When to choose
- you want a readable, tutorial-style PyTorch reference implementation of TTT layers
- you need to integrate TTT models into a Huggingface Transformers pipeline
- you are doing research or education on expressive hidden states for RNNs

## When to avoid
- you need fast training - the authors recommend the JAX codebase instead
- you need optimized inference speed - use the ttt-lm-kernels repository
- you need a production-ready, systems-optimized language model implementation

## Facets
- artifact type: library
- maturity: experimental
- function: machine-learning, deep-learning, llm-inference
- domain: deep-learning, large-language-models
- platform: python
- tags: test-time-training, rnn, sequence-modeling, pytorch, huggingface-transformers, research-code, natural-language-processing, gpu

## Member repositories
- test-time-training/ttt-lm-pytorch (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:35.274942+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-30T04:39:47.619815+00:00, confidence not recorded.
  - readme: https://github.com/test-time-training/ttt-lm-pytorch (fetched 2026-08-28T04:04:35.274942+00:00, sha 35f948b477c9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
