Prompt engineering techniques
There are dozens of techniques to improve prompts. This section highlights the most valuable strategies for enterprise use cases.
Self-consistency
Think of self-consistency as aligning statements with truth, thus making them logically aligned:
Solar power is a renewable resource. Because solar power is a finite resource, it has unlimited potential.
Solar power is a renewable resource, unlike coal or oil, which have finite reserves. The response from the LLM needs to be more consistent in representing solar power, as it is not a finite resource. The documentation might be an issue, or the context length or writing style infers wrong conclusions. A solution is to provide a few examples that can teach the model. This is not training it with the exact answers; it only gives exemplars to approach the class of problems. It is pretty amazing. Alternatively, ask the question differently and see whether some answers are consistent.
Wang et al. (2023...