Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Build the SimpleArabicCharacterTokenizer class
/ 25
Build the generate_text_from_ngram_model function
/ 25
Build the segment_encoded_sequence function
/ 25
Build the create_training_sequences function
/ 25
In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.
When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.
To score 100% you must successfully complete all tasks within the time period!
This challenge lab is recommended for students who have completed the Google DeepMind: 01 Build Your Own Small Language Model course. To build a stronger foundation and see how this lab fits into the broader curriculum, we encourage you to explore the Google DeepMind AI Research Foundations learning path.
Now, it's time to apply what you've learned to a practical, real-world scenario. You will step into the role of a developer for Cymbal Chat, a startup specializing in custom AI. Your mission is to use a provided dataset of short children's stories in Arabic to build the foundational codebase they need to meet the lab's objectives. Are you ready for the challenge?
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
You must wait for the lab to provision before making any changes to the environment. The necessary pre-configured components will be available once the lab is ready.
Cymbal Chat is a startup that specializes in custom AI language models. For certain Arabic natural language processing (NLP) tasks, character-based language models can outperform word-based models. Cymbal Chat plans to explore this approach for its new prototype.
A customer has requested a language model for Arabic speakers to generate simple, coherent stories. To fulfill this, you must develop the foundational tools and data preparation framework for training robust, character-based language models.
You are expected to have the skills and knowledge for these tasks, so don't expect step-by-step guides to be provided.
For this task, you import the necessary libraries and load the Arabic stories dataset. Do not modify the pre-written code cells in the Jupyter Notebook that are labeled accordingly.
In the Google Cloud console, navigate to Vertex AI > Colab Enterprise > My notebooks.
Select the
Click Import.
On the Import notebooks form, select Cloud Storage.
For Notebook file path, enter
Click Import. The notebook, gdm_challenge_lab.ipynb, will open in a new tab upon completion.
Connect to the runtime: To execute the cells, you must first connect the notebook gdm_challenge_lab.ipynb to a runtime environment:
colab-cpu-runtime.Review the narrative in Task 1. Define helper functions and load data to understand the purpose of the code cells.
Execute each cell in this section to define the helper functions and load the dataset.
In this task, you complete the SimpleArabicCharacterTokenizer class, a character-level tokenizer for Arabic text.
This class contains two methods:
character_tokenize: Converts raw Arabic text into a list of single-character tokens.join_text: Joins a list of character tokens back into a single string without padding.Your code is required in the [TODO - Add your code here] sections. Carefully read the notebook instructions, and ensure you have completed the character_tokenize and join_text methods.
character_tokenize: This method should return a list of single-character strings in the same order as the input text.
join_text: This method should return a single string by joining the input tokens without any intervening characters.
SimpleArabicCharacterTokenizer class.Click Check my progress to verify the objective.
In this task, you complete the inference loop for a character n-gram model that has been trained on the Arabic stories dataset. This model generates text from a given prompt and supports both random and greedy sampling.
Your code is required within the [TODO - Add your code here] sections. Carefully read the notebook's instructions and complete the generate_text_from_ngram_model function to do the following:
Support either random or greedy sampling, based on the sampling_mode argument.
Return the generated tokens as a single string.
Save your notebook, and run the cell to test your n-gram text generator.
Click Check my progress to verify the objective.
In this task, you build the necessary tools to prepare data for a character-based language model aimed at Arabic speakers. You develop the framework for robust and efficient model training.
Your code is required in the [TODO - Add your code here] sections. Carefully read the notebook instructions to complete the segment_encoded_sequence function.
This function takes an encoded sequence of token IDs and segments it into subsequences. Your implementation should ensure the following:
max_length length but can be shorter. All other subsequences must be exactly max_length.Save your notebook, and run the cell to test your completed segment_encoded_sequence function.
Click Check my progress to verify the objective.
You'll complete the create_training_sequences function. This function takes a dataset, a tokenizer, and a maximum input length to create a pair of 2D padded arrays (inputs and targets) suitable for model training.
Your code is required in the [TODO - Add your code here] sections. Carefully read the notebook instructions to complete the create_training_sequences function. Ensure your implementation:
segment_encoded_sequence to segment each encoded sequence.input and target arrays from the padded arrays for model training.Save your notebook, and run the cell to test your completed create_training_sequences function.
Click Check my progress to verify the objective.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual last updated on January 08, 2026.
Lab last tested on January 08, 2026.
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one