SuperGeekery: A blog probably of interest only to nerds by John F Morton.

A blog prob­a­bly of inter­est only to nerds by John F Mor­ton.

The Art of Writing Effective GPT Prompts: A Step-by-Step Workflow

Meta ai prompt creation

I’m end­ing the year with a meta post. Over the course of 2023, just like the rest of the world, I’ve been exper­i­ment­ing with Chat­G­PT and oth­er LLMs. I’ll share a prompt I wrote and the con­tent that it cre­at­ed as an exam­ple of how I’m inter­act­ing with AI mod­els.

The human-writ­ten intro­duc­tion #

The prompt that gen­er­at­ed the body of this post is what I’d like for you to focus on as you read. The con­tent top­ic and the con­tent struc­ture that defines the post are defined by the prompt, but the con­tent itself comes from the mod­el. I think the GPT did a good job here. That’s not always the case, but the post actu­al­ly makes ref­er­ence to how to deal with this.

I have not edit­ted any­thing below the prompt except to add for­mat­ting. The words are exact­ly as they appeared in the GPT inter­face. To genereate the post, I’ve used https://​flowg​pt​.com/​p​/​s​e​o​— c​o​n​t​e​n​t​— m​aster, which relys on Chat­G­PT, and promised to cre­ate a Human Writ­ten | Pla­gia­rism Free | SEO Opti­mized Arti­cle” with it’s cus­tomized mod­el. 

Human-writ­ten” must mean that I, a human, wrote the prompt. Maybe that counts in 2023.

Here’s the prompt I gave the GPT. Enjoy the post!

I want to write an arti­cle to teach my read­ers the basic work­flow for writ­ing good GPT prompts. The arti­cle should include a top ten list at the begin­ning and then have a short sec­tion describ­ing each item in the list. Some of these sec­tions can have two exam­ples of how to imple­ment each tip prop­er­ly. One exam­ple would be the incor­rect way to use the tip and the fol­lowup tip will show the prop­er way.

Intro­duc­tion #

Writ­ing good prompts for the GPT (Gen­er­a­tive Pre-trained Trans­former) mod­el is cru­cial for obtain­ing high-qual­i­­ty out­puts. In this arti­cle, we will explore a step-by-step work­flow to help you mas­ter the art of craft­ing effec­tive GPT prompts. By fol­low­ing these tips, you’ll be able to gen­er­ate more accu­rate and rel­e­vant respons­es from the mod­el, enhanc­ing the over­all user expe­ri­ence.

Top Ten Tips for Writ­ing Good GPT Prompts #

1. Under­stand the Model’s Capa­bil­i­ties and Lim­i­ta­tions #

To write effec­tive GPT prompts, it’s essen­tial to famil­iar­ize your­self with the capa­bil­i­ties and lim­i­ta­tions of the mod­el. Under­stand­ing what the mod­el can and can­not do will enable you to set real­is­tic expec­ta­tions and tai­lor your prompts accord­ing­ly. Remem­ber, the GPT mod­el excels at gen­er­at­ing text based on pat­terns it has learned but may strug­gle with fac­tu­al accu­ra­cy or log­i­cal coher­ence.


Incor­rect: Describe the sci­en­tif­ic process of time trav­el in detail.”

Prop­er: Write a cre­ative sto­ry about time trav­el and its con­se­quences.”

2. Define Clear Instruc­tions #

Craft­ing pre­cise and unam­bigu­ous instruc­tions is cru­cial for guid­ing the mod­el effec­tive­ly. Ambi­gu­i­ty or vague­ness in prompts can lead to unpre­dictable or off-top­ic respons­es. Clear­ly state what you want the mod­el to do and pro­vide any nec­es­sary guide­lines or con­straints.


Incor­rect: Write an inter­est­ing sto­ry.”

Prop­er: Write a thrilling mys­tery sto­ry set in a haunt­ed man­sion.”

3. Pro­vide Con­text and Con­straints #

Set­ting the con­text and pro­vid­ing rel­e­vant con­straints helps the mod­el under­stand the desired out­put bet­ter. With­out con­text, the mod­el may gen­er­ate respons­es that are detached or lack coher­ence. By pro­vid­ing nec­es­sary back­ground infor­ma­tion, you guide the mod­el towards more accu­rate and mean­ing­ful respons­es.


