Skip to Main Content

University Library, University of Illinois at Urbana-Champaign

Introduction to Generative AI

This library guide is a UIUC campus resource to read and reference for instructional, professional, and personal learning. Updates will occur on a semester basis. Last Updated: March 2024

What is a prompt and prompt engineering?

A black corgi with her owner who is a female librarian who is wearing a dress. She has long red hair with bangs and glasses. Books are surrounding them, generated by Adobe Firefly.A prompt is the content you enter into a generative AI tool in order to receive your desired output. It may not immediately create the content you envisioned, and you may need to refine your prompt to generate an output that closer aligns to what you want. Generated output can change based on the quality of the prompt and implementing prompt engineering can refine your content to more efficiently use a language learning model.

Prompt engineering is the process of structuring text using tactics to get better results. Knowing the capabilities and limitations of a tool can help you receive more accurate and relevant responses. 

Tips for Prompt Engineering

1. Be Clear and Specific

Adding details and providing contextual information to your prompt will generate more relevant responses. Include outcome, length, format, style, etc. 

Below is an example prompt:

  • Original: "Words like 'climate change'"
  • Refined: "Provide a list of synonyms and keywords that relate to term 'climate change'."

2. Be Direct

Phrase your input as a command rather than a statement or question. To create a command, place an action verb at the front of a sentence. Generative AI tools can more effectively design responses that are clear and direct, so make sure to avoid ambiguous language.

Below is an example prompt:

  • Original: “Could you please tell me what the word potable means?”
  • Refined: “Define ‘potable’ and provide two examples of how to use potable in a sentence. Include a list of industries where the concept of ‘potable’ is applied.
     

3. Don't Use "Not" or Negative Language

Avoid using language asking the generator not to do an output. Instead, find a way to rephrase your command that specifies exactly what you want it to generate. Using positive instructions will be more effective than negative instructions. 

Below is an example prompt:

  • Original: “What are some plays not written by Shakespeare?”
  • Refined: “Identify a list with brief descriptions of well-known English plays and exclude plays written by William Shakespeare.”

4. Break down complex questions into smaller parts

Giving the tool one step of a prompt at a time will allow you to validate the output before inputting another instruction. Breaking down the prompt prevents missed instructions and miscommunication between you and the tool. 

Below is an example prompt:

  • Original: “What is the population of Sri Lanka? What are the most profitable industries in Sri Lanka? What natural resources are mined in Sri Lanka?”
  • Refined: “Provide the total population and demographic breakdown of religion, ethnic groups, and language of Sri Lanka.”
     

5. Create a Role or Give an Example

Prompt the generative AI tool to take on a role or provide an example for the generator to mimic. This will allow the tool more direction and generate more specific responses. 

Below is an example prompt:

  • Original: “Give me information about mass conversion around a chemical reaction.”
  • Refined: “Respond to the prompt about mass conversion around a chemical reaction, as an undergraduate chemistry tutor.”