Lessons from “GenAI for developers” course by Google

I just finished the Google Cloud Skills path called “Generative AI for developers” and I wanted to write down some of the main lessons and impressions I had.

Overall I think the lessons were well-thought out, aimed at an intermediate audience like me, and I learned a lot about the various Google tools (here’s my cert). However there were also some technology snags along the way that detracted from the experience.

Main topics of the course

The topics in the course are the following:

  1. Introduction to Image Generation – with an Intro video + quiz re: how diffusion models are used for image generation
  2. Attention Mechanism – Intro video + quiz re: how attention mechanisms work, and can be used for a variety of tasks from text summarization to translation
  3. Encoder – Decoder Architecture – Intro video, Jupyter Lab (Python code) walkthrough + quiz re: how encoder – decoder works, and can be used in sequence to sequence tasks such as text summarization, Q&A, translation etc
  4. Transformer models and BERT – Intro video, Jupyter Lab walkthrough + quiz re: main components of the Transformer architecture and the self-attention mechanism
  5. Create Image Captioning models – Intro video, Jupyter Lab walkthrough + quiz re: how do use deep learning to create Image captions
  6. Introduction to Generative AI Studio – Intro video + quiz regarding Vertex AI for customizing and prototyping Generative AI models.
  7. Generative AI explorer – A set of labs using Jupyter Notebooks to explore different GenAI models, and try out prompting tools and various parameters (see below)
  8. Explore and Evaluate Models using Model Garden – Using Vertex AI to try out different Foundation Models, tools and parameters (see below)
  9. Prompt Design using Palm – How to design good prompts, setting restrictions and interacting with Palm 2, that has detailed reasoning, language and coding capabilities (see below).

Generative AI explorer – with Vertex AI

The lessons that I liked the most were using different examples to teach how to use the models in different use cases. Everything was run on Google  Vertex AI – which is a unified AI platform, that allows you to:

  • Select from 100+ foundation models in the Model Garden
  • Try out code snippets with JupyterLab in the Workbench
  • Access every model with a simple API call
  • Train and deploy models to Production

Text generation examples

You can test any of the Text generation models by selecting the model in the top right dropdown. You specify the context (prompt) for the model, and provide input/ output examples if you prefer. Giving no examples is called zero-shot prompting, giving a few examples is called few shot prompting, which for most use cases is the better alternative.

Pressing the ‘Get code’ button also top right gives you the code snippets you need to connect to the selected model in your Google Cloud project:

Chat model examples

Under the Language models you can customize & test the foundation models e.g for customer service or support use cases. Some key parameters include:

  • Temperature: A lower temperature of say 0, 0.1 are better when factual, true or false responses are required. A higher temperature say 0.6 to 1 will give more imaginative answers, but will also increase the risk of the model hallucinating.
  • Token limit: Determines the maximum number of text output from one prompt, with one token equal to roughly four characters.
  • Safety Settings: You can define how strict the model responses are regarding potentially harmful content, such as hate speech, sexual content or harassment.

Codey – code generation, chat and completion

You can select between different code engines based on your use case:

  • Codey for Code Generation (6k or 32k token limit). Takes your natural language input and generates the requested code – example below:
  • Codey for Code Chat (6k or 32k token limit) – model chatbot fine tuned for helping with code related questions.
  • Codey for  Code Completion – model fine tuned to suggest code based on the context, code already written. 

Exploring the Model Garden

In the Model Garden you can try out different Foundation models such as:

  • Gemini Pro – e.g. for text summarization, text generation, entity recognition, sentiment analysis and more.
  • Gemini Pro Vision (Multimodal) – e.g. for visual understanding, classification, summarization and processing visual inputs such as photos, video, documents, infographics etc.
  • Claude 2: a leading LLM from Anthropic – similar to Gemini Pro
  • Llama 2: Open Source LLM released by Facebook / Meta that is fine-tunable to your use case/ domain.

There are over 100+ models to date, however the main drawback of note is that the Fine Tunable models (except for LLAMA2 and Falcon) are mostly just related to classification or vision detection/ classification.

Prompt Design

Some of the prompting lessons here:

  • Be concise
  • Be specific and well-defined
  • Ask for one task at a time 
  • Improve response quality by including examples (few shot)
  • Use a Dare prompt  – Determine Appropriate Response (DARE) prompt, which uses the LLM itself to decide whether it should answer a question based on what its mission is. Meaning that you send the regular prompt / context first, followed by the Dare prompt to verify that the output generated matches the mission.

Most of the example Jupyter Notebooks in the course can be found on Github here.

Conclusion

Overall I think the course teaches the material well – I liked the hands on Jupyter Notebooks better than the video + quiz sections as it’s easier to learn with concrete examples.

I’m most impressed by is the completeness of the Google Vertex AI platform, and I feel that I have a good basis to use the platform independently today.

Tip: Integrated Product Teams – Fueling Product success

Teamwork from Canva
Teamwork from Canva

An Integrated Product Team (IPT) is crucial for product startups to thrive in a hyper competitive landscape. Research by both academics and DoD has shown an IPT to increase customer satisfaction, reduce risk and time to market while helping better align stakeholder interests.

An IPT is a cross-functional group of professionals working collaboratively towards a common goal: the successful development, launch, and management of a product or portfolio of products. IPT members typically represent diverse areas such as design, engineering, marketing, and sales, ensuring a holistic approach to product creation, innovation, and customer satisfaction.

Key benefits of adopting an IPT approach include:

  1. Boosted collaboration: Uniting cross-functional team members fosters open communication and swift decision-making.
  2. Enhanced innovation: Harnessing diverse perspectives sparks creativity and cutting-edge product development.
  3. Agile processes: Quick adaptation to changing market conditions and customer needs ensures efficiency and quality.
  4. Accelerated time-to-market: Streamlined processes give startups a competitive edge by capturing market share faster.
  5. Customer focus: Integrating customer feedback throughout development enhances user satisfaction and loyalty.
  6. Engaged employees: An empowered and inclusive environment drives professional growth, satisfaction, and retention.

To embrace an IPT approach and unlock your product startup’s full potential today, contact me here or on Twitter @oskarhurme – my DMs are open.