Prompting Techniques and Logical Mimicry

Data Scientists and Prompt Engineers have a commonality — maintaining a toolkit of techniques and the expertise on which to deploy and when

Prompting Techniques and Logical Mimicry

Imagined by Bing Image Creator powered by DALL-E using the following prompt: “A toolkit imbued with technological circuitry inside of a digital toolbox”

Prompt Engineering roles within organizations seeking to capitalize on the “AI Moment” are buzzing around LinkedIn and other job-posting sites. Many hype actors are claiming that Prompt Engineering is a lucrative role that simply involves understanding natural language (i.e fluency in a native language) and approximately two hours of learning. Truth of the matter is that becoming a Prompt Engineer is quite complex and is shifting to be more analogous with Data Science.

Aside from the technical skills involved in both career paths, both, at its core, require a fundamental knowledge of the tools and methodologies available at their disposal. For example, a Data Scientists maintains a working knowledge set of the available modeling algorithms used in practice such as K-nearest neighbor (KNN), random forest, multiple linear regression, neural networks, logistic regression, decision trees, native bayes, and more. Furthermore, when tackling a data science problem, multiple algorithms are employed, tuned, and optimized to then determine the model that both has the lowest mean square error (MSE) and the right level of prediction accuracy without overfitting, typically shown in a confusion matrix. Aside from other technical skills such as feature engineering, data partitioning, and general programming (typically inside of notebooks).

Prompt Engineers require an analogous set of tools, but instead of algorithms, they are prompting techniques. Many scientific communities are still racing to uncover new prompting techniques as well as understand both the nuances and “black box” workings of LLM reasoning to determine the optimal results. As new LLM models are being released into the market, researchers are utilizing these prompting techniques against widely available models to cross compare how both the techniques vary within a specific model but differences across models.

What has become apparent in reading through the scientific papers and abstracts is that many of the prompting techniques mimic logical reasoning humans undertake, just instead of learning them in school (say… to solve word problems in math), scientists are applying them against large language models.

Here is a brief summary of the most popular prompting techniques available within a Prompt Engineer’s toolkit:

  1. Zero-shot Prompting — This technique involves providing a prompt to the model without any prior examples. It’s useful when you want a quick response without training the model on similar tasks. However, it may not always provide the most accurate results due to the lack of context.
  2. Few-shot Prompting — Few-shot prompting is a technique that involves providing a model with a few examples before the actual prompt, as opposed to zero-shot prompting. This can help in improving the accuracy of the model’s responses, but it requires more preparation. Few-shot prompting is based on the idea that models can learn from a few examples and generalize to new tasks. It is useful for tasks that require some domain knowledge or specific skills, such as translation, summarization, or sentiment analysis.
  3. Chain-of-Thought (CoT) Prompting — This technique involves providing a series of related prompts to guide the model’s responses. The engineer will take a large problem and break the problem into sub-components, chaining the output of one sub-task as the input to the subsequent task. This method is particularly useful for complex tasks that require multiple steps or stages. This allows for a more systematic and step-by-step exploration of the task at hand. However, this technique might be more time-consuming than other techniques due to the need to carefully design and sequence the prompts. Despite this, it’s a powerful tool for managing complex tasks and guiding the model towards desired outputs.
  4. Tree of Thoughts (ToT) - Tot builds upon the concepts presented by Chain of Thought prompting by structuring the prompts in a hierarchical manner, similar to a tree diagram rather than a linear chain. This method is particularly useful for tasks that involve multiple sub-tasks or categories. In this approach, each branch of the “tree” represents a different line of thought or category, and the model navigates through these branches based on the prompts and its responses. This allows for a more organized and systematic exploration of the task at hand. However, this technique requires careful planning and organization to ensure that the tree structure accurately represents the task’s complexity and various aspects.
  5. Retrieval Augmented Generation (RAG) — a technique that combines the strengths of both retrieval-based and generative models to provide more accurate and diverse responses. In this approach, the model first retrieves relevant documents or passages from its training data (the retrieval phase). Then, it uses these retrieved documents to generate a response (the generation phase). This allows the model to leverage the specific information contained in the retrieved documents, leading to more informed and contextually relevant responses. However, implementing RAG might be more complex than other techniques due to the need for both retrieval and generation components.
  6. Analogical Prompting — Analogical prompting is a technique that prompts large language models (LLMs) to self-generate relevant examples or analogies before solving a new problem. This technique aims to mimic the human reasoning process of recalling related problems and deriving insights from them and pulling upon the vectorization architecture within the LLM. This technique also eliminates the need for manual labeling of examples and tailors them to each individual problem.
  7. Step-Back Prompting — a technique that enables Large Language Models (LLMs) to perform abstractions, derive high-level concepts, and first principles from instances containing specific details. This method involves adding an additional prompt to give the model the freedom to do some abstract thinking before addressing the primary question. The process works in two steps (1) Abstraction: Rather than addressing the question head-on, the LLM is first prompted to ask a more generic question about a high-level concept, still related to the main question. (2) Reasoning: Using the first prompt and answer as a grounding mechanism, the LLM can now more accurately reason about a solution to the main question. This technique has been shown to significantly improve LLMs’ abilities in following a correct reasoning path towards the solution. It has been observed to yield substantial performance gains on a wide range of challenging reasoning-intensive tasks including STEM, Knowledge QA, and Multi-Hop Reasoning.
  8. Role Prompting — a technique used in prompt engineering to control the output generated by an AI model by assigning it a specific role. For example, the model can be asked to act as a poet, a comedian, a doctor, or a lawyer. This technique is particularly effective because it provides the model with some context about how it is expected to respond, given the particular role. The more information and details given to the model in the prompts, the higher the chances of getting accurate and relevant responses. By giving the AI a role or expertise, users can better tailor their interactions and narrow the focus of the conversation. This makes Role Prompting a powerful tool for generating more relevant, domain-specific, and context-specific responses.

There are tons more techniques available and emerging. I’ve found this page particularly helpful:

Remember that humans are inherently the ones building artificial intelligence to mimic human intelligence and reasoning. Its only appropriate that the mathematical representations we build of the human mind (such as artificial neurons) only function as such and require similar prompts and techniques as we do to reason.

If you are an AI practitioner or anyone genuinely interested in playing around with Large Language Models, I encourage you to try some of these techniques on your own to understand the nuances between them and find the technique that fits your problem best. Happy prompting!


Sam is passionate about empowering people to innovate, understand, and transform the world utilizing ground-breaking Conversational Artificial Intelligence technology. He seamlessly melds business acumen, technological know-how, and creative vision to identify, prioritize, and resolve his client’s most daunting problems to ensure their competitive edge in the marketplace.

Follow me on LinkedIn