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.

  1. Define Goal

    1. Utilize S.M.A.R.T. framework granularly

      1. Specific - goals should be well-defined and answer 5 W’s: who, want, where, when, and why.  Narrow focus with instructions in the questioning

      2.  Measurable - goals need to have quantifiable criteria; how to determine success

      3. Attainable - goals should be realistic

      4. Relevant -  goals should align with objectives and be worthy of pursuit

      5. Time Bound - goals should have a deadline and create accountability

      6. Write goal in prompt bar - what you want to achieve

  2. Context Provision

    1. Describe current state and desired future state for effective planning.  Provide great instruction in questioning for clarity of request.   

  3. Output Format

    1. Use iterative refinement with the AI to modify prompts based on the responses.  State preferred format of output response.

    2. Zero shot and few-shot

      1. Zero shot - best for simple tasks, LLMs are prompted without examples

      2. Few -s hot - ideal for complex queries and domain specific content by giving LLMs a small number of examples

      3. Chaining - complex tasks broken down into sequence of smaller prompts for improved accuracy

  4. Results

    1. Collaboration - ask LLMs to cite sources for validation, illustrate sequential execution, check for hallucinations and biases

    2. Opportunity to templatize prompts for re-use and accelerated decisioning