Discover posts

Explore captivating content and diverse perspectives on our Discover page. Uncover fresh ideas and engage in meaningful conversations

Lesson 12
111. The more vague the prompt, the more chance that the model will produce a result that is not usable.
112. Be clear and concise in the prompts that you feed into the model.
113. Next, be sure to define boundaries for the prompt.
114. It’s better to instruct the model on what to do rather than what not to do.
115. If the model gets stuck, give it a few 'fallback' outputs that work in various situations.
116. For example, something like "I'm still learning about that" to use when unsure.
117. Another best practice is to adopt a persona for your input.
118. Adding a persona for the model can provide meaningful context to help it focus on related questions, which can help improve accuracy.
119. This prompt would help Sasha, the cloud architect, get started with prototyping a network architecture for Cymbal Bank.
120. And finally, it’s a recommended practice to keep each sentence concise.
To be continued…lesson 13

image

Lesson 11
101. The element order can also change
102. Let's amend Sasha’s original prompt “How can I create a network that uses IPv4 and IPv6 addresses?” and add a role context to the input fed into Gemini.
103. She also adds the detail of needing a dual stack subnet.
104. The new prompt is “I want you to act as a cloud architect in Google
105. Cloud. How can I use gcloud to create a network that uses IPv4 and IPv6 subnets?”
106. But since Gemini maintains its own interaction context, she could have just asked “I want you to act as a cloud architect
107. in Google Cloud. How can I adjust the gcloud command provided to create a subnet to ensure the subnet is dual stack?”
108. Now that you’ve had a chance to explore what Gen AI is, what large language models are
109. and how they’re trained, and what prompt engineering is, it’s time to explore some prompt engineering best practices.
110. The first best practice is to write detailed and explicit instructions.
To be continued…lesson 12

image

Lesson 10.
91. In our example, we state “I want you to act as a business professor. I’ll give you a term, and you will correctly explain its
92. meaning. Make sure your answers are always right. What is ROI? “ For Sasha’s needs, using role prompts might be the best solution. She can define
93. what is required and in what context. This means that the LLM will have a clear point of reference when supplying an answer. Now that you’ve
94. seen the types of prompts you can create, let’s explore the two elements of a prompt: the preamble and the input. The preamble refers to the
95. introductory text you provide to give the model context and instructions before your main question or request. Think of it as setting the stage for the
96. LLM to better understand what you want. It can include the context for the task, the task itself, and some examples to guide the model. The
97. input is the central request you're making to the LLM. It’s what the instruction or task will act upon, for example “Comment: I don’t know what
98. to think about the video. The review is:” Based on the preamble, Gemini reviews the input and suggests if the review is positive, neutral, or negative.
100. It is worth noting that not all the components are required for a prompt, and the format can change depending on the task at hand.
To be continued…lesson 11

image

Lesson 9

81. Prompts can be in the form of a question, and are categorized into four categories: zero-shot, one-shot, few-shot, and role prompts.
82. Zero-shot prompts do not contain any context or examples to assist the model
83. For example, the prompt “What’s the capital of France?” does not provide any examples of what a capital is.
84. Clearly, that is not too important for this example.
85. But for more specific and technical prompts, an example would help refine the scope of the response from Gemini.
86. One-shot prompts, however, provide one example to the model for context.
87. Here, we ask for the capital of France again, but we provide Italy and Rome as an example.
88. And few-shot prompts provide at least two examples to the model for context.
89. Here, our prompt is updated to also include Japan and Tokyo in our examples.
90. And then, there are role prompts which require a frame of reference for the model to work from as it answers the questions.
To be continued…lessonn10

image

Lesson 8
71. She just needs to articulate her needs in a way that gets the best response from Gemini.
72. For example, if she uses the prompt “How can I create a network that uses
73. For example, if she uses the prompt “How can I create a network that uses
74. IPv4 and IPv6 addresses?”, she will get a response that details how to do just that
75. You’ve learned that a large language model is a huge object model containing a massive dataset of text.
76. But how can you extract the information you need from this dataset?
77. This is where prompt engineering comes in.
78. A prompt is the text that you feed to the model, and prompt engineering is a way of articulating your prompts to get the best response from the model.
79. The better structured a prompt is, the better the output from the model will be
80. Let’s explore what this means
To be continued..lesson 9

image

