How to Get Good Answers from ChatGPT

Getting good answers from GPT is a matter of consistency and providing good examples for the model. This is a guide to the prompting technique known as few-shot prompting or few-shot learning.

Few-shot is a fancy term for training a model with your prompt by giving it examples. Most people figure this out naturally, and I’ve seen it given as advice in many ways: “be sure to give it details” or “paste in your product info,” etc. This technique alone can get you a decent way toward “human-like” output, or it can be used to give you more consistent output of any kind. All you are doing is teaching ChatGPT what a good answer looks like.

Say you want ChatGPT to a write a blog article, but it needs to blend in to your site. Give ChatGPT samples of existing articles you’ve written, at least 100 words, or if you’re don’t care about tokens, you can give it whole articles if they fit in the context limits. Include the prompt you would normally use and at least one, preferably two, examples.

Code:

User: Write me a 700 word how-to guide on XAssistant: <Your pre-existing writing sample or article1>User: Write me a 700 word how-to guide on YAssistant: <Your pre-existing writing sample or article2>Write me a 700 word how-to guide on Z

That whole thing is your prompt. You’ll get an article about Z. From then on in the conversation, simply give the command and the topic, and if there is a clear format and voice to your examples, it will attempt to emulate it. The more examples you give, and the more consistent the writing style and format of the samples you use, the better your results will be.

This is useful for getting formatted outputs too. e.g.:
(use real product examples)

Code:

Product Format Example #1Item: XDesc: XSizes: X, X, XPrice: $XProduct Format Example #2Item: XDesc: XSizes: X, X, XPrice: $XPut these products into the format used in the examples above:<bunch of messy unstructured product info you copied off some website>

That’s all your prompt. You get the idea. Like I said, you’re probably already doing this in some form. Now do it more consciously and intentionally, and craft good examples for GPT, and you will get better output. The prompts can be anything, the key is consistency and good examples — preferably at least two, to help it establish a pattern.

(Note: This is a version of a guide I have previously posted elsewhere – D.D.)