Build a GPT-2 style language model with 20 million parameters from scratch using JAX, the open-source library behind Googleâs Gemini, Veo, and Nano Banana models.
We'd like to know you better so we can create more relevant courses. What do you do for work?

Session expired â please return to Cornerstone to restart the session and complete the course.
Build a GPT-2 style language model with 20 million parameters from scratch using JAX, the open-source library behind Googleâs Gemini, Veo, and Nano Banana models.
Learn JAXâs core primitives (automatic differentiation, JIT compilation, and vectorized mapping) and how to combine them to define, train, and checkpoint a neural network efficiently.
Load a pretrained MiniGPT model and run inference through a chat interface, completing the full workflow from data preprocessing and training to generating text with the trained LLM.
Introducing Build and Train an LLM with JAX, a short course built in partnership with Google and taught by Chris Achard, Developer Relations Engineer on Googleâs TPU Software team.
JAX is the open-source numerical computing library that Google uses to build and train its most advanced models, including Gemini. It looks similar to NumPy, but adds automatic differentiation, just-in-time compilation, and the ability to scale training across thousands of CPUs, GPUs, and TPUs. In this course, youâll learn JAX by building and training a language model from scratch.
Youâll implement a complete MiniGPT-style LLM with 20 million parametersâdefining the architecture, loading and preprocessing training data, running the training loop, saving checkpoints, and finally chatting with your trained model through a graphical interface. Along the way, youâll work with key tools from the JAX ecosystem: Flax/NNX for neural network layers, Grain for data loading, Optax for optimization, and Orbax for checkpointing.
In detail, youâll:
The steps youâll follow to build and train MiniGPT are the same foundational steps Google uses to develop its more powerful models like Gemini. This course gives you hands-on experience with the tools and techniques at the core of modern LLM development.
Developers and ML practitioners who want to understand how large language models are built and trained at a foundational level. Familiarity with Python and basic machine learning concepts is recommended.
Gradedă»Quiz
Additional learning features, such as quizzes and projects, are included with DeepLearning.AI Pro. Explore it today
Keep learning with updates on curated AI news, courses, and events, as well as Andrewâs thoughts from DeepLearning.AI!