Skip to content

Prompt Engineering Basics

Google Deepming image

(Image credit: Google DeepMind, Unsplash)

What is Prompt Engineering?

Prompt engineering is the process of designing effective prompts to obtain desired responses from large language models (LLMs). LLMs are statistical models trained on massive datasets of text and code.

They can generate text, translate languages, create various types of creative content, and answer questions informatively.

However, LLMs are not perfect and can sometimes generate incorrect or misleading information. Prompt engineering can help mitigate these issues by providing LLMs with the necessary information to generate accurate and informative responses.

There are several techniques for prompt engineering, including:

  • Using keywords: This technique involves using keywords in the prompt to help the LLM focus on the topic of the prompt. For example, if you want the LLM to generate a love poem, you might include keywords like "love" and "poem" in the prompt.
  • Using examples: This technique involves providing examples in the prompt to help the LLM understand the desired format of the response. For instance, if you want the LLM to summarize a news article, you might include an example of a summary in the prompt.
  • Using constraints: Constraints can be used to limit the scope of the LLM's response. For example, you might specify the length of the response in the prompt if you want the LLM to generate a 100-word response.

Prompt engineering is a crucial skill for effective use of LLMs. By crafting clear and concise prompts tailored to the specific task at hand, you can ensure that LLMs generate accurate, informative, and creative responses.

Brief ChatGPT/Bard Cheat Sheet

Type of prompts Wrting styles Role Playing: "Act as X"
Binary Academic Agricultural Engineer
Comparative Confrontational Business Consultant
Explanation Creative Chemistry Professor
Feed-back Formal Defense Attorney
Fill-in-the-blank Humorous Environmental Scientist
Instruction Informal Family Counselor
Multiple choice Journalistic Geoscientist
Ordering Narrative Health Educator
Open-ended Objective Industrial Engineer
Prediction Poetic Job Recruiter
Scenario Technical Landscape Architect
more ... more ... more ...

Other type of ChatGPT/Bard tasks

Task Prompt example
NLP
Text generation Write a ...
Summarization Summarize this text: ...
Open question answering (Who/What/Where/When/Why) did ...
Paraphrase Rewrite this text: ...
Machine translation Translate this text into Language : ...
Structured output styles
Lists Give a list of number object names
Numbered lists Give a numbered list of number object names
Headings and subheadings Convert this text into headings and subheadings: ...
Tables Create a table from this list: ...
Unstructured output styles
Narrative modes (1st, 2nd or in 3rd person) Write a paragraph on how to verb something in 1st person
Formal Write a paragraph on topic in a formal style
Informal Write a paragraph on topic in an informal style
Personas Write a paragraph on topic in the style of persona
Media types
Write social media posts Write a tweet on topic
Write blogs Write a blog on topic
Write Emails Write an email on topic to audience
Write poems Write a poem about description topic
Write songs Write a type of song about desired topic show guitar chords
Write Resumes / Cover Letters Write a job position resume

Model parameters tuning

Parameter name Use Description
Answers -a or --answers Specifies the number of output answers (default is 1)
Category -c or --category Specifies the category of prompt (coding, creative, factual, fun, general, music, news, science, sports and writing)
Format -f or --format Specifes the format of output ("html", "markdown", "plain text", other).
Language -l or --language Specifies the required language of output.
Size -s or --size Specifies the maximum number of characters in the output.
Temperature -t or --temperature Control the creativity of output. The higher the temperature will result in more creative output (highly creative, maybe less coherent). A lower temperature is more focused, coherent and conservative. The temperature can be any value between 0 and 1 (default maybe 05 depending on the model)
Prompt examples
Tell me something I don't know! --size 50 --temperature 0.1 --category factual
Tell me something I don't know! --size 50 --temperature 1 --category fun
Create a lesson plan for a {grade level} class that incorporates {specific topic or skill} and engages students through {specific teaching method or activity}
Create a curriculum map for a {grade level} class that aligns with state standards and includes {specific topic or theme}
Design a feedback system for {specific type of assignment} that provides constructive feedback to {grade level} students and promotes {specific learning outcome or skill}
Create a study plan for a {specific subject} exam that includes {specific review materials or strategies} and identifies potential areas of weakness to focus on
Develop a classroom management plan that addresses common student behavior challenges such as {specific challenge} and outlines specific strategies for addressing them
Design an assessment or feedback tool that helps {grade level} students track their progress and identify areas for improvement in {specific subject}
Create a plan for differentiated instruction for a {grade level} class that includes {specific learning style or ability} students
Design a technology-integrated lesson plan that enhances student learning and engagement in {specific subject}
Develop a professional development plan for improving {specific teaching skill or technique} in {specific subject}
Design a classroom environment that promotes positive behavior and learning, including {specific visual or interactive elements}
Design a project-based learning activity that encourages {grade level} students to apply {specific subject} concepts in a real-world context
Develop a plan for fostering a positive and inclusive classroom culture, including {specific activities or discussions}
Create an assessment and grading policy that aligns with state standards and promotes {specific learning outcome or skill}
Design a plan for building positive relationships with {grade level} students, including {specific strategies for rapport-building}
Create a lesson plan that encourages {grade level} students to work collaboratively on a {specific project or assignment}
Develop a plan for learning centers that align with state standards and promote {specific skill or concept} in {specific subject}
Design a scaffolding plan for {grade level} students who struggle with {specific subject} concepts, including {specific strategies for support and reinforcement}
Create a lesson plan that incorporates {specific student interest or need} and promotes student ownership of learning in {specific subject}
Develop a plan for regular self-reflection on teaching practices and identification of areas for improvement
Create a plan for assessing student learning that includes {specific formative and summative assessments}

References


Created: 05/28/2023 (C. Lizárraga); Last update: 05/30/2023 (C. Lizárraga)

CC BY-NC_SA

CC BY-NC-SA 4.0

UA Data Science Institute