Generated by GPT-5-mini| Transformers (library) | |
|---|---|
| Name | Transformers |
| Developer | Hugging Face |
| Initial release | 2018 |
| Programming language | Python |
| Repository | GitHub |
| License | Apache License 2.0 |
Transformers (library) is an open-source software library for natural language processing, computer vision, and multimodal machine learning that provides implementations of transformer-based architectures. It enables researchers and engineers to access pretrained models, tokenizers, and utilities for tasks such as language understanding, generation, translation, and question answering. The library has become central to workflows in artificial intelligence research and industry, influencing model development, benchmarking, and deployment across major institutions.
The project was launched by Hugging Face in 2018 following advances reported by teams behind Attention Is All You Need, Google Research, and OpenAI. Early development incorporated weights and recipes inspired by work from Google Brain, Facebook AI Research, and Microsoft Research, while adoption accelerated alongside datasets curated by Stanford University, UC Berkeley, and Carnegie Mellon University. The repository attracted contributions from engineers affiliated with DeepMind, NVIDIA, and Allen Institute for AI, and became integrated into evaluation suites used by competitions such as GLUE, SuperGLUE, and XTREME. Over time, governance practices evolved with inputs from contributors associated with Linux Foundation, OpenAI, and academic consortia including Massachusetts Institute of Technology and University of Washington.
The library implements transformer encoder, decoder, and encoder–decoder stacks originally popularized by Attention Is All You Need and later extended by architectures from BERT (model), GPT-2, GPT-3, T5 (model), RoBERTa, XLNet, DistilBERT, and ALBERT. Core components include model classes, pretrained weight loaders, configuration objects, and training utilities compatible with frameworks such as PyTorch, TensorFlow, and backends provided by ONNX. Tokenization pipelines reference algorithms like Byte Pair Encoding, WordPiece, and SentencePiece developed by teams at Google, Facebook, and RIKEN. Model hubs and metadata schemas draw on patterns established by GitHub, Docker, and artifact registries used at Google Cloud Platform and Amazon Web Services.
The project hosts implementations and pretrained checkpoints for a broad set of models from research groups including Google Research, OpenAI, Facebook AI Research, DeepMind, Microsoft Research, NVIDIA Research, AI2 (Allen Institute for AI), RIKEN, and University of Washington. Examples include BERT (model), GPT-2, GPT-Neo, GPT-J, T5 (model), FLAN-T5, RoBERTa, Electra, XLNet, DeBERTa, LaMDA, Megatron-LM, and CLIP (model). Tokenizers supported include implementations interoperable with algorithms from Byte Pair Encoding, WordPiece, and SentencePiece, alongside specialized tokenizers used in systems by Meta Platforms, Google, and OpenAI.
The library provides model inference, fine-tuning scripts, training loops, dataset connectors, and utilities for tasks benchmarked in GLUE, SuperGLUE, SQuAD, CoQA, and XNLI. It integrates with experiment tracking platforms such as Weights & Biases and artifact stores like MLflow. Data processing adapters connect to sources and formats used by Hugging Face Datasets, Papers with Code, and corpora curated by Common Crawl and Wikipedia. It supports features for quantization, pruning, knowledge distillation pioneered in publications from Google Research and Facebook AI Research, and model interpretability techniques related to work from OpenAI and Stanford University.
Transformers integrates with machine learning frameworks and platforms including PyTorch, TensorFlow, JAX, ONNX Runtime, Apache TVM, NVIDIA Triton Inference Server, Amazon SageMaker, Google Cloud AI Platform, and Microsoft Azure Machine Learning. Model sharing and versioning workflows align with services from GitHub, Docker Hub, and Hugging Face Hub. The ecosystem includes complementary projects and tools such as Hugging Face Datasets, Accelerate (software), Tokenizers (library), and benchmarking initiatives from Papers with Code and EleutherAI.
Performance optimizations leverage implementations and hardware from NVIDIA, Intel, Google TPU, and architectures introduced by Megatron-LM, Deepspeed, and FSDP (Fully Sharded Data Parallel). The library supports distributed training strategies used by teams at Microsoft Research and OpenAI, enables mixed-precision via standards from IEEE, and facilitates model export to runtimes like ONNX and deployment on inference platforms including NVIDIA Triton, Amazon SageMaker, and Kubernetes. Benchmarks reference datasets and leaderboards maintained by GLUE, SuperGLUE, and XTREME.
The codebase is distributed under the Apache License 2.0 and community governance includes maintainers and contributors from organizations such as Hugging Face, Google Research, Facebook AI Research, Microsoft Research, OpenAI, NVIDIA Research, and academic institutions like Stanford University and Carnegie Mellon University. Community activities include discussions on GitHub, workshops at conferences such as NeurIPS, ICML, ACL (conference), and EMNLP, and collaborations with initiatives like EleutherAI and BigScience. The project’s adoption in industry and research has influenced standards and best practices across institutions including Amazon Web Services, Google Cloud Platform, Microsoft Azure, and Linux Foundation.
Category:Machine learning libraries