Prompt Engineering
Prompt Engineering defined - is the practice of designing inputs for AI tools that produce optimal outputs. Users ask questions / invoke commands of a large language model. Understanding how to structure prompts to improve reliability of AI-generated outputs.
Quality In → Quality Out
Best Practices:
Communication = provide deep context and background information.
Define Goal
Utilize S.M.A.R.T. framework granularly
Specific - goals should be well-defined and answer 5 W’s: who, want, where, when, and why. Narrow focus with instructions in the questioning
Measurable - goals need to have quantifiable criteria; how to determine success
Attainable - goals should be realistic
Relevant - goals should align with objectives and be worthy of pursuit
Time Bound - goals should have a deadline and create accountability
Write goal in prompt bar - what you want to achieve
Context Provision
Describe current state and desired future state for effective planning. Provide great instruction in questioning for clarity of request.
Output Format
Use iterative refinement with the AI to modify prompts based on the responses. State preferred format of output response.
Zero shot and few-shot
Zero shot - best for simple tasks, LLMs are prompted without examples
Few -s hot - ideal for complex queries and domain specific content by giving LLMs a small number of examples
Chaining - complex tasks broken down into sequence of smaller prompts for improved accuracy
Results
Collaboration - ask LLMs to cite sources for validation, illustrate sequential execution, check for hallucinations and biases
Opportunity to templatize prompts for re-use and accelerated decisioning