How to Write Better AI Prompts

How to Write Better AI Prompts

AI models like ChatGPT-4 and Claude that generate text responses are becoming increasingly advanced, but they still rely on high-quality prompts to achieve their full potential. As an AI practitioner, honing your prompting skills is critical to getting the most out of these systems.??

New Concepts

There are a few key concepts to understand around prompting AI models:

  • The context window refers to how much previous context the model has access to when generating a new response - typically around 6,500 words for publicly available models.
  • Temperature controls the randomness of the model's response, with higher temps producing more creative but possibly erroneous responses. (Only relevant for API calls)
  • Tokens refer to the units used for billing - each token is a few characters. (Only relevant for API calls)

Designing Prompts by Hand (not API Calls)

When designing prompts by hand:

  1. If you're having the model generate something, start by specifying the tone, attitude or brand values you want the model to reflect.
  2. Clearly state your expectations, like desired response length and also what the model can expect. For example "I may have missed something--so, if I did, let me know" or "I've told you everything you need to know".
  3. For complex tasks, provide step-by-step guidance or start simple then build up prompting in stages.
  4. AI models are also great categorizers, so tell the model what goes in each category and have it organize accordingly.??

Some Tips on Chat-based API Calls

For API calls:

  • Use a human/assistant message pattern to provide context and specify the required response format.
  • It helps to end prompts by pre-formatting the desired response, e.g. "Please list three steps for launching a startup: 1.?"
  • Use XML tags to denote reference text versus instructions, e.g. "Here's a sample business plan:??<ref>...</ref>?Please summarize the key highlights."

With practice, you'll be prompting AI models to generate exactly the responses you need. By providing ample context, clear guidance, and specific formatting, you can leverage these advanced systems to extend your own capabilities and gain valuable insights.

I hope you found this helpful!

要查看或添加评论,请登录

Davis Jones的更多文章

社区洞察

其他会员也浏览了