POSTS / ChatGLM Prompt Engineering Course Notes (2) - Tricks

Published: 2023-12-09

Notes from ChatGLM Prompt Training Course Last Note is Here #4.

How to Write a Prompt?

Note that you can never write a prompt at once.

How to Enhance Your Prompt?

There are several methods of enhancing your prompt to get a more proper answer from LLM:

  1. Replace vague instructions with enumerations.
  2. Describe instructions with detailed explanation.
  3. Provide examples of expected answers.

What is detailed Information?

Tell LLM what character it should play, which gives LLM a clear overview of the follow works.

Give LLM the background of your tasks so that LLM can better understand your instructions.

Try best to simplify the whole flow of the given tasks for complicated steps might bring a not-so-good result.

Examples must not be very complex and also remember that more don’t always mean better.

Tell LLM what to do instead of restricting what it should not do.

How to Integrate with workflow?

You can’t expect one interaction with LLM to solve everything, which means multiple prompts are always solution to a complex workflow.

Most of the times you can use few-shots to enhance the performance of LLM, which clearly shows what it should give to answer your question.

The last sentence of your prompt is very importance as LLM might give more attention to that, so you should better enphasize the task you give.

There’s a typical process for iteratively generating a suitable prompt:

  1. Try zero-shot.
  2. Based on the last answer, update your prompt with few-shots as well as some of the methods mentioned before.
  3. Check the last answer and fix issues with some tiny modification.