Prompt Engineering

References

Reddit thread on prompting techniques

Model grounding

Grounding refers to aligning model’s understanding, and responses with real world knowledge, entities, or concepts

Model conditioning

Models are Grounded by using a set techniques referred to as model Conditioning. These techniques involve careful crafting of prompts and fine-tuning of model over a specific dataset.

model-conditioning-techniques

Prompt structure

A prompt may be thought of as composed of multiple building blocks.

Instructions : tells the model about the task you would like it to perform – or it may tell how to perform the task. E.g., you can tell the model to act like a 5th grade science teacher.

Input data : This is a task specific input e.g., it is a question in case of Q&A, it may be content of a pdf document in case of summarization task.

Examples : Models can make use of examples to produce better responses.

Context: In addition models learns from the context. This inherent ability of models is used for preventing hallucinations and imprecise responses. In this part of the prompt you provide additional information on the task

Output format: You can guide the model to produce output is a desired format. This is extremely important as output from the models is consumed by applications before it is presented to the human.

prompt-structure

References

Constructing Prompts for the Command Model

Collection of prompt generation tools