Train your first Decision Transformer
📰 Hugging Face Blog
Train a Decision Transformer model from scratch to make a half-cheetah run using the transformers library
Action Steps
- Load the dataset and build a Custom Data Collator
- Train the Decision Transformer model using a transformers Trainer
- Fine-tune the model for a specific task, such as making a half-cheetah run
Who Needs to Know This
Machine learning engineers and AI researchers can benefit from this tutorial to learn how to train Decision Transformer models for offline decision-making tasks
Key Insight
💡 Decision Transformers can be used as decision-making models, and can be trained from scratch using the transformers library
Share This
🤖 Train your first Decision Transformer model to make a half-cheetah run! 💻
Key Takeaways
Train a Decision Transformer model from scratch to make a half-cheetah run using the transformers library
Full Article
Published Time: 2022-09-08T00:00:00.124Z
# Train your first Decision Transformer
[Hugging Face](https://huggingface.co/)
* [Models](https://huggingface.co/models)
* [Datasets](https://huggingface.co/datasets)
* [Spaces](https://huggingface.co/spaces)
* [Buckets new](https://huggingface.co/storage)
* [Docs](https://huggingface.co/docs)
* [Enterprise](https://huggingface.co/enterprise)
* [Pricing](https://huggingface.co/pricing)
*
*
* * *
* [Log In](https://huggingface.co/login)
* [Sign Up](https://huggingface.co/join)
[Back to Articles](https://huggingface.co/blog)
# [](https://huggingface.co/blog/train-decision-transformers#train-your-first-decision-transformer) Train your first Decision Transformer
Published September 8, 2022
[Update on GitHub](https://github.com/huggingface/blog/blob/main/train-decision-transformers.md)
[- [x] Upvote 15](https://huggingface.co/login?next=%2Fblog%2Ftrain-decision-transformers)
* [](https://huggingface.co/jufan "jufan")
* [](https://huggingface.co/NeoCodes-dev "NeoCodes-dev")
* [](https://huggingface.co/almonmanzano "almonmanzano")
* [](https://huggingface.co/cpgrant "cpgrant")
* [](https://huggingface.co/neeldevenshah "neeldevenshah")
* [](https://huggingface.co/mkk20 "mkk20")
* +9
[](https://huggingface.co/edbeeching)
[Edward Beeching edbeeching Follow](https://huggingface.co/edbeeching)
[](https://huggingface.co/ThomasSimonini)
[Thomas Simonini ThomasSimonini Follow](https://huggingface.co/ThomasSimonini)
* [What are Decision Transformers?](https://huggingface.co/blog/train-decision-transformers#what-are-decision-transformers "What are Decision Transformers?")
* [Training Decision Transformers](https://huggingface.co/blog/train-decision-transformers#training-decision-transformers "Training Decision Transformers")
* [Loading the dataset and building the Custom Data Collator](https://huggingface.co/blog/train-decision-transformers#loading-the-dataset-and-building-the-custom-data-collator "Loading the dataset and building the Custom Data Collator")
* [Training the Decision Transformer model with a 🤗 transformers Trainer.](https://huggingface.co/blog/train-decision-transformers#training-the-decision-transformer-model-with-a-%F0%9F%A4%97-transformers-trainer "Training the Decision Transformer model with a 🤗 transformers Trainer.")
* [Conclusion](https://huggingface.co/blog/train-decision-transformers#conclusion "Conclusion")
* [What’s next?](https://huggingface.co/blog/train-decision-transformers#whats-next "What’s next?")
* [References](https://huggingface.co/blog/train-decision-transformers#references "References")
In a [previous post](https://huggingface.co/blog/decision-transformers), we announced the launch of Decision Transformers in the transformers library. This new technique of **using a Transformer as a Decision-making model** is getting increasingly popular.
So today, **you’ll learn to train your first Offline Decision Transformer model from scratch to make a half-cheetah run.** We'll train it directly on a Go
# Train your first Decision Transformer
[Hugging Face](https://huggingface.co/)
* [Models](https://huggingface.co/models)
* [Datasets](https://huggingface.co/datasets)
* [Spaces](https://huggingface.co/spaces)
* [Buckets new](https://huggingface.co/storage)
* [Docs](https://huggingface.co/docs)
* [Enterprise](https://huggingface.co/enterprise)
* [Pricing](https://huggingface.co/pricing)
*
*
* * *
* [Log In](https://huggingface.co/login)
* [Sign Up](https://huggingface.co/join)
[Back to Articles](https://huggingface.co/blog)
# [](https://huggingface.co/blog/train-decision-transformers#train-your-first-decision-transformer) Train your first Decision Transformer
Published September 8, 2022
[Update on GitHub](https://github.com/huggingface/blog/blob/main/train-decision-transformers.md)
[- [x] Upvote 15](https://huggingface.co/login?next=%2Fblog%2Ftrain-decision-transformers)
* [](https://huggingface.co/jufan "jufan")
* [](https://huggingface.co/NeoCodes-dev "NeoCodes-dev")
* [](https://huggingface.co/almonmanzano "almonmanzano")
* [](https://huggingface.co/cpgrant "cpgrant")
* [](https://huggingface.co/neeldevenshah "neeldevenshah")
* [](https://huggingface.co/mkk20 "mkk20")
* +9
[](https://huggingface.co/edbeeching)
[Edward Beeching edbeeching Follow](https://huggingface.co/edbeeching)
[](https://huggingface.co/ThomasSimonini)
[Thomas Simonini ThomasSimonini Follow](https://huggingface.co/ThomasSimonini)
* [What are Decision Transformers?](https://huggingface.co/blog/train-decision-transformers#what-are-decision-transformers "What are Decision Transformers?")
* [Training Decision Transformers](https://huggingface.co/blog/train-decision-transformers#training-decision-transformers "Training Decision Transformers")
* [Loading the dataset and building the Custom Data Collator](https://huggingface.co/blog/train-decision-transformers#loading-the-dataset-and-building-the-custom-data-collator "Loading the dataset and building the Custom Data Collator")
* [Training the Decision Transformer model with a 🤗 transformers Trainer.](https://huggingface.co/blog/train-decision-transformers#training-the-decision-transformer-model-with-a-%F0%9F%A4%97-transformers-trainer "Training the Decision Transformer model with a 🤗 transformers Trainer.")
* [Conclusion](https://huggingface.co/blog/train-decision-transformers#conclusion "Conclusion")
* [What’s next?](https://huggingface.co/blog/train-decision-transformers#whats-next "What’s next?")
* [References](https://huggingface.co/blog/train-decision-transformers#references "References")
In a [previous post](https://huggingface.co/blog/decision-transformers), we announced the launch of Decision Transformers in the transformers library. This new technique of **using a Transformer as a Decision-making model** is getting increasingly popular.
So today, **you’ll learn to train your first Offline Decision Transformer model from scratch to make a half-cheetah run.** We'll train it directly on a Go
DeepCamp AI