
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:
- Split the prompt into multiple chunks of ~4,000 tokens each
- 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:
- Describe the requirement to Bing Chat
- Bing often returns something close but not quite right (since your prompt is not perfect yet either)
- Give Bing feedback and let it adjust—it is fast and usually converges quickly
- When satisfied, ask: “Based on your final output, write an example prompt you can follow reliably”
- 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.