Prompt Engineering via Prompt Patterns — Reflection Pattern
The article is part of series: Prompt Engineering via Prompt Patterns
You can switch to video version of this article
Free AI web copilot to create summaries, insights and extended knowledge, download it at here
1670
Abstract
nclusion, what was the rationale and what kind of assumptions were involved in generating that output. One really simple example can be if you ask it to suggest a hotel in a city you are visiting and you are given a sharp crips response ‘The Plaza Hotel’. Wouldn’t you be left scratching your head as to how and why it picked this one out of dozens if not hundreds of options and whether it suits me or not?</p><p id="12c8">This is where reflection pattern can help. The goal of this pattern is to make the model explain the rationale behind the answer it came up with. This helps you assess the answer’s validity as well as provides you insight as to how the model came up with this particular response. This pattern helps clarifying assumptions, avoid confusion and reveal gaps in knowledge or understanding. It may also reveal what kind of data or inputs were involved in creating the response in question, and what kind of processing the model performed to prioritize some options over the other.</p><p id="7526">With the available output, you not only understand the inner details of how model generated the output, you are also able to address any shortcomings or issues with the default answer by incorporating the additional information to refine your prompt. You are also better able to guage the accuracy of this response. This is an excellent tool if you are not getting expected output and know you need to refine your prompt, but are not sure what changes would lead to expected results. The information generated with this pattern helps you debug your original prompt and help you fix any shortcomings efficiently. Note, however, that the pattern is only he
Options
lpful if you can meaningfully interpret the details it provides.</p><p id="0be8">The contextual statements for this pattern are</p><p id="1a5c">Whenever you generate an answer, explain the reasoning and assumptions behind your answer.</p><p id="7a3c">(Optionally) so I can improve my answer.</p><p id="1432">This not only instructs LLM to explain the reasoning and assumptions, it also tells the model that intention is to improve the question. This helps model tune the answers to that specific purpose.</p><p id="8329">The pattern can be used in variety of examples. We already covered the hotel case where this can be effectively used. Coming up with another</p><p id="5393">Please suggest the three best authors for children’s books ages 5–10. When you provide an answer, please explain the reasoning and assumptions behind your response. If possible, use specific examples or evidence to support your answer as to why they are the best options. Moreover, please address any potential ambiguities or limitations in your answer, to provide a more accurate response.</p><p id="672b">That was it for reflection pattern. Please like/share if article seemed useful. You can also consider subscribing to our <a href="https://www.youtube.com/@LearnAwesome">YouTube channel</a> as well. Thank you!!!.</p><p id="e2f7">Next article: <a href="https://readmedium.com/prompt-engineering-via-prompt-patterns-refusal-breaker-pattern-0abcc18f2898">Prompt Engineering via Prompt Patterns — Refusal Breaker Pattern</a></p><figure id="a426"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*KdsdvMnt6TErbLXFPVwztw.png"><figcaption></figcaption></figure></article></body>
The article is part of series: Prompt Engineering via Prompt Patterns
You can switch to video version of this article
Large language models, by definition, are just that. Models. They are learning algorithms trained on public information. They try to come up with most plausible response depending on various factors, but say if the training data on the topic is garbage, it would give garbage as response, resulting in incomplete, inaccurate or ambiguous output. Training data is not always to blame, reasons can include making assumptions and decisions out of a variety of possible options.
Then there are cases when there is an output where you are kept wondering why or how it came to this conclusion, what was the rationale and what kind of assumptions were involved in generating that output. One really simple example can be if you ask it to suggest a hotel in a city you are visiting and you are given a sharp crips response ‘The Plaza Hotel’. Wouldn’t you be left scratching your head as to how and why it picked this one out of dozens if not hundreds of options and whether it suits me or not?
This is where reflection pattern can help. The goal of this pattern is to make the model explain the rationale behind the answer it came up with. This helps you assess the answer’s validity as well as provides you insight as to how the model came up with this particular response. This pattern helps clarifying assumptions, avoid confusion and reveal gaps in knowledge or understanding. It may also reveal what kind of data or inputs were involved in creating the response in question, and what kind of processing the model performed to prioritize some options over the other.
With the available output, you not only understand the inner details of how model generated the output, you are also able to address any shortcomings or issues with the default answer by incorporating the additional information to refine your prompt. You are also better able to guage the accuracy of this response. This is an excellent tool if you are not getting expected output and know you need to refine your prompt, but are not sure what changes would lead to expected results. The information generated with this pattern helps you debug your original prompt and help you fix any shortcomings efficiently. Note, however, that the pattern is only helpful if you can meaningfully interpret the details it provides.
The contextual statements for this pattern are
Whenever you generate an answer, explain the reasoning and assumptions behind your answer.
(Optionally) so I can improve my answer.
This not only instructs LLM to explain the reasoning and assumptions, it also tells the model that intention is to improve the question. This helps model tune the answers to that specific purpose.
The pattern can be used in variety of examples. We already covered the hotel case where this can be effectively used. Coming up with another
Please suggest the three best authors for children’s books ages 5–10. When you provide an answer, please explain the reasoning and assumptions behind your response. If possible, use specific examples or evidence to support your answer as to why they are the best options. Moreover, please address any potential ambiguities or limitations in your answer, to provide a more accurate response.
That was it for reflection pattern. Please like/share if article seemed useful. You can also consider subscribing to our YouTube channel as well. Thank you!!!.
Next article: Prompt Engineering via Prompt Patterns — Refusal Breaker Pattern

Zakk YangStreamline Your Prompt Generation with the meta-prompt-generator Package
Scott LundbergExplore how clear syntax can enable you to communicate intent to language models, and also help ensure that outputs are easy to parse
Sara NóbregaHow to Leverage ChatGPT’s o1 and o3-mini for Better Responses
THE BRICK LEARNINGdspy is a powerful framework for Declarative AI that allows you to construct, optimize, and execute prompts effectively. It abstracts away…
Fareed KhanArchitecture and Training step by step