---
title: "Core prompt engineering techniques"
source: "https://systems-analysis.info/eng/Core_prompt_engineering_techniques"
wiki: "systems-analysis.info/eng"
article: "Core_prompt_engineering_techniques"
language: "en"
categories:
  - "Category:English"
  - "Category:Large language models"
  - "Category:Machine learning"
  - "Category:Prompt engineering"
  - "Category:Technology"
revision_id: 106
wiki_created_at: 2026-09-06T22:17:28Z
wiki_modified_at: 2026-09-06T22:17:28Z
downloaded_at: 2026-09-07T22:21:04Z
---

# Core prompt engineering techniques

**Prompt engineering** encompasses a variety of techniques and methods aimed at optimizing interaction with large language models (LLMs) to achieve desired results. These techniques involve structuring prompts, providing context, managing output style, and enhancing the model's reasoning abilities. Since LLMs generate responses by predicting subsequent tokens based on the input prompt, the quality and structure of the prompt directly influence the outcome. Core prompt engineering techniques allow developers and users to effectively control the model's behavior, reduce errors, and adapt it to specific tasks without needing to modify the model's internal parameters.

## Basic Principles and Prompt Structure

While specific implementations vary, effective prompts are often constructed based on common principles and structures:

- **Empirical guidelines:** One practical framework (though not an industry standard) suggests following these principles: Provide Direction, Specify Format, Provide Examples, Evaluate Quality, and Decompose the Task.
- An effective prompt often includes the following components:
  - **Introduction/Role:** Sets the context for the task or defines the model's role/persona.
  - **Instructions:** Clear directions on what needs to be done.
  - **Context:** Necessary information (either static or dynamically retrieved via RAG).
  - **Examples (Few-shot):** Demonstrations of the desired format/style.
  - **Output cue:** An explicit instruction for the model to begin generating the response.

<!-- -->

