Note 3— Prompt Engineering for Developer

Topic: Iterative Prompt Development

Mars Wang
2 min readMar 31, 2024
Photo by Tim Johnson on Unsplash

Why

There probably isn’t a perfect prompt for everything under the sun. It is more important that you have a process for development a good prompt for your specific application — Andrew Ng

What

Iterative Prompt Development: Find a prompt that works more reliably every single time

How

Iterative Process:

  • Try something
  • Analyze where the result does not give what you want
  • Clarify instructions, give more time to think
  • Refine prompts with a batch of examples
Cycle of iterative prompt development

Example: How to iterate and refine your prompt
Ask LLM for a technical fact sheet

info of the fact sheet

Case 1: write product description

the prompt that needs to generate technical fact sheet
the response → too prolix, hope to shorten the response

After finding the response doesn’t meet the expectation (prolixity), you need to optimize the response (concise):

Phase of optimizing response: utilizing “Use at most 50 words” to shorten the response

Case 2: Rewrite the description that aims to different retailers who specialize in different domain
→ the response needs to emphasize on technical details and material-related words

describe the TA (furniture retailers), and what they care about.
the response

Case 3: Following the previous situation (Case 1, 2), the sheet needs to be added Product ID:

--

--

Mars Wang
Mars Wang

Written by Mars Wang

99' | Software Development | Cloud | Adventurer

No responses yet