Incor­rect: Talk about the impor­tance of renew­able ener­gy.”

Prop­er: Write a per­sua­sive argu­ment about the impor­tance of tran­si­tion­ing to renew­able ener­gy sources to com­bat cli­mate change.”

4. Use Prompts to Guide the Nar­ra­tive #

Prompts can serve as a pow­er­ful tool to guide the model’s sto­ry­telling abil­i­ties. By pro­vid­ing a spe­cif­ic start­ing point or sce­nario, you can direct the mod­el to gen­er­ate nar­ra­tives that align with your desired out­come.


Incor­rect: Write a sto­ry.”

Prop­er: You are a detec­tive inves­ti­gat­ing a mys­te­ri­ous mur­der in a small town. Describe the events lead­ing up to the crime and the sub­se­quent inves­ti­ga­tion.”

5. Exper­i­ment with Dif­fer­ent Prompts #

Don’t be afraid to exper­i­ment with dif­fer­ent prompts to obtain diverse out­puts. By vary­ing the word­ing, tone, or struc­ture of your prompts, you can explore dif­fer­ent cre­ative pos­si­bil­i­ties and uncov­er unique respons­es from the mod­el.


Prompt 1: Describe a beau­ti­ful sun­set over the ocean.”

Prompt 2: Imag­ine you’re a poet try­ing to cap­ture the essence of a breath­tak­ing sun­set. Write a poem that evokes emo­tions of awe and tran­quil­i­ty.”

6. Bal­ance Speci­fici­ty and Open-End­ed­ness #

Find­ing the right bal­ance between spe­cif­ic instruc­tions and allow­ing cre­ative free­dom is cru­cial. Over­ly spe­cif­ic prompts may lim­it the model’s cre­ativ­i­ty, while vague prompts can lead to irrel­e­vant or non­sen­si­cal respons­es. Strike a bal­ance to achieve the desired out­come.


Over­ly spe­cif­ic: Write a sto­ry about a yel­low dog named Max who finds a lost trea­sure in the back­yard on a sun­ny day.”

Bal­anced: Cre­ate an engag­ing sto­ry involv­ing a curi­ous dog and a hid­den trea­sure.”

7. Iter­ate and Refine Prompts #

The process of refin­ing and iter­at­ing on prompts is essen­tial for improv­ing results. Don’t set­tle for the first draft of your prompt. Con­tin­u­ous­ly ana­lyze the out­put, iden­ti­fy areas for improve­ment, and refine your prompts to elic­it bet­ter respons­es from the mod­el.


Ini­tial prompt: Write a fun­ny joke.”

Refined prompt: Craft a humor­ous one-lin­er about a clum­sy pen­guin try­ing to dance.”

8. Con­sid­er Prompts as Con­ver­sa­tions #

Approach prompts as a con­ver­sa­tion with the mod­el. Pro­vide back-and-forth con­text to increase the model’s under­stand­ing and encour­age more coher­ent and con­tex­tu­al­ly rel­e­vant respons­es.


One-sided prompt: Describe the role of arti­fi­cial intel­li­gence in health­care.”

Con­ver­sa­tion­al prompt: You are a doc­tor dis­cussing the ben­e­fits and chal­lenges of imple­ment­ing AI in health­care with a curi­ous patient. Explain how AI can improve patient care while address­ing poten­tial eth­i­cal con­cerns.”

9. Lever­age Pre­pro­cess­ing and Post­pro­cess­ing #

Uti­lize pre­pro­cess­ing and post­pro­cess­ing tech­niques to enhance the qual­i­ty of your prompts. Pre­pro­cess­ing involves tasks like tok­eniza­tion, remov­ing unnec­es­sary ele­ments, or for­mat­ting. Post­pro­cess­ing allows you to refine the model’s out­put for bet­ter coher­ence and read­abil­i­ty.


Pre­pro­cess­ing: Con­vert­ing the prompt to a suit­able input for­mat for the GPT mod­el.

Post­pro­cess­ing: Edit­ing the gen­er­at­ed text for gram­mar, clar­i­ty, and over­all read­abil­i­ty.

10. Eval­u­ate and Iter­ate on Gen­er­at­ed Out­puts #

