Maximizing Productivity With Chatgpt
Maximizing Productivity With Chatgpt
Disclaimer
The information contained within this eBook is strictly for educational purposes. If you wish to
apply ideas contained in this eBook, you are taking full responsibility for your actions.
The author has made every effort to ensure the accuracy of the information within this book was
correct at time of publication. The author does not assume and hereby disclaims any liability to any
party for any loss, damage, or disruption caused by errors or omissions, whether such errors or
omissions result from accident, negligence, or any other cause.
No part of this eBook may be reproduced or transmitted in any form or by any means, electronic or
mechanical, recording or by any information storage and retrieval system, without written
permission from the author.
Credits
Founder: Jason Brownlee
Author: Abid Ali Awan, Matthew Mayo, Kanwal Mehreen, Adrian Tam
Technical Reviewers: Vinod Chugani, Ethan Li, Devansh Sethi
Copyright
Maximizing Productivity with ChatGPT
© 2023 MachineLearningMastery.com. All Rights Reserved.
Edition: v1.02
Contents
Preface vi
Introduction viii
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Can you determine the content that a human or ChatGPT wrote? Can you pick up on
the nuances that differentiate between human-generated text and large language models that
generate text?
Before I asked you these questions, would you have noticed that I did not write any of
the above? It was all the work of ChatGPT.
Has the evolution of large language models conquered the world of instant content? Let’s
find out more.
Introduction
Book Organization
This is a short book with two parts:
ix
⊲ Foundations: It helps you to understand what ChatGPT (and other large language
models) really are. Also, you should be familiar with the terms that arise from
interacting with ChatGPT, such as prompts and hallucination.
⊲ Applications: Each chapter contains several examples to demonstrate how ChatGPT
may change how you worked. Playing with ChatGPT is fun, but it is not only a toy.
It can revolutionize a lot of things and make humans more productive.
The chapters are as follows:
on a topic. The result may be imaginative and unrealistic, but after all, you may find
it insightful.
⊲ ChatGPT as Your Expert Helper. If you provided a concrete and detailed direction to
ChatGPT, it may not hallucinate too much. People probably found ChatGPT most
useful for this, and this is also why someone mistook ChatGPT as a database, because
it acts like one. You will see examples in this chapter where ChatGPT behaves like
an expert that can solve your problem in detail.
⊲ Writing an Essay with ChatGPT. Writing fiction with ChatGPT is mostly using it for
brainstorming. But writing an analytical essay can also be similar to fiction because
you want it to help you brainstorm arguments to support your conclusion.
⊲ Using ChatGPT as Your Personal Teacher. When you try to learn something but
have no idea how to start, you can ask ChatGPT to give you a study plan. It works
like ChatGPT is an expert often, but you rely on the model’s capability to distill
information it was trained on. Nonetheless, when it works well, you will appreciate
how much help it can give you.
⊲ Using ChatGPT for Translation Effectively. If you do not want ChatGPT to
hallucinate, you must provide data in the prompt so the model has something to
work on. The easiest example is to translate. In fact, ChatGPT is an amazing
translator because it was trained from text of many languages, and it learned the
language rules by example. Therefore, you will appreciate the result of translation
from ChatGPT sounds much more natural than any rule-based machine translator.
⊲ Mastering Summarization with ChatGPT. Another example of providing data in the
prompt and letting ChatGPT use its language skills only is summarizing text. This
is to make the model extract idea from your prompt and reproduce the idea in its
response. By watching how ChatGPT summarizes your input, you will be convinced
that the language model can understand.
⊲ Advanced Techniques for Research with ChatGPT. If ChatGPT can summarize your
paragraphs, it can also summarize your data. In this chapter, you will see how
ChatGPT can distill insights from the data you provided, a common research task.
However, you will also see other examples that you can ask ChatGPT for ideas on
how to do your research.
⊲ Using the Natural Language Understanding Capability of ChatGPT. Suppose you take
ChatGPT as an assistant who can speak human language. It is good at converting
unstructured data into structured data, such as extracting information embedded in
paragraphs into a point form or table. This chapter gives you examples. Then, you
can leverage the language capability of ChatGPT to clean up messy text and save
you time reading them.
⊲ Using ChatGPT as Your Programming Assistant. While ChatGPT can speak human
language, it can also speak computer language. It is because, probably, ChatGPT has
trained from programming textbooks. Therefore, we can make ChatGPT generate a
program for you and save you time to bootstrap your project. You can also do it the
other way, make ChatGPT explain a program in English.
xi
⊲ Generating Diagrams with ChatGPT. ChatGPT would not give you pictures in its
output. But it doesn’t mean we cannot make ChatGPT to help us create pictures. In
this chapter, you will see the trick to make ChatGPT create pictures, namely, ask it
to produce some picture-generating language so that you can produce a picture with
another tool.
⊲ Creating a PowerPoint Presentation using ChatGPT. If you can produce a picture,
you can produce other things, too, if you know the tool. In this chapter, we will see an
example of how to generate a PowerPoint Presentation. Of course, it is not directly
from ChatGPT’s output, but we will see how we can get the file in a few steps.
This book is an effort between MachineLearningMastery and KDnuggets. Abid Ali Awan
contributed chapters 7, 8, 10, and 11. Matthew Mayo contributed chapter 6. Kanwal Mehreen
contributed chapters 12–13 as well as the frontmatter. Adrian Tam contributed chapters 1–5,
9, and 14–17.
By finishing this book, you should be fairly competent in prompt engineering: A skill of
expressing your intention well with enough information to make a large language model work
xii
for you. In fact, this is also the skill to make clear of yourself, so other people can work for
you.
Are you ready? Let’s dive in!
Next
Next up you will discover a gentle introduction to large language models, so that you know
who you’re talking to when you’re talking to ChatGPT.
I
The Magic Behind ChatGPT
What are Large Language Models
1
Large language models (LLMs) are recent advances in deep learning models to work on human
languages. Some great use case of LLMs has been demonstrated. ChatGPT is powered by an
LLM. A large language model is a trained deep-learning model that understands and generates
text in a human-like fashion. Behind the scenes, it is a large-scale transformer model that
does all the magic.
In this chapter, you will learn about the structure of large language models and how it
works. In particular, you will know:
⊲ The machine learning theory behind ChatGPT
⊲ How a model reads text and generates output
⊲ Why ChatGPT can produce text in a human-like fashion
Let’s get started.
Overview
This chapter is divided into three parts; they are:
⊲ From Transformer Model to Large Language Model
⊲ Why Transformer Can Predict Text?
⊲ How a Large Language Model Is Built?
In 2017, Vaswani et al. published a paper, “Attention Is All You Need”, to establish a
transformer model. It is based on the attention mechanism. Contrary to recurrent neural
networks, the attention mechanism allows you to see the entire sentence (or even the paragraph)
at once rather than one word at a time. This allows the transformer model to understand
the context of a word better. Many state-of-the-art language processing models are based on
transformers.
To process a text input with a transformer model, you first need to tokenize it into a
sequence of words. These tokens are then encoded as numbers and converted into embeddings,
which are vector-space representations of the tokens that preserve their meaning. Next, the
encoder in the transformer transforms the embeddings of all the tokens into a context vector.
Below is an example of a text string, its tokenization, and the vector embedding. Note
that the tokenization can be subwords, such as the word “nosegay” in the text is tokenized
into “nose” and “gay”.
As she said this, she looked down at her hands, and was surprised to find that she had
put on one of the rabbit's little gloves while she was talking. "How can I have done
that?" thought she, "I must be growing small again." She got up and went to the table to
measure herself by it, and found that, as nearly as she could guess, she was now about
two feet high, and was going on shrinking rapidly: soon she found out that the reason of
it was the nosegay she held in her hand: she dropped it hastily, just in time to save
herself from shrinking away altogether, and found that she was now only three inches
high.
['As', ' she', ' said', ' this', ',', ' she', ' looked', ' down', ' at', ' her', ' hands',
',', ' and', ' was', ' surprised', ' to', ' find', ' that', ' she', ' had', ' put',
' on', ' one', ' of', ' the', ' rabbit', "'s", ' little', ' gloves', ' while', ' she',
' was', ' talking', '.', ' "', 'How', ' can', ' I', ' have', ' done', ' that', '?"',
' thought', ' she', ',', ' "', 'I', ' must', ' be', ' growing', ' small', ' again', '."',
' She', ' got', ' up', ' and', ' went', ' to', ' the', ' table', ' to', ' measure',
' herself', ' by', ' it', ',', ' and', ' found', ' that', ',', ' as', ' nearly', ' as',
' she', ' could', ' guess', ',', ' she', ' was', ' now', ' about', ' two', ' feet',
' high', ',', ' and', ' was', ' going', ' on', ' shrinking', ' rapidly', ':', ' soon',
' she', ' found', ' out', ' that', ' the', ' reason', ' of', ' it', ' was', ' the',
' nose', 'gay', ' she', ' held', ' in', ' her', ' hand', ':', ' she', ' dropped', ' it',
' hastily', ',', ' just', ' in', ' time', ' to', ' save', ' herself', ' from',
' shrinking', ' away', ' altogether', ',', ' and', ' found', ' that', ' she', ' was',
' now', ' only', ' three', ' inches', ' high', '.']
[ 2.49 0.22 -0.36 -1.55 0.22 -2.45 2.65 -1.6 -0.14 2.26
-1.26 -0.61 -0.61 -1.89 -1.87 -0.16 3.34 -2.67 0.42 -1.71
...
2.91 -0.77 0.13 -0.24 0.63 -0.26 2.47 -1.22 -1.67 1.63
1.13 0.03 -0.68 0.8 1.88 3.05 -0.82 0.09 0.48 0.33]
The context vector is like the essence of the entire input. Using this vector, the transformer
decoder generates output based on clues. For instance, you can provide the original input as
a clue and let the transformer decoder produce the subsequent word that naturally follows.
Then, you can reuse the same decoder, but this time the clue will be the previously produced
next-word. This process can be repeated to create an entire paragraph, starting from a leading
sentence.
This process is called autoregressive generation. This is how a large language model
works: It is a transformer model in a large scale that can take very long input text, the
context vector is also large, so it can handle very complex concepts, and with many layers in
its encoder and decoder. We let the LLM generate text autoregressively until it reached the
natural end of a paragraph, based on the input we provided as well as the earlier words and
sentences it generated previously.
1.2 Why Transformer Can Predict Text? 5
Articles
Ashish Vaswani et al. “Attention Is All You Need”. In: Proc. 31st Conference on Neural
Information Processing Systems (NIPS 2017). 2017.
https://arxiv.org/pdf/1706.03762.pdf
Andrej Karpathy. The Unreasonable Effectiveness of Recurrent Neural Networks. May 2015.
http://karpathy.github.io/2015/05/21/rnn-effectiveness/
Claude E. Shannon. “Prediction and Entropy of Printed English”. The Bell System Technical
Journal, Jan. 1951, pp. 50–64.
https://www.princeton.edu/~wbialek/rome/refs/shannon_51.pdf
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving Language
Undestanding by Generative Pre-Training. 2018.
https : / / cdn . openai . com / research - covers / language - unsupervised / language _
understanding_paper.pdf
1.5 Summary
There are multiple large language models developed. Examples include the GPT-3 and GPT-
4 from OpenAI, LLaMA from Meta, and PaLM2 from Google. These are models that can
understand language and can generate text. In this chapter, you learned that:
⊲ The large language model is based on transformer architecture
⊲ The attention mechanism allows LLMs to capture long-range dependencies between
words; hence the model can understand the context
⊲ Large language model generates text autoregressively based on previously generated
tokens
In the next chapter, you will see how you can play with an LLM on your own computer.
Get a Taste of LLMs from
GPT4All
2
Large language models have become popular recently. ChatGPT is fashionable. Trying out
ChatGPT to understand what LLMs are about is easy, but sometimes, you may want an offline
alternative that can run on your computer. In this chapter, you will learn about GPT4All as
an LLM that you can install on your computer. In particular, you will learn:
⊲ What is GPT4All
⊲ How to install the desktop client for GPT4All
⊲ How to run GPT4All in Python
Let’s get started.
Overview
This chapter is divided into three parts; they are:
⊲ What is GPT4All?
⊲ How to get GPT4All
⊲ How to use GPT4All in Python
After you have the client installed, launching it the first time will prompt you to install a
model, which can be as large as many GB. To start, you may pick “gpt4all-j-v1.3-groovy”
(the GPT4All-J model). It is a relatively small but popular model.
2.2 How to get GPT4All 9
Once the client and model are ready, you can type your message in the input box. The model
may expect a specific form of input, e.g., a particular language or style. This model expects
a conversation style (like ChatGPT) and generally handles English well. For example, below
is how it responds to the input “Give me a list of 10 colors and their RGB code”:
import gpt4all
gptj = gpt4all.GPT4All("ggml-gpt4all-j-v1.3-groovy")
messages = [{"role": "user", "content": "Give me a list of 10 colors and their RGB code"}]
ret = gptj.chat_completion(messages)
print(ret)
Running the above code will download the model file if you haven’t yet. Afterward, the model
is loaded, input is provided, and the response is returned as a Python dictionary like the
following:
{'model': 'ggml-gpt4all-j-v1.3-groovy',
'usage': {'prompt_tokens': 272,
'completion_tokens': 301,
'total_tokens': 573},
'choices': [
{'message':
{'role': 'assistant',
❈ 'content': ' Here is a list of 10 colors and their RGB code:Red (255, 0, 0) ❈
❈ Green (0, 255, 0) Blue (0, 0, 255) Yellow (255, 255, 0) Orange (255, ❈
❈ 127, 0) Purple (0, 128, 255) Pink (255, 192, 203) Blue-Green (0, 0, ❈
❈ 255) Green-Blue (0, 0, 255) Blue-Purple (0, 0, 255) Blue-Green (0, 0, ❈
255) Blue-Purple (0, 0'
}
}
]
}
The example above use an input as a list of one dictionary. A more sophisticated input would
be a list of many dictionaries, each containing the keys role and content. The role can be
either "system", "assistant", or "user", while content is a string of text. If you’re using
GPT4All-J model like the example, your role is "user" while the computer is "assistant".
The input should be a sequence of conversations between these two parties. Below is how you
can construct a conversation step by step:
2.3 How to use GPT4All in Python 11
import json
import gpt4all
gptj = gpt4all.GPT4All("ggml-gpt4all-j-v1.3-groovy")
❈
messages = [{"role": "user", "content": "Can you explain what is a large language ❈
model?"}]
ret = gptj.chat_completion(messages)
messages.append(ret["choices"][0]["message"])
messages.append({"role": "user", "content": "Can you give some examples applications?"})
ret = gptj.chat_completion(messages)
messages.append(ret["choices"][0]["message"])
messages.append({"role": "user", "content": "Are there any limitations?"})
ret = gptj.chat_completion(messages)
messages.append(ret["choices"][0]["message"])
messages.append({"role": "user", "content": "Summarize the above in two sentences."})
ret = gptj.chat_completion(messages)
print(json.dumps(messages, indent=4))
print(json.dumps(ret, indent=4))
Note that you invoked the model multiple times. Each time it responded, you took the output
and appended it to the list of messages, so you accumulated the context. Then you add a new
dialog and invoke the model again. You need to collect the messages because each time you
invoke the model, it starts afresh without knowing the previous conversation. So it is your
job to keep the history to remind the model of its prior responses.
Below is an example of the output of the code above, in which the last input message to
the model and its response is printed. You may get a better result from another model. You
may also get a different result due to the randomness in the model:
[
{
"role": "user",
"content": "Can you explain what is a large language model?"
},
{
"role": "assistant",
❈
"content": " A large language model is a type of artificial intelligence that ❈
❈ can process and understand natural language, such as speech or text. It ❈
❈ is trained on large amounts of data and can perform tasks such as ❈
❈ language translation, sentiment analysis or even answering questions. ❈
❈ Large language models are becoming increasingly popular in various ❈
industries, including finance and healthcare."
},
{
"role": "user",
"content": "Can you give some examples applications?"
},
2.3 How to use GPT4All in Python 12
{
"role": "assistant",
❈
"content": " Large language models are being used in a variety of ❈
❈ applications, such as:- Language translation and machine translation, ❈
❈ where large language models are trained on vast amounts of data to ❈
❈ improve accuracy and speed.- Sentiment analysis, where large language ❈
❈ models are trained to analyze social media data and identify patterns in ❈
❈ user opinions.- Question answering, where large language models are ❈
❈ trained to answer questions based on a large corpus of data.- Healthcare, ❈
❈ where large language models are being used to analyze patient data and ❈
❈ identify patterns in health trends.- Finance, where large language models ❈
are being used to analyze financial data and identify patterns in"
},
{
"role": "user",
"content": "Are there any limitations?"
},
{
"role": "assistant",
❈
"content": " Yes, there are some limitations to large language models. One ❈
❈ of the main challenges is that they require a lot of data to train, which ❈
❈ can be expensive and time-consuming. Additionally, large language models ❈
❈ can be computationally expensive and may require specialized hardware to ❈
❈ run. Another limitation is that large language models may not be able to ❈
❈ understand the nuances of human language, which can make them less ❈
❈ effective in certain situations. Finally, large language models may not ❈
❈ be able to understand the context of a conversation or text, which can ❈
make them less effective in certain applications."
},
{
"role": "user",
"content": "Summarize the above in two sentences."
}
]
{
"model": "ggml-gpt4all-j-v1.3-groovy",
"usage": {
"prompt_tokens": 2113,
"completion_tokens": 542,
"total_tokens": 2655
},
"choices": [
{
"message": {
"role": "assistant",
❈
"content": " Large language models are a type of artificial ❈
❈ intelligence that can process and understand natural language, ❈
❈ such as speech or text. They are trained on large amounts of data ❈
❈ and can perform tasks such as language translation, sentiment ❈
❈ analysis or even answering questions. They are becoming ❈
❈ increasingly popular in various industries, including finance and ❈
❈ healthcare. However, there are some limitations such as expensive ❈
❈ data and specialized hardware, computational expense, lack of ❈
understanding nuances in human language and context."
2.4 Further Readings 13
}
}
]
}
Articles
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving Language
Undestanding by Generative Pre-Training. 2018.
https : / / cdn . openai . com / research - covers / language - unsupervised / language _
understanding_paper.pdf
2.5 Summary
GPT4All is a nice tool you can play with on your computer. It allows you to explore the
interaction with a large language model and help you better understand the capability and
limitation of a model. In this chapter, you learned that:
⊲ GPT4All has a desktop client that you can install on your computer
⊲ GPT4All has a Python interface that allows you to interact with a language model
in code
⊲ There are multiple language models available
In the next chapter, you will learn some basic prompting technique so you know what to type
in the GPT4All input box.
What Are Zero-Shot Prompting
and Few-Shot Prompting
3
In the literature on language models, you will often encounter the terms “zero-shot prompting”
and “few-shot prompting.” It is important to understand how a large language model generates
an output. In this chapter, you will learn:
⊲ What is zero-shot and few-shot prompting?
⊲ How to experiment with them in GPT4All
Let’s get started.
Overview
This chapter is divided into three parts; they are:
⊲ How Do Large Language Models Generate Output?
⊲ Zero-Shot Prompting
⊲ Few-Shot Prompting
“
Classify the text into positive, neutral or negative:
Text: That shot selection was awesome.
”
Classification:
The response was a single word, “positive.” This is correct and concise. The model obviously
can understand “awesome” is a positive sensation, but knowing to identify the sensation
3.3 Few-Shot Prompting 16
is because of the instruction at the beginning, “Classify the text into positive, neutral or
negative.”
In this example, you found that the model responded because it understood your
instruction.
Still using the Vicuna-7B model in GPT4All, but this time, we are providing the prompt:
“
Text: Today the weather is fantastic
Classification: Pos
Text: The furniture is small.
Classification: Neu
Text: I don’t like your attitude
Classification: Neg
Text: That shot selection was awful
”
Classification:
Here you can see that no instruction on what to do is provided, but with some examples, the
model can figure out how to respond. Also, note that the model responds with “Neg” rather
than “Negative” since it is what is provided in the examples.
Guiding the model to respond with examples is called few-shot prompting.
3.4 Summary 17
Due to the model’s random nature, you may be unable to reproduce the exact
INFO-CIRCLE result. You may also find a different output produced each time you run the
model.
3.4 Summary
In this chapter, you learned some examples of prompting. Specifically, you learned:
⊲ What are one-shot and few-shot prompting
⊲ How a model works with one-shot and few-shot prompting
⊲ How to test out these prompting techniques with GPT4All
In the next chapter, you will learn more about creating a prompt.
A Gentle Introduction to Prompt
Engineering
4
ChatGPT is a service provided by OpenAI that is a conversational large language model. It is
widespread, and it is found to be very useful. Behind the scene, it is a large language model.
Unlike the other LLMs that generate continuing text from the leading sentence you provided,
ChatGPT enables you to ask questions or provide instructions, and the model will respond
like a conversation. To make ChatGPT respond correctly, you must interact with the model.
This technique is called prompt engineering.
In this chapter, you will understand ChatGPT as an LLM and learn about prompt
engineering. In particular,
⊲ What is the input context to LLM in ChatGPT
⊲ How ChatGPT interacts with the input
⊲ How to provide an appropriate prompt to get the result you desired
Let’s get started.
Overview
This chapter is divided into three parts; they are:
⊲ Understanding ChatGPT
⊲ Engineering the Context
⊲ Advices for Prompt Engineering
“
Abr. Do you bite your thumb at us, sir?
Sam. I do bite my thumb, sir.
4.2 Engineering the Context 19
”
Sam. No, sir, I do not bite my thumb at you, sir; but I bite my thumb, sir.
Romeo and Juliet, act 1 scene 1
If you input the first four lines of a conversation into a language model, it is reasonable to
expect that it will generate the fifth line. As the model has learned from a vast amount of text,
the format of a play is just a style that it understands. Because the model can understand
context, its words should flow naturally with the preceding text, as if it were a proper response
in a chat.
“
To prepare for Easter, Mrs. Smith went to a store and bought 10 toy bunnies for
$5 each. Chocolate egg is $1 cheaper than bunnies, and Mrs Smith bought 15.
”
How much did Mrs. Smith spend?
A newer version of ChatGPT can probably do it right, but questions of this type are easily
error-prone if the large language model attempts to give you an answer immediately. The
reason is that when you try to generate a short answer, the context needs more clues to keep
the logic right. However, it is easy to do the math right when the LLM tries to lay out the
logic in steps. Therefore, someone suggested you ask ChatGPT not “How much did Mrs.
Smith spend” but “Explain how much did Mrs. Smith spend with steps in detail.” These are
the clues to force ChatGPT to reason with logic. For example, the following is what you may
observe as an answer:
“
To calculate how much Mrs. Smith spent, we need to determine the cost of the
toy bunnies and the chocolate eggs separately and then add them together.
Mrs. Smith bought 10 toy bunnies at $5 each, so the total cost of the bunnies is
4.3 Advises for Prompt Engineering 20
10 * $5 = $«10*5=50»50.
Each chocolate egg is $1 cheaper than the toy bunnies, so the cost of each chocolate
egg is $5 - $1 = $«5-1=4»4.
Mrs. Smith bought 15 chocolate eggs, so the total cost of the chocolate eggs is 15
* $4 = $«15*4=60»60.
Finally, to find out the total amount Mrs. Smith spent, we add the cost of the
bunnies and the cost of the chocolate eggs: $50 + $60 = $«50+60=110»110.
”
Therefore, Mrs. Smith spent $110 in total.
You can see how an LLM can give you the correct answer. LLM cannot do mental math and
has limited logic capability (since it is trained with text, it learns as much as a single sentence
can express). Should there be more complicated logic, you must ensure the model goes in
small steps. It is called the chain of thoughts.
4.4 Summary
In this chapter, you learned how prompts drive the output from an LLM, particularly ChatGPT.
Specifically, you learned.
⊲ How a prompt set up a context so that the model can generate output within the
context
⊲ LLMs are limited; you need to provide correct guidance in the prompt to produce
accurate output.
4.4 Summary 21
Large Language Models (LLMs) are known to have hallucinations. This is a behavior in that
the model speaks false knowledge as if it is accurate. In this chapter, you will learn why
hallucinations are a nature of an LLM. Specifically, you will learn:
⊲ Why LLMs hallucinate
⊲ How to make hallucinations work for you
⊲ How to mitigate hallucinations
Let’s get started.
Overview
This chapter is divided into three parts; they are
⊲ What are Hallucinations in Large Language Models
⊲ Using Hallucinations
⊲ Mitigating Hallucinations
To understand hallucination, you can build a two-letter bigrams Markov Chain from
some text: Extract a long piece of text, build a table of every pair of neighboring letters and
tally the count. For example, “hallucinations in large language models” would produce “HA”,
“AL”, “LL”, “LU”, etc. and there is one count of “LU” and two counts of “LA.” Now if you
started with a prompt of “L”, you are twice as likely to produce “LA” than “LL” or “LS”.
Then with a prompt of “LA”, you have an equal probability of producing “AL”, “AT”, “AR”,
or “AN”. Then you may try with a prompt of “LAT” and continue this process. Eventually,
this model invented a new word that didn’t exist. This is a result of the statistical patterns.
You may say your Markov Chain hallucinated a spelling.
Hallucination in LLMs is not much more complex than this, even if the model is much more
sophisticated. From a high level, hallucination is caused by limited contextual understanding
since the model is obligated to transform the prompt and the training data into an abstraction,
in which some information may be lost. Moreover, noise in the training data may also provide
a skewed statistical pattern that leads the model to respond in a way you do not expect.
5.4 Summary
In this chapter, you learned how an LLM hallucinates. In particular,
⊲ Why hallucination would be useful
⊲ How to limit the hallucination
It’s worth noting that while hallucination can be mitigated, but probably not completely
eliminated. There is a trade-off between creativity and accuracy.
Starting with the next chapter, you will see more examples of how to use LLMs and
ChatGPT in particular, for your benefit.
II
Work Productively with ChatGPT
Prompt Engineering for Effective
Interaction with ChatGPT
6
With the explosion in popularity of generative AI in general and ChatGPT in particular,
prompting has become an increasingly important skill for those in the world of AI. Crafting a
prompt, the mechanism of interacting with a large language model (LLM) such as ChatGPT,
is not the simple syntactic undertaking it would first appear to be. After the novelty of
the first interchanges with ChatGPT, it became clear that practice and consideration would
be needed for prompt mastery. As a result, developing processes to create the most useful
prompts possible — known as prompt engineering — has become a coveted expertise in LLM
circles and beyond.
In this chapter, you will learn about prompt engineering. In particular,
⊲ How to provide information in the prompt for the greatest impact on the responses
⊲ What are personas, positive and negative prompts, zero-shot prompts, and so on
⊲ How to use prompts iteratively to leverage the conversational nature of ChatGPT
Let’s get started.
Overview
This chapter is divided into three parts; they are
⊲ Principles of Prompting
⊲ Basic Prompt Engineering
⊲ Advanced Prompt Engineering Strategies
⊲ Collaborative Power Tips
constructing prompts, users can guide ChatGPT’s output toward their intended goals and
ensure more accurate and useful responses.
There are several foundational techniques to remember in the process of prompt
optimization for ChatGPT.
First, providing explicit instructions at the beginning of the prompt helps set the context
and define the task for the model. Specifying the format or type of the expected answer is also
beneficial. Additionally, you can enhance the interaction by incorporating system messages
or role-playing techniques in the prompt.
Below is an example prompt with the above techniques:
“
I would like you to generate 10 quick-prep dinner meal ideas for recipe blogs, with
each idea including a title and a one-sentence description of the meal. These blogs
will be written for an audience of parents looking for easy-to-prepare family meals.
”
Output the results as a bulleted list.
Compare that prompt with the following:
“ ”
Write 10 recipe blogs.
Intuitively, the former will garner more useful results.
Remember that you can improve the quality and relevance of the model’s responses by
iteratively refining and experimenting with prompts, creating more productive conversations.
Don’t be afraid to test out potential prompts on ChatGPT directly.
6.2.2 Succinctness
Succinctness in a prompt is important for clarity and precision. A well-crafted prompt should
be concise and to the point, providing enough information for ChatGPT to understand the
6.2 Basic Prompt Engineering 28
user’s intent without being overly verbose. However, ensuring the prompt is not too brief is
vital, which may lead to ambiguity or misunderstanding. This balance between not enough
and too much can be tricky to strike. Practice is probably the best way to master this skill.
Wording and succinctness in the prompt are important because it is for specificity.
“
You are to act as a real estate agent with 10 years of experience in the Phoenix
area. Your goal is to produce a one-paragraph summary of each of the top 5
family neighborhoods in the Phoenix metropolitan area. The intended audience
is inexperienced home buyers.
Along with the explicitly stated roles and goals, note the relative specificity of the
”
example prompt above.
“
You are to act as a real estate agent with 10 years of experience in the Phoenix
area. Your goal is to produce a one-paragraph summary of each of the top 5
family neighborhoods in the Phoenix metropolitan area. The intended audience
”
is inexperienced home buyers.
The above prompt’s framing is positive, guiding what ChatGPT should generate. Let’s add
some wording to discourage certain output, be it in content or format. An example of negative
prompting geared toward content guidance could be the addition of the following to our above
example:
6.3 Advanced Prompt Engineering Strategies 29
“
Do not include any neighborhoods within 5 miles of downtown or adjacent to the
”
airport.
This additional constraint should be helpful in ChatGPT’s understanding of what output it
should generate.
Input/Output Prompting
The input/output prompting strategy involves defining the input that the user provides to the
LLM and the output that the LLM is to generate in response. This strategy is fundamental
to prompt engineering as it directly influences the quality and relevance of the ChatGPT’s
response.
For instance, the user might provide an input prompt asking ChatGPT to generate a
Python script for a specific task, and the desired output would be the generated script.
Below is an example of the most basic strategy: provide a single input and desire a single
output.
“
Generate a Python script that takes a single mandatory command line argument
([project]) and performs the following tasks:
- creates a new folder named [project]
- creates a file within the new folder named [project].py
”
- writes a simple Python script file header to the [project].py file
Zero-Shot Prompting
The zero-shot strategy involves the LLM generating an answer without any examples or
context. This strategy can be useful when the user wants a quick answer without providing
additional detail or when the topic is so general that examples would artificially limit the
response. For example:
“ ”
Generate 10 possible names for my new dog.
One-Shot Prompting
The one-shot strategy involves the LLM generating an answer based on a single example or
piece of context provided by the user. This strategy can guide ChatGPT’s response and ensure
it aligns with the user’s intent. The idea here would be that one example would provide more
guidance to the model than none. For example:
“
Generate 10 possible names for my new dog.
”
A dog name that I like is Banana.
6.3 Advanced Prompt Engineering Strategies 30
Few-Shot Prompting
The few-shot strategy involves the LLM generating an answer based on a few examples or
pieces of context provided by the user. This strategy can guide ChatGPT’s response and
ensure it aligns with the user’s intent. The idea here would be that several examples would
provide more guidance to the model than one. For example:
“
Generate 10 possible names for my new dog.
Dog names that I like include:
- Banana
- Kiwi
- Pineapple
”
- Coconut
As you can guess, the more examples the prompt included, the closer the generated output
conforms to what is desired. With zero-shot, there may be no fruit names suggested; with
one-shot, there may be several; and with few-shot, the suggestions may consist entirely of
fruit-themed names.
Chain-of-Thought Prompting
The chain-of-thought strategy involves providing the LLM with a few examples that help to
refine the original question and ensure a more accurate and comprehensive answer. Chain-
of-thought prompts are so-called because they include a few chain-of-thought examples in
the prompting. It is differentiated from the X-shot prompting techniques as chain-of-thought
prompts are structured to encourage critical thinking and are designed to help uncover new
insights or approaches that ChatGPT may not have otherwise considered.
The technique also encourages the LLM to output its critical reasoning. The calling card
of chain-of-thought prompting is the phrase “Let’s think step by step” which is generally
appended to the end of a prompt, which research suggests is enough to improve generated
results.
Consider the following one-shot prompt example:
“
Q: Joe has 20 eggs. He buys 2 more cartons of eggs. Each carton contains 12 eggs.
How many eggs does Joe have now?
A: The answer is 44.
Q: Farmer John had 93 chickens. If he sold 20 to Farmer Bill and bought twice
”
that number more, how many chickens does Farmer John have now?
And consider ChatGPT’s incorrect output response:
“ ”
The answer is 73.
Now let’s look at the following chain of thought prompt, which is written to encourage critical
thinking by the LLM:
“
Q: Joe has 20 eggs. He buys 2 more cartons of eggs. Each carton contains 12 eggs.
How many eggs does Joe have now? Let’s think step by step.
A: Joe started with 20 eggs. 2 cartons of 12 eggs is 24 eggs. 20 + 24 = 44.
Therefore, Joe has 44 eggs, and the answer is 44.
6.3 Advanced Prompt Engineering Strategies 31
Q: Farmer John had 93 chickens. If he sold 20 to Farmer Bill and bought twice
that number more, how many chickens does Farmer John have now? Let’s think
”
step by step.
ChatGPT’s response is different this time:
“
A: Farmer John sold 20 chickens to Farmer Bill, so he was left with 93 - 20 = 73
chickens. He then bought twice the number of chickens he sold, so he bought 2
* 20 = 40 chickens. Adding these newly bought chickens to his remaining stick,
”
Farmer John now has 73 + 40 = 113 chickens.
By providing an example of the critical thinking process needed to solve this problem and
coaching it to think step by step, ChatGPT could apply the same reasoning to our question
and come up with the right answer this time.
6.3.1 Self-Criticism
The self-criticism strategy involves prompting the LLM to assess its output for potential
inaccuracies or improvement areas. This strategy can ensure the information provided by
ChatGPT is as accurate as possible. It can aid users in debugging their prompts and
determining why they are not getting results that meet expectations.
An example of such a prompt is as follows:
“
Please re-read your above response. Do you see any issues or mistakes with your
response? If so, please identify these issues or mistakes and make the necessary
”
edits.
This example pertains to coaching ChatGPT to use self-criticism for debugging its buggy
code:
“
Look at the code you have just generated. Currently it does not run. Are you
able to see any syntax errors or flow control mistakes that you can rectify? If so,
”
please identify the section of problematic code and re-generate it.
Harnessing ChatGPT’s self-healing abilities is a prompt engineering technique you must not
overlook.
6.3.2 Iterative
The iterative or expansive strategy involves prompting the LLM with follow-up prompts based
on the output of an initial prompt. This involves iterating on the results by asking further
questions or making additional requests from each successive response.
For example, consider having ChatGPT assist in creating an outline for a book you are
writing. The first prompt could like this:
“
I am writing a book on time travel theories. I have not settled on a specific topic.
Generate 5 specific topic suggestions for such a book. For each suggestion, provide
a title and one paragraph of description of what the book would cover. The book
”
will be aimed at casual readers.
Now, suppose one of the suggested topics is as follows:
6.4 Collaborative Power Tips 32
“
Title: “Temporal Paradoxes: Navigating the Complexities of Time Travel”
Description: “Temporal Paradoxes” delves into the mind-bending intricacies of
time travel paradoxes, exploring the fascinating conundrums they present. This
book explores various paradoxes such as the Bootstrap Paradox, the Predestination
Paradox, and the Information Paradox, among others.
”
...
You could then iterate on this using a follow-up prompt:
“
I will write the book you suggested, “Temporal Paradoxes: Navigating the
Complexities of Time Travel”. Generate a chapter outline for this book, including
”
sections and subsections.
A possible output excerpt is below:
“
Introduction
- Defining temporal paradoxes
- Significance of temporal paradoxes in time travel narratives
- Overview of the chapter structure
Chapter 1: The Bootstrap Paradox
1.1 The essence of the Bootstrap Paradox
- Explaining the concept and its origin
- Key examples from literature, film, and real-life anecdotes
”
...
This iteration can then continue. Further prompting could be:
“
Let’s flesh out the introduction. Generate a two paragraph summary of what each
of the chapter’s sections will cover. The chapter outline for the introduction is
below.
---
Introduction
- Defining temporal paradoxes
- Significance of temporal paradoxes in time travel narratives
”
- Overview of the chapter structure
You could see how further iteration could continue in this example. A similar iteration could
be used to have ChatGPT generate code: starting with an overview, iterating on the overview
to generate modules, generating on the modules to generate functions, and finally generate the
code within functions. Just as breaking big problems into smaller, more manageable problems
is generally a prescription for success with humans, ChatGPT excels at completing larger
tasks in more approachable chunks.
“ ”
What prompt could I use right now to further help you in this task?
ChatGPT should then generate suggestions for useful prompts that you could use on it to
strengthen its further responses.
“
I would like you to write a Python program to manage my client information,
which is stored in a Google Sheet. Please ask me whatever questions you need
”
answers to in order to undertake this assignment.
Leaving it to ChatGPT to decide what information it needs to perform a task can benefit,
as it takes out some guesswork and discourages hallucination. Of course, a poorly crafted
prompt for model-guided prompting could leave you fielding several unrelated questions from
ChatGPT, so the initial prompt still needs to be thoughtfully written.
6.5 Summary
Once you become comfortable with the prompt engineering strategies, you can search out
other more complex, high-performance approaches. These strategies include tree of thoughts,
reflexion, and self-consistency, among others. Additional strategies are being developed
regularly; no doubt that between the time this was written and when you are reading it,
there have been some interesting developments on this front.
Remember, the point of prompt engineering is to convey your intentions and desires to
ChatGPT in a way that can be clearly and unambiguously understood by the LLM, so that it
can act upon the request in such a way that produces the desired output as closely as possible.
If you keep this in mind, move forward with the presented strategies, and hone your prompt
engineering skills through regular practice, you will find ChatGPT a genuinely helpful junior
assistant, willing and able to help whenever needed.
Just so long as you ask it properly.
In the next chapter, you will see examples of using ChatGPT for brainstorming.
Strategies for Effective
Brainstorming with ChatGPT
7
ChatGPT demonstrated its capability for a broad knowledge base, but it is also a fantastic
brainstorming and ideation tool. You can ask it to devise a complete project plan by framing
requests or providing wide-ranging responses to open-ended questions, supplementing and
extending human creativity.
In this chapter, you will learn to write detailed ChatGPT prompts for exploring
brainstorming capabilities. Specifically, you will learn:
⊲ How to plan a detailed Euro trip from Pakistan
⊲ How to plan a dinner for a family of five
⊲ Learn tips on improving the brainstorming and planning prompts.
Let’s get started.
Overview
This chapter is divided into three parts; they are:
⊲ Plan a Detail EuroTrip
⊲ Plan a Dinner for a Family
⊲ Tips on Maximizing ChatGPT’s Brainstorming Capabilities
“
Act as a professional travel agent and provide at least three detailed itinerary
options spanning the entire two-week trip to Europe from Pakistan. Each
option should include 3–5 destinations in a logical geographic sequence. Assume
the traveler is interested in blending city sightseeing with outdoor or cultural
”
experiences and a USD 3000 budget.
The following is the output you may find from ChatGPT:
“
Option 1: Eastern Europe Discovery
Duration: 14 days
Budget: USD 3000
Day 1-3: Prague, Czech Republic
⊲ Explore the historic Old Town, visit Prague Castle, and stroll across the
Charles Bridge.
⊲ Enjoy panoramic views from the Petřín Tower and visit the Astronomical
Clock.
⊲ Experience the vibrant nightlife and try traditional Czech cuisine.
Day 4-6: Budapest, Hungary
⊲ Take a relaxing cruise along the Danube River, passing by iconic landmarks.
⊲ Visit Buda Castle and admire the stunning views from Fisherman’s Bastion.
⊲ Relax in the thermal baths, such as Széchenyi or Gellért Baths.
⊲ Explore the ruin bars and enjoy Hungarian delicacies.
Day 7-9: Krakow, Poland
⊲ Discover the historic center and visit the Royal Wawel Castle.
⊲ Explore the somber history of Auschwitz-Birkenau Memorial and Museum.
⊲ Take a day trip to the beautiful Wieliczka Salt Mine.
⊲ Sample traditional Polish dishes like pierogi and bigos.
Day 10-12: Vienna, Austria
⊲ Visit the majestic Schönbrunn Palace and explore its gardens.
⊲ Marvel at St. Stephen’s Cathedral and the Belvedere Palace.
⊲ Attend a classical music concert or opera performance.
⊲ Try Viennese coffee and Sachertorte cake in a traditional café.
Day 13-14: Salzburg, Austria
⊲ Take a Sound of Music tour and visit filming locations.
⊲ Explore the baroque architecture of the historic Old Town.
⊲ Visit Mozart’s birthplace and enjoy a concert at the Mozarteum.
7.1 Plan a Detail EuroTrip 36
”
...
ChatGPT provided three options in detail. Let’s say to select the third option called “Central
Europe Highlights”. You can ask for the itinerary in the follow-up question:
“
I like option 3: Central Europe Highlights. Please list the itinerary that I have to
”
do before traveling to Europe.
The response would begin with the following:
“
Certainly! Here’s a detailed itinerary for your Central Europe Highlights trip.
Before traveling to Europe, it’s essential to take care of the following preparations:
1. Research and Planning:
⊲ Familiarize yourself with the visa requirements for European
countries and apply if necessary.
⊲ Check the validity of your passport and ensure it has at least six
months of validity beyond your planned departure date.
⊲ Research the local customs, currency, and transportation options in
each destination.
⊲ Create a budget for accommodations, transportation, meals, and
activities.
2. Flights:
⊲ Search for flights from Pakistan to Berlin, Germany, as your starting
point.
”
...
The travel preparation involves research and planning, booking flights, accommodations,
intercity transport, travel insurance, sightseeing and activities, currency exchange and finances,
and vaccination. However, as a language model, the response from ChatGPT is not always
accurate and complete. ChatGPT has ignored that citizens of Pakistan need a visa to enter
Europe. Therefore, you need another follow-up question:
“
As a Pakistani, we need a Schengen visa to enter Europe. Can you tell me the
”
process of getting a visit visa for Germany?
This is what ChatGPT responded:
“
Certainly! To travel to Germany as a Pakistani citizen, you will need to apply for
a Schengen visa. Here’s an overview of the process for obtaining a visit visa for
Germany:
1. Determine the type of visa:
7.2 Plan a Dinner for a Family 37
⊲ If you are planning a tourist trip, you will need to apply for a Schengen
Tourist Visa (Type C).
⊲ If you plan to visit friends or relatives, you may need to apply for a
Schengen Visitor Visa (Type C) or a specific visa for that purpose.
2. Gather the required documents:
”
...
Securing a visitor visa involves several key steps. Determining the appropriate visa category
based on trip purpose and duration of stay establishes the foundation, while assembling the
required application documents like passport, proof of funds, travel itinerary, and occupation
documentation lays the groundwork.
While we can continue refining the itineraries by asking additional clarifying questions,
the initial brainstorming phase is now completed.
“
Suppose you are a super mom with 10 years of experience in cooking dinner for
”
the family. How would you plan an Italian-style dinner for 5 in 2 hours at home?
The response from ChatGPT is as follows:
“
As a super mom with 10 years of cooking experience, I’m here to help you plan
a delicious Italian-style dinner for your family of five in just two hours. Here’s a
step-by-step guide to make the most of your time:
1. Plan the menu: Choose a variety of dishes that encompass different
components like appetizers, main course, sides, and dessert. Here’s a sample
menu to get you started:
⊲ Appetizer: Bruschetta with tomato and basil.
⊲ Main Course: Spaghetti Carbonara.
⊲ Side Dish: Caprese Salad.
⊲ Dessert: Tiramisu.
2. Make a shopping list: Go through the recipes for each dish and list down
the ingredients you’ll need. Check your pantry to see if you already
7.3 Tips on Maximizing ChatGPT’s Brainstorming Capabilities 38
”
...
From the above, you got a list of dishes, a shopping list, prep work, how to manage the time,
and serving. There are 4 courses: Appetizer(Bruschetta with tomato and basil) main course
(Spaghetti Carbonara), side dish (Caprese Salad), and dessert (Tiramisu).
Of course, you can ask a follow-up question to find the recipe. You can simply refer to
“the dishes” without repeating the name since ChatGPT can remember what it answered:
“ ”
Now, write down a detailed plan for making all of the dishes on the menu.
The recipes as provided by ChatGPT are as follows:
“
Bruschetta with Tomato and Basil:
⊲ Preheat the oven to 375°F (190°C).
⊲ Slice a baguette into ½-inch thick slices.
⊲ Arrange the baguette slices on a baking sheet and brush them with olive
oil.
⊲ Toast the slices in the preheated oven for about 8-10 minutes or until golden
and crisp.
⊲ In the meantime, dice ripe tomatoes and finely chop fresh basil leaves.
⊲ In a bowl, combine the tomatoes,
”
...
After that, you can continue refining the recipe by providing follow-up prompts to modify
elements like ingredients, cooking methods, and flavor profiles based on your preferences and
available items.
Brainstorming, in general, can be a challenging task that involves exploring different options
and formulating a plan based on personal preferences. However, ChatGPT can simplify
brainstorming by offering various options and explanations. Although ChatGPT can assist,
it’s important to communicate your interests and adjust to your specific goals effectively. By
actively engaging with ChatGPT and refining the suggestions provided, you can optimize the
brainstorming experience and achieve better outcomes.
7.4 Summary
In this chapter, we delved into the powerful brainstorming capabilities of ChatGPT through
a series of practical examples. Specifically, we covered:
⊲ How to write a brainstorming prompt for planning a two-week trip to Europe, including
tips on narrowing down your options and prioritizing your itinerary.
⊲ How to use direct and detailed methods to plan a dinner party for five, and leverage
ChatGPT’s capabilities to explore recipes and cooking methods.
⊲ Tips on crafting open-ended and flexible prompts for brainstorming, adding more
details as you go along, and adapting your ideas based on available resources.
In the next chapter, you will learn about how to treat ChatGPT as an expert to give you
advises.
ChatGPT as Your Expert Helper
8
ChatGPT can help us learn new programming languages, courses, techniques, and skills. It
has become a go-to tool for many professionals seeking to improve their workflows or learn
something new. ChatGPT expert helper prompts can reduce our dependence on Google and
provide detailed plans for achieving goals.
In this chapter, you will learn to leverage simple ChatGPT prompts for learning a technique
or performing specialized tasks. Specifically, you will learn how to:
⊲ Generate instructions for training a model on a TPU (Tensor Processing Unit).
⊲ Generate detailed instructions for safely cutting down a tree.
⊲ Craft expert helper prompts.
Let’s get started.
Overview
This chapter is divided into three parts; they are
⊲ Accelerating Machine Learning Models with TPUs
⊲ A Guide to Safely Cutting Down a Tree
⊲ Tips on Writing Expert Helper Prompts
“
Act as a professional Machine Learning Engineer and write the Python code
for training the TensorFlow Image classification model on TPU. The computing
”
environment is Google Colab.
This is the output you may see from ChatGPT’s response:
import tensorflow as tf
The ChatGPT example demonstrates how to train a model on TPU by generating Python
code with placeholders. To properly execute the code, you must replace the placeholders with
8.2 A Guide to Safely Cutting Down a Tree 42
your dataset loading and preprocessing code, model architecture, loss function, evaluation
metrics, optimizer, training parameters, training data, and test data.
After replacing the code, you can copy and paste it into a new Colab notebook and run
the code with TPU hardware acceleration. The code you obtained may not be fully executable
and may contain some bugs. However, you should be able to identify them and correct them
easily.
Output from ChatGPT is not always correct. You must verify the accuracy using
INFO-CIRCLE other means.
“
Act as an experienced professional arborist and list the critical safety procedures
for removing a 50-foot-tall Box Elder tree located between two houses in a suburban
”
neighborhood in Mountain View, California.
This is what you may see in the output:
“
As an experienced professional arborist, I can provide you with a list of critical
safety procedures for removing a 50-foot-tall Box Elder tree located between two
houses in a suburban neighborhood in Mountain View, California. It’s important
to note that tree removal can be dangerous, and I highly recommend consulting
with a certified arborist or tree removal professional for such a task. Nevertheless,
here are some general safety procedures to consider:
1. Perform a thorough assessment: Before starting the tree removal process,
assess the tree’s condition, potential hazards, and the surrounding area.
Look for signs of decay, disease, or structural weaknesses that may affect
the tree’s stability.
2. Obtain necessary permits: Check with the local authorities and obtain
any required permits or permissions for tree removal in Mountain View,
California. Compliance with local regulations is crucial to ensure safety
and avoid legal issues.
3. Use proper personal protective equipment (PPE): Wear appropriate PPE,
including a hard hat, safety glasses, ear protection, gloves, and sturdy, non-
8.2 A Guide to Safely Cutting Down a Tree 43
slip boots. PPE helps protect against falling debris and other potential
hazards.
4. Establish a safety zone: Clearly mark and secure the area around the tree
to prevent unauthorized access. Use caution tape or barricades to keep
pedestrians and vehicles away from the work zone.
5. Plan for equipment and personnel: Determine the necessary equipment,
tools, and personnel required for safe tree removal. This may include
chainsaws, ropes, rigging equipment, and an experienced crew.
6. Engage in proper pruning techniques: If necessary, perform tree pruning to
remove dead branches or reduce the tree’s weight before the main removal
process. Proper pruning techniques help prevent accidents and control the
tree’s fall direction.
7. Conduct controlled tree felling: When felling the tree, employ proper cutting
techniques to ensure a controlled fall. Consider the tree’s lean, surrounding
obstacles, wind direction, and other factors that might influence its fall path.
8. Use rigging and lowering devices: If the tree’s location poses a risk to nearby
structures or obstacles, utilize rigging and lowering devices to safely control
the tree’s descent. This technique helps minimize the potential for property
damage and injury.
9. Perform tree removal in sections: When dealing with larger trees, it’s
often safer to remove them in sections. This involves carefully cutting and
lowering smaller portions of the tree to the ground rather than attempting
to fell the entire tree at once.
10. Use proper tree removal techniques: Follow industry best practices for
tree removal, including making precise cuts, avoiding excessive force, and
maintaining control throughout the process. Be aware of potential hazards
such as limb kickback and split wood.
11. Consider hiring professionals: Given the complexity and potential risks
involved in removing a 50-foot-tall tree between two houses, it’s strongly
recommended to engage the services of a certified arborist or experienced
tree removal company. Their expertise and specialized equipment will help
ensure a safe and efficient removal process.
Remember, tree removal can be extremely hazardous, especially when dealing with
large trees or those in close proximity to structures. Prioritizing safety at all times
”
is essential to protect yourself, your crew, and the surrounding property.
The list generated covered many important safety steps. However, removing a large tree
like the one described is a complex undertaking that likely requires specialized equipment,
trained personnel, required permits, proper techniques, access to key details, and contingency
planning. Even if you hire professionals, you need access to the tree’s location, area, and
spread before giving a green light.
8.3 Tips on Writing Expert Helper Prompts 44
8.4 Summary
In this chapter, we discussed how to craft ChatGPT expert helper prompts to generate helpful
responses. Specifically, we covered:
⊲ How to write a well-explained prompt for accelerating machine learning models training
with TPUs.
⊲ How to generate a list of the critical safety procedures for removing a tree. It is more
complex than you think.
⊲ Tips for crafting more targeted prompts that provide a clear description of the task
from the perspective of the relevant expert include necessary variables and a defined
objective.
In the next chapter, you will see how you can make ChatGPT to help you write paragraphs
of text.
Writing an Essay with ChatGPT
9
ChatGPT is a language model that you can use by talking to it. A language model in such
a scale can naturally produce fluent text that is difficult to tell apart from work by humans.
If you want to use it for a task, you will likely still need to provide detailed instructions.
Moreover, you should also not expect it to replace humans entirely. You would likely need to
do the final polishing.
In the following, you will use ChatGPT to produce an essay. Specifically, you will learn
⊲ How to guide break down your task into steps for ChatGPT
⊲ How to guide ChatGPT step by step to make an essay
Let’s get started.
Overview
This chapter is divided into four parts; they are:
⊲ Topic of the Essay
⊲ Straightforward Instruction
⊲ Guiding ChatGPT to Write Step-by-Step
⊲ How It Works
1
https://www.ets.org/pdfs/gre/sample-issue-task.pdf
9.2 Straightforward Instruction 46
“
As people rely more and more on technology to solve problems, the ability of
”
humans to think for themselves will surely deteriorate.
Let’s see how ChatGPT responds if you ask it to write such an essay.
“
Write an essay in support of the following statement:
As people rely more and more on technology to solve problems, the ability of
”
humans to think for themselves will surely deteriorate.
The result would differ each time you run it due to the system’s randomness. One result
would be the following:
“
The increased reliance on technology in modern times has undoubtedly made life
easier for people. From automated manufacturing processes to virtual personal
assistants, technology has become an integral part of our lives. However, as people
become increasingly dependent on technology to solve problems, the question
arises: will our ability to think for ourselves deteriorate?
It is a well-established fact that the human brain is like a muscle that needs
regular exercise to remain strong and healthy. When we solve problems using our
own mental faculties, we are essentially exercising our brain and enhancing our
cognitive abilities. However, when we rely solely on technology to solve problems,
we are not using our own brainpower and are essentially outsourcing our thinking
to machines.
9.3 Guiding ChatGPT to Write Step-by-Step 47
One of the most significant consequences of relying too much on technology is the
deterioration of critical thinking skills. Critical thinking involves analyzing and
evaluating information, identifying biases and assumptions, and making informed
judgments based on evidence. When we rely on technology to solve problems,
we tend to become passive consumers of information, accepting whatever the
technology presents to us without questioning its accuracy or reliability. This
lack of critical thinking can lead to poor decision-making and an inability to solve
complex problems on our own.
Moreover, technology can also contribute to a decline in creativity and innovation.
When we use technology to solve problems, we are limited by its capabilities and
functionalities. In contrast, when we think for ourselves, we are free to explore
new and unconventional ideas and come up with creative solutions to problems.
Overreliance on technology can stifle our creativity and prevent us from discovering
new and innovative solutions to the challenges we face.
Another negative consequence of relying too much on technology is the loss of
social skills. Social interaction is essential for the development of interpersonal
skills, such as communication, empathy, and conflict resolution. When we rely on
technology for communication, we miss out on the subtle nuances of face-to-face
interaction, which are critical for building meaningful relationships. This can lead
to a lack of social skills and difficulty in building and maintaining relationships
with others.
In conclusion, while technology has undoubtedly made our lives easier and more
convenient, it is important to recognize the potential negative consequences of
overreliance on technology. As we continue to integrate technology into our lives,
we must ensure that we do not become overly dependent on it to solve problems.
We must continue to exercise our critical thinking skills, nurture our creativity,
and maintain our social skills to ensure that we remain competent and independent
”
problem solvers.
This looks very natural and not bad as an essay. But indeed, it is not top-notch. You can get
a better essay if you know how to ask better.
“
Give me 3 paragraphs in support of the following statement, one argument in each
paragraph:
9.3 Guiding ChatGPT to Write Step-by-Step 48
As people rely more and more on technology to solve problems, the ability of
”
humans to think for themselves will surely deteriorate.
And now it produces the following:
“
Paragraph 1: As technology becomes more advanced, it is easier for people to rely
on it to solve problems. This can lead to a lack of critical thinking skills because
people may not be challenged to solve problems on their own. For example, people
who use GPS to navigate may not develop spatial awareness or map-reading skills,
which are important for problem-solving in many areas of life. In addition, people
who rely on calculators or computer programs to do math may not develop strong
mental math skills or an understanding of mathematical concepts. As a result,
their ability to think independently and solve problems may deteriorate.
Paragraph 2: In addition to reducing critical thinking skills, technology can also
have a negative impact on creativity. When people rely on technology to solve
problems, they may become less likely to think outside the box and come up
with creative solutions. This is because they are used to following pre-determined
algorithms or solutions provided by technology. This can be seen in the world of
art, where digital tools can be used to create artwork quickly and easily. While
these tools can be useful, they may also limit creativity by making it easier to
create conventional or derivative works.
Paragraph 3: Finally, the over-reliance on technology can lead to a reduction
in social skills. As people spend more time communicating through screens and
devices, they may have less practice interacting with others face-to-face. This can
make it harder for them to understand social cues, empathize with others, and
develop strong relationships. In addition, people who rely on technology for social
interaction may be more likely to experience feelings of loneliness and isolation.
This can have a negative impact on mental health, which can, in turn, affect overall
”
cognitive functioning and problem-solving abilities.
It looks better. The first paragraph especially has a concrete example. But no examples are
given in the other two paragraphs. Let’s continue on the chat to ask for more examples:
“
Can you give some concrete examples of how technology negatively impacts
”
creativity?
It answers:
“
Certainly! Here are a few examples of how technology can negatively impact
creativity:
Template-driven design: Many digital tools, such as website builders, offer pre-
designed templates that users can customize with their own content. While these
templates can be helpful for beginners, they can also stifle creativity by limiting
design options and encouraging conformity.
Dependence on filters: Social media platforms like Instagram offer a variety of
filters that users can apply to their photos to enhance their appearance. While
these filters can be fun to use, they can also discourage creativity by making it
easy to create generic, highly stylized images that all look the same.
9.3 Guiding ChatGPT to Write Step-by-Step 49
Auto-correction and predictive text: While these features can be helpful for
avoiding typos and speeding up the writing process, they can also lead to a lack of
creativity in writing. For example, if someone relies too heavily on auto-correction,
they may not take the time to learn proper spelling or grammar, which can limit
their ability to express themselves creatively through writing.
Algorithmic recommendations: Streaming services like Netflix and Spotify use
algorithms to recommend content to users based on their viewing or listening
history. While this can be helpful for discovering new content, it can also limit
creativity by promoting similar content and discouraging users from exploring new
genres or artists.
Overall, while technology can be a powerful tool for enhancing creativity, it’s
important to be aware of its potential limitations and actively work to avoid
”
falling into creative ruts or becoming too dependent on digital tools.
It needs to be more concise since the GRE analytical writing is only roughly 500 to 600 words.
However, these examples are helpful. You can further ask for examples regarding the third
paragraph it originally produced:
“
Can you give some concrete examples of how technology can lead to a reduction
”
in social skills? Be brief.
Now it answered:
“
Sure, here are some examples of how technology can lead to a reduction in social
skills:
Overreliance on texting and social media can lead to a lack of face-to-face
communication skills and make it harder to pick up on social cues.
Spending excessive amounts of time on screens can lead to social isolation and
feelings of loneliness.
The anonymity of online communication can lead to a lack of empathy and an
increase in cyberbullying.
Online dating and social networking apps can reduce opportunities for in-person
social interaction and make it harder to form deep, meaningful relationships.
Constant access to technology can create a distraction from real-world social
situations and lead to a lack of engagement and attention in face-to-face
”
conversations.
That’s good. Note that these examples are not in paragraph form because you needed to
specify how ChatGPT should answer. But it is not difficult for you to incorporate these into
your essay paragraphs.
Getting insight and input from ChatGPT and polish further into the format you
INFO-CIRCLE desired should be the better way to use the tool, rather than asking ChatGPT
to generate the final result in one shot.
9.3 Guiding ChatGPT to Write Step-by-Step 50
Now we still need an introduction and a conclusion to complete the essay. Let’s ask
ChatGPT to do these.
“ ”
Please write an introduction paragraph for the above.
This is what it produced:
“
Technology has undoubtedly transformed the way we live our lives, from how we
work and communicate to how we access information and solve problems. While the
benefits of technology are numerous and undeniable, there are also some negative
consequences to our over-reliance on digital tools. One such consequence is a
reduction in social skills. As people spend more time communicating through
screens and devices, they may have fewer opportunities to practice face-to-face
communication skills, leading to a decline in social awareness and empathy. In
this context, it is worth exploring some concrete examples of how technology can
”
negatively impact our social skills and what we can do to mitigate these effects.
For the conclusion, you want to reference the main content of your essay. You shouldn’t worry
since ChatGPT remembers the conversation. You can ask:
“ ”
Please write a conclusion paragraph to summarize everything above.
and it answered:
“
In conclusion, while technology has many positive effects on our lives, it is essential
to recognize that there are also some negative consequences, such as a reduction
in critical thinking skills, creativity, and social skills. Technology can provide
shortcuts and instant gratification that can ultimately lead to the erosion of
essential skills. It is crucial to be aware of these potential drawbacks and take
steps to mitigate their effects, such as setting limits on screen time, engaging in
face-to-face communication, and finding ways to use technology in a balanced and
mindful way. By doing so, we can continue to benefit from the many advantages
of technology while also ensuring that we maintain the skills and connections that
”
make us human.
With a bit of reordering and polishing, you now have a complete essay.
9.4 How It Works 51
9.5 Summary
In this chapter, you discovered how ChatGPT can help you write an essay. In particular, you
learned:
⊲ ChatGPT can write you an essay in one shot with a short guidance
⊲ You can break down the task into multiple steps to make ChatGPT produce a more
detailed response
9.5 Summary 52
⊲ ChatGPT can reference the dialog with you in creating new responses
In the next chapter, you will learn how to make ChatGPT to guide you to learn something.
Using ChatGPT as Your
Personalized Teacher
10
Machine Learning and Data Science are the two most essential technologies in Industry
4.0. Data Science refers to extracting meaningful insights from data, while Machine Learning
enables the computer to learn independently without being explicitly programmed. Mastering
these fields requires a solid understanding of fundamental concepts, hands-on experience, and
guidance from mentors. Traditional learning methods, like attending lectures, reading books,
making notes, etc., can be inflexible, expensive, and time-consuming. This is where ChatGPT
can be your personalized tutor.
In this chapter, you will uncover the benefits of ChatGPT as a personal tutor for machine
learning and data science enthusiasts. In particular, you will learn
⊲ How to let ChatGPT guide you to learn abstract algebra
⊲ How to let ChatGPT help you prepare for a data science interview
Let’s get started.
Overview
This chapter is divided into three parts; they are:
⊲ Mastering Linear Algebra in 12 Weeks
⊲ Self-Quizzing for a Machine Learning Interview
⊲ Prompting Tips to Enhance Learning Experience
“
I am interested in mastering [Subject] with a focus on [Topic]. I would like to
create a [Number of Weeks/Months] study plan that will help me achieve this goal.
Can you please help me by:
1. [Subgoal-1]
2. [Subgoal-2]
”
...
You can also specify your current level of expertise. The following is an example of what you
prompted to ChatGPT:
“
I am interested in mastering abstract linear algebra with a focus on topics relevant
to data science and machine learning. I would like to create a 12-week study plan
that will help me achieve this goal.
Can you please help me by:
1. Identifying the key concepts that I need to learn in abstract linear algebra
weekly
”
2. Recommending the best resources for learning these concepts.
The response from ChatGPT was as follows:
“
Certainly! Here’s a breakdown of key concepts to learn in abstract linear algebra
weekly, along with recommended resources:
Week 1: Introduction to Linear Algebra and Vectors
Learn about the basic concepts of linear algebra, such as vectors, vector spaces,
and linear combinations.
Familiarize yourself with vector operations, including addition, subtraction, and
scalar multiplication.
Recommended resources:
“Introduction to Linear Algebra” by Gilbert Strang
“Linear Algebra and Its Applications” by David C. Lay
Week 2: Matrices and Matrix Operations
Study matrices, their representation, and operations like addition, subtraction,
and scalar multiplication.
Explore matrix multiplication and properties such as associativity and
distributivity.
Recommended resources:
“Linear Algebra and Its Applications” by David C. Lay
“Linear Algebra Done Right” by Sheldon Axler
Week 3: Systems of Linear Equations
10.1 Mastering Linear Algebra in 12 Weeks 55
”
...
As ChatGPT has a maximum token limit for each response so if you experience an incomplete
response, you can use this prompt:
“ ”
Can you please continue and complete your response?
Now you get a complete roadmap with topics relevant to your end goal and all the resources
you need per topic. Is that enough? You may also want ChatGPT to summarize the topic
and provide some practice questions to solidify your understanding. In this case, you can use
a follow-up prompt to create an interactive learning experience.
“
Thank you for sharing the 12-week schedule. I am excited to get started!
Can you please explain the first concept of Week 1
with examples? I would also appreciate it if you could provide the practice problems
”
to solidify my understanding of the concept.
The response from ChatGPT was:
“
Certainly! In Week 1, the first concept is “Introduction to Linear Algebra and
Vectors.” Let’s dive into it:
Concept Explanation:
Linear algebra is a branch of mathematics that deals with vector spaces and linear
transformations.
Vectors are mathematical objects that have both magnitude and direction, and
they are fundamental in linear algebra.
Vectors can be represented as column vectors or row vectors and can have various
dimensions.
Example:
Let’s consider a two-dimensional vector represented as v = [2, 5]. Here, the vector
has two components: 2 and 5. The first component (2) represents the magnitude
or value in the x-direction, and the second component (5) represents the magnitude
or value in the y-direction.
Practice Problems:
Given vectors u = [1, -3] and v = [4, 2], calculate the sum u + v.
Determine the magnitude (length) of the vector u = [3, -4].
Find the unit vector in the same direction as v = [2, 7].
Given the vectors u = [1, 2, 3] and v = [4, -1, 0], calculate the dot product u · v.
Verify whether the vectors u = [1, 2, -3] and v = [-2, 4, -6] are parallel (collinear)
by checking if one is a scalar multiple of the other.
10.2 Self-Quizzing for a Machine Learning Interview 56
Solving these practice problems will help solidify your understanding of vectors
”
and their properties. Good luck!
With the help of ChatGPT, you are now able to master the concepts of abstract linear algebra.
You can learn effectively and have a virtual tutor available 24/7 to clear your doubts and
suggest additional resources for better understanding.
“
I want you to act as my [Subject/Position] Interviewer. Conduct my [Interview
Type] interview for the [Position/Role]. Please ask me a series of questions to
evaluate my knowledge and skills in [Areas], and provide feedback on my responses
”
unless I ask you to stop.
So this is the prompt you feed into ChatGPT:
“
I want you to act as my Machine Learning Interviewer. Conduct my technical
interview for the Junior Machine Learning Engineer position. Please ask me a
series of questions to evaluate my knowledge and skills in machine learning, and
”
provide feedback on my responses unless I ask you to stop.
Which you may see this response from ChatGPT:
“
Sure! I’d be happy to conduct your technical interview for the Junior Machine
Learning Engineer position. I’ll ask you a series of questions related to machine
learning, and I’ll provide feedback on your responses. Let’s begin! Question
1: What is the difference between supervised learning and unsupervised learning?
Provide examples of each. (Note: Feel free to take your time and provide a detailed
”
response. I’ll wait for your answer before proceeding to the next question.)
“
In Supervised learning, we have a labeled dataset while in Unsupervised Learning
we have an unlabeled dataset. For example, sentiment analysis can be an example of
supervised learning where the text has been labeled with correct output for training
purposes. Clustering the unlabeled dataset into groups based on similarities is an
”
example of an unsupervised learning problem
Then ChatGPT will appraise you:
10.2 Self-Quizzing for a Machine Learning Interview 57
“
Great job on explaining the difference between supervised and unsupervised
learning! You correctly mentioned that supervised learning involves using labeled
data, where the algorithm learns from input-output pairs to make predictions or
classifications. Sentiment analysis is indeed a good example of supervised learning,
where sentiment labels (positive, negative, neutral) are provided for training.
You also mentioned unsupervised learning correctly. In unsupervised learning,
the algorithm works with unlabeled data to find patterns, structures, or groupings
in the data. Clustering is a commonly used technique in unsupervised learning,
where similar data points are grouped based on their features or attributes.
Overall, your response demonstrates a good understanding of the difference between
supervised and unsupervised learning, and you provided relevant examples. Well
done!
Let’s move on to the next question.
Question 2: What is the purpose of regularization in machine learning algorithms?
”
How does it help in preventing overfitting?
“ ”
Regularization adds a penalty to the loss function hence preventing overfitting
In this case, ChatGPT will tell you to enrich your answer:
“
That’s a good start! Regularization is indeed used to prevent overfitting in machine
learning algorithms. Let me provide you with a more detailed explanation.
Regularization is a technique that introduces a penalty term to the loss function
during training. The penalty term is based on the complexity or magnitude of the
model’s parameters. The purpose of this penalty term is to discourage the model
from fitting the training data too closely, which can lead to overfitting.
Overfitting occurs when a model becomes too specialized in capturing the noise
or idiosyncrasies of the training data, resulting in poor generalization to unseen
data. Regularization helps to address this issue by adding a regularization term to
the loss function, which controls the complexity of the model. The regularization
term encourages the model to find a balance between fitting the training data well
and keeping the model’s parameters small or constrained.
By including regularization, the model is penalized for having large or complex
parameter values, which helps prevent overfitting. It encourages the model to
generalize better to unseen data by finding a simpler and more robust representation
of the underlying patterns in the data.
In summary, regularization adds a penalty to the loss function to prevent overfitting
by discouraging complex or large parameter values in the model. This promotes
better generalization to new, unseen data.
10.2 Self-Quizzing for a Machine Learning Interview 58
Well done on your response! If you have any questions or would like to discuss
”
further, feel free to let me know before moving on to the next question.
You can observe how ChatGPT provided a detailed explanation of the concept. It also allows
you to clear any of your concerns before it can move over to the next question just like a real
tutor.
Isn’t it cool? Now, let us move over to our last scenario by first prompting ChatGPT to
continue with the next question. Then it may respond with:
“
Of course! Let’s proceed to the next question.
Question 3: Explain the bias-variance tradeoff in machine learning and its
relationship to model complexity.
(Take your time to provide a detailed response, and feel free to ask for clarification
”
if needed.)
“
The bias-variance tradeoff is a trade-off between the model’s accuracy and its
complexity. As the complexity of a model increases, bias increase and variance
”
decreases
In this case, you will see ChatGPT trying to correct you:
“
I appreciate your attempt at explaining the bias-variance tradeoff. However,
the relationship between bias and variance is slightly different than what you
mentioned. Allow me to provide a more accurate explanation:
The bias-variance tradeoff is a fundamental concept in machine learning that deals
with the relationship between the bias and variance of a model. Bias refers to the
error introduced by approximating a real-world problem with a simplified model,
making assumptions that may not hold. Variance, on the other hand, refers to the
model’s sensitivity to fluctuations in the training data, meaning it captures noise
or random variations rather than the true underlying patterns.
The tradeoff arises when adjusting the complexity of a model. A model with high
bias tends to be overly simplistic, making strong assumptions that may not match
the underlying data distribution. Such a model may have low accuracy on both
the training and testing data and is said to underfit the data. On the other hand, a
model with high variance captures the noise or random fluctuations in the training
data too closely. It may perform well on the training data but fails to generalize
to unseen data, a phenomenon known as overfitting.
Here’s how the tradeoff works: When you have a simple model with low complexity,
such as linear regression with few features or low polynomial degree, it generally
exhibits high bias and low variance. As you increase the complexity, say by adding
more features or increasing the polynomial degree, the model becomes more flexible
and can better fit the training data. However, this comes at the cost of potentially
10.3 Prompting Tips to Enhance Learning Experience 59
higher variance and lower bias. The model becomes more prone to overfitting and
may fail to generalize well to unseen data.
The goal is to strike a balance between bias and variance by finding an optimal
level of model complexity that minimizes the total error. This is typically achieved
through techniques like cross-validation, regularization, or ensemble methods that
combine multiple models.
In summary, the bias-variance tradeoff refers to the tradeoff between a model’s
bias and variance. Increasing complexity reduces bias but increases variance while
decreasing complexity increases bias but reduces variance. The aim is to find
the right level of complexity that minimizes the overall error and ensures good
generalization to unseen data.
A great effort in attempting to explain the bias-variance tradeoff! If you have any
further questions or if there’s anything you’d like me to clarify, please let me know
”
before we move on to the next question
You can see how ChatGPT explained how bias-variance trade-off works under the hood and
generated an even more detailed response to your incorrect answer.
10.4 Summary
ChatGPT is a valuable tool that you can use to create a personalized learning environment.
It can adapt beautifully according to the progress of the learner. Here are the key takeaways
from this chapter:
⊲ ChatGPT can tailor the journey to address the strengths and weaknesses of the
individual.
⊲ Define your end goals and subgoals before drafting the initial prompt
10.4 Summary 60
⊲ Follow the prompting tips for a more dynamic conversation and relevant responses
In the next chapter, you will see evidence that ChatGPT is good at many languages.
Using ChatGPT for Translation
Effectively
11
ChatGPT has demonstrated its ability to handle translation tasks with surprisingly high
accuracy. While Google Translate has been the go-to tool for multilingual translation for
years, recent studies show that ChatGPT performs competitively with commercial translation
products in high-resource European languages.
ChatGPT’s strength as a translator goes beyond just natural language text. You can also
translate the code between different programming languages. Simply providing an initializing
prompt describing the translation you want, ChatGPT can often generate the converted code
within seconds with high accuracy.
In this chapter, you will learn how to use ChatGPT prompts to understand ChatGPT’s
Translation Capabilities. Specifically, you will learn how to:
⊲ Translate a poem from English to Swedish.
⊲ Translate code from Julia to Python.
⊲ Enhance translation results.
Let’s get started.
11.1 Overview
This chapter is divided into three parts; they are
⊲ Language Translation
⊲ Code Translation
⊲ Tips on Effective Translation
“ ”
You are a translation helper that translates English poems into Swedish.
11.2 Language Translation 62
“
Sure! I can help you with translating English poems into Swedish. Please provide
me with the English poem you would like to have translated, and I’ll do my best
”
to assist you.
Your translation bot is now fully prepared and comprehensively understands the context. You
can proceed by requesting to translate the poem into Swedish. You provide the poem in your
second prompt:
“
Please convert the following poem from English to Swedish:
Nature’s first green is gold,
Her hardest hue to hold.
Her early leaf’s a flower;
But only so an hour.
Then leaf subsides to leaf.
So Eden sank to grief,
So dawn goes down to day.
”
Nothing gold can stay.
The following is what ChatGPT responded:
“
Sure! Here’s the translation of the poem “Nothing Gold Can Stay” by Robert
Frost into Swedish:
Naturens första gröna är guld,
Hennes hårdaste nyans att behålla.
Hennes tidiga löv är en blomma;
Men endast så en timme.
Sedan försvinner bladet till blad.
Så sjönk Eden i sorg,
Så gryningen går ner till dagen.
Ingenting guld kan bestå. I hope this translation captures the essence of the
original poem in Swedish. Let me know if there’s anything else I can assist you
”
with!
Validation
To confirm the accuracy of the translation, you can paste the translated poem into Google
Translate to get the English version. In this case, the translation is nearly flawless, which is
impressive given the difficulty of translating poetry. It successfully captures both the essence
and the meaning of the original poem.
11.3 Code Translation 63
“
You are a professional software engineer that has mastered both Julia and Python
programming languages. In this case, you will help me translate a simple Julia
”
game into Python.
Similar to the previous example, ChatGPT will acknowledge your instructions and wait for
the code from you:
“
Of course! I’d be happy to help you translate your Julia game into Python. Please
provide me with the code for the game in Julia, and I’ll assist you in converting
”
it to Python.
Now, ask ChatGPT to convert the following code into Python, using the following prompt:
“
Please convert the following Julia Code into Python:
```
function number_game()
secret_number = rand (1:100) # Generate a random secret number between 1 and 100
attempts = 0
println("Welcome to the Number Game!")
println ("I'm thinking of a number between 1 and 100. Can you guess it?")
while true
attempts += 1
guess = parse(Int, readline()) # Read the player's guess from input
if guess < secret_number
println("Too low! Try again.")
elseif guess > secret_number
println("Too high! Try again.")
11.3 Code Translation 64
else
println("Congratulations! You guessed the number in $attempts attempts!")
break
end
end
end
The code above is deliberately quoted using three backticks (```) following the convention of
quoting codes in Markdown format. You shall see ChatGPT translated the code in response:
”
“
Sure! Here’s the equivalent Python code for the given Julia code:
import random
def number_game():
secret_number = random.randint(1, 100) # Generate a random secret number between 1 and 100
attempts = 0
print("Welcome to the Number Game!")
print("I'm thinking of a number between 1 and 100. Can you guess it?")
while True:
attempts += 1
guess = int(input()) # Read the player's guess from input
if guess < secret_number:
print("Too low! Try again.")
elif guess > secret_number:
print("Too high! Try again.")
else:
print(f"Congratulations! You guessed the number in {attempts} attempts!")
break
Validation
”
As a language model, ChatGPT may produce some errors in the code. To verify the accuracy
of the translation, you should create a Python file named number_game.py, paste the converted
code, and execute the file in the terminal, so that you let a real Python interpreter to tell you
whether the code is working as expected.
In this case, ChatGPT has flawlessly translated the Julia code into Python with just a
simple prompt.
11.4 Tips on Effective Translation 65
Articles
Wenxiang Jiao, Wenxuan Wang, Jen-tse Huang, Xing Wang, and Zhaopeng Tu. “Is ChatGPT
A Good Translator? Yes With GPT-4 As The Engine”, 2023.
https://arxiv.org/pdf/2301.08745.pdf
11.6 Summary 66
11.6 Summary
In this chapter, we have explored different use cases of machine translation with ChatGPT,
highlighting effective strategies for achieving accurate translations. Specifically, we have
discussed the following topics:
⊲ Writing an effective initialization and translation prompt for language translation.
⊲ Writing translation prompts for technical tasks, such as converting Julia code into
Python.
⊲ Enhancing translation results through context awareness, attention to punctuation,
validation techniques, and optimizing ChatGPT
⊲ prompts.
By implementing these techniques, you can leverage ChatGPT’s translation capabilities to
their fullest potential and obtain high-quality translations for various use cases.
Translation needs to understand the context of the text. In the next chapter, you will
see another example in which ChatGPT can understand your input well to paraphrase what
you said.
Mastering Summarization with
ChatGPT
12
In this era of information overload, summarizing plays a crucial role in extracting meaningful
information from large amounts of data. It is not only time-saving but also facilitates quick
decision-making. However, manual summarization techniques of hiring human experts to
read, analyze and summarize the data have become obsolete due to the exponential growth
of data. This is where the world felt the need to use Natural Language Processing techniques
to develop an automated system that presents condensed information. ChatGPT is one of
them and is widely used in various fields for summarization purposes.
In this chapter, you will have a detailed look into how ChatGPT can assist in generating
summaries. In particular,
⊲ Summarizing market research reports and developing an effective marketing strategy
⊲ Analyzing user feedback surveys to improve product design
Let’s get started.
Overview
This chapter is divided into three parts; they are:
⊲ Summarizing Market Research Reports
⊲ Analyzing User Feedback Surveys
⊲ Tips for Effective Summarization with ChatGPT
“
Summarize the key findings and insights from the market research reports on
the target audience and competitors. Highlight the key demographics, behaviors,
needs, and preferences of potential customers. Identify the main competitors,
their product profiles, marketing strategies, and key strengths. Synthesize this
information to determine how to effectively position and differentiate our new
product to capture interest from the target audience in a crowded market.
Market Research Report 1: [ ]
Market Research Report 2: [ ]
”
...
The market research reports considered in this case are quite lengthy to cite here, but an
overview of both is as follows:
⊲ Market Research Report 1 — Target Audience Analysis: This market research report
aims to comprehensively understand the target audience for the upcoming product
launch. The research was conducted through surveys, interviews, and data analysis,
enabling the marketing team to gain valuable insights into potential consumers’
demographic profiles, preferences, and behaviors.
⊲ Market Research Report 2 — Competitive Landscape Analysis: This market research
report analyzes the competitive landscape for the new product launch. By summarizing
the findings, the marketing team gains valuable insights into the key competitors, their
market positioning, product offerings, and marketing strategies.
The following is the response from ChatGPT:
“
Synthesis and Recommendations: Based on the findings from the market research
reports on the target audience and competitors, we can derive key insights to
effectively position and differentiate our new product in the crowded market.
Target Audience Insights:
⊲ Our target audience consists of tech-savvy individuals aged 25-40, with
a balanced gender distribution and higher income levels. They value
convenience, quality, and personalized experiences.
⊲ To capture their interest, our marketing strategy should emphasize
the product’s ability to enhance productivity, save time, and provide
entertainment value.
⊲ Leveraging social media platforms like Instagram and YouTube, along with
targeted email marketing campaigns, can effectively reach and engage our
target audience.
Competitor Analysis:
12.2 Analyzing User Feedback Surveys 69
”
audience and differentiates our product in the competitive market landscape.
The results were quite impressive. ChatGPT enabled the team to develop a good marketing
strategy in no time. They were able to increase their brand awareness and generate more
leads. This new tool allows the marketing team to work smarter and more cost-effectively.
You can use ChatGPT to help them summarize the survey result. The summary would
be shared on their social media page. Hence it should be clear and concise.
Here is the format of the user surveys used in this case:
1. Respondent 1:
⊲ Biggest Pain Points: Slow loading times, frequent crashes, and lack of
integration with other software.
⊲ Desired Features: Improved performance and stability, seamless integration
with popular tools, and a more intuitive user interface.
⊲ Satisfaction with Current Product: Somewhat dissatisfied.
⊲ Likelihood to Recommend: Unlikely to recommend.
2. Respondent 2:
⊲ Biggest Pain Points: Limited customization options, lack of advanced reporting
features, and difficulty in accessing certain functionalities.
⊲ Desired Features: More flexibility for customization, robust reporting and
analytics capabilities, and easier access to key features.
⊲ Satisfaction with Current Product: Moderately satisfied.
⊲ Likelihood to Recommend: Neutral.
and so on. These survey data should be incorporated into the prompt, such as the following:
“
Summarize the key findings and insights from the user feedback surveys. Identify
the most common pain points, frustrations, and feature requests from users.
Highlight any areas of concern or potential issues raised. Provide a synthesis of this
feedback to determine how we can best address the key needs and concerns of our
users with the new product feature. Extract any suggestions or recommendations
provided by users on how we can improve the product or better meet their needs
”
User Survey Data
The response from ChatGPT might be:
“
Key Findings and Insights: Common Pain Points and Frustrations:
⊲ Slow loading times, frequent crashes, and lack of integration with other
software.
⊲ Limited customization options, lack of advanced reporting features, and
difficulty in accessing certain functionalities.
⊲ Inconsistent user experience across devices, inadequate customer support,
and a steep learning curve for new users.
⊲ Limited collaboration features, inefficient workflow management, and lack
of integration with project management tools.
⊲ Lack of regular updates and bug fixes, poor documentation and user guides,
and difficulties in onboarding new team members.
Desired Features and Recommendations:
12.2 Analyzing User Feedback Surveys 71
The response is well-summarized but not concise. The company can learn what to improve,
but it is not the right amount of information to share on social media. You need a shorter
”
version for that. This can be obtained using a follow-up prompt:
“
Using condensation and paraphrasing techniques, summarize a given text into a
”
shortened version.
The response from ChatGPT might be:
“
User feedback surveys highlight common pain points and frustrations, including
slow loading times, crashes, lack of integration, limited customization options,
and difficulty in accessing functionalities. Users also express concerns about
inconsistent user experience, inadequate customer support, and steep learning
curves. They desire improved performance, stability, intuitive interfaces,
customization options, advanced reporting features, and easier access to key
functionalities. Additionally, users recommend responsive design, enhanced
customer support, better onboarding processes, robust collaboration tools,
streamlined workflow management, and seamless integration with project
management software. Suggestions for improvement include regular updates,
bug fixes, comprehensive documentation, and improved onboarding resources.
Dissatisfaction with the current product and the likelihood of users not
recommending it emphasize the importance of addressing these concerns to enhance
”
user satisfaction and retention.
Although the generated response summarized the above content quite well, it can be
refined further to make its tone easier for the general public to understand. We can also define
the word limit or directly generate social media posts with appropriate hashtags.
12.3 Tips for Effective Summarization with ChatGPT 72
12.4 Summary
In this chapter, you explored the use of ChatGPT for effective summarization. Summarizing
large amounts of data is crucial in today’s information overload era. Manual techniques have
become obsolete, leading to the adoption of automated systems like ChatGPT. You examined
two case studies: summarizing market research reports to develop a marketing strategy and
analyzing user feedback surveys to improve product design. ChatGPT provided concise and
insightful summaries in both cases, enabling the teams to make informed decisions. The
impressive results demonstrated the effectiveness and cost-efficiency of leveraging ChatGPT
for summarization purposes. This chapter also provided tips for effective summarization
with ChatGPT, emphasizing the importance of context, iterative improvement, and human
validation.
The above summary was generated by ChatGPT and then refined. Feel free to evaluate
its effectiveness in capturing the key information of this chapter.
In the next chapter, you will see how ChatGPT’s fantastic capability of understanding
what you provide can help you do research.
Advanced Techniques for
Research with ChatGPT
13
Research has always been essential to human progress and has evolved tremendously over the
past few years. With the advent of advanced technologies, new tools and techniques have
emerged to conduct more efficient research and to stay at the forefront of knowledge. One
such technology is ChatGPT, a large language model that uses deep learning approaches
to generate human-like responses. The remarkable ability of ChatGPT to understand and
develop text has made it an invaluable tool that can enhance your research. Your productivity
as a researcher is improved as it saves time and resources by providing comprehensive insights.
However, researchers must be careful about the ethical considerations of using ChatGPT and
ensure that their research is accurate and unbiased.
In this chapter, you will explore the advanced techniques to improve your research. In
particular,
⊲ Analyzing and Interpreting Research Data
⊲ Performing Literature Review & Identifying Research Gaps
Let’s get started.
Overview
This chapter is divided into three parts; they are:
⊲ Analyzing and Interpreting Research Data
⊲ Performing Literature Review & Identifying Research Gaps
⊲ Bonus Prompts for Researchers
will be time-consuming and requires dedicated software expertise. This is where you can use
ChatGPT to help you make sense of the data.
You will see how we will ask questions to assist this business owner. Before proceeding
toward the prompts, here is the snapshot of the data that we will be working on:
Customer ID Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10
1 4 5 3 5 4 3 4 4 5 3
2 3 4 2 4 3 2 3 3 4 2
3 5 5 4 5 5 5 4 5 5 4
4 2 3 2 4 2 2 3 3 2 2
5 4 4 3 4 4 4 4 4 4 3
6 3 4 2 4 3 3 3 3 4 2
7 1 2 1 2 1 1 2 2 1 1
. . . . . . . . . . .
. . . . . . . . . . .
49 2 2 1 2 1 1 2 2 1 1
50 3 4 2 4 3 3 3 3 4 2
“
I would like you to help me with the initial data exploration of the customer
satisfaction ratings dataset that I collected. Please provide insights on the
following:
1) Can you provide summary statistics of the customer satisfaction rating dataset,
including the range, mean, median, and mode of the ratings?
2) How many customers gave the highest rating (5) for each question, and how
many gave the lowest rating (1)?
”
Dataset: [ ]
The following is the response from ChatGPT:
“
To perform the initial data exploration of the customer satisfaction rating dataset,
let’s start by calculating the summary statistics, including the range, mean, median,
and mode of the ratings. Here are the summary statistics for each question in the
dataset: Question 1 (Q1):
Range: 4 (5 - 1)
Mean: 3.08
Median: 3
Mode: 4 (appears most frequently)
...
13.1 Analyzing and Interpreting Research Data 75
Here are the summary statistics for the customer satisfaction rating dataset you
provided:
Range: The range of ratings is from 1 to 5.
Mean: The mean rating across all customers and questions is 3.36.
Median: The median rating is 4.0, which means that half of the ratings are below
4 and a half are above.
Mode: The mode represents the most common rating in the dataset. In this case,
there are multiple modes, with a rating of 4 being the most frequent rating.
Now, let’s find out how many customers gave the highest rating (5) and the lowest
rating (1) for each question:
For Question 1 (Q1):
Number of customers who gave a rating of 5: 5
Number of customers who gave a rating of 1: 3
...
Please note that the above counts are based on the dataset you provided. If you
”
have more data, the counts may differ.
“
Based on the above statistics, what are the key insights I can draw from the data?
Can you also provide information about the following:
1. Key drivers of customer loyalty based on available data?
”
2. Common reasons for customer complaints or negative feedback?
Since we have considered dummy data where the questions are just like the black box, ChatGPT
cannot provide us recommendations about how to improve our strategy but will pinpoint the
areas of improvement.
Here is the response from ChatGPT:
“
Based on the provided statistics, we can draw the following key insights from the
data:
Average Rating: The average rating across all customers and questions is 3.36,
which is slightly below the midpoint of 5. This suggests that overall customer
satisfaction is moderate.
Positive Ratings: The most frequent rating is 4, which indicates that many
customers are generally satisfied with the service or product.
13.2 Performing Literature Review & Identifying Research Gaps 76
Negative Ratings: There are a few customers who have given the lowest rating of
1 for some questions. This indicates that there are areas where improvement is
needed to address customer concerns.
Question 10 (Q10): This question received the highest number of lowest ratings
(5 customers gave a rating of 1). It may be worth investigating the specific issues
raised in this question to identify potential areas for improvement.
Now, let’s analyze the data to identify the key drivers of customer loyalty based
on the available information. To determine this, we can look at the questions that
received the highest number of 5 ratings:
Question 2 (Q2): This question received a rating of 5 from all customers. It suggests
that the aspect addressed in this question is a key driver of customer loyalty.
Unfortunately, without the actual question content, it’s difficult to determine the
specific driver.
Questions 1, 4, 5, 6, 7, 8, and 9: These questions also received a rating of 5 from
all customers. Similar to Q2, the specific drivers of loyalty cannot be identified
without knowing the content of these questions.
Regarding common reasons for customer complaints or negative feedback, the data
indicates that Question 10 (Q10) received the highest number of lowest ratings (5
customers gave a rating of 1). It suggests that there are specific issues addressed
in Q10 that lead to customer dissatisfaction. To identify the common reasons for
negative feedback, it’s essential to review the content of Question 10 and analyze
the responses provided by the customers. Without that information, we cannot
provide specific insights into the common complaints.
To gain deeper insights and a more comprehensive understanding of the data, it is
recommended to review the actual questions and analyze the qualitative feedback
provided by customers, if available. This will provide more context and enable
more accurate identification of key drivers of loyalty and common reasons for
”
complaints.
You have seen how helpful ChatGPT can be to business owners so they can make data-driven
decisions. However, one crucial thing that the researchers should be mindful of is to avoid
biased language while framing the prompts or input data. This can lead to biased results.
Using high-quality training data representing the whole population is also helpful in ensuring
the research is accurate and unbiased.
“
[Zeenat]: I need help with a literature review on renewable energy sources and
their integration into the power grid. Can you provide me with an overview of the
”
current state of research in this area?
“
[ChatGPT]: Certainly! The integration of renewable energy sources into the power
grid has been a topic of extensive research in recent years. Here’s an overview of
the current state of research in this area:
1. Renewable Energy Technologies: Numerous renewable energy technologies
are being studied and deployed, including solar photovoltaic (PV) systems,
wind turbines, hydroelectric power, biomass, geothermal, and tidal energy.
Researchers are investigating the technical aspects, efficiency, and scalability of
these technologies.
2. Grid Integration Challenges: One major focus of research is understanding and
addressing the challenges associated with integrating renewable energy into the
power grid. These challenges include intermittency and variability of renewable
generation, grid stability, voltage control, frequency regulation, and power quality
issues.
”
...
ChatGPT has a knowledge cutoff of September 2021, so ChatGPT might not be aware of the
recent events. It provides a comprehensive overview of the current challenges and work done
so far, but the response should also be verified from other sources. Let’s get back to Zeenat’s
conversation with ChatGPT:
“
[Zeenat]: Can you provide a list of the top 10 most-cited papers on renewable
”
energy integration into the power grid?
“
[ChatGPT]: I can give you a general idea of some influential papers in the field that
were highly cited as of my knowledge cutoff date. These papers have contributed
significantly to the understanding and development of renewable energy integration
into the power grid:
1. “Power System Stability and Control” by Prabha Kundur
2. “Large-scale Renewable Power Generation: Integration and Sustainability” by
Peter Droege
3. “Power System Analysis” by Hadi Saadat
4. “Renewable Energy Sources and Climate Change Mitigation” by Ottmar
Edenhofer et al.
5. “Renewable Energy Integration: Practical Management of Variability,
Uncertainty, and Flexibility in Power Grids” by Lawrence E. Jones
6. “The Smart Grid: Enabling Energy Efficiency and Demand Response” by Clark
W. Gellings
7. “Renewable Energy Grid Integration: Technical and Regulatory Issues” by
Lawrence E. Jones
8. “Renewable and Efficient Electric Power Systems” by Gilbert M. Masters
13.2 Performing Literature Review & Identifying Research Gaps 78
”
power grid.
Collecting the most cited and influential papers is time-consuming, mainly when the
information is scattered across various resources. However, you can save much time by using
ChatGPT as your research assistant. Now that you have the list of the top 10 cited papers,
Zeenat needs to identify the potential research gaps that can form the basis for her thesis.
“
[Zeenat]: Based on the current research, what are the main challenges and research
gaps that need to be addressed in the integration of renewable energy sources into
”
the power grid?
“
[ChatGPT]: The integration of renewable energy sources into the power grid poses
several challenges and research gaps that are being actively addressed by researchers
and industry experts. Here are some of the main challenges and research areas:
1. Grid Stability: The intermittent nature of renewable energy sources, such
as solar and wind, can impact grid stability. Developing advanced control and
forecasting techniques can help address this issue.
2. Energy Storage: Efficient and cost-effective energy storage solutions are needed
to store excess renewable energy for use during periods of low generation.
3. Grid Management: As renewable energy sources become more prevalent, there
is a need for better grid management techniques, such as demand response and
distributed energy resource management.
4. Regulatory Frameworks: Addressing the regulatory challenges related to
renewable energy integration, such as grid access, pricing, and incentives, remains
an important research area.
5. Technological Innovations: Continued research on new technologies and
materials that can improve the efficiency and cost-effectiveness of renewable energy
generation and storage is crucial.
6. System Integration: Research on the integration of renewable energy sources
with existing power infrastructure, including the interplay between different energy
sources and grid components, is needed.
These are some of the key challenges and research gaps in the integration of
renewable energy sources into the power grid. Researchers, policymakers, and
industry stakeholders are actively working to address these challenges and develop
innovative solutions to accelerate the transition to a sustainable and renewable
”
energy-based grid
13.3 Bonus Prompts for Researchers 79
With ChatGPT’s help, Zeenat could understand the current state of the research and identify
the potential gaps that helped her develop the research questions for her thesis. But you need
to be aware of important considerations other than the knowledge limitations; these are as
follows:
⊲ Accuracy and Reliability: ChatGPT is a language model, so the responses cannot be
declared 100
⊲ Ethics and Bias: Researchers should strive to maintain ethical research standards and
be aware of potential biases in ChatGPT’s responses.
“
Can you suggest 5 important unanswered questions related to [your area of interest]
”
that would advance the current state of knowledge in [specific subfield or topic]?
“
Can you suggest the best research methodology and data collection techniques for
studying [research topic] in [specific subfield or context], including their strengths,
”
weaknesses, and when each would be most appropriate?
“
What are some effective strategies for developing a strong introduction, clear thesis
statement, and convincing conclusion for my [research paper] on [research topic]?
Please provide guiding questions and ideas on how to structure these elements to
”
ensure they are effective and aligned with the research goals.
“
Proofread and edit my Research Paper for any grammatical, punctuation, repetitive
words, and spelling errors. Please provide suggestions to improve the readability
”
and flow of my research paper.
“
I would like you to generate a dataset of [About?] with [Number of Records]
synthetic records with the following characteristics.
[Name of Field] ([Data Type / Range]) ...
13.4 Summary 80
”
header row listing the field names and [Number] data rows.
13.4 Summary
While ChatGPT can be a helpful resource, the actual human research and the researcher’s
understanding and expertise in a particular subject remain essential for high-quality research.
Here are the key takeaways from this chapter:
⊲ ChatGPT can help assist research tasks allowing you to focus more on the actual
research and less on the other things. Sample prompts and examples are provided to
demonstrate how it can assist at different stages of the research process.
⊲ Researchers should carefully frame prompts and provide enough detail and context
to guide ChatGPT in generating relevant and valuable responses.
⊲ Researchers must take responsibility for the accuracy and reliability of their work.
They should abide by the ethical considerations of using AI-based assistance in their
research.
In the next chapter, you will see why ChatGPT can save you time because it can understand
text.
14
Using the Natural Language
Understanding Capability of
ChatGPT
Overview
This chapter is divided into three sections; they are:
⊲ You AI Secretary
⊲ Extracting Unstructured Information
⊲ How to Use ChatGPT for NLU
An excerpt is as follows:
“
» GOOD MORNING, EVERYBODY. I’M MICHAEL STERN, DELEGATE
FOR COMPTROLLER BRAD LANDER AND CHAIR OF THE FINANCE
COMMITTEE OF THE NEW YORK CITY TRANSITIONAL FINANCE
14.1 Your AI Secretary 82
”
» THANK YOU.
This is not a long meeting, but the transcript spans several pages. You can summarize the
transcript into 1-page minutes using the following prompt:
“
As an experienced secretary, please summarize the meeting transcript below to
meeting minutes, list out the participants, agenda, key decisions, and action items.
» GOOD MORNING, EVERYBODY. I’M MICHAEL STERN, DELEGATE FOR
COMPTROLLER
BRAD LANDER AND CHAIR OF THE FINANCE COMMITTEE OF THE
NEW YORK CITY
TRANSITIONAL FINANCE AUTHORITY. AS A REMINDER, PLEASE KEEP
YOUR FILMS
MUTED UNLESS SPEAKING. I’LL NOW CALL TO ORDER A MEETING OF
THE FINANCE
COMMITTEE. RITA, COULD YOU PLEASE CALL THE ROLL?
...
» THANK YOU, EVERYBODY. HAVE A GREAT WEEKEND.
» HAVE A GREAT WEEKEND.
”
» THANK YOU.
In the prompt, you provided the transcript and told ChatGPT what to include in the output
to ensure all key details are included. The following is what ChatGPT produced:
“
Meeting Minutes
Meeting: Finance Committee Meeting
Date: [Insert Date]
Time: [Insert Time]
Location: [Insert Location]
Participants:
- Michael Stern (Delegate for Comptroller Brad Lander and Chair of the Finance
Committee)
- David Womack (Representing Director Jacques Jiha)
- Diana Beinart (Representing Commissioner Preston Niblack)
- Louann Koziol (Representing Commissioner Thomas Foley)
- Hector German (Representing Speaker Adrienne Adams)
Agenda:
1. Approval of the minutes of the committee’s last meeting.
2. Resolution recommending the Board of Directors approve the 125th series
resolution authorizing the issuance of up to 1.6 billion of fiscal 23 series D future
tax-secured bonds. Key Decisions:
1. Approval of the minutes of the committee’s last meeting.
- The minutes were reviewed and approved unanimously.
14.1 Your AI Secretary 83
Note: The transcript provided does not include specific details about the meeting
such as dates, times, and locations. Please fill in the missing information based
”
on the context and requirements of the organization.
The minutes are much tidier than the transcript and easier to read. One particular fact is
that this transcript is two meetings scheduled as one and you can be aware of that from
the minutes. However, you may still need to polish it if you wish it in a particular format.
Some information that should appear in the minute but not available from the transcript is
replaced with a placeholder that you need to fill in. This shouldn’t be very difficult compared
to summarizing the transcript.
ChatGPT can do this job easily because it is trained to understand language, and it can
extract key information. You can make it a helpful secretary with an appropriate prompt to
instruct ChatGPT to reproduce the key information in a particular format.
Nevertheless, some meetings are lengthy. The transcript may be very long and would
hit the context length limit in ChatGPT. In that case, ChatGPT will refuse to proceed. You
may want to break down the transcript into multiple chunks and let ChatGPT summarize
each first. Then combine the summarized result to generate the minutes.
“
Read the following text, and answer the following:
1. What is the latest passenger count?
2. What is the date referenced for this volume?
3. How many passengers it has before?
4. What was the date referenced for the previous volume?
Text:
The Port Authority of New York and New Jersey today announced that for the
first time since the start of the COVID-19 pandemic, monthly air passenger levels
across the agency’s regional airports surpassed pre-pandemic volumes.
In November, the Port Authority’s airports handled a total of 11 million passengers,
which was 102 percent of pre-COVID November 2019 volumes. Strong demand
for air travel in November was driven primarily by domestic travelers during
Thanksgiving, when 8 percent more holiday passengers flew to U.S. destinations
compared to Thanksgiving 2019.
The Port Authority also forecasts demand for air travel will remain high through
the remainder of 2022, particularly during the 11-day period beginning Friday,
Dec. 23, 2022, to Monday, Jan. 2, 2023.
The evident return to air travel in the bistate region caps a year of accomplishments
and openings for the Port Authority’s redevelopment projects at its three major
14.2 Extracting unstructured information 85
”
underway, having broken ground in December 2021.
The text is from a press release obtained here:
14.3 How to Use ChatGPT for NLU 86
⊲ https://www.panynj.gov/port-authority/en/press-room/press-release-archives/20
22-press-releases/port-authority-reports-monthly-airport-passenger-volume-s
urpasse.html
“
1. The latest passenger count mentioned in the text is 11 million passengers.
2. The date referenced for this volume is November.
3. The text does not provide information on the number of passengers before the
COVID-19 pandemic.
”
4. The date referenced for the previous volume is not mentioned in the text.
The distilled result is easier to extract, and you may transfer it to another use. Also note that
when the provided text does not contain the information you were looking for, it will tell you
so. This is because, in your prompt, you asked it to answer based on the text only.
14.4 Summary
In this chapter, you have seen how to use ChatGPT as a natural language understanding tool.
You have seen examples of:
⊲ Transforming a meeting transcript into minutes
⊲ Extracting specific information from text
Using this capability of ChatGPT, you can easily build a helper, such as extracting action
items from an email you received and create a to-do list.
In the next chapter, you will see ChatGPT can generate not only human language, but
also programming language.
Using ChatGPT as Your
Programming Assistant
15
A large language model is a machine that can understand and generate text. Depending on
how it is trained, sometimes the model can generate something other than text. ChatGPT is
such a large language model. It can generate programming code if you prompt it correctly. In
this chapter, you will learn how to make ChatGPT to generate a program for you. Specifically,
you will learn
⊲ How to make ChatGPT to bootstrap your programming project
⊲ How to use ChatGPT as your programming helper
Let’s get started.
Overview
This chapter is divided into two parts; they are:
⊲ Start a Programming Project
⊲ Understanding Code and Generating Function Snippets
“
I need to create a REST API server that accepts a URL as input, captures the web
page screenshot into JPEG format, and returns it as output. Optionally, the user
may provide an email address as an additional input. In that case, the screenshot
”
should be emailed out instead of returned. Can you help me with this program?
With this, ChatGPT produces the following suggestion:
“
Certainly! I can help you with that. To create a REST API server that captures
web page screenshots and handles optional email functionality, you can use Node.js
along with a few additional packages. Here’s an outline of the steps you can follow:
1. Set up a new Node.js project and initialize it using npm:
mkdir screenshot-api
cd screenshot-api
npm init
2. Install the necessary packages. You’ll need express for the API server, puppeteer
for capturing screenshots, and nodemailer for sending emails:
3. Create an index.js file and set up the basic server using Express:
});
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
4. Inside the /screenshot route, use Puppeteer to capture the web page screenshot
and handle the response accordingly:
// Launch Puppeteer
const browser = await puppeteer.launch();
const page = await browser.newPage();
} else {
// Send the screenshot as the response
res.type('image/jpeg');
res.send(screenshotBuffer);
}
});
5. To handle sending emails with the screenshot attachment, add the following
code inside the if (email) block:
node index.js
”
to your needs.
This is a very detailed result that tells you how to finish this programming task. The response
covered all the requirements, but you should notice that when you didn’t specify explicitly in
the prompt, ChatGPT will make some design decisions for you, such as what programming
language to use.
It is not easy to think for all the details at the first run, but the nature of ChatGPT
allows you to provide follow-up prompt to revise the answer, such as:
“
For the above problem, I want to use Python and FastAPI as the web framework
”
and Selenium for the web browser. Can you rewrite this?
The response from ChatGPT now becomes:
“
Certainly! Here’s a revised version of the solution using Python, FastAPI as the
web framework, and Selenium for the web browser automation. 1. Install the
necessary packages. You’ll need fastapi, uvicorn for running the server, selenium,
and webdriver_manager for managing the web driver:
2. Create a new file called main.py and import the required modules:
15.1 Start a Programming Project 91
app = FastAPI()
class ScreenshotRequest(BaseModel):
url: str
email: str = None
@app.get("/screenshot")
async def capture_screenshot(request: ScreenshotRequest):
options = Options()
options.headless = True
try:
# Set up the Chrome webdriver
❈
driver = webdriver.Chrome(ChromeDriverManager().install(), ❈
options=options)
driver.set_window_size(1280, 720)
if request.email:
# Send the email with the screenshot attachment
❈
raise HTTPException(status_code=400, detail="Failed to capture ❈
screenshot.")
”
web page screenshots and handle optional email functionality.
You can see that, you didn’t provide any unnecessary detail in your follow-up prompt except
referencing to “the above problem” but ChatGPT can accurately “translated” the Node.js
implementation into Python and use the libraries you specified.
It is a fantastic result, although you may still need to polish the code. One example is
that the browser screen size is certainly affecting how a web page is rendered, but the size was
hard-coded in the above since you didn’t specify that it should be adjustable in your prompt.
Another potential reason to polish the generated code is to catch other coding style issues or
add defensive measures against security concerns.
In summary, as in the other use case, the more detail you put in the prompt with sufficient
clarity is the key to a useful response. In the case of a programming task, it is crucial to lay
out the details of
⊲ What is the objective
⊲ What is the input and output format
⊲ What are the tools the program should use
⊲ What are the different situations that the program may encounter and how should
these situations be handled
“
Please explain what the following code is doing:
```
float det(float** a, float k) {
float s = 1, ret = 0, **b;
int i, j, m, n, c;
15.2 Understanding Code and Generating Function Snippets 93
if (k == 1) {
return a[0][0];
} else {
b = (float**) malloc(sizeof(float*)*k);
for (i = 0; i < k; i++)
b[i] = (float*) malloc(sizeof(float)*k);
ret = 0;
for (c = 0; c < k; c++) {
m = 0;
n = 0;
for (i = 0; i < k; i++) {
for (j = 0; j < k; j++) {
b[i][j] = 0;
if (i != 0 && j != c) {
b[m][n] = a[i][j];
if (n < (k - 2))
n++;
else {
n = 0;
m++;
}
}
}
}
ret = ret + s * (a[0][c] * det(b, k - 1));
s = s * -1;
};
for (i = 0; i < k; i++)
free(b[i]);
};
free(b);
return ret;
}
```
This prompt is very simple: There is only one keyword, “explain”. But pay attention to how
you provide the code to ChatGPT: The use of backticks (```) follows the Markdown’s code
”
fence syntax to quote the program. This helps identify which is your instruction and which
is not.
While this program is not long, ChatGPT explained the code with great verbosity. It
also identifies the intent at a high level. Namely, it is to calculate the determinant of a matrix.
The following is the response:
“
The code you provided is a recursive implementation of calculating the determinant
of a square matrix using the Laplace expansion. Here’s a step-by-step breakdown
of what the code does:
15.2 Understanding Code and Generating Function Snippets 94
6. It initializes ret to 0.
7. It enters a loop that iterates over each column of the first row of the matrix
a.
store the submatrices obtained by excluding the first row and the selected column.
”
The recursion continues until it reaches the base case of a 1×1 matrix.
“ ”
Can you rewrite this code for clarity and add comments?
The keywords here are “for clarity” and “add comments”. ChatGPT provides the following
in response:
“
Certainly! Here’s a revised version of the code with comments explaining each
step:
❈ // Create the submatrix by excluding the first row and the current ❈
column
for (i = 0; i < size; i++) {
for (j = 0; j < size; j++) {
submatrix[i][j] = 0;
else {
n = 0;
m++;
}
}
}
}
return result;
}
}
I’ve added comments above each significant section of the code to explain what it
”
does. This should make the code more readable and easier to understand.
This version is undoubtedly easier to read.
Besides, you can ask for more. Such as ask to catch bugs or potential security issues in
the code. Let’s ask ChatGPT to produce some unit test code:
“ ”
Can you give me a few unit test cases to ensure this function works well?
Not require any further explanation, the following is the response:
“
Certainly! Here are a few unit test cases to verify the correctness of the determinant
function: Test Case 1: 2×2 Matrix
These test cases cover matrices of different sizes (2×2, 3×3, and 4×4) and include
positive, negative, and zero determinant values. By comparing the calculated
determinant values with the expected outputs, you can verify if the determinant
”
function is working correctly.
But it is apparent that the unit test code missed a corner case: The 1 × 1 matrix. This
reveals that ChatGPT is not always perfect. You should only use it as your assistant not a
replacement. You should always verify the result.
15.3 Summary
In this chapter, you saw how ChatGPT can help you with programming. Not only can it
generate code as part of its response to your question, but also it can figure out the intention
of a code that you provided. Specifically, you have learned that:
⊲ You can use ChatGPT to generate the initial code for your software project or generate
test code for a function
⊲ You can ask ChatGPT to explain the code to you
⊲ You can make use of ChatGPT to refactor and clean up code
In the next chapter, you will see why ChatGPT’s ability to speak a computer language is
helpful, even if you are not writing software.
Generating Diagrams with
ChatGPT
16
A large language model trained with appropriate content can generate responses more than
just English text. ChatGPT, for example, is known to be able to generate code in many
programming languages. Indeed, you can make ChatGPT generate other content as well,
such as pictures. In this chapter, you will learn
⊲ How to make ChatGPT to generate block diagrams and sequence diagrams
⊲ The general rules to make ChatGPT to create diagrams for you
Let’s get started.
Overview
This chapter is divided into three parts; they are
⊲ Building a System Design Block Diagram
⊲ Building a Sequence Diagram
⊲ Limitations and Tips for Graphics Generation
“
A cloud file storage service has the following components:
1. A mobile client that contains a local database, an index controller, a chunk
controller, and a watcher components
2. The controllers and watcher components are interacting with the server side
16.1 Building a System Design Block Diagram 99
”
Please create a block diagram for this using the Mermaid syntax.
There are two key properties in constructing such prompt:
⊲ You put down the system components and how they interact with each other clearly
⊲ You request to use Mermaid syntax for the diagram
Giving the detail of what components should include and how they should interact is important
to get the elements in the diagram right. However, ChatGPT can generate text but not
graphics. In order to have the diagram, you need a graphics generation language that can
present in plaintext form. Mermaid.js (https://mermaid.js.org/) is one example.
The response from ChatGPT is as follows:
“
Sure! Here’s a block diagram representing the components and their interactions
in the cloud file storage service:
mermaid
Copy code
graph TD
In this diagram, the mobile client consists of a local database, an index controller,
a chunk controller, and a watcher component. These components interact with
the server-side components through a load balancer. The server side consists of
controllers, a file processing server, a metadata server, and a notification server.
The file processing server handles the upload and download of files, breaking
them down into chunks and storing them in the cloud storage. The metadata
server processes the metadata of files and stores it in the metadata database. The
notification server pushes messages, such as file updates, to the client, which are
handled by the watcher component. All these operations are streamlined using a
message queue built on top of Kafka.
Please note that this is a simplified representation, and there may be additional
components or interactions depending on the specific implementation of the cloud
”
file storage service.
The code block in the response is the diagram in Mermaid.js syntax. If you copy them to the
Mermaid Live Editor online (https://mermaid.live/), the following is what you get:
Figure 16.1: The diagram based on the Mermaid code produced by ChatGPT
Mermaid is a Javascript library that can render a variety of graphics on a web page. You
may further polish the Mermaid code to add color or move the blocks to a different location
16.2 Building a Sequence Diagram 101
on the canvas. However, it is a great help from ChatGPT already if you need a visualization
of a system.
In fact, you can combine this technique with others, such as providing a system’s high-
level goal to ChatGPT and asking it to tell you the system components. Then in the follow-up
prompt, ask ChatGPT to convert this into a diagram.
You can try out the following prompt as an example:
“
What are the system components behind a social media like Twitter and how do
”
they interact?
and then in the follow-up prompt,
“ ”
Please provide a block diagram for the above in the Mermaid syntax.
“
How can a user interact with an webapp and login using OAuth2? Please generate
”
a sequence diagram in PlantUML syntax to explain.
OAuth2 is a common way of authentication on webapps that the webapp server does not need
you to create an account, but instead uses other platform’s account. For example, you can use
your Google account to login to ChatGPT. Google checks your password, but the application
(ChatGPT) is not part of Google. There are multiple parties involved in the process.
The following is how ChatGPT explained this process to you:
“
Certainly! I can help you generate a sequence diagram in PlantUML syntax to
illustrate how a user can interact with a web app and login using OAuth2. Here’s
the diagram:
plantuml
Copy code
@startuml
actor User
participant "Web App" as WebApp
participant "OAuth2 Provider" as OAuthProvider
”
implementation details. It serves as a simplified representation of the general flow.
Here you asked for a different “language” of the graphics syntax: PlantUML. You can copy
the code above and run it on the PlantUML Online Server (https://www.plantuml.com/plant
uml/uml/). The picture you get is the following:
Figure 16.2: The UML diagram generated from the output of ChatGPT
16.3 Limitations and Tips for Graphics Generation 103
The sequence diagram explains how the login and authentication happened and how the access
token was created.
Note that this works because ChatGPT can accurately articulate how this process works.
If your process is too complicated or not known by ChatGPT, you should provide the detail
of how the different components interact in the prompt and ask ChatGPT to convert your
description into a graphics language.
16.4 Summary
In this chapter, you learned that ChatGPT can generate text and graphics, albeit in the form
of some graphics language. Specifically, you saw how ChatGPT can
⊲ generate a block diagram depicting the interaction of different parties according to
your description
⊲ generate a sequence diagram to explain a complex logic to answer your question
Most importantly, the key to making ChatGPT generate graphics is to give enough details on
how the graph should be generated. You should specify the format (e.g., in Mermaid syntax)
and provide enough detail about what should be on the visualization.
In the next chapter, you will see one more example of combining the power of ChatGPT
with some other tool to boost productivity.
Creating a PowerPoint
Presentation using ChatGPT
17
Making ChatGPT your assistant to help you write an email is trivial since it is well-known
to be very capable of generating text. ChatGPT is not a robot that can light up your stove
and cook dinner. But you may wonder if it can generate something other than text. In the
previous chapter, you learned that ChatGPT could generate a graphic via an intermediate
language. In this chapter, you will learn about another example of using an intermediate
language, namely, VBA for PowerPoint. Specifically, you will learn:
⊲ How to make ChatGPT to generate a slide deck outline
⊲ How to convert a slide deck outline into an actual PowerPoint file
Let’s get started.
Overview
This chapter is divided into three parts; they are
⊲ Outline of a Pitching Deck
⊲ Running VBA and Obtaining the PowerPoint File
⊲ Generating Other File Formats
⊲ Details: Your storyline should be that Python can work better than Java. Depending
on the use case, you may want to give more detail on a particular application, such
as REST API system
Therefore, you may try the following prompt:
“
You are an expert in Python programming and system development.
Write the outline for a slide deck to pitch the Python ecosystem to a Java veteran.
Tell them how Python can do everything they were doing with Java. Focus on the
benefits of easy to use, easy to develop, and easy to maintain. Especially focusing
”
on how Python supports building a scalable system with REST API support.
As expected, ChatGPT can give you an outline as follows:
“
Slide Deck: Pitching the Python Ecosystem to a Java Veteran
Slide 1: Introduction
⊲ Welcome and Introduction
⊲ Target Audience: Java Veterans
⊲ Objective: Show how Python can replace Java and offer benefits in ease
of use, development, and maintenance, with a focus on building scalable
systems with REST API support.
Slide 2: Overview of Python
⊲ Brief introduction to Python as a high-level programming language
⊲ Python’s popularity and its extensive ecosystem
Slide 3: Easy to Use
⊲ Python’s simplicity and readability compared to Java
⊲ Concise and expressive syntax
⊲ Reduced boilerplate code
Slide 4: Easy to Develop
⊲ Rapid prototyping and shorter development cycles
⊲ Wide range of built-in libraries and packages
⊲ Massive community support and extensive documentation
Slide 5: Easy to Maintain
⊲ Python’s emphasis on code readability and maintainability
⊲ Clean and organized code structure
⊲ Automated testing frameworks for better code quality
Slide 6: Scalable Systems
⊲ Python’s ability to build scalable systems with REST API support
⊲ Overview of Python frameworks such as Django and Flask
⊲ Support for microservices architecture
17.1 Outline of a Pitching Deck 106
”
17.1 Outline of a Pitching Deck 107
You should review what ChatGPT provided to you. You may also use a follow-up prompt
to ask ChatGPT to revise some slides or add some content. However, once you are satisfied
with the outline, you can tell ChatGPT to create the PowerPoint slide.
Since ChatGPT will not return a PowerPoint file to you, you need to find something to
generate PowerPoint. Just like you learned that Mermaid syntax is a way to present a sequence
diagram in the previous chapter, PowerPoint comes with Visual Basic for Application (VBA)
that can generate a slide deck using code.
For example, you can use this follow-up prompt to generate the VBA code that creates
the deck:
“
Now write the VBA code to create the PowerPoint slides for this deck. Occasionally
”
add humorous and whimsical content.
The output from ChatGPT is as follows:
“
Certainly! Here’s an example of VBA code that creates the PowerPoint slides for
the pitch deck, with occasional humorous and whimsical content:
Sub CreatePitchDeck()
...
”
17.2 Running VBA and Obtaining the PowerPoint File 108
You should see a “VBAProject” window in the Visual Basic Editor. Right-click on that to
insert a new Module.
17.2 Running VBA and Obtaining the PowerPoint File 109
Then you can copy and paste the VBA code that ChatGPT generated into the Module window,
just as the screenshot below.
Then you are ready to run this VBA code to generate a PowerPoint file. All you need is
to click the “Run” button on the toolbar.
Running this will create another PowerPoint presentation with the content generated by
ChatGPT. You can discard the first presentation as it is empty and work on this one instead.
17.3 Generating Other File Formats 110
Note that the slides are bare, and you may want to apply a template to make them more
colorful. Instructions on switching a template to an existing presentation can be easily found
online. Also, note that the slide generated is not perfect. There could be some formatting
issues, for example. ChatGPT is just helping you to get started. It is your job to polish it
further.
17.4 Summary
In this chapter, you learned how to create a PowerPoint file. In particular, you learned
⊲ How to make ChatGPT create an outline for your presentation
17.4 Summary 111
⊲ How to convert the outline into VBA code that can generate the actual presentation
⊲ How to execute the VBA to obtain the final output
This workflow may be adopted for other file formats.
This marks the end of this book.
III
Appendix
What Can ChatGPT Do?
A
ChatGPT or any other large language model is merely a trained machine learning model that
can generate text. Should there be any fact in the context it generates, it is either because
it remembered that from the training data, or because such combination fits probabilistically
according to the training data.
Consider the example if your prompt contains Albert Einstein, and relativity; you should
not be surprised if a model says Albert Einstein developed relativity and earned him a Nobel
prize (not for this reason, actually). Probably from the training data, the model learned about
the high probability of collocation between Einstein and relativity, as well as Einstein and
probability. Therefore mistakes were made. We call this the hallucination of a large langauge
model. After all, the model size is large, but the training data set is much larger. We should
not imagine a model can remember everything in the training dataset.
When using ChatGPT, you must consider whether hallucination works for you. See the
table below to compare:
There are use cases sitting in between. For example, making ChatGPT your teacher
to generate a study plan would require some imagination, but also preferred not to be too
creative that the output is out of context or unrealistic. This is the difficult part of the model
to keep the level of hallucination at the sweet spot.
Prompt Engineering Cheatsheet
B
Kids in United States had a game called funny fill-in which a template passage with a lot of
blanks are provided, and they are supposed to fill in words in the blanks to make up a story,
however ridiculous it would be. The blanks are hinted with “person’s name”, “color” and so
on to help make the passage meaningful.
Below are some fill-in templates of the same fashion. It can help you interact with
ChatGPT better.
Writing
Write a format, e.g., blog post on topic, e.g., why electric car is not environmental friendly in style, e.g. humorous
style. You should provide number arguments, including list of ideas you want to include but do
not mention list of ideas you do not want to include .
Completion
Can you action, e.g., complete the following paragraph with instructions, e.g., the same style ?
put your partial paragraph here
Idea Generation
As a role, e.g., chemistry professor , you are an expert in topic, e.g., sports . Give me
number ideas / examples for use case, e.g., birthday gift about subject, e.g., data science covering
additional details .
B.2 Exact and Accurate Response 115
Summarization
Summarize the following into number words: paragraphs here
Information Extraction
Identify the topics, e.g., action items from the following format, e.g., meeting minutes and recap in
format, e.g., point forms : content here
Graphic Generation
Create a format, e.g., sequence diagram in Mermaid.js for description of all the components in detail
Follow-up Prompts
Make the above refer to the previous dialog into different style, e.g., longer but less formal
Translation
Traslate the following from a language, e.g., Java to another language, e.g., French : content to translate
B.3 In-between
Critiques
Provide number ways to improve my what should it be, e.g., press release : text to critique here
Guided Response
Provide a format, e.g., email response to the following format, e.g., letter to adjective, e.g., politely
theme, e.g., refuse the request : relevant text here .
How-to
Provide step-by-step instructions/N-day plan on topic, e.g., cutting down a tree
Generate names
Suggest number adjective, e.g., eye-catching topic, e.g., titles for my description, e.g., fiction on apocalypse
with additional detail
B.4 Keywords 116
Programming
What is the Excel formula / NumPy function for task, e.g., calculating the monthly payment for a fixed-rate mortgage
Review Code
Identify the bug in the following code and suggest a rewrite: insert your source code here
Testing Code
Please generate unit tests for the following code: insert your source code here
B.4 Keywords
A good prompt can guide the model to generate useful response. In the prompt, think if you
provided details to the who, when, what, where, why, how questions. If you are struggling to
create a good prompt, let the keywords below to inspire you:
Action Curate a list. Generate N keywords. Give N counterexamples. Tips and tricks.
Paraphrase. Rewrite. Correct typos and grammatical errors.
Style Explain to a 5-year-old. In 500 words. Concise. Using humor. Appealing tone. Playful
tone. Persuasive. Explain with a metaphor. With examples. With headings and subheadings.
Output format High-volume SEO keywords. Hashtags. Search terms. Blog post. Social
media ad. Journal article. Movie plot. School essay. Interview questions. Formal letter.
Step-by-step guide.
Details Highlight the benefits. Comfort the recipient. Emphasizing. Avoiding. Balance
between. Add a call-to-action.
How Far You Have Come
You made it. Well done. Take a moment and look back at how far you have come.
⊲ You learned what is ChatGPT and in general, what is a large language model
⊲ You learned what ChatGPT expects in the prompt, and how the prompt can shape
its response
⊲ You learned how to make use of the hallucination as a feature to help you brainstorm
and generate creative contents
⊲ You also learned how to provide detailed information in the prompt to prohibit
hallucination, using ChatGPT merely as an assistant who understands your instruction
⊲ You discovered ChatGPT not only can help you write paragraphs, but also generate
graphics or files if you combine its output with some other tools
Don’t make light of this. You have come a long way in a short amount of time. You have
developed the important and valuable skill of being able to make ChatGPT work in your
favor. Once you are familiar with it, you have a high performance assistant at a very low cost,
and its help can boost your productivity a lot. To shed some light on what you can do now,
you can imagine you’re a student graduating from school and looking for a job, then
⊲ You can ask ChatGPT to give you some idea on what to mention in the cover letter
(Chapter 7)
⊲ You can describe your credential and interest and ask ChatGPT to write your resume
(chaptername 9)
⊲ You can ask ChatGPT to help you practice for interview (Chapter 10)
⊲ You can ask ChatGPT to write a very nice thank you letter in response to a job offer
(Chapter 14)
We want to take a moment and sincerely thank you for letting us help you start your
journey with ChatGPT. We hope you feel yourself empowered by this new technology.