Loading

Robin
Growth Hacking

My Own Prompt Engineering Notes

5/1/2023 · 2 min read

After watching Andrew Ng’s course yesterday, I used GPT today to help a former colleague with large-scale data extraction and matching. I ran into a few issues—here is what worked for me.

Handling the token limit

The prompt token limit seems to be around 4,000 (even on paid tiers), so prompt text cannot exceed that—but real business needs often do. My approach:

  1. Split the prompt into multiple chunks of ~4,000 tokens each
  2. Write an inner loop for the current task: extract step by step; if a step does not match, continue until it does

API request rate

On the free GPT API, you only get about three requests per minute. Use a sleep: pause ~55 seconds after every three requests.

Debugging prompts

Official examples are in English, but Chinese instructions work fine. Manually editing the prompt and re-running is slow, and sometimes the wording looks right but the answer is wrong. Try this:

  1. Describe the requirement to Bing Chat
  2. Bing often returns something close but not quite right (since your prompt is not perfect yet either)
  3. Give Bing feedback and let it adjust—it is fast and usually converges quickly
  4. When satisfied, ask: “Based on your final output, write an example prompt you can follow reliably”
  5. Use that prompt as a reusable template for batch jobs

The point of a prompt is a general pattern—once it is right, you can apply it at scale.

Related posts