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.

Generative Agents: Five Bold Examples of AI Revolutionizing Product Development

Image created with Canva, no generative agent used here :-)
Image created with Canva, no generative agent used here 🙂

(first published on Linkedin)

As we are seeing ChatGPT become more widely used, companies of all sizes must ask themselves how do they adapt their products and their competitive strategies in this new world? 

To recap – ChatGPT by OpenAI is a generative agent that is designed specifically for generating text by predicting what comes next in a given sequence. As a generative agent, ChatGPT can create new content, write code, carry out conversations, and even provide assistance in various tasks, depending on the context and the data it has been trained on.

Generative agents are poised to redefine product development, offering unmatched creativity, efficiency, and innovation. Here are five compelling examples of how these AI-powered systems are transforming the way we create and consume products:

Personalized Products: AI-Driven Sneaker Revolution

1.Generative agents will enable brands like Nike or Adidas to analyze user preferences and create customized sneaker designs tailored to individual tastes. These one-of-a-kind shoes will foster deep connections between consumers and brands.

Rapid Prototyping: Hyper-Iterative Rocket Design

2. Companies like SpaceX can leverage generative agents to rapidly generate multiple rocket designs, streamlining the prototyping process, and pulling our sci-fi dreams closer to the present.

Sustainable Design: Eco-Friendly Furniture Evolution

3. Generative agents can help IKEA analyze material data and environmental impact, creating innovative designs that minimize waste and promote sustainability. These eco-friendly products will resonate with environmentally conscious consumers, bolstering IKEA’s brand reputation.

Democratization of Design: Small Business AI Explosion

4. As AI systems become more accessible, Etsy’s small business owners will harness the power of generative agents to create professional, high-quality products. This democratization will unleash a wave of innovation and competition, transforming the online marketplace.

Metaverse Product Sales: The Ultimate Autonomous Agent Experience

5. Generative agents will bring the metaverse to life, creating autonomous agents that interact believably with users for product sales. Imagine the next generation of virtual real estate, where AI-driven real estate agents engage with potential buyers, personalizing the experience and providing valuable feedback to sellers.

Generative agents are set to transform the product development landscape with their AI-powered capabilities. Do you agree, disagree? Pls let me know in the comments.