# Ma-Lab-Berkeley/CRATE

Code for CRATE (Coding RAte reduction TransformEr).

Repository: https://github.com/Ma-Lab-Berkeley/CRATE
Canonical: https://ross.abutalabs.com/products/ma-lab-berkeley-crate
Language: Python
License: MIT
License Family: permissive
Topics: compression, sparsification, transformer-architecture, white-box-architecture
Last push: 2024-10-23T15:24:28+00:00

## Health v2 (maintenance only)
Score: 29/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 85
- inputs: {"age_days": 1192, "days_push": 679, "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 1275, forks 99 (observed 2026-08-28T04:04:12.971721+00:00)

## What it is
CRATE is the official PyTorch implementation of the Coding RAte reduction TransformEr, a family of 'white-box' transformer architectures derived mathematically as unrolled optimization of a sparse rate reduction objective. It accompanies published NeurIPS, CPAL, and ICLR papers and provides models and training code for vision tasks such as segmentation and masked autoencoding.

## Use cases
- implement white-box transformer architectures in pytorch
- train an interpretable vision transformer
- reproduce the NeurIPS 2023 CRATE paper results
- study transformers as optimization of a compression objective
- experiment with sparse rate reduction losses
- pretrain masked autoencoding models with structured diffusion

## When to choose
- you are researching or teaching principled, mathematically derived transformer architectures
- you want to reproduce or extend the CRATE papers' vision experiments
- you need an interpretable alternative to black-box transformer blocks in PyTorch

## When to avoid
- you need a production-ready, plug-and-play transformer with state-of-the-art benchmarks
- you want a maintained general-purpose model zoo rather than research code
- you are not working in PyTorch or need heavy ecosystem tooling

## Facets
- artifact type: library
- maturity: active
- function: deep-learning, machine-learning, transformers
- domain: deep-learning, machine-learning, computer-vision
- platform: python
- tags: pytorch, white-box-transformer, sparse-rate-reduction, transformer-architecture, interpretability, vision-transformer, masked-autoencoder, self-supervised-learning, image-segmentation, research-code, natural-language-processing, gpu

## Member repositories
- Ma-Lab-Berkeley/CRATE (main) score 29

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:12.971721+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-30T05:02:59.895932+00:00, confidence not recorded.
  - readme: https://github.com/Ma-Lab-Berkeley/CRATE (fetched 2026-08-28T04:04:12.971721+00:00, sha 549c52a8c25a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
