Transcription
If you're using multiple AI models and need a framework to prompt effectively across platforms, worry not. I've got you. I've spent hundreds of hours working with all four major models and combined everything I've learned along with insights from their latest documentation to build a reusable prompt engineering framework that works across all of them. And in this video, I'll share that framework with you and show you exactly how to use it. And because I respect your time, I'll highlight all the topics we'll cover so you can skip ahead if you want to. We'll start with the framework itself, explore a few advanced techniques worth mastering, and wrap up with how context engineering fits into the mix.
If we haven't met before, I'm Ali Salam and I currently work as a director in a tech company. And on this channel, I'll help you turn tech and finance into your personal advantage. All right, let's take a look at the prompt engineering framework. And by the way, I'll share all of the documents with you in the chat as well as in the description so you have access to all of this.
I use the Claude skills to build out the report itself. That's why you will probably recognize Claude signature design which this is constructed with. And the way the document is built up is that you have each section of the prompt engineering framework outlined with the orange header and then you have the prompt itself. And the first thing you'll probably notice is that it's combined within what's often times referred to as an XML sandwich because this is a very effective way of separating each section within the prompt for the model. And then under the prompt itself, you'll have an example of how it looks. We have a set of them as you can see in here. and we'll go through them one by one. And by the way, I have a separate document that I'll share with you where you have all of these elements just outlined as the full prompt so you can just plug and play everything that we go through once we're done.
So starting off with the role, this sets the kind of who is responding to whom and specificity matters here. So for example, senior financial analyst will give you a much better result than just expert. The more specific you are about the role and the audience, the better the model can calibrate its responses. And one model difference that is good to be aware of here is that GPD5 tends to maintain this persona much better across long conversations than GPT4 did. So setting this up front tends to pay off fairly well if you're a chat GPT user. And you can see three kind of elements in here. You are a specific role expert, your audience, and communication style. And below here, you can see how that manifests into an example. I won't bore you with reading through the examples. You can read through it later.
Let's move on to task. This is where you want to tell the model what it's actually going to achieve. And you want to start with an action verb like analyze, draft, create, compare, and then state your objective. So, for example, analyze the competitive positioning of our SAS product against three main competitors. And then a really good best practice is to break down your objective into between two to four subobjectives to steer the model execution into the various work streams that you think is the most important. And the general rule of thumb here is to not make the model guess. Try to be as explicit as you can. Now, here is where it differs a little bit between the models. GPD5 is smart enough that you can be more concise. You don't need to like overspecify like you had to do with GPT4. And if you're a cloud user, then cloud 4 is much more literal than cloud 3. So if you wanted to go like above and beyond, then you actually have to ask it explicitly and it will do that for you. And if you're using the 03 and 04 mini reasoning models in chatbt, then keep this section lean because overspecification actually confuses their reasoning.
All right, let's shift gear to the next one which is context. This is where all your information goes. documents, data, background details. Think of this as your single source of truth. If you have done this for a while, then you probably know that the context is typically where you have the most information. And this is another thing that is good to know that the optimization actually differs a little bit depending on which model you use here. So for example, if you use GPT, Claude or Gemini, general rule is that the more context the better. So just use as much context window as you can. If you're again using the reasoning models 03 and 04 mini, less is more. Too much context actually overwhelms the reasoning process. And if you're using perplexity, then try to keep this section more search friendly. So oriented against search because that is the way perplexity works. And avoid like generic prompts.
Moving on to example. Generally speaking, this section is very powerful but also optional. The general idea here is that you want to show the model a couple of examples of what good looks like. This is often times referred to as few shoting. If you only provide it with one example, that's a one shot. And if you provide it with no examples, that's a zero shot. Now, let's go model specific. If you are using GPT, Claude, and Gemini, then examples are your secret weapon. If you feed your prompt with three to five examples, that will dramatically improve consistency and output. and they're especially powerful when you need consistent tone or specific formatting. For the reasoning models 03 and04 mini skip this section entirely. This may sound a bit counterintuitive, but it has been researched and that research showed that few shot prompting consistently degraded 01 and 03 performance. And the official documentation recommends that you try with zero shot first when using these models. And if needed, you can move to a oneshot. And here's a big one. If you're using perplexity, then skip examples completely because it confuses the search mechanism. Including examples in the prompt can confuse the retrieval layer by unintentionally triggering searches on those examples rather than answering your query.
All right, it appears like my ghost have appeared here. That's okay. Double the fun. Let's move on to the output. And this is where you specify your desired output. Be surgical about how you want the response formatted. And really, that's the pro tip. The more specific you are here, the less editing you'll need to do. So instead of saying something generic like create a table, say create a markdown table, three columns. Column one is feature, column two is us, and column 3 is the competitor. For length, specify number of words, like say 3 to 400 words. Don't just say brief. And for structure, specify the flow. So say like I want summary first, then analysis, then recommendations, whatever structure that floats your wrote. An interesting model specific setting to note. And actually this is not specific to the output section, but good to know. Nevertheless, Claude 4 responds better to positive framing rather than negative. So it's much better to say do X rather than like don't do Y.
All right, moving on to constraints. Here you can basically establish your guard rails. So what to avoid, style rules, boundaries, and as for the rest of the framework, specific constraints will always work much better than vague ones. So for example, maximum three sentences per paragraph.
Let's go to the last section, which is the instructions. So this is where you can apply fairly advanced techniques, but also be aware that this is where most people also screw it up. So an example here would be think through your approach step by step, then provide the final answer in the requested format. This technique is often times referred to as chain of thought. You can also steer it on grounding here. So if information is missing or uncertain, state this explicitly rather than guessing. This will reduce hallucinations. Another good technique to reduce hallucinations is to say something along the lines of um when you make a statement, give me a percentage of how sure you are about the statement itself. And that will then cause the model to reflect on whether the statements are likely to be true or not. And also for you to then be able to prompt chain and say, "Hey, for those statements that you aren't sure about, go fetch me the information to update those to 100% rather than 60 or 70 or whatever they land on." And this is another section where if you're using the reasoning models 03 and 04 mini, just remove this section completely because those models have a hidden chain of thought built into them. So double stating that it should do that here will not give you anything. It just induces risk of confusion. And generally speaking with reasoning models, telling them how to think tends to actually hurt their performance. And OpenAI is explicitly stating that you should avoid chain of thought prompts with reasoning models. But that does not apply for standard models because there you need to guide them. Thinking step by step is going to increase the performance significantly. I've seen some research that point towards 20 to 30%. I don't know if it's true or not, but it will definitely elevate the performance of the models.
Quick pause. I have a favor to ask you. If you're enjoying the video so far, you should consider becoming a part of the small but very exclusive group of around 5% of viewers that have subscribed. And if you've already subscribed, I just want to say thank you. You're the reason why this channel keeps growing and keeps getting better.
Chain verification is a prompting technique where the AI doublech checkcks its own reasoning, spotting possible gaps, cross-refferencing evidence, and refining answers before giving you the final results. So, four steps here. First, identify at least three potential gaps or uncertainties in your reasoning. You can adjust the number here if you want to. Second, reference the evidence that supports or contradicts each. Third, revise your summary accordingly. And lastly, present only the final verified version. Now, this actually works great for Chat GPT, Claude, and Gemini. And you can add this in the instruction section when needed. Just be aware that cramming the instructions with all of these meta prompts will deteriorate performance. So, don't do all of them by default. Also, perplexity works a little bit differently due to the core mold's retrieval augmented approach where prompts trigger live searches. So, this would again be one of those risk factors where you could potentially confuse the retrieval layer. So, a better way of doing chain of verification if you're a perplexity user is to have it as a follow-up prompt after you've received the first answer.
Reverse prompting flips the usual process. So instead of you writing the perfect prompt, you tell the AI what you want and then let it design and run the optimal prompt to achieve it. And the reason why this works is because the model knows what kind of instructions it responds best to. Every system has its own little internal prompting dialect. So by allowing it to design the prompt itself, it will tailor the words, structures, reasoning steps to its own strengths. And this can honestly oftentime produce clearer and more accurate results than human crafted prompts. Let's take a look at an example. I want to and then you input your task or goal. So that would be the example that we looked at earlier. Analyze the competitive positioning of our SAS products. You don't need to plug in the subworkflows here. the main objective will be enough and then write the optimal prompt that would generate the best possible result for this task following prompt engineering best practices. The last piece here then execute that prompt and show me the final answer is optional. I actually prefer to skip this and then look at the prompt before I execute it. Potentially tweak it a little bit and then fire it off myself. But just be aware that you can approach it this way in case you want to.
So context engineering is forecasted to be like the next AI thing in 2026. And it's essentially about how AI uses the right context to deliver the right information for you. And really there are kind of two main components of context engineering. First is how you as a user prompting in your chat window become more proficient at leveraging contextual information for the task you're solving. This could for example be by connecting external databases through rag agents or using memory features that most of the platforms now have enabled. And then secondly is how developers enable the use of context for users. And this would be by setting up access to external databases like your rags or building automated workflows that better incorporates relevant data. And a very common misconception is that context engineering will somehow make prompt engineering obsolete. This is simply not true. And if someone says this to you, you should call BS. Prompt engineering is the way you interact with the model. And context engineering is the way you feed the model with the right information. and the two work together to enhance the model's output. Thinking that prompt engineering isn't worth learning anymore would be like saying it's not worth getting a driver's license because self-driving cars are coming. And while both of those statements are likely true someday, that would still be years away. And honestly, if anything, prompt engineering will likely get more advanced, not less. Because as we learn more about the models and as new features gets rolled out, you would need to make sure that you can prompt effectively. So keep your prompt engineering skills sharp. It will put you ahead of the curve.
All right, that was it. And now you've learned how to prompt engineer across the various platforms. I hope you found the video useful. Let me know if you did and let me know if you didn't. This channel is for you, so your feedback really matters. In case you want to continue your learning path, I will post a video right here showing you how to go from a beginner to an advanced user of Plexity. And with that said, thanks again for trusting me with your time and happy prompting.