Back to directory

x-transformers

A concise but fully-featured PyTorch transformer implementation bundling many experimental architecture variants and training techniques from published papers.

x-transformers

x-transformers provides encoder, decoder, and encoder-decoder transformer wrappers usable for a decoder-only GPT-like model, a BERT-like encoder, or a vision transformer for image classification through the same underlying TransformerWrapper and Encoder/Decoder building blocks, configured by arguments such as depth, number of heads, and attention head dimension. It implements Flash Attention, the fused attention technique that processes the attention matrix in tiles and recomputes on the backward pass to keep memory linear in sequence length, letting models reach longer context lengths without hitting a memory ceiling, and it composes with image-captioning setups such as a PaLI-style vision-language model.

The library also exposes configurable dropout and a large set of other experimental features drawn from individual research papers, intended to be combined and tried rather than fixed into one architecture.

It installs with pip install x-transformers and is distributed under the MIT license.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.