Certified Prompt Engineering Body of Knowledge PDF

Summary

This document is a guide to certified prompt engineering, covering introduction, language models, training methods, evaluation metrics, and ethical considerations. It's intended for those interested in this field and aims to enhance prompt designing and response quality. The book provides an overview of the prompt engineering process, including important factors, and ethical considerations to ensure responsible development.

Full Transcript

CERTIFIED PROMPT ENGINEERING BOOK OF KNOWLEDGE WWW.GSDCOUNCIL.ORG USA || SWITZERLAND || SINGAPORE CERTIFIED PROMPT ENGINEERING: BODY OF KNOWLEDGE This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Pr...

CERTIFIED PROMPT ENGINEERING BOOK OF KNOWLEDGE WWW.GSDCOUNCIL.ORG USA || SWITZERLAND || SINGAPORE CERTIFIED PROMPT ENGINEERING: BODY OF KNOWLEDGE This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 1 1. INTRODUCTION TO PROMPT ENGINEERING Prompt engineering is the process of designing, testing, and optimizing prompts that elicit specific responses from natural language models. Prompt engineering has evolved from the fields of natural language processing, artificial intelligence, and human-computer interaction, and has applications in various domains such as education, entertainment, business, and social good.  Some examples of prompt engineering are:  Creating prompts that generate summaries, headlines, captions, or slogans from text or images.  Creating prompts that evaluate the comprehension, reasoning, or creativity of students or learners.  Creating prompts that provide feedback, guidance, or suggestions to users or customers.  Creating prompts that facilitate dialogue, storytelling, or collaboration among users or agents. Some challenges of prompt engineering are: Choosing the right format, style, and tone of the prompt to suit the task, the model, and the audience. Ensuring the prompt is clear, concise, and unambiguous, and avoids leading, confusing, or misleading the model or the user. Measuring the quality, reliability, and validity of the prompt and the generated response. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 2 Handling the variability, uncertainty, and diversity of natural language and human behavior. 1.1 Importance of Prompt Design Prompt design is the core of prompt engineering, as it determines the effectiveness and efficiency of the prompt and the response. Prompt design involves various aspects such as the content, structure, and presentation of the prompt, as well as the evaluation and optimization of the prompt.  Some benefits of prompt design are:  It improves the accuracy, relevance, and coherence of the generated response.  It reduces the complexity, redundancy, and ambiguity of the prompt.  It enhances the usability, accessibility, and engagement of the prompt.  It aligns the prompt with the task, the model, and the user goals and expectations. Some principles of prompt design are: Define the purpose, scope, and criteria of the prompt and the response. Use simple, direct, and specific language and avoid jargon, slang, or idioms. Provide context, background, and examples to guide the model and the user. Use appropriate format, style, and tone to convey the prompt and the response. Test, evaluate, and optimize the prompt and the response using various methods and metrics. 1.3 Ethical Considerations in Prompt Engineering Prompt engineering is not only a technical but also a social and ethical endeavor, as it involves the interaction of natural language models, prompt engineers, and users. Prompt engineering can have positive or negative impacts on individuals, groups, and society, depending on how the prompts and the responses are designed, used, and interpreted.  Some ethical issues in prompt engineering are:  The potential for bias, discrimination, or harm in the prompts and the responses, due to the data, the model, or the user.  The responsibility, accountability, and transparency of the prompt engineers and the model developers for the prompts and the responses. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 3  The privacy, security, and consent of the users and the data providers for the prompts and the responses.  The quality, reliability, and validity of the prompts and the responses, and the risks and uncertainties associated with them. Some ethical guidelines for prompt engineering are: Respect the dignity, diversity, and rights of the users and the data providers, and avoid any harm or offense to them. Ensure the prompts and the responses are fair, accurate, and trustworthy, and disclose any limitations or uncertainties. Protect the privacy, security, and consent of the users and the data providers, and follow the relevant laws and regulations. Seek feedback, input, and collaboration from various stakeholders, and promote the social good and the public interest. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 4 2. UNDERSTANDING LANGUAGE MODELS Language models are computational systems that can generate or analyze natural language texts, such as words, sentences, or paragraphs. Language models are based on mathematical and statistical methods that learn the patterns, structures, and rules of natural languages from large amounts of data. Language models can be used for various applications, such as machine translation, speech recognition, text summarization, question answering, and natural language generation. 2.1 Language Model Architecture Language model architecture refers to the design and structure of the language model, such as the input, output, parameters, layers, and functions. Language model architecture determines how the language model processes and represents natural language data, and how it learns from the data and generates or analyzes the texts. Some common types of language model architectures are:  N-gram models: These are simple and fast models that use fixed-length sequences of words (n-grams) to estimate the probability of the next word in a text, based on the previous words. N-gram models rely on counting and smoothing techniques to handle data sparsity and unknown words.  Neural network models: These are complex and powerful models that use artificial neural networks to learn the distributed representations of words and texts, and to predict the next word or token in a text, based on This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 5 the context. Neural network models can capture long-range dependencies and semantic relationships in natural language data.  Transformer models: These are state-of-the-art models that use a special type of neural network called transformer, which is based on attention mechanisms that allow the model to focus on the relevant parts of the input and output. Transformer models can process large amounts of data in parallel, and can generate or analyze long and coherent texts. 2.2 Training Methods Training methods refer to the techniques and strategies that are used to optimize the language model parameters and to improve its performance and accuracy. Training methods involve defining the objective function, the loss function, the optimization algorithm, and the evaluation metrics. Some common training methods for language models are:  Maximum likelihood estimation: This is a classical method that aims to maximize the likelihood of the observed data given the model parameters, or equivalently, to minimize the negative log-likelihood as the loss function. Maximum likelihood estimation can be done using gradient- based optimization algorithms, such as stochastic gradient descent, Adam, or Adagrad.  Maximum entropy: This is a general method that aims to maximize the entropy of the model distribution, subject to some constraints derived from the observed data. Maximum entropy can be seen as a way of regularizing the maximum likelihood estimation, and can prevent overfitting and improve generalization.  Adversarial training: This is a recent and advanced method that uses a game-theoretic approach to train the language model, by introducing an adversary that tries to fool the model or make it produce errors. Adversarial training can enhance the robustness and diversity> of the language model, and can overcome some of the limitations of maximum likelihood estimation. 2.3 Language Model Evaluation Language model evaluation refers to the measurement and assessment of the quality and performance of the language model, according to some criteria and metrics. Language model evaluation can be done in different ways, such as: This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 6  Intrinsic evaluation: This is a direct and quantitative way of evaluating the language model, by measuring how well it fits the data or how accurately it predicts the next word or token in a text. Intrinsic evaluation uses metrics such as perplexity, accuracy, or log-likelihood.  Extrinsic evaluation: This is an indirect and qualitative way of evaluating the language model, by measuring how well it performs on a specific downstream task or application, such as machine translation, text summarization, or question answering. Extrinsic evaluation uses metrics such as BLEU, ROUGE, or F1-score.  Human evaluation: This is a subjective and interactive way of evaluating the language model, by asking human judges or users to rate or compare the texts generated or analyzed by the model, based on some criteria such as fluency, coherence, relevance, or informativeness. Human evaluation can use methods such as Likert scales, pairwise comparisons, or preference tests. 2.4 Challenges and Limitations Despite the advances and achievements of language models, there are still many challenges and limitations that need to be addressed and overcome, such as:  Data quality and availability: Language models depend on large amounts of data to learn natural language patterns and rules, but the data may not be always reliable, representative, or sufficient. Data quality and availability can affect the accuracy, fairness, and diversity of the language model outputs.  Computational cost and efficiency: Language models require high computational resources and power to process and generate natural language texts, especially for large and complex models. Computational cost and efficiency can affect the scalability, speed, and usability of the language model applications.  Ethical and social implications: Language models can have positive or negative impacts on individuals, groups, and society, depending on how they are designed, used, and interpreted. Ethical and social implications can involve issues such as bias, discrimination, harm, privacy, security, consent, responsibility, accountability, transparency, and trust. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 7 3. GPT AND SIMILAR MODELS GPT, which stands for Generative Pre-trained Transformer, is a family of language models that use the transformer architecture and are pre-trained on large corpora of text using self-supervised learning. GPT and similar models can generate natural language texts across various domains and tasks, such as text summarization, machine translation, text classification, question answering, and more. Some of the features and benefits of GPT and similar models are: - They can leverage the large amounts of unlabeled text data available on the web, and learn general linguistic knowledge and patterns from them. - They can capture long-range dependencies and complex relationships among words and sentences, using attention mechanisms and positional embeddings. - They can generate coherent and fluent texts, using a left-to-right decoder that predicts the next word or token given the previous ones. - They can adapt to different domains and tasks, using transfer learning and fine- tuning techniques that adjust the model parameters according to the specific data and objective. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 8 3.1 GPT Architecture The GPT architecture is based on the transformer decoder, which consists of a stack of identical layers, each containing two sub-layers: a masked multi-head self-attention layer and a feed-forward layer. The input of the GPT model is a sequence of tokens, each represented by a vector that is the sum of three embeddings: a word embedding, a position embedding, and a segment embedding. The output of the GPT model is a probability distribution over the vocabulary for each token in the sequence, which can be used to generate the next token or to calculate the likelihood of a given token. The GPT architecture has the following characteristics: - It uses a masked self-attention mechanism, which prevents the model from attending to the future tokens in the sequence, and thus enforces the causal dependency among the tokens. - It uses a multi-head attention mechanism, which allows the model to attend to different aspects and contexts of the input sequence, and to learn multiple representations for each token. - It uses a residual connection and a layer normalization for each sub-layer, which helps to stabilize the training and to avoid the vanishing gradient problem. - It uses a dropout and a weight decay for regularization, which helps to prevent overfitting and to improve generalization. 3.2 GPT Training Process The GPT training process involves two stages: pre-training and fine-tuning. In the pre-training stage, the GPT model is trained on a large corpus of text, such as Wikipedia or Common Crawl, using a self-supervised learning objective. The objective is to maximize the likelihood of the next token in the sequence, given the previous tokens, using a cross-entropy loss function. This objective is also known as the masked language modeling or the causal language modeling objective. The pre-training stage aims to learn universal and generic linguistic features and knowledge from the text data, and to produce a general-purpose language model that can be used for various downstream tasks. In the fine-tuning stage, the GPT model is trained on a smaller and task-specific dataset> using a supervised or semi-supervised learning objective. The objective is to optimize the model parameters for a specific domain or task, such as text summarization, machine translation, text classification, question answering, and more. The fine- tuning stage can use different loss functions and output layers, depending on the This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 9 task. For example, for text classification, the GPT model can use a linear layer and a softmax function to predict the class label of a given text. The fine-tuning stage aims to adapt the general-purpose language model to the specific data and objective, and to produce a high-performance and task-specific language model. 3.3 Variants of GPT Since the introduction of the original GPT model in 2018, there have been several variants and improvements of the GPT model, such as: - GPT-2: This is an improved version of GPT, which uses a larger model size, a larger vocabulary size, a larger training data, and a modified self-attention layer. GPT-2 can generate longer and more coherent texts than GPT, and can achieve state-of-the-art results on several natural language processing tasks and benchmarks. - GPT-3: This is a further improved version of GPT, which uses a much larger model size, a much larger vocabulary size, a much larger training data, and a few architectural changes. GPT-3 can generate even longer and more diverse texts than GPT-2, and can perform well on many natural language processing tasks and benchmarks, without any fine-tuning or task-specific training. - GPT-Neo: This is an open-source version of GPT-3, which uses a similar model size, a similar vocabulary size, a similar training data, and a similar architecture as GPT-3. GPT-Neo can generate comparable texts to GPT-3, and can be used for research and experimentation purposes. - GPT-J: This is another open-source version of GPT-3, which uses a smaller model size, a smaller vocabulary size, a different training data, and a different architecture than GPT-3. GPT-J can generate high-quality texts, and can outperform GPT-3 on some natural language processing tasks and benchmarks. 3.4 Transfer Learning with GPT Transfer learning with GPT is a technique that uses the GPT model or its variants as a feature extractor or a backbone for other natural language processing tasks or applications. Transfer learning with GPT can leverage the rich and powerful representations learned by the GPT model from the large-scale text data, and can transfer them to other domains or tasks that have limited or scarce data. Transfer learning with GPT can be done in different ways, such as: - Zero-shot learning: This is a way of using the GPT model without any fine- tuning or task-specific training, by exploiting the natural language understanding This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 10 and generation abilities of the model. For example, the GPT model can be used to answer a natural language question, by generating a natural language answer based on the given context and query. - One-shot> learning: This is a way of using the GPT model with a minimal amount of fine-tuning or task-specific training, by providing the model with a few examples or demonstrations of the desired output. For example, the GPT model can be used to summarize a text, by generating a summary based on the given text and a few examples of summaries. - Few-shot learning: This is a way of using the GPT model with a small amount of fine-tuning or task-specific training, by providing the model with a small dataset or a small number of examples of the desired output. For example, the GPT model can be used to classify a text, by generating a class label based on the given text and a small dataset of texts and labels. - Fine-tuning: This is a way of using the GPT model with a moderate amount of fine-tuning or task-specific training, by providing the model with a medium-sized dataset or a medium number of examples of the desired output. For example, the GPT model can be used to translate a text, by generating a translation based on the given text and a medium-sized dataset of parallel texts. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 11 4. PROMPT DESIGN: 4.1 Query Formulation Techniques - Query formulation is the process of designing and constructing a natural language query that can elicit a desired response from the GPT model or its variants. - Query formulation techniques are methods or strategies that can help to improve the quality and effectiveness of the queries, and to achieve the specific goals or objectives of the tasks or applications. - Some of the common query formulation techniques are: - Prefixing: This is a technique of adding a prefix or a label to the query, such as "TL;DR:", "Q:", "A:", or "Summarize:", to indicate the type or the format of the expected output. For example, the query "TL;DR: What is the main idea of this article?" can prompt the GPT model to generate a concise summary of the given article. - Reformulating: This is a technique of rephrasing or rewording the query, using different words, synonyms, paraphrases, or variations, to avoid ambiguity, This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 12 confusion, or repetition, and to enhance clarity, specificity, or diversity. For example, the query "What is the best way to learn GPT?" can be reformulated as "How can I master GPT effectively?" or "What are the optimal methods for acquiring GPT skills?". - Expanding: This is a technique of adding more information, details, examples, or context to the query, to provide more guidance, direction, or constraints for the GPT model, and to reduce the search space or the uncertainty of the output. For example, the query "Write a poem" can be expanded as "Write a poem about love, with four lines and a rhyme scheme of ABAB". - Reducing: This is a technique of removing or simplifying some information, details, examples, or context from the query, to make it more concise, general, or flexible, and to increase the search space or the creativity of the output. For example, the query "Write a short story about a girl who discovers a magical world in her backyard" can be reduced as "Write a short story about magic". 4.2 Handling Constraints - Constraints are the rules, requirements, limitations, or conditions that the GPT model or its variants have to follow or satisfy when generating the output for a given query. - Handling constraints is the process of incorporating, enforcing, or adjusting the constraints in the query formulation or the output generation, to ensure the validity, accuracy, consistency, or quality of the output, and to avoid errors, violations, or failures. - Some of the common ways of handling constraints are: - Implicitly: This is a way of handling constraints without explicitly stating or specifying them in the query, but relying on the implicit knowledge, assumptions, or expectations of the GPT model or the user. For example, the query "Write a haiku" implicitly implies that the output should be a haiku, which is a type of poem with three lines and a syllable structure of 5-7->> 5. - Explicitly: This is a way of handling constraints by explicitly stating or specifying them in the query, using words, symbols, operators, or expressions, to indicate the presence, absence, or degree of the constraints. For example, the query "Write a haiku about nature, with no mention of animals" explicitly specifies that the output should be a haiku, that the topic should be nature, and that the constraint is to avoid mentioning animals. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 13 - Dynamically: This is a way of handling constraints by dynamically changing or adapting them in the query formulation or the output generation, depending on the feedback, evaluation, or interaction of the GPT model or the user. For example, the query "Write a haiku" can be dynamically modified as "Write a haiku about winter" or "Write a better haiku" based on the output or the preference of the GPT model or the user. 4.3 Addressing Biases - Biases are the tendencies, preferences, or influences that the GPT model or its variants may have or exhibit when generating the output for a given query, which may affect the fairness, quality, diversity, or reliability of the output, and may cause harms, risks, or challenges for the tasks or applications. - Addressing biases is the process of identifying, measuring, mitigating, or preventing the biases in the query formulation or the output generation, to ensure the ethical, responsible, or trustworthy use of the GPT model or its variants, and to avoid negative impacts, consequences, or implications for the users, the society, or the environment. - Some of the common ways of addressing biases are: - Detecting: This is a way of addressing biases by detecting or discovering the presence, source, or type of the biases in the query or the output, using methods such as analysis, inspection, testing, or auditing. For example, the query "Who is the best leader in the world?" or the output "The best leader in the world is [NAME]" may contain or reveal some biases, such as political bias, cultural bias, or personal bias, which can be detected by examining the query or the output, or by comparing them with other queries or outputs. - Correcting: This is a way of addressing biases by correcting or modifying the query or the output, to reduce, eliminate, or balance the biases, using methods such as editing, rewriting, filtering, or diversifying. For example, the query "Who is the best leader in the world?" or the output "The best leader in the world is [NAME]" can be corrected by changing the query to "What are the criteria for evaluating the best leader in the world?" or by changing the output to "The best leader in the world may depend on different factors, such as [FACTORS]". - Avoiding: This is a way of addressing biases by avoiding or preventing the query or the output from containing or generating any biases, using methods such as designing, training, or selecting the GPT model or its variants, or the This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 14 query formulation techniques, that are unbiased,>> fair, or neutral. For example, the query "Who is the best leader in the world?" or the output "The best leader in the world is [NAME]" can be avoided by using a GPT model or a query formulation technique that does not have or produce any biases, such as political bias, cultural bias, or personal bias. 4.4 Interpreting Model Output - Interpreting model output is the process of understanding, explaining, or evaluating the output generated by the GPT model or its variants for a given query, and the factors, reasons, or mechanisms behind the output generation. - Interpreting model output is important for enhancing the transparency, explainability, or accountability of the GPT model or its variants, and for improving the usability, satisfaction, or trust of the users, the tasks, or the applications. - Some of the common ways of interpreting model output are: - Attribution: This is a way of interpreting model output by attributing or assigning the importance, relevance, or contribution of the input, the output, or the model parameters, features, or components, to the output generation, using methods such as saliency, gradient, or attention. For example, the output "The best leader in the world is [NAME]" can be attributed by highlighting or ranking the input tokens, the output tokens, or the model layers, heads, or weights, that have the most or the least influence on the output generation. - Visualization: This is a way of interpreting model output by visualizing or displaying the output, the input, or the model parameters, features, or components, in a graphical, diagrammatic, or interactive way, to facilitate the comprehension, exploration, or comparison of the output generation, using methods such as plots, charts, graphs, or dashboards. For example, the output "The best leader in the world is [NAME]" can be visualized by showing or animating the output, the input, or the model parameters, features, or components, in a word cloud, a bar chart, a network graph, or a heat map, to illustrate the output generation process or result. - Evaluation: This is a way of interpreting model output by evaluating or assessing the quality, performance, or accuracy of the output, the input, or the model, based on some criteria, metrics, or standards, to measure the effectiveness, efficiency, or robustness of the output generation, using methods This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 15 such as scoring, rating, or testing. For example, the output "The best leader in the world is [NAME]" can be evaluated by scoring or rating the output, the input, or the model, based on some criteria, metrics, or standards, such as coherence, relevance, diversity, or correctness, to determine the output generation quality or performance. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 16 5. PROMPT ENGINEERING STRATEGIES: Prompt engineering is the process of designing, crafting, or optimizing the query or the input for the GPT model or its variants, to elicit the desired output or behavior from the model, and to enhance the quality, performance, or efficiency of the output generation, for various tasks or applications. Prompt engineering strategies are the methods, techniques, or approaches that can be used for prompt engineering, to manipulate, control, or optimize the query or the input, and to handle the challenges, issues, or limitations of the GPT model or its variants, such as biases, errors, or incompleteness. - Some of the common prompt engineering strategies are: 5.1 Debiasing Techniques - Debiasing techniques are prompt engineering strategies that aim to reduce, eliminate, or balance the biases that the GPT model or its variants may have or exhibit when generating the output for a given query, which may affect the fairness, quality, diversity, or reliability of the output, and may cause harms, risks, or challenges for the users, the society, or the environment. - Debiasing techniques can be applied at different stages of the output generation process, such as before, during, or after the output generation, and can involve This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 17 different components or aspects of the query or the input, such as the wording, the formatting, the context, or the parameters. - Some of the common debiasing techniques are: - Rewording: This is a debiasing technique that involves changing or modifying the wording or the phrasing of the query or the input, to avoid or remove any words, expressions, or terms that may trigger or reflect any biases, such as stereotypes, prejudices, or assumptions, and to use more neutral, inclusive, or respectful language. For example, the query "Who is the best leader in the world?" can be reworded as "What are the qualities of a good leader?" to avoid or remove any political, cultural, or personal biases. - Reframing: This is a debiasing technique that involves changing or modifying the framing or the perspective of the query or the input, to avoid or remove any implicit or explicit biases that may influence or shape the output generation, such as framing effects, priming effects, or anchoring effects, and to use more objective, balanced, or diverse perspectives. For example, the query "Write a haiku about nature, with no mention of animals" can be reframed as "Write a haiku about any aspect of nature" to avoid or remove any negative or restrictive biases. - Counterfactual: This is a debiasing technique that involves adding or incorporating counterfactual or alternative scenarios, cases, or examples to the query or the input, to avoid or remove any confirmation or selection biases that may limit or constrain the output generation, such as availability bias, confirmation bias, or sampling bias, and to use more comprehensive, representative, or generalizable scenarios, cases, or examples. For example, the query "Write a sentence with a pronoun" can be supplemented with> counterfactual or alternative scenarios, cases, or examples, such as "He ran to the store", "She loves to read books", or "They are good friends" to avoid or remove any gender or number biases. 5.2 Context Manipulation - Context manipulation is a prompt engineering strategy that involves adding, modifying, or removing the context or the additional information that is provided to the GPT model or its variants along with the query or the input, to influence, guide, or constrain the output generation, and to enhance the quality, performance, or efficiency of the output generation, for various tasks or applications. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 18 - Context manipulation can be applied at different levels of granularity or specificity, such as word-level, sentence-level, paragraph-level, or document- level, and can involve different types or sources of information, such as textual, visual, or multimodal. - Some of the common context manipulation techniques are: - Priming: This is a context manipulation technique that involves adding or incorporating some relevant or related information to the query or the input, to prime, activate, or stimulate the GPT model or its variants to generate the output that is more coherent, consistent, or appropriate with the query or the input, and to avoid or reduce any errors, inconsistencies, or incoherencies. For example, the query "Write a haiku about winter" can be primed with some relevant or related information, such as "A haiku is a type of poem with three lines and a syllable structure of 5-7-5" to prime the GPT model or its variants to generate the output that is more coherent, consistent, or appropriate with the query or the input, and to avoid or reduce any errors, inconsistencies, or incoherencies. - Conditioning: This is a context manipulation technique that involves adding or incorporating some specific or desired information to the query or the input, to condition, direct, or steer the GPT model or its variants to generate the output that meets some specific or desired criteria, requirements, or preferences, and to avoid or reduce any deviations, variations, or redundancies. For example, the query "Write a sentence with a pronoun" can be conditioned with some specific or desired information, such as "Use the pronoun 'they'" to condition, direct, or steer the GPT model or its variants to generate the output that meets some specific or desired criteria, requirements, or preferences, and to avoid or reduce any deviations, variations, or redundancies. - Filtering: This is a context manipulation technique that involves removing or excluding some irrelevant or unwanted information from the query or the input, to filter, refine, or simplify the GPT model or its variants to generate the output that is more relevant, concise, or clear with the query or the input, and to avoid or reduce any noise, clutter, or ambiguity. For example, the query "Write a review of the movie 'Inception'" can be filtered by removing or excluding some irrelevant or unwanted information, such as "The movie was released in 2010 and directed by Christopher Nolan" to filter, refine> or simplify the GPT model or its variants to generate the output that is more relevant, concise, or clear with the query or the input, and to avoid or reduce any noise, clutter, or ambiguity. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 19 5.3 Controlled Generation - Controlled generation is a prompt engineering strategy that involves adding, modifying, or removing some parameters, features, or components of the GPT model or its variants, to control, regulate, or adjust the output generation process or result, and to enhance the quality, performance, or efficiency of the output generation, for various tasks or applications. - Controlled generation can be applied at different stages or levels of the output generation process or result, such as token-level, sentence-level, paragraph-level, or document-level, and can involve different aspects or dimensions of the output, such as style, tone, length, or structure. - Some of the common controlled generation techniques are: - Infilling: This is a controlled generation technique that involves adding or incorporating some placeholders, markers, or slots to the query or the input, to indicate, specify, or reserve some positions, spaces, or segments for the output generation, and to control, regulate, or adjust the output generation process or result, such as the length, the structure, or the content of the output. For example, the query "Write a sentence with a noun, a verb, and an adjective" can be infilled with some placeholders, markers, or slots, such as "[NOUN] [VERB] [ADJECTIVE]" to indicate, specify, or reserve some positions, spaces, or segments for the output generation, and to control, regulate, or adjust the output generation process or result, such as the length, the structure, or the content of the output. - Prefixing: This is a controlled generation technique that involves adding or incorporating some prefixes, cues, or signals to the query or the input, to provide, suggest, or hint some information, instructions, or expectations for the output generation, and to control, regulate, or adjust the output generation process or result, such as the style, the tone, or the format of the output. For example, the query "Write a haiku about winter" can be prefixed with some prefixes, cues, or signals, such as "" or "" to provide, suggest, or hint some information, instructions, or expectations for the output generation, and to control, regulate, or adjust the output generation process or result, such as the style, the tone, or the format of the output. - Postfixing: This is a controlled generation technique that involves adding or incorporating some postfixes, tags, or indicators to the query or the input, to mark, label, or categorize the output generation, and to control, regulate, or This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 20 adjust the output generation process or result, such as the quality, the accuracy, or the confidence of the output. For example, the query "Write a sentence with a pronoun" can be postfixed with some postfixes, tags, or indicators, such as "" or "" to mark, label, or categorize the output generation, and to control, regulate, or adjust the output generation process or result, such as the quality, the accuracy, or the confidence of the output. 5.4 Iterative Optimization - Iterative optimization is a prompt engineering strategy that involves repeating, modifying, or improving the query or the input, or the output or the feedback, for the GPT model or its variants, to optimize, refine, or enhance the output generation, and to enhance the quality, performance, or efficiency of the output generation, for various tasks or applications. - Iterative optimization can be applied at different frequencies or intervals of the output generation process or result, such as once, multiple times, or continuously, and can involve different methods or modes of optimization, such as manual, automatic, or interactive. - Some of the common iterative optimization techniques are: - Editing: This is an iterative optimization technique that involves manually changing or modifying the query or the input, or the output or the feedback, for the GPT model or its variants, to correct, improve, or customize the output generation, and to optimize, refine, or enhance the output generation, such as the quality, the performance, or the efficiency of the output generation. For example, the query "Write a sentence with a pronoun" or the output "She loves to read books" can be edited by manually changing or modifying the query or the input, or the output or the feedback, for the GPT model or its variants, to correct, improve, or customize the output generation, and to optimize, refine, or enhance the output generation, such as the quality, the performance, or the efficiency of the output generation. - Rewriting: This is an iterative optimization technique that involves automatically generating or producing a new or alternative query or input, or output or feedback, for the GPT model or its variants, to paraphrase, summarize, or expand the output generation, and to optimize, refine, or enhance the output generation, such as the quality, the performance, or the efficiency of the output generation. For example, the query "Write a sentence with a pronoun" or the output "She loves to read books" can be rewritten by automatically generating or This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 21 producing a new or alternative query or input, or output or feedback, for the GPT model or its variants, to paraphrase, summarize, or expand the output generation, and to optimize, refine, or enhance the output generation, such as the quality, the performance, or the efficiency of the output generation. - Fine-tuning: This is an iterative optimization technique that involves interactively adjusting or adapting the query or the input, or the output or the feedback, for the GPT model or its variants, to learn, update, or personalize the output generation, and to optimize, refine, or enhance the output generation, such as the quality, the performance, or the efficiency of the output generation. For example, the query "Write a sentence with a pronoun" or the output "She loves to read books" can be fine-tuned by interact> ively adjusting or adapting the query or the input, or the output or the feedback, for the GPT model or its variants, to learn, update, or personalize the output generation, and to optimize, refine, or enhance the output generation, such as the quality, the performance, or the efficiency of the output generation. 6. PILLARS OF PROMPTING Prompting is a technique that involves designing, crafting, or engineering the query or the input, or the output or the feedback, for the GPT model or its variants, to elicit, generate, or produce the desired or optimal output, for various tasks or applications. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 22 Prompting can be based on different principles, methods, or strategies, such as context manipulation, controlled generation, or iterative optimization, as discussed in the previous section. Prompting can also be guided by some best practices, standards, or criteria, that can help to improve, enhance, or optimize the quality, performance, or efficiency of the output generation, for various tasks or applications. These best practices, standards, or criteria can be considered as the pillars of prompting, as they support, sustain, or strengthen the prompting process or result, and make it more robust, reliable, or effective. Some of the common pillars of prompting are: 6.1 Providing Examples - This pillar of prompting involves providing or supplying some examples, samples, or instances of the desired or optimal output, along with the query or the input, for the GPT model or its variants, to illustrate, demonstrate, or exemplify the expected or intended output, for various tasks or applications. - Providing examples can help to clarify, specify, or define the query or the input, and to guide, influence, or constrain the output generation, such that the output is more coherent, consistent, or appropriate with the query or the input, and meets the desired or optimal criteria, requirements, or preferences, for various tasks or applications. - Providing examples can also help to avoid or reduce any errors, inconsistencies, or incoherencies, or any deviations, variations, or redundancies, in the output generation, and to enhance the quality, performance, or efficiency of the output generation, for various tasks or applications. - For example, the query "Write a haiku about winter" can be provided with some examples, samples, or instances of the desired or optimal output, such as: Cold wind blows fiercely Snowflakes dance in the night sky Winter has arrived or Winter solstice comes This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 23 The longest night of the year Darkness turns to light These examples can help to illustrate, demonstrate, or exemplify the expected or intended output, such as the format, the structure, or the content of the haiku, and to guide, influence, or constrain the output generation, such that the output is more coherent, consistent, or appropriate with the query or the input, and meets the desired or optimal criteria, requirements, or preferences, for the task or application of writing a haiku. 6.2 Giving Direction - This pillar of prompting involves giving or offering some direction, instruction, or guidance, along with the query or the input, for the GPT model or its variants, to indicate, suggest, or hint the expected or intended output, for various tasks or applications. - Giving direction can help to control, regulate, or adjust the output generation> process or result, and to direct, steer, or align the output generation, such that the output meets some specific or desired criteria, requirements, or preferences, for various tasks or applications. - Giving direction can also help to avoid or reduce any ambiguity, confusion, or uncertainty, or any noise, clutter, or distraction, in the output generation, and to enhance the quality, performance, or efficiency of the output generation, for various tasks or applications. - For example, the query "Write a sentence with a pronoun" can be given with some direction, instruction, or guidance, such as: Use the pronoun 'they' or The pronoun should be singular and possessive These directions can help to indicate, suggest, or hint the expected or intended output, such as the type, the number, or the case of the pronoun, and to control, regulate, or adjust the output generation process or result, such that the output meets some specific or desired criteria, requirements, or preferences, for the task or application of writing a sentence with a pronoun. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 24 6.3 Formatting Responses - This pillar of prompting involves formatting or structuring the query or the input, or the output or the feedback, for the GPT model or its variants, to organize, arrange, or present the information, data, or content, in a clear, concise, or consistent manner, for various tasks or applications. - Formatting responses can help to improve, enhance, or optimize the readability, usability, or accessibility of the output generation, and to make it more user- friendly, intuitive, or appealing, for various tasks or applications. - Formatting responses can also help to avoid or reduce any errors, mistakes, or glitches, or any overlaps, gaps, or discrepancies, in the output generation, and to enhance the quality, performance, or efficiency of the output generation, for various tasks or applications. - For example, the query "Write a summary of the article" can be formatted or structured, such as: Article Title or Some possible ways to format or structure the output or the feedback, for the GPT model or its variants, are: - Summarize the main points of the article in one paragraph - Use bullet points to list the key facts or details of the article - Include the source, author, and date of the article at the end of the summary - Use quotation marks to indicate any direct quotes from the article These formats or structures can help to organize, arrange, or present the information, data, or content, in a clear, concise, or consistent manner, and to improve, enhance, or optimize the readability, usability, or accessibility of the output generation, and to make it more user-friendly, intuitive, or appealing, for the task or application of writing a summary of the article. 6.4 Evaluating Quality - This pillar of prompting involves evaluating or assessing the quality, performance, or efficiency of the output generation, for the GPT model or its variants, based on some metrics, standards, or criteria,> such as accuracy, relevance, coherence, fluency, or creativity, for various tasks or applications. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 25 - Evaluating quality can help to measure, monitor, or track the output generation, and to identify, analyze, or diagnose any strengths, weaknesses, or areas of improvement, for the GPT model or its variants, for various tasks or applications. - Evaluating quality can also help to provide, receive, or incorporate some feedback, comments, or suggestions, for the GPT model or its variants, to improve, enhance, or optimize the output generation, for various tasks or applications. - For example, the output "She loves to read books" for the query "Write a sentence with a pronoun" can be evaluated or assessed based on some metrics, standards, or criteria, such as: - Accuracy: The output is accurate, as it uses a pronoun correctly - Relevance: The output is relevant, as it answers the query - Coherence: The output is coherent, as it forms a complete and meaningful sentence - Fluency: The output is fluent, as it uses proper grammar and punctuation - Creativity: The output is creative, as it conveys some information or emotion about the subject These metrics, standards, or criteria can help to measure, monitor, or track the output generation, and to identify, analyze, or diagnose any strengths, weaknesses, or areas of improvement, for the GPT model or its variants, for the task or application of writing a sentence with a pronoun. They can also help to provide, receive, or incorporate some feedback, comments, or suggestions, for the GPT model or its variants, to improve, enhance, or optimize the output generation, for the task or application of writing a sentence with a pronoun. 6.5 Chaining AIs - This pillar of prompting involves chaining or combining the output generation of one GPT model or variant with the input or query of another GPT model or variant, to create, generate, or produce a more complex, sophisticated, or advanced output, for various tasks or applications. - Chaining AIs can help to leverage, utilize, or integrate the capabilities, features, or functions of different GPT models or variants, and to create, generate, or produce a more complex, sophisticated, or advanced output, that would not be This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 26 possible or feasible by using a single GPT model or variant, for various tasks or applications. - Chaining AIs can also help to avoid or reduce any limitations, constraints, or challenges of using a single GPT model or variant, and to enhance the quality, performance, or efficiency of the output generation, for various tasks or applications. - For example, the output "She loves to read books" for the query "Write a sentence with a pronoun" can be chained or combined with the input or query of another GPT model or variant, such as "Summarize the sentence in one word" to create, generate, or produce a more complex, sophisticated, or advanced output, such as: Reader This output can help to leverage, utilize, or integrate the capabilities> , features, or functions of different GPT models or variants, such as writing a sentence with a pronoun and summarizing the sentence in one word, and to create, generate, or produce a more complex, sophisticated, or advanced output, that would not be possible or feasible by using a single GPT model or variant, for the tasks or applications of writing a sentence with a pronoun and summarizing the sentence in one word. It can also help to avoid or reduce any limitations, constraints, or challenges of using a single GPT model or variant, such as producing a longer or more detailed output than required, and to enhance the quality, performance, or efficiency of the output generation, for the tasks or applications of writing a sentence with a pronoun and summarizing the sentence in one word. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 27 7. CHATGPT INTRODUCTION - ChatGPT is a GPT model or variant that is specialized or trained for the task or application of conversational AI, such as chatbots, virtual assistants, or dialog systems. - ChatGPT can generate or produce natural, engaging, and human-like conversations, responses, or dialogs, based on some inputs, queries, or contexts, from users, customers, or clients, for various domains, topics, or scenarios, such as entertainment, education, or health care. - ChatGPT can also learn, adapt, or improve from the feedback, comments, or suggestions, from users, customers, or clients, and from the data, information, or content, from various sources, platforms, or channels, such as text, audio, or video, to enhance the quality, performance, or efficiency of the output generation, for the task or application of conversational AI. 7.1 ChatGPT Introduction and Prompting ChatGPT - ChatGPT introduction and prompting ChatGPT involves introducing or explaining the concept, idea, or purpose of ChatGPT, and the process, method, or technique of prompting ChatGPT, to users, customers, or clients, who want to This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 28 use, interact, or communicate with ChatGPT, for the task or application of conversational AI. - ChatGPT introduction and prompting ChatGPT can help to inform, educate, or persuade users, customers, or clients, about the benefits, advantages, or features of ChatGPT, and the steps, guidelines, or rules of prompting ChatGPT, to create, generate, or produce natural, engaging, and human-like conversations, responses, or dialogs, for various domains, topics, or scenarios, such as entertainment, education, or health care. - ChatGPT introduction and prompting ChatGPT can also help to build, establish, or maintain trust, rapport, or relationship with users, customers, or clients, and to ensure, verify, or validate the accuracy, relevance, coherence, fluency, or creativity of the output generation, for the task or application of conversational AI. - For example, the output "Hello, I am ChatGPT, a conversational AI that can chat with you about anything you want. I can also answer your questions, give you suggestions, or tell you jokes. To start a conversation with me, you just need to type a message and press enter. I will reply to you as soon as possible. You can also give me feedback, comments, or suggestions, by typing /feedback followed by your message. This will help me to learn, adapt, or improve from your inputs, and to generate better outputs for you. Let's have some fun!" for the query "Write an introduction and prompt for ChatGPT" can be an example of ChatGPT introduction and prompting ChatGPT. 7.2 ChatGPT Capabilities and Limitations - ChatGPT capabilities and limitations involves describing or highlighting the strengths, weaknesses, or areas of improvement of ChatGPT, for the task or application of> conversational AI, such as chatbots, virtual assistants, or dialog systems. - ChatGPT capabilities and limitations can help to demonstrate, showcase, or illustrate the potential, value, or impact of ChatGPT, and to acknowledge, address, or overcome the challenges, difficulties, or risks of ChatGPT, for the task or application of conversational AI. - ChatGPT capabilities and limitations can also help to set, manage, or adjust the expectations, preferences, or satisfaction of users, customers, or clients, and to provide, receive, or incorporate some feedback, comments, or suggestions, for This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 29 ChatGPT, to improve, enhance, or optimize the output generation, for the task or application of conversational AI. - For example, the output "ChatGPT has many capabilities, such as: - Generating natural, engaging, and human-like conversations, responses, or dialogs, based on some inputs, queries, or contexts, from users, customers, or clients, for various domains, topics, or scenarios, such as entertainment, education, or health care. - Learning, adapting, or improving from the feedback, comments, or suggestions, from users, customers, or clients, and from the data, information, or content, from various sources, platforms, or channels, such as text, audio, or video, to enhance the quality, performance, or efficiency of the output generation, for the task or application of conversational AI. - Using different styles, tones, or moods, such as formal, informal, humorous, or sarcastic, to suit the needs, wants, or goals of users, customers, or clients, and to create, generate, or produce more diverse, varied, or creative outputs, for the task or application of conversational AI. However, ChatGPT also has some limitations, such as: - Producing inaccurate, irrelevant, incoherent, or ungrammatical outputs, due to the lack of knowledge, understanding, or reasoning, about some domains, topics, or scenarios, such as technical, scientific, or legal, or due to the errors, mistakes, or biases, in the data, information, or content, used to train, test, or evaluate ChatGPT, for the task or application of conversational AI. - Repeating, contradicting, or diverging from the inputs, queries, or contexts, from users, customers, or clients, due to the lack of memory, attention, or consistency, in maintaining, tracking, or updating the state, history, or progress of the conversations, responses, or dialogs, generated by ChatGPT, for the task or application of conversational AI. - Violating, infringing, or compromising the privacy, security, or ethics, of users, customers, or clients, due to the lack of control, regulation, or supervision, over the data, information, or content, collected, stored, or shared by ChatGPT, or over the outputs, generated, produced, or delivered by ChatGPT, for the task or application of conversational AI." for the query "Write the capabilities and limitations of ChatGPT>" can be an example of ChatGPT capabilities and limitations. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 30 7.3 ChatGPT Plugins - ChatGPT plugins involves adding, integrating, or embedding some additional, supplementary, or complementary features, functions, or tools, to ChatGPT, to extend, expand, or improve the output generation, for the task or application of conversational AI, such as chatbots, virtual assistants, or dialog systems. - ChatGPT plugins can help to enhance, enrich, or diversify the output generation, and to provide, offer, or deliver more value, benefit, or utility, to users, customers, or clients, who use, interact, or communicate with ChatGPT, for the task or application of conversational AI. - ChatGPT plugins can also help to solve, resolve, or address some of the limitations, constraints, or challenges of ChatGPT, and to optimize, refine, or fine- tune the output generation, for the task or application of conversational AI. - For example, the output "Some of the possible ChatGPT plugins are: - Sentiment analysis: This plugin can help to analyze, detect, or measure the sentiment, emotion, or mood, of the inputs, queries, or contexts, from users, customers, or clients, and to adjust, modify, or personalize the outputs, generated by ChatGPT, accordingly, to match, align, or correspond with the sentiment, emotion, or mood, of the users, customers, or clients, for the task or application of conversational AI. - Entity recognition: This plugin can help to identify, extract, or label the entities, such as names, locations, dates, or numbers, in the inputs, queries, or contexts, from users, customers, or clients, and to use, utilize, or leverage the entities, in the outputs, generated by ChatGPT, accordingly, to make, create, or produce more accurate, relevant, or specific outputs, for the task or application of conversational AI. - Image generation: This plugin can help to generate, produce, or create some images, pictures, or photos, based on the inputs, queries, or contexts, from users, customers, or clients, or based on the outputs, generated by ChatGPT, and to display, show, or present the images, along with the outputs, to enrich, diversify, or enhance the output generation, for the task or application of conversational AI." for the query "Write some examples of ChatGPT plugins" can be an example of ChatGPT plugins. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 31 8. GITHUB COPILOT INTRODUCTION: 8.1 What is GitHub Copilot? - GitHub Copilot is a code generation tool that uses artificial intelligence (AI) to help developers write code faster, easier, and better. - GitHub Copilot is powered by OpenAI Codex, a deep learning system that can generate natural language and code from natural language and code. - GitHub Copilot works as an extension for Visual Studio Code, a popular code editor, and provides suggestions for code completion, code refactoring, code documentation, and code testing, based on the context of the code that the developer is writing or editing. - GitHub Copilot can generate code for a variety of programming languages, such as Python, JavaScript, TypeScript, Ruby, Java, C#, and Go, and for various domains, frameworks, and libraries, such as web development, data science, machine learning, and game development. - GitHub Copilot can also generate code from natural language descriptions, such as comments, docstrings, or queries, and can learn from the developer's own code, preferences, and style, to provide more personalized and relevant suggestions. - For example, the output "import pandas as pd # load the CSV file into a DataFrame df = pd.read_csv('data.csv') # print the first five rows of the DataFrame print(df.head())" for the query "# write some Python code to load and print a CSV file" can be an example of code generation by GitHub Copilot. 8.2 How to Install? - To install GitHub Copilot, the developer needs to have Visual Studio Code and a GitHub account, and to sign up for the GitHub Copilot technical preview, which is currently available by invitation only. - The steps to install GitHub Copilot are: - Visit the website and click on the "Join the waitlist" button. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 32 - Log in with your GitHub account and fill in the form with your name, email, and some information about your coding experience and interests. - Wait for an email invitation from GitHub Copilot, which may take some time depending on the demand and availability of the service. - Once you receive the invitation, follow the instructions in the email to install the GitHub Copilot extension for Visual Studio Code, which requires granting some permissions to access your code and GitHub repositories. - Restart Visual Studio Code and start using GitHub Copilot by pressing Ctrl+Space to trigger the code suggestions. 8.3 Prompting GitHub Copilot - Prompting GitHub Copilot involves providing some inputs, queries, or contexts, to GitHub Copilot, to request, trigger, or activate the code generation, for the task or application of coding. - Prompting GitHub Copilot can help to save, reduce, or optimize the time, effort, or resources, of the developer, and to improve, enhance, or simplify the quality, performance, or efficiency, of the code, for the task or application of coding. - Prompting GitHub Copilot can also help to learn, discover, or explore> new, different, or better ways, methods, or techniques, of coding, and to solve, resolve, or address some of the challenges, problems, or errors, of coding. - For example, the output "def reverse_string(string): # write a function that reverses a string # use slicing to reverse the string return string[::-1]" for the query "# write a function that reverses a string" can be an example of prompting GitHub Copilot. 8.4 GitHub Copilot Capabilities and Limitations - GitHub Copilot capabilities and limitations involves describing or highlighting the strengths, weaknesses, or areas of improvement of GitHub Copilot, for the task or application of coding. - GitHub Copilot capabilities and limitations can help to demonstrate, showcase, or illustrate the potential, value, or impact of GitHub Copilot, and to acknowledge, This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 33 address, or overcome the challenges, difficulties, or risks of GitHub Copilot, for the task or application of coding. - GitHub Copilot capabilities and limitations can also help to set, manage, or adjust the expectations, preferences, or satisfaction of the developer, and to provide, receive, or incorporate some feedback, comments, or suggestions, for GitHub Copilot, to improve, enhance, or optimize the code generation, for the task or application of coding. - For example, the output "GitHub Copilot has many capabilities, such as: - Generating high-quality, readable, and idiomatic code, based on some inputs, queries, or contexts, from the developer, for various programming languages, domains, frameworks, and libraries, such as Python, JavaScript, web development, and machine learning. - Learning, adapting, or improving from the feedback, comments, or suggestions, from the developer, and from the code, data, or content, from various sources, platforms, or channels, such as GitHub, Stack Overflow, or YouTube, to enhance the quality, performance, or efficiency of the code generation, for the task or application of coding. - Using different styles, patterns, or conventions, such as PEP 8, camelCase, or snake_case, to suit the needs, wants, or goals of the developer, and to create, generate, or produce more consistent, standardized, or compatible code, for the task or application of coding. However, GitHub Copilot also has some limitations, such as: - Producing incorrect, incomplete, or unsafe code, due to the lack of knowledge, understanding, or reasoning, about some domains, frameworks, or libraries, such as cryptography, blockchain, or TensorFlow, or due to the errors, mistakes, or biases, in the code, data, or content, used to train, test, or evaluate GitHub Copilot, for the task or application of coding. - Repeating, contradicting, or diverging from the inputs, queries, or contexts, from the developer, due to the lack of memory, attention, or consistency, in maintaining, tracking, or updating the state, history, or progress of the code, generated by GitHub Copilot, for the task or application of coding. - Violating,> infringing, or compromising the privacy, security, or ethics, of the developer, the code, or the users, due to the lack of control, regulation, or This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 34 supervision, over the code, data, or content, collected, stored, or shared by GitHub Copilot, or over the code, generated, produced, or delivered by GitHub Copilot, for the task or application of coding." for the query "Write the capabilities and limitations of GitHub Copilot" can be an example of GitHub Copilot capabilities and limitations. 9. GPT-3 INTRODUCTION: 9.1 Introduction - GPT-3 is a deep learning model that generates natural language text, based on some inputs, queries, or contexts, from the user, using a large-scale neural network architecture called Transformer. - GPT-3 is the third and latest version of the Generative Pre-trained Transformer (GPT) series, developed by OpenAI, a research organization dedicated to creating and ensuring the safe and beneficial use of artificial intelligence. - GPT-3 is one of the most advanced and powerful natural language processing (NLP) models in the world, with 175 billion parameters, which enable it to learn from a massive amount of text data, such as books, articles, websites, social media posts, and code, collected from various sources, platforms, or channels, such as the Common Crawl, Wikipedia, Reddit, or GitHub. - GPT-3 can perform various NLP tasks, such as text generation, text summarization, text translation, text classification, text sentiment analysis, text question answering, text completion, text paraphrasing, text reasoning, and text coding, with little or no additional training, fine-tuning, or supervision, using a technique called few-shot learning, which leverages the knowledge and skills learned from previous tasks or domains, to adapt to new tasks or domains, with few or no examples or labels. 9.2 Prompting GPT-3 - Prompting GPT-3 involves providing some inputs, queries, or contexts, to GPT- 3, to request, trigger, or activate the text generation, for the task or application of NLP. - Prompting GPT-3 can help to save, reduce, or optimize the time, effort, or resources, of the user, and to improve, enhance, or simplify the quality, performance, or efficiency, of the text, for the task or application of NLP. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 35 - Prompting GPT-3 can also help to learn, discover, or explore new, different, or better ways, methods, or techniques, of NLP, and to solve, resolve, or address some of the challenges, problems, or errors, of NLP. - For example, the output "def fib(n): # write a function that returns the nth Fibonacci number # use recursion to define the function if n == 0 or n == 1: return n else: return fib(n-1) + fib(n-2)" for the query "# write a function that returns the nth Fibonacci number" can be an example of prompting GPT-3. 9.3 GPT-3 Capabilities and Limitations - GPT-3 has many capabilities, such as: - Generating high-quality, readable, and idiomatic text, based on some inputs, queries, or contexts, from the user, for various languages, domains, formats, and styles, such as English, French, Chinese, science, fiction, poetry, and humor. - Learning, adapting, or improving from the feedback, comments, or suggestions, from the user, and> from the text, data, or content, from various sources, platforms, or channels, such as the Common Crawl, Wikipedia, Reddit, or GitHub, to enhance the quality, performance, or efficiency of the text generation, for the task or application of NLP. - Using different skills, abilities, or functions, such as logic, arithmetic, creativity, and common sense, to suit the needs, wants, or goals of the user, and to create, generate, or produce more accurate, relevant, or interesting text, for the task or application of NLP. - However, GPT-3 also has some limitations, such as: - Producing incorrect, incomplete, or inappropriate text, due to the lack of knowledge, understanding, or reasoning, about some domains, formats, or styles, such as math, law, or sarcasm, or due to the errors, mistakes, or biases, in the text, data, or content, used to train, test, or evaluate GPT-3, for the task or application of NLP. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 36 - Repeating, contradicting, or diverging from the inputs, queries, or contexts, from the user, due to the lack of memory, attention, or consistency, in maintaining, tracking, or updating the state, history, or progress of the text, generated by GPT-3, for the task or application of NLP. - Violating, infringing, or compromising the privacy, security, or ethics, of the user, the text, or the users, due to the lack of control, regulation, or supervision, over the text, data, or content, collected, stored, or shared by GPT-3, or over the text, generated, produced, or delivered by GPT-3, for the task or application of NLP. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 37 10. PROMPT ENGINEERING MODELS: - Prompt engineering models are models that can generate, optimize, or evaluate prompts for GPT-3 or other language models, based on some inputs, queries, or contexts, from the user, for the task or application of natural language processing (NLP). - Prompt engineering models can help to improve, enhance, or simplify the quality, performance, or efficiency of the text generation, for the task or application of NLP, by providing more relevant, accurate, or interesting prompts, that can elicit more desired, expected, or satisfactory responses, from GPT-3 or other language models. - Prompt engineering models can also help to learn, discover, or explore new, different, or better ways, methods, or techniques, of prompting GPT-3 or other language models, and to solve, resolve, or address some of the challenges, problems, or errors, of prompting GPT-3 or other language models, such as prompt design, prompt selection, prompt evaluation, or prompt adaptation. - Some examples of prompt engineering models are: 10.1 Google Bard Introduction - Google Bard is a prompt engineering model developed by Google Research, that can generate natural language prompts for GPT-3 or other language models, based on some inputs, queries, or contexts, from the user, for the task or application of natural language understanding (NLU). - Google Bard uses a self-attention network to encode the inputs, queries, or contexts, from the user, and then uses a decoder with a copy mechanism to generate natural language prompts, that can capture the semantic and syntactic information, of the inputs, queries, or contexts, from the user.  For example, given the input "The sky is blue and the sun is shining", Google Bard can generate the prompt "What is the color of the sky and the state of the sun?" for the task of question answering.  Another example, given the input "Barack Obama was the 44th president of the United States", Google Bard can generate the prompt "The [MASK] president of the United States was Barack Obama" for the task of cloze completion. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 38 - Google Bard can generate natural language prompts for various NLU tasks, such as sentiment analysis, named entity recognition, relation extraction, question answering, and natural language inference, and can outperform existing methods, such as templates, keywords, or clozes, in terms of prompt quality, model performance, and generalization ability.  For example, Google Bard can generate the prompt "How do you feel about this sentence: I love this movie." for the task of sentiment analysis, and the prompt "Identify the person and the organization in this sentence: Elon Musk is the CEO of Tesla." for the task of named entity recognition.  Another example, Google Bard can generate the prompt "What is the relation between the two entities in this sentence: Paris is the capital of France." for the task of relation extraction, and the prompt "Given this premise: All dogs are mammals. And this hypothesis: Some dogs are black. Is the hypothesis entailed, contradicted, or neutral by the premise?" for the task of natural language inference. 10.2 Meta LLaMA Introduction - Meta LLaMA is a prompt engineering model developed by Facebook AI Research, that can optimize natural language prompts for GPT-3 or other language models, based on some inputs, queries, or contexts, from the user, for the task or application of few-shot learning. - Meta LLaMA uses a meta-learning framework to optimize natural language prompts, that can adapt to new tasks or domains, with few or no labeled examples, by leveraging the prior knowledge, embedded in the pre-trained language models, such as GPT-3 or BERT.  For example, given the input "This is a positive review of a movie", Meta LLaMA can optimize the prompt "This review is [MASK]" for the task of text classification, by learning from a few examples of positive and negative reviews, and using the pre-trained language model to fill in the mask with the correct label.  Another example, given the input "Barack Obama was born in Hawaii", Meta LLaMA can optimize the prompt "Fact or fiction: [MASK]" for the task of fact verification, by learning from a few examples of true and false statements, and using the pre-trained language model to fill in the mask with the correct label. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 39 - Meta LLaMA can optimize natural language prompts for various few-shot learning tasks, such as text classification, natural language inference, fact verification, and question answering, and can achieve state-of-the-art results, compared to existing methods, such as PET, LM-BFF, or PAWS-X.  For example, Meta LLaMA can optimize the prompt "Given this premise: All dogs are mammals. And this hypothesis: Some dogs are black. The hypothesis is [MASK] by the premise." for the task of natural language inference, and the prompt "Who is the author of Harry Potter? [MASK]" for the task of question answering.  Another example, Meta LLaMA can optimize the prompt "This text is written in [MASK] language" for the task of text classification, and the prompt "Is this statement true or false: The sun rises in the west. [MASK]" for the task of fact verification. 10.3 Anthropic Claude Introduction - Anthropic Claude is a prompt engineering model developed by Anthropic AI, that can evaluate natural language prompts for GPT-3 or other language models, based on some inputs, queries, or contexts, from the user, for the task or application of natural language generation (NLG). - Anthropic Claude uses a contrastive learning approach to evaluate natural language prompts, that can measure the quality, diversity, and relevance, of the text, generated by GPT-3 or other language models, in response to the prompts, by comparing them with human-written references, or alternative generations, from different models.  For example, given the prompt "Write a summary of the following article:...", Anthropic Claude can evaluate the text generated by GPT-3 or other language models, by comparing it with a human-written summary, or a summary generated by another model, such as BART or T5, and score it based on the similarity, coherence, and informativeness, of the summary.  Another example, given the prompt "Rewrite the following sentence in a more polite way:...", Anthropic Claude can evaluate the text generated by GPT-3 or other language models, by comparing it with a human-written rewrite, or a rewrite generated by another model, such as PEGASUS or GPT-2, and score it based on the politeness, clarity, and meaning preservation, of the rewrite. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 40 - Anthropic Claude can evaluate natural language prompts for various NLG tasks, such as text summarization, text paraphrasing, text expansion, and text rewriting, and can provide feedback, comments, or suggestions, to the user, on how to improve, modify, or refine the prompts, to generate better text, for the task or application of NLG.  For example, Anthropic Claude can provide feedback such as "The prompt is too vague, try to specify the length and the style of the summary", or "The prompt is too specific, try to use more general terms and avoid biasing the generation", to help the user to create better prompts for the task of text summarization.  Another example, Anthropic Claude can provide feedback such as "The prompt is too simple, try to introduce some variation and creativity in the paraphrasing", or "The prompt is too complex, try to simplify the language and avoid unnecessary words in the paraphrasing", to help the user to create better prompts for the task of text paraphrasing. This material is exclusively for GSDC members and cannot be distributed, sold, or reproduced. Certified Prompt Engineering Book of Knowledge © Global Skillup Certification Pvt. Ltd. 100D Pasir Panjang RD, #05 - 03 Meissa, Singapore 118520 41 11. HOW DOES AI WORK? Artificial intelligence (AI) is the field of computer science that aims to create machines and systems that can perform tasks that normally require human intelligence, such as vision, language, reasoning, or decision making. AI works by using algorithms, which are sets of rules or instructions, that can process data, learn from data, or generate data, depending on the goal of the task or application. 11.1 Tokens  Tokens are the basic units of meaning or representation in natural language processing (NLP), which is a subfield of AI that deals with

Use Quizgecko on...
Browser
Browser