Ad

x-transformers: Full-attention Transformer with Experimental Features

x-transformers implements a flexible transformer model with experimental features, supporting encoder-decoder, decoder-only, and encoder-only architectures and flash attention.
Screenshot of lucidrains/x-transformers homepage

x-transformers provides a versatile, full-attention transformer model with experimental features inspired by current research. The library allows for encoder-decoder, decoder-only (GPT-style), and encoder-only (BERT-style) configurations. It offers implementations for state-of-the-art models like ViTransformer, ViT, PaLI, and incorporates techniques such as flash attention and memory augmentation to improve efficiency and performance.

This project enables experimentation with cutting-edge transformer architectures and attention mechanisms. It supports various attention techniques, including flash attention and memory augmentation, offering insights into training and inference optimization. The implementation provides flexibility in model configuration and is actively updated with new features from research papers.

  • Architectures: Encoder-decoder, decoder-only (GPT-like), and encoder-only (BERT-like) transformer models.
  • Flash Attention: Implements Flash Attention for improved memory efficiency and speed, particularly for long sequences.
  • Memory Augmentation: Integrates learned key/values to enhance performance and potentially reduce the need for feedforward networks.
  • Extensible: Supports various dropout techniques and configuration options for fine-tuning and experimentation.
  • ViT and PaLI: Includes implementations of Vision Transformer (ViT) and PaLI models for image processing tasks.

The project is actively developed with recent commits and ongoing experimentation (last commit: 2026-04-21). It has a reasonable number of stars and forks, indicating community interest. Documentation is accessible through the README and examples, though more extensive documentation could improve usability for some advanced features.

x-transformers benefits researchers and developers seeking to experiment with transformer architectures and advanced attention techniques. It provides a readily usable framework for replicating and extending research, with particular value for exploring memory-efficient attention methods and incorporating concepts from recent advancements like ViT and PaLI. It's suitable for those looking to implement and understand state-of-the-art transformer models.

Languages:
Summarize:
Share:
Stars
5,921
Forks
515
Issues
74
Created
5 years ago
Commit
21 days ago
License
MIT
Archived
No
Updated 14 days ago

Similar Repositories