Training models on TPU pods has quietly become one of the smartest moves in AI infrastructure, especially now that GPU availability has collapsed under the weight of LLM demand. Google trained PaLM — all 540 billion parameters of it — on TPU pods, and the hardware scales from tiny experiments to those massive runs without changing your fundamental approach.

The team behind Hugging Face Transformers has spent years making this practical. The main blockers were simple but stubborn: many models weren’t XLA-compatible, and data collators didn’t use native TensorFlow operations. Both of those issues are now largely resolved, which means most TensorFlow models in the library can run on TPUs with minimal extra work. XLA is the compiler that powers JAX, has first-class support in TensorFlow, and even works from PyTorch, so the compatibility push benefits more than just TPU users.

This guide walks through a complete end-to-end pipeline: loading WikiText v1, training a Unigram tokenizer from scratch, tokenizing the data, converting it to TFRecord shards on Google Cloud Storage, and finally training a RoBERTa base model. The code defaults to a BERT-sized model, but the architecture is designed to scale up to much larger models and bigger pod slices by tweaking a few configuration options.

The GPU shortage isn’t going away. Anyone who has watched H100 prices spike or lost a bidding war on eBay knows that access to compute is becoming a class divide. TPUs offer an alternative route to high-performance hardware that most people haven’t seriously explored yet. Once you get comfortable with TPU training, the guide’s authors note, you might not want to go back.