After gen­er­at­ing out­puts, eval­u­ate their qual­i­ty and iter­ate on your prompts accord­ing­ly. Ana­lyze the gen­er­at­ed text for rel­e­vance, coher­ence, and align­ment with your intend­ed goals. Use these insights to refine future prompts and enhance the over­all effec­tive­ness of your work­flow.


Eval­u­ate the out­put: Assess the gen­er­at­ed text for accu­ra­cy, log­i­cal flow, and adher­ence to the prompt’s intent.

Iter­ate on the prompt: Incor­po­rate the lessons learned from the eval­u­a­tion to cre­ate more refined prompts in the future.

Con­clu­sion #

Mas­ter­ing the art of writ­ing effec­tive GPT prompts requires a sys­tem­at­ic approach. By under­stand­ing the model’s capa­bil­i­ties, defin­ing clear instruc­tions, pro­vid­ing con­text, and exper­i­ment­ing with dif­fer­ent prompts, you can gen­er­ate more accu­rate and rel­e­vant respons­es. Remem­ber to iter­ate, con­sid­er prompts as con­ver­sa­tions, and lever­age pre­pro­cess­ing and post­pro­cess­ing tech­niques to refine your prompts and improve the over­all qual­i­ty of gen­er­at­ed out­puts. With prac­tice and atten­tion to detail, you’ll be able to unlock the full poten­tial of the GPT mod­el and cre­ate engag­ing and com­pelling con­tent.

FAQs (Fre­quent­ly Asked Ques­tions) #

1. How do I han­dle the bal­ance between speci­fici­ty and open-end­ed­­ness in GPT prompts?

Find­ing the right bal­ance between speci­fici­ty and open-end­ed­­ness in GPT prompts is cru­cial. Start with a clear objec­tive and pro­vide enough guid­ance to steer the mod­el towards the desired out­come, while still allow­ing room for cre­ativ­i­ty and inter­pre­ta­tion. Exper­i­ment and iter­ate to find the opti­mal bal­ance for your spe­cif­ic use case.

2. What are some com­mon mis­takes to avoid when writ­ing GPT prompts?

Some com­mon mis­takes to avoid when writ­ing GPT prompts include being over­ly vague or over­ly spe­cif­ic, neglect­ing to pro­vide con­text, and fail­ing to iter­ate and refine prompts based on gen­er­at­ed out­puts. It’s also impor­tant to con­sid­er the model’s lim­i­ta­tions and set real­is­tic expec­ta­tions.

3. Can you pro­vide some tips for refin­ing and iter­at­ing on prompts?

To refine and iter­ate on prompts effec­tive­ly, ana­lyze the gen­er­at­ed out­puts for rel­e­vance, coher­ence, and align­ment with your goals. Iden­ti­fy areas for improve­ment and make adjust­ments to the prompts. Exper­i­ment with dif­fer­ent vari­a­tions and tech­niques, and learn from the feed­back received to con­tin­u­al­ly improve your prompts.

4. How can I eval­u­ate the effec­tive­ness of GPT prompts?

To eval­u­ate the effec­tive­ness of GPT prompts, assess the gen­er­at­ed out­puts based on their rel­e­vance, coher­ence, and align­ment with the intend­ed goals. Solic­it feed­back from users or experts in the field to gain dif­fer­ent per­spec­tives. Use this eval­u­a­tion to iter­ate and refine your prompts for bet­ter results.

5. Are there any addi­tion­al resources or tools that can assist in writ­ing GPT prompts?

Yes, there are sev­er­al resources and tools avail­able to assist in writ­ing GPT prompts. Some pop­u­lar ones include OpenAI’s prompt engi­neer­ing guide, com­mu­ni­ty forums, and online tuto­ri­als that pro­vide insights into best prac­tices and strate­gies for opti­miz­ing GPT prompts.

Con­grat­u­la­tions! You’ve now learned the step-by-step work­flow for writ­ing effec­tive GPT prompts. By imple­ment­ing these tips and tech­niques, you’ll be able to har­ness the pow­er of the GPT mod­el and cre­ate com­pelling and engag­ing con­tent. Hap­py writ­ing!

If you have any fur­ther ques­tions or need addi­tion­al assis­tance, feel free to reach out.

QR code for the The Art of Writing Effective GPT Prompts: A Step-by-Step Workflow

Link to this page