Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
Kseniase 
posted an update 4 days ago
Post
3526
From Prompt Engineering to Context Engineering: Main Design Patterns

Earlier on, we relied on clever prompt wording, but now structured, complete context matters more than just magic phrasing. The next year is going to be a year of context engineering which expands beyond prompt engineering. The two complement each other: prompt engineering shapes how we ask, while context engineering shapes what the model knows, sees, and can do.

To keep things clear, here are the main techniques and design patterns in both areas, with some useful resources for further exploration:

▪️ 9 Prompt Engineering Techniques (configuring input text)

1. Zero-shot prompting – giving a single instruction without examples. Relies entirely on pretrained knowledge.

2. Few-shot prompting – adding input–output examples to encourage model to show the desired behavior. ⟶ https://arxiv.org/abs/2005.14165

3. Role prompting – assigning a persona or role (e.g. "You are a senior researcher," "Say it as a specialist in healthcare") to shape style and reasoning. ⟶ https://arxiv.org/abs/2403.02756

4. Instruction-based prompting – explicit constraints or guidance, like "think step by step," "use bullet points," "answer in 10 words"

5. Chain-of-Thought (CoT) – encouraging intermediate reasoning traces to improve multi-step reasoning. It can be explicit ("let’s think step by step"), or implicit (demonstrated via examples). ⟶ https://arxiv.org/abs/2201.11903

6. Tree-of-Thought (ToT) – the model explores multiple reasoning paths in parallel, like branches of a tree, instead of following a single chain of thought. ⟶ https://arxiv.org/pdf/2203.11171

7. Reasoning–action prompting (ReAct-style) – prompting the model to interleave reasoning steps with explicit actions and observations. It defines action slots and lets the model generate a sequence of "Thought → Action → Observation" steps. ⟶ https://arxiv.org/abs/2210.03629

Read further ⬇️
Also subscribe to Turing Post: https://www.turingpost.com/subscribe
  1. Prompt templates – reusable prompt structures with placeholders for inputs.

  2. Retrieval-augmented prompting – injecting external information into the prompt. ⟶ https://arxiv.org/abs/2512.04106

P.S. These are only the main prompt engineering techniques, but there are much more. Here's a good survey where you can find them: https://arxiv.org/pdf/2402.07927


▪️ Context Engineering (designing the information environment the model operates in)

  1. Retrieval-Augmented Generation (RAG) – dynamically injecting external knowledge retrieved from databases, search, or vector stores.

  2. Tool calling / function calling – enabling the model to use external tools. (APIs, calculators, code, search). They return extra info that the model needs to perform the task.

  3. Structured context – providing schemas, JSON, tables, or graphs instead of free-form text.

  4. System prompts / policies – persistent high-level instructions that govern behavior across interactions. ⟶ https://arxiv.org/abs/2212.08073

  5. Short-term memory – passing recent interaction history or intermediate state; summarizing information from the ongoing conversation. ⟶ https://arxiv.org/pdf/2512.13564

  6. Long-term memory – storing and retrieving user profiles, facts, or past decisions and conversations over time. ⟶ https://arxiv.org/abs/2503.08026

  7. Environment state – exposing the current world, task, or agent state (files, variables, observations).

  8. Multi-agent context – sharing state or messages between multiple LLM-based agents. ⟶ https://arxiv.org/abs/2505.21471

this is a very good study. it reminded me of a time a few years ago when i found things like "few shots" and similar things ridiculous; that was a big mistake.

Prompt Engineering and Context Engineering are complementary sides of the same LLM interaction process: the former crafts efficient input phrasing (like Zero-shot or Chain-of-Thought) that's cheaper and sufficient for most tasks due to minimal token usage, while the latter builds richer data environments for complex scenarios. Start with cost-effective Prompt Engineering for 80% of needs, escalating to Context Engineering only when extended knowledge or tools are required, as in your LM-Studio caching optimizations.

In this post