Lesson 3: The Art of the Prompt
Lesson No: 3
The Art of the Prompt: A Casual Order or Dignified Guidance?
By Tanzeel-ur-Rahman (CodeHubb & MindCrafts_AI) Farooka (Sargodha)
Assalamu Alaikum wa Rahmatullahi wa Barakatuh.
Suppose there is an intelligent and capable employee in your office. As you walk past, you call out to him: “Brother! Please write a letter.” and you get busy with your own work. Now that employee will be puzzled: who is the letter addressed to? What is its purpose? What tone should be kept, and how long should the letter be? He will write the letter according to his own guess, and it is possible that you may not like it. The fault was not the employee's; it was your incomplete instruction.
The same thing often happens with artificial intelligence (AI). When we give it an instruction, in technical language it is called a “prompt”, while the methods of preparing better and more effective prompts are called “prompt engineering”. We often write only “write a post” or “make a website”, and then expect that the AI will give the best result according to our need.
A wise craftsman uses a simple formula to get better work from his tools:
The Three Basic Principles of a Prompt
1. Role: Tell the AI in what capacity it has to work. For example, for an image, “You are an expert AI Visual Designer”; for a video, “You are an experienced Video Director”; for a Facebook post, “You are a social media copywriter”; and for a website, “You are a Full-Stack Web Developer”. In the same way, for an email the role of Business Communication Specialist can be given, for SEO content SEO Content Strategist, for a YouTube script YouTube Scriptwriter, and for an educational lesson Instructional Designer. Remember, telling the role makes the required point of view clear, but checking the accuracy of the answer is still necessary.
2. Purpose (Task): State clearly what the actual work is that has to be done. For example, do not say only “You are an expert social media writer”; also state: “Write a Facebook post for the opening of a new home bakery opening in Farooka, in which there is an announcement of the opening and an introduction to fresh cakes and biscuits.”
3. Conditions and Limits (Constraints): Make the required standard and the restrictions clear. For example, the language should be simple, the tone should be warm and friendly, the writing should not be more than 50 words, and unverified claims should not be included.
When these three things are clear, it becomes easy for the AI to reach the required result.
Five More Important Components for Better Results
When the work is somewhat complex, include these five components as well, according to need:
4. Context: Provide the necessary information related to the work. For example, the bakery has newly opened, it is located in Farooka, and its main products are cakes and biscuits. Instead of guessing about information that has not been provided, you can also instruct it to ask the necessary questions.
5. Audience: State who the content has to be prepared for. For children, easy language; for business people, professional language; and for ordinary users, simple and easy-to-understand language can be suitable.
6. Output Format: Make clear in what form the answer is wanted, for example a Facebook post, a table, an email, a step-by-step list, a complete web page, code files, a scene-by-scene video script, or presentation slides.
7. Example: If you want writing in a particular style, provide a sample. For example: “Keeping the style of this writing in front of you, write a new post; keep the language simple and the paragraphs short, but do not copy the original sentences.”
8. Evaluation Criteria: State what things must necessarily be present in a good answer. For example, the bakery post must include the announcement of the opening, a mention of cakes and biscuits, and an invitation for customers to come.
In this way, our broad framework is formed:
Role + Purpose + Conditions + Context + Audience + Output Format + Example + Evaluation Criteria
Remember, it is not necessary to include all the components in every small prompt. For a simple task, the three basic principles can be enough, while in complex work, more details are beneficial.
Seven Practical Examples for Different Tasks
1. Facebook post: Role: You are an experienced social media copywriter. Purpose: Write a post for the opening of Farooka's new home bakery. Conditions: The audience should be local customers, the language should be simple, the tone should be warm and friendly, and the writing should not be more than 50 words.
2. Prompt for an image or video: Role: You are an AI Visual Designer and Video Prompt Specialist. Purpose: Prepare a prompt for creating a promotional image for the bakery's opening. Conditions: The composition, light, colours, products and Aspect Ratio should be clear. For a video, also include the details of the scenes, the camera movement, the duration and the consistency of the characters.
3. Educational content: Role: You are an experienced educational writer. Purpose: Prepare a lesson on the benefits and limits of artificial intelligence for beginner students. Conditions: The language should be easy, practical examples should be included, and unverified claims should be avoided.
4. Website or software: Role: You are an experienced Full-Stack Software Developer. Purpose: Make a plan for preparing an inventory management web application for a small business. Conditions: Make the Requirements, Technology Stack, Database Design, File Structure and Development Steps clear. First present the plan, then, after approval, prepare the code step by step. Instead of having large software made complete in a single prompt, divide it into the stages of Plan, Code, Test, Debug and Improve.
5. SEO content: Role: You are an experienced SEO Content Strategist. Purpose: Prepare an informative blog post on WordPress Website Design. Conditions: Keep the Search Intent and suitable Headings in mind, and avoid unnecessary Keyword Repetition. Provide the SEO Title, Meta Description, Outline, the complete article and related FAQs. Remember, good SEO content also does not guarantee the first position.
6. YouTube script: Role: You are an experienced YouTube Scriptwriter. Purpose: Write the script of a two-minute video on Prompt Engineering for beginners. Conditions: Include an interesting opening, one everyday example, easy language and an effective ending. If the video is to be made with AI, the script can later be divided into scenes.
7. Correcting Urdu writing: Role: You are an expert Urdu editor and proofreader. Purpose: Improve the language, flow and sentence arrangement of my writing. Conditions: Keep the original meaning, the author's personal style and the important information intact. Do not include unnecessary new information, and at the end give a brief explanation of the prominent changes.
From these examples it becomes clear that the basic principles are the same, but the context, conditions and required result can be different for each task.
Practical Exercise and Experience
1. First write this casual prompt:
“Write an advertisement for the opening of a new bakery in Farooka.”
Review the length of the answer, its conventional nature and its information.
2. Now, in the same chat, write this organised prompt:
“Role: You are an experienced local business marketer.
Purpose: Prepare a Facebook post for the opening of a new home bakery in Farooka.
Context: The bakery's main products are cakes and biscuits.
Audience: The local customers of Farooka.
Conditions: The tone should be warm and friendly, the language should be simple, the writing should consist of at most 50 words, and unverified details should not be included.
Output Format: One complete Facebook post, at the end of which customers are invited to come to the bakery.”
Now compare the two answers. Did the second answer follow your instructions better? Did the unnecessary details decrease? Was the required purpose fulfilled in a clearer way?
If there is a shortcoming in the answer, give further instruction, for example: “Make the post shorter still, keep the 50-word limit, and use only the information provided.”
This is the practical exercise of improving a prompt.
Today's Takeaway and Task
Today, write these three basic principles in your notebook:
Role + Purpose + Conditions
And remember that in complex tasks, context, audience, output format, example and evaluation criteria can also be included.
Today's task is this: according to your need, choose a Facebook post, an image prompt, an SEO article, or a feature of a website. First write a simple prompt, then improve it with the help of these same three basic principles. Compare the two answers and tell us your experience in the comments.
Remember, a good prompt is not only the name of telling the AI the work; it is also the art of making your need clear, setting suitable limits, and checking the answer you receive.
Tanzeel-ur-Rahman #Lesson3 #PromptEngineering #SmartInstructions #AIForBeginners #MindCraftsAI #CodeHubb
Join the WhatsApp channel for all the previous lessons, and check the comments for Lesson No. 2.