Lesson 7
61. They can also make the model more likely to generate incorrect or misleading information.
62. But we will see in the Prompt Engineering section that there are things we can do to minimize this problem.
63. OK, but knowing where the sun is will not help Sasha with her current task.
64. Lucky for Sasha, Google Cloud offers a generative AI model called Gemini, [[Pause here for 5 seconds]] which can act as an always-on collaborator.
65. This gen AI-powered assistant can help a wide range of Google Cloud users, including developers, data scientists, and operators.
66. To provide an integrated assistance experience, Gemini is embedded in many Google Cloud products.
67. Gemini has access to a massive range of data, including Google Cloud documentation, tutorials, and samples
68. With the right prompts, it can produce detailed suggestions and guides on what resources will best suit Sasha’s current challenge and their configuration.
69. Gemini can even create detailed gcloud commands and insert them into Cloud Shell for her.
70. She just needs to articulate her needs in a way that gets the best response from Gemini.
To be continued..lesson 8

image

Lesson 6.
51.To make matters worse, LLMs only understand the information that is explicitly given to them in the prompt.
52. In other words, they often assume that the prompt is true.
53. They also do not have the ability to ask for more context information.
54. Ultimately, an LLM does not know anything outside of what it was trained on, and it cannot truly know if that information is accurate.
55. But what causes a hallucination
56. Hallucinations can be caused by a number of factors, including: The model is not trained on enough data.
57. The model is trained on noisy or dirty data.
58. The model is not given enough context
59. The model is not given enough constraints.
60. Hallucinations can be a problem for LLMs because they can make the output text difficult to understand.
To be continued…lesson 7

image

Lesson 5
41. When you submit a prompt to an LLM, it calculates the probability of the correct answer from its pre-trained model.
42. The probability is determined through a task called pre-training.
43. Pre-training an LLM involves feeding a massive dataset of text, images, and code to the model so that it can learn the underlying structure and patterns of the language.
44. This process helps the model to understand and generate human language more effectively.
45. In this way, the LLM works like a fancy autocomplete, suggesting the most common correct response to the prompt
45. But sometimes the LLM gives a completely wrong answer.
46. This is called a hallucination.
47. Hallucinations are words or phrases that are generated by the model that are often nonsensical or grammatically incorrect
48. This happens because LLMs can only understand the information they were trained on.
49. This means that they might not be aware of your business's proprietary or domain-specific data.
50. Also, they do not have access to real-time information.
To be continued..check post 6

image

Lesson 4
31. And why do they need training at all?
32. Large language models refer to large, general-purpose language models that can be pre-trained and then fine-tuned for specific purposes.
33.In this context, large refers to: The size of the training dataset, which can sometimes be at the petabyte scale
34. And the number of parameters.
35. Parameters are the memories and knowledge that the machine has learned during model training.
35. They determine the ability of a model to solve a problem, such as predicting text, and can reach billions or even trillions in size.
36. General-purpose means that the models can sufficiently solve common problems
37. This is thanks to the commonality of a human language, regardless of the specific tasks.
38. Saying LLMs are pre-trained and fine-tuned, means… …that they have been pre-trained for a general
39. purpose with a large dataset… ...and then fine-tuned for specific goals with a much smaller dataset.
40. But how are LLMs trained?
To be continued…check post 4

image

Lesson 3.
21.Gen AI models learn the patterns and structure from input training data and then create new data with similar characteristics.
22.Generative AI has uses across a wide range of industries, including software development, healthcare, finance, entertainment, customer service, and sales.
23.However, rather than exploring all generative AI applications, this training will specifically focus on articulating prompts to harness the power of gen AI effectively.
23.Let me introduce a scenario that we’ll make reference to throughout this section of the training.
24.We’ve included it to help put some of this theory into practice.
25.Meet Sasha, a cloud architect, who needs to create a prototype design of Google Cloud VPC network architecture for Cymbal Bank.
26.Sasha wants to save time by combining her existing knowledge of cloud architecture and generative AI tools to create a usable prototype design
27.Sasha was excited to learn about Gemini, since having the tool inside the Google Cloud Console means that she can access it without any additional installs
28.We’ll check back in with Sasha later
29.Let’s spend some time exploring large language models, which are a highly sophisticated computer programs trained on gigantic amounts of data that can be text or images.
30.But how are they trained?
To be continued…check post 3

image