1/43
Looks like no tags are added yet.
cognitive verifier pattern
technique used in prompt engineering to improve the accuracy and relevance of responses generated by LLMs.
works by having the LLM ask itself additional questions to gain deeper understanding of user's prompt
cognitive verifier pattern example
prompt: write blog post about exercise benefits
LLMs questions: who is the target audience ( beginners, professionals ), should the focus be on physical or mental benefits
your answers: beginners, both physical and mental benefits
zero-prompting
provides input to a language model without specific training examples, expecting it to generate a response based on pre-existing knowledge
zero-prompting example
prompt: explain concept of democracy
description: language model generates response based on its understanding w/o training
few-shot prompting
offers a limited number of examples or "shots" related to a specific task or topic to guide the language model's response generation
appropriate when some training data is available
few-shot prompting example
prompt:
pos.: this movie was fantastic, i laughed lots
neg.: this movie is a waste of time, has bad acting
neutral: it was okay
now analyse the sentiment: neutral + description of why
chain-of-thought ( CoT )
used in natural language processing tasks. in CoT prompt, the user provides a partial sentence or context, the model is tasked with generating the continuation
CoT are used to assess a language model's ability to understand and generate coherent text, + its capacity to infer context and complete open-ended tasks.
used in various NLP apps like chatbots, dialogue systems, and writing assistance
CoT example
prompt: solve this word-problem with step-by-step process "12 cupcakes at bakery, sarah buys 5, what's left?"
CoT aspect guides LLM to explain each step: identify starting # ( 12 ), understand the action ( sarah buys 5 ), and performing
least-to-most
aka least intrusive prompting or increasing assistance, is used to teach skills or guide a learner toward completing a task
works by providing gradually increasing levels of help until learner can do it independently
least-to-most example
prompt scenario for teaching to write email
independent level: without any prompts
least intrusive ( step 1 ): prompt says you need to send an email to NAME requesting a meeting to discuss TOPIC
more intrusive ( step 2 ): start your email with a salutation like DEAR NAME. then introduce yourself and purpose of the email
most intrusive ( step 3 ): dear name, i am name, i', writing to request a meeting to discuss topic
tree-of-thought ( ToT )
is used in prompt engineering to encourage LLMs to explore different possibilities and consider multiple reasoning paths before generating a response
is used when dealing with tasks that have multiple potential solutions like in creating writing for generating stories with multiple plot lines, character choices, and endings
ToT example
prompt: write short story about robot lost in story with reasons they might be lost, how they will find home. consider different scenarios
CoT v. ToT:
CoT focuses on a linear sequence of intermediate steps leading to a single answer
ToT encourages exploring and branching out
generated knowledge prompt
involves a 2-step process to help LLMs understand and respond to requests more effectively.
step 1: involves prompting LLM itself to generate potentially useful info related to main prompt.
step 2: once LLM generates knowledge, it is then used to inform and guide the LLM in responding to the main prompt
suitable for educational settings, question answering systems, and conversational AI apps where users seek information on common topics
generated knowledge prompt example
main prompt: write blog post about benefits of houseplants for mental health
generated knowledge: LLM could generate info about different houseplants, their air-purifying, and studies linking nature to stress reduction
enhanced prompt: main prompt + include info about different types of plants, their air properties, and positive impact on us
self-consistency prompt
asks a model the same prompt multiple times and takes the most consistent result
used in storytelling, dialogue generation, and text-based tasks where maintaining coherence and continuity is essential
self-consistency example
prompt: continue the story of detective solving missing cake case
ask multiple times
sampling bias
when the data used to train the AI does not represent the population it is intended to analyse
sampling bias example
if an AI model is trained on a dataset primarily consisting of urban data, it may perform poorly when applied to rural settings
an AI model trained on data from male patients may fail to diagnose diseases in female patients accurately
if the system is trained on images that mostly feature people with light skin tones, it may have higher error rates on recognising those with darker skin tones
measurement bias
occurs when there are errors in the data collection process that systematically skew the data. this can happen due to faulty instruments, incorrect data entry, or subjective judgement
measurement bias examples
if a survey on a job satisfaction uses leading questions, the responses may not accurately reflect the participants' true feelings, leading to biased data
if a sensor used in environmental monitoring has calibration issues, the collected data might be inaccurate, affecting any AI model trained on this data
algorithmic bias
refer to biases originating from AI algorithms' design and implementation. these biases can result from the assumptions and decisions made by the developers during the creation of the algorithm.
these biases can perpetuate and even amplify existing biases present in the training data
algorithmic bias example
an AI-based recruitment tool that learns from historical data may inadvertently favour candidates like those hired in the past, perpetuating gender or racial biases
predictive policing algorithms that rely on historical crime data may disproportionately target minority communities if that data reflects existing biases in law enforcement practice
selection bias
when the data used to train the AI model is not randomly selected and is instead chosen in a way that excludes certain groups or outcomes.
selection bias example
if an AI model is trained on product reviews from a single website, it may not generalise well to reviews from other platforms with different demographics
the AI model may not accurately predict treatment outcomes for other age groups if clinical trial data are predominantly from a specific age group
confirmation bias
occurs when the model is designed or interpreted in a way that confirms pre-existing beliefs / hypotheses.
can happen if scientists selectively include data supporting their assumptions or if the AI is tuned to emphasize certain outcomes
confirmation bias example
if an AI model is designed to predict market trends based on data that aligns with the analyst's expectations, it may overlook emerging trends that contradict them
if an AI model is trained to diagnose a disease using only data that confirms known symptoms, it might miss atypical presentations of the disease
A company is developing new software for programming and wants to incorporate AI.Which software task is well-suited for AI?
Explaining code errors = correct
defining code variables
performing user testing
specifyin project structure
Which step is important before creating a prompt for AI to develop a social media post?
Clarifying the purpose of the post = correct
considering ethical ramifications
writing a verison of the post manually
uploading all previous posts to compare
A person wants to use an AI-based search tool to find recipe ideas for dinner. The person includes "gluten-free" as part of the prompt.Which term refers to this key component of a prompt?
Context = correct
persona
output format
instructions
Which advantage results from the inclusion of context and goals in prompt writing?
Adaptability and responsiveness = correct
faster rate of response
improved interface appear
greater machine learnign rate
What is a risk of neglecting clarity and specificity when writing a prompt?
misunderstood queries = correct
blatant misinformation
conflicting personas
narrow responses
A person writes a prompt to find the distance between two points on the coordinate plane. The prompt includes, "Explain the process step-by-step."
chain of thought = correct
few shot
self consistency
generated knwoeldge
Which guideline should be followed when crafting a prompt to generate an image using AI?
Avoid multiple sentences = correct
offer multiple options
start with the audience
avoid descriptive language
A businessperson needs to read a technical and complex report. The person wants to use AI to analyze the report and produce a version that is easier to comprehend.
Which prompt engineering solution is most effective to achieve this goal?
Indicate the desired reading level with "at a twelfth-grade reading level" = correct
Give a list of appropriate words with the phrase "using these words"
Ask the model to create another version with "read and summarize"
Correctly instruct the model with the keywords "translating" and "document"
A doctor wants to analyze a large dataset for research about a disease treatment.How can generative AI help the doctor analyze the data?
By suggesting appropriate visualization techniques = correct
By adjusting values to have a greater level of precision
By highlighting ethical considerations from conclusions
By creating an interactive database to explore the data
Which capability makes generative AI a valuable data sorting tool?
Categorizing data into predefined groups = correct
Correcting biases in data collection
Identifying potential ethical concerns
Detecting sources of measurement errors
persona
represents the role or identity that the AI assumes when interacting with a user
instructions
the user's intention
the clarity and specificity of the user's intention are paramount, as they determine the relevance and accuracy of the AI's response.
instructions example
example: seeking guidance on programming concept query could be, "explain OOP principles" prompting the AI chatbot to provide a detailed explanation tailored to the user's request.
example: "calculate the square root of 144" expects the AI to perform the computation accurately and deliver the result
input content
aka text
represents the information provided by the user that the chatbot must process and analyse to generate a response
the quality and relevance of it significantly impact the accuracy and effectiveness of the chatbot's response
output format
refers to the specific requirements or expectations regarding how the output response should be presented to the user
output format example
output response including structured bullet points or numbered lists to present information
in voice, there should be a focus in speech clarity, tone of voice, and pacing
context / additional information
any supplementary context or background that can aid in understanding or refining the user's query
context examples
in weather forecasting bots, additional information may include the user's location or preferred units of measurement, like C / F, to tailor to the user's needs
specify dietary restrictions like gluten-free or vegan recipe suggestions