Scroll back to the top
TEXAS A&M UNIVERSITY

Elevating AI Responses through Strategic Prompt Engineering

Posted on 04/04/2024 12:17 PM

In the evolving landscape of AI, prompt engineering emerges as a critical skill. Prompt engineering is the process of creating, modifying, or improving a prompt to produce the desired output. But what is a prompt? In this case, a prompt is the input provided to a generative AI, usually as a question, directive, or action. For example, when you open ChatGPT and type “Write a lesson plan on fluid dynamics,” the AI will generate a lesson plan. However, a more refined prompt would provide a better outcome, such as “Write a thirty-minute lesson plan on fluid dynamics for college juniors and include an activity for a flipped classroom.” The results are better because the prompt was better - that is, it provided more details. 

A good prompt will include several components:

  1. Required: Give a directive, question, or action.

  2. Important: Define the persona to target the results. For instance, I would receive dramatically different results if I asked a third-grade student, a mathematician, or Robert Frost to write a poem.

  3. Helpful: Provide context and limitations. I limited the lesson plan in time and the intended audience.

  4. Helpful: Provide examples or describe the format of output that you expect.

Why provide so much detail? Since an AI is trained on billions of documents, they don’t always work well together. The more precisely we create the prompt, our result will be more successful.

Just as humans obtain their best results through planning and “thinking” about the answer, you can also guide AI in solving complex problems. One strategy for resolving complex issues is “chain-of-thought prompting.” Chain-of-thought prompting is a method developed by researchers at Google to enhance the reasoning capabilities of large language models (LLMs). You may be surprised to find that AI is no different than humans in this case. AI generally wants to respond to the prompt quickly; however, you can guide it through a more complex process. Chain-of-thought prompting induces the model to decompose the problem into intermediate reasoning steps, leading to a more correct final answer. For example, I may ask the AI to develop an outline for a lesson plan. I then edit and feed the outline into the AI to create the content. I may ask the AI to expand on specific areas. Lastly, I can prompt the AI for an evaluation based on the content. The results will be much better than the previous simple prompt. AI prompting is like a conversation with an expert, and there is no exact formula. Think through how you would approach a complex problem and lead the AI through the process, editing and improving along the way. Chain-of-thought prompting enables language models to reason step by step and enhance their ability to handle complex tasks.

There are many other strategies for improving AI prompts. With them all, precision reigns supreme in the use of AI. When you craft prompts with care, you’ll witness the magic of AI unfold. In addition, the more precisely we create prompts, the more successful our AI responses become. So, let’s engineer prompts that spark brilliance.


Tags:
Credits: Kelli Adam