- **System Prompt:** In chat-based APIs (e.g., from OpenAI, Anthropic), this allows setting global instructions and a role for the entire session.
- **Formatting:** Using Markdown, JSON, XML, or YAML helps structure the prompt and simplifies parsing the response. Delimiters (\`\`\`, \`"""\`, XML tags) are important for separating instructions from data.

## Core Instruction and Example Techniques

- **Clear and specific instructions:** Describe the task, desired outcome, and constraints as precisely as possible. Avoid ambiguity.
- **[Role Prompting](https://systems-analysis.info/eng/Role_Prompting "Role Prompting"):** Assigning the model a role ("You are an expert in...") to control its tone, style, and knowledge base.
- **Zero-shot Prompting:** A prompt without any examples. Effective for simple tasks or those the model is already very familiar with.
- **Few-Shot Prompting:** Providing a few (typically 2 to 5) "question-answer" examples to demonstrate the task. A special case is **One-shot Prompting** with a single example. This is particularly useful for complex formats or styles. Care must be taken to avoid anchoring bias or the model picking up on spurious patterns from the examples.

## Context Management Techniques

- **Retrieval-Augmented Generation (RAG):** Dynamically adding relevant information from external knowledge bases to the prompt before sending it to the LLM. First proposed by Meta AI in 2020, this method is key to combating hallucinations and ensuring data currency.
- **Chunking:** Breaking down large texts into smaller pieces (chunks) to fit within the model's context window. Strategies include splitting by sentences, paragraphs, or tokens (with overlap).
- **Summarization:** Compressing long texts or conversation histories to convey the main ideas within a limited context.

## Reasoning Enhancement Techniques

These techniques aim to make the model "think" more carefully and structurally. The effectiveness of many of these, especially CoT, becomes apparent in large-scale models (typically those with over 100 billion parameters).

- **[Chain-of-Thought (CoT)](https://systems-analysis.info/eng/Chain-of-Thought_Prompting "Chain-of-Thought Prompting"):** Instructing the model to generate a step-by-step reasoning process before providing the final answer. This significantly improves performance on math, logic, and multi-step problems.
  - **Zero-shot CoT:** The simplest form, requiring no examples. Simply adding a phrase like "Let's think step by step" to the prompt can trigger a chain of reasoning.
- **CoT Variations:**
  - **Auto-CoT:** Automatically generating reasoning examples for few-shot prompting.
  - **Self-Consistency:** Generating multiple reasoning chains and selecting the most frequent answer through a "voting" process, which enhances reliability.
  - **[Tree-of-Thoughts (ToT)](https://systems-analysis.info/eng/Tree_of_Thoughts_(ToT) "Tree of Thoughts (ToT)"):** Exploring multiple reasoning paths in a tree-like structure, with the ability to backtrack and evaluate intermediate steps. This technique has shown high efficacy in complex problems, for example, increasing the success rate for solving the "Game of 24" from ~4% to ~74%.
  - **[Graph-of-Thought](https://systems-analysis.info/eng/Graph_of_Thoughts "Graph of Thoughts") (GoT), LogiCoT**, and others, which aim for more complex or logically verified reasoning.
- **[ReAct](https://systems-analysis.info/eng/ReAct_Prompting "ReAct Prompting") (Reason and Act):** A technique that extends [CoT](https://systems-analysis.info/eng/Chain-of-Thought_Prompting "Chain-of-Thought Prompting"). It involves an iterative cycle where the model alternates between Reasoning steps (Thought) and taking Actions with tools (Act), updating its understanding based on Observations.
- **[Self-Refine](https://systems-analysis.info/eng/Self-Refine_Prompting "Self-Refine Prompting"):** An iterative process where the model first generates a response, then critiques it, and finally refines it based on its own critique. This "generate-critique-refine" cycle can be repeated multiple times.
- **Take a Step Back Prompting:** The model first formulates general principles or abstractions and then applies them to the specific problem.

## Advanced Techniques: Agents and Tools

- **Tool Usage / Function Calling:** Giving an LLM the ability to call external APIs (e.g., search, calculator, database). The model generates a structured request to call a tool, which is executed by the application, and the result is returned to the model. Modern LLMs (like GPT-4 and Claude 3) have built-in support for this feature.
- **Agents:** LLM-based systems that can autonomously plan, use tools, and act to achieve a goal. They often use ReAct-like cycles. Frameworks like [LangChain](https://systems-analysis.info/eng/LangChain "LangChain"), AutoGen, and CrewAI simplify their creation.
- **Multi-agent systems:** The interaction of multiple specialized agents to solve complex problems.

## Techniques for Reducing Errors and Hallucinations

- **RAG:** Grounding responses in retrieved factual data.
- **Response constraint instructions:** Requiring the model to answer only based on the provided context or to indicate uncertainty ("If the answer is unknown, say 'I don't know'").
- **Citation prompting:** Requiring the model to cite its sources or quote parts of the context on which its answer is based.
- **Verification and self-critique:** Using techniques such as **Chain-of-Verification (CoVe)** (generating a response and then verifying and correcting it), Self-Refine, or directly prompting the model to check its answer for errors.
- **CoT:** The step-by-step reasoning process itself can reduce logical errors.

## Evaluation and Iteration Techniques

Although evaluation is a separate process, some of its aspects are part of prompt engineering:

- **A/B Testing Prompts:** Comparing the effectiveness of different prompt versions on the same tasks.
- **Using an LLM for evaluation:** Applying a powerful model (e.g., GPT-4) to assess the quality of responses generated by another prompt or model (LLM-as-a-Judge).

## Prompt Patterns

Common reusable structures:

- **Persona Pattern.**
- **Output Customization Pattern.**
- **Question Refinement Pattern.**
- **Cognitive Verifier / Self-Critique Pattern.**
- **Step-by-Step / Chain-of-Thought Pattern.**
- **Template Pattern.**

## External links

- <a href="https://en.wikipedia.org/wiki/Prompt_engineering#Prompting_techniques" class="external text" rel="nofollow">Prompting techniques — Wikipedia</a>

## See also

- [Large Language Models](https://systems-analysis.info/eng/Large_language_model "Large language model")
- [Chain-of-Thought Prompting](https://systems-analysis.info/eng/Chain-of-Thought_Prompting "Chain-of-Thought Prompting")
- [LLM hallucinations](https://systems-analysis.info/eng/LLM_hallucinations "LLM hallucinations")

## Bibliography

- Radford, A. et al. (2019). *Language Models are Unsupervised Multitask Learners*. <a href="https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf" class="external text" rel="nofollow">PDF</a>.
- Brown, T. B. et al. (2020). *Language Models are Few-Shot Learners*. <a href="https://arxiv.org/abs/2005.14165" class="external text" rel="nofollow">arXiv:2005.14165</a>.
- Lewis, P. et al. (2020). *Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks*. <a href="https://arxiv.org/abs/2005.11401" class="external text" rel="nofollow">arXiv:2005.11401</a>.
- Li, X. L.; Liang, P. (2021). *Prefix-Tuning: Optimizing Continuous Prompts for Generation*. <a href="https://arxiv.org/abs/2101.00190" class="external text" rel="nofollow">arXiv:2101.00190</a>.
- Liu, Y. et al. (2021). *Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity*. <a href="https://arxiv.org/abs/2104.08786" class="external text" rel="nofollow">arXiv:2104.08786</a>.
- Bai, Y. et al. (2022). *Constitutional AI: Harmlessness from AI Feedback*. <a href="https://arxiv.org/abs/2212.08073" class="external text" rel="nofollow">arXiv:2212.08073</a>.
- Wei, J. et al. (2022). *Chain-of-Thought Prompting Elicits Reasoning in Large Language Models*. <a href="https://arxiv.org/abs/2201.11903" class="external text" rel="nofollow">arXiv:2201.11903</a>.
- Wang, X. et al. (2022). *Self-Consistency Improves Chain of Thought Reasoning in Language Models*. <a href="https://arxiv.org/abs/2203.11171" class="external text" rel="nofollow">arXiv:2203.11171</a>.
- Kojima, T. et al. (2022). *Large Language Models are Zero-Shot Reasoners*. <a href="https://arxiv.org/abs/2205.11916" class="external text" rel="nofollow">arXiv:2205.11916</a>.
- Zhang, Z. et al. (2022). *Automatic Chain of Thought Prompting in Large Language Models*. <a href="https://arxiv.org/abs/2210.03493" class="external text" rel="nofollow">arXiv:2210.03493</a>.
- Zhou, D. et al. (2022). *Least-to-Most Prompting Enables Complex Reasoning in Large Language Models*. <a href="https://arxiv.org/abs/2205.10625" class="external text" rel="nofollow">arXiv:2205.10625</a>.
- Yao, S. et al. (2022). *ReAct: Synergizing Reasoning and Acting in Language Models*. <a href="https://arxiv.org/abs/2210.03629" class="external text" rel="nofollow">arXiv:2210.03629</a>.
- Besta, M. et al. (2023). *Graph of Thoughts: Solving Elaborate Problems with Large Language Models*. <a href="https://arxiv.org/abs/2308.09687" class="external text" rel="nofollow">arXiv:2308.09687</a>.
- Madaan, A. et al. (2023). *Self-Refine: Iterative Refinement with Self-Feedback*. <a href="https://arxiv.org/abs/2303.17651" class="external text" rel="nofollow">arXiv:2303.17651</a>.
- Schick, T. et al. (2023). *Toolformer: Language Models Can Teach Themselves to Use Tools*. <a href="https://arxiv.org/abs/2302.04761" class="external text" rel="nofollow">arXiv:2302.04761</a>.
- Rafailov, R. et al. (2023). *Direct Preference Optimization: Your Language Model is Secretly a Reward Model*. <a href="https://arxiv.org/abs/2305.18290" class="external text" rel="nofollow">arXiv:2305.18290</a>.
- Wang, Y. et al. (2023). *Self-Instruct: Aligning Language Models with Self-Generated Instructions*. <a href="https://arxiv.org/abs/2212.10560" class="external text" rel="nofollow">arXiv:2212.10560</a>.
- Yao, S. et al. (2023). *Tree of Thoughts: Deliberate Problem Solving with Large Language Models*. <a href="https://arxiv.org/abs/2305.10601" class="external text" rel="nofollow">arXiv:2305.10601</a>.
- Chen, S. Y. et al. (2023). *Extending Context Window of Large Language Models via Positional Interpolation*. <a href="https://arxiv.org/abs/2306.15595" class="external text" rel="nofollow">arXiv:2306.15595</a>.
- Chang, K. et al. (2024). *Efficient Prompting Methods for Large Language Models: A Survey*. <a href="https://arxiv.org/abs/2404.01077" class="external text" rel="nofollow">arXiv:2404.01077</a>.
- Genkina, D. (2024). *AI Prompt Engineering Is Dead*. *IEEE Spectrum*. <a href="https://spectrum.ieee.org/prompt-engineering-is-dead" class="external autonumber" rel="nofollow">[1]</a>.
- Li, Z. et al. (2024). *Prompt Compression for Large Language Models: A Survey*. <a href="https://arxiv.org/abs/2410.12388" class="external text" rel="nofollow">arXiv:2410.12388</a>.
- Liang, X. et al. (2024). *Internal Consistency and Self-Feedback in Large Language Models: A Survey*. <a href="https://arxiv.org/abs/2407.14507" class="external text" rel="nofollow">arXiv:2407.14507</a>.
- Han, H. et al. (2025). *Retrieval-Augmented Generation with Graphs (GraphRAG)*. <a href="https://arxiv.org/abs/2501.00309" class="external text" rel="nofollow">arXiv:2501.00309</a>.
- Li, W. et al. (2025). *A Survey of Automatic Prompt Engineering: An Optimization Perspective*. <a href="https://arxiv.org/abs/2502.11560" class="external text" rel="nofollow">arXiv:2502.11560</a>.
- Wu, Z. et al. (2025). *The Dark Side of Function Calling: Pathways to Jailbreaking Large Language Models*. *EMNLP 2025*. <a href="https://aclanthology.org/2025.coling-main.39.pdf" class="external text" rel="nofollow">PDF</a>.
- Yang, B. et al. (2025). *Hallucination Detection in Large Language Models with Metamorphic Relations*. <a href="https://arxiv.org/abs/2502.15844" class="external text" rel="nofollow">arXiv:2502.15844</a>.
