See any GenAI model as a genius boy who is dump to answer. He has all the knowledge but don't know what and how to answer. The tool to fetch your answer in most accurate and well structured way is called Prompt Engineering.
Here I will mention 3 techniques for well prompt engineering.
Clear Prompting:
We have a lot in our head which we don't say because it is 'common sense.' As a wise man said: "common sense is not common", thus we need to be clear, direct, well structured and well explained while giving prompts.
The below example shows that when we ask a question, it may get confuse or give details that is more needed. But when we are direct, it give is a better answer.
Indirect Prompt:
Direct Prompt:
Ask to think Step-By-Step:
This method, also referred to as chain of thought (CoT) prompting, can greatly enhance the accuracy and depth of a model.
Now ask to think step by step:
Reduce Hallucination:
To reduce hallucination, can follow the steps:
- Ask the model to answer only if it is confident and sure about the response.
- Give the model space to think before responding by encouraging step-by-step reasoning.
- Ask the model so say "I don't know the answer" if it is not sure or don't have the answer.