Bespoke websites for real business impact, true responsive architecture, zero bloatware, WordPress FSE & Next.js 15, 100/100 Core Web Vitals.
DEVPIXEL
Back to all articles

A 4-Step Technical Prompt Engineering Framework for Large Language Models

October 14, 2026DevPixel EngineeringDevPixel Engineering12 min read0 views
AI & Workflow Automation

A 4-step framework for technical prompt engineering: Role definition, context provisioning, instruction standardization, and output structuring for LLMs.

DEVPIXEL / MEDIA LIBRARY
A 4-Step Technical Prompt Engineering Framework for Large Language Models

With the exact same question, one person might ask AI and get immediately usable results, while another receives a generic paragraph that leaves them wondering what to do next. The difference lies in the amount of context you feed into the prompt, not in who knows some secret command.

The four steps in this guide are Role, Context, Detailed Requirements, and Output Standardization. Each step includes concrete examples, and the final section puts them all together into a complete prompt—along with a side-by-side comparison between a weak prompt and a fully-formed 4-step prompt, 3 advanced techniques, and a self-check checklist before you hit send.

Step 1 · Role: Tell the AI who it should think as

4-Step Technical Prompt Design Process for Large Language Models
Practical process: 4-Step Technical Prompt Design Process for Large Language Models

This is the mindset-framing step. If you simply say “write this for me”, the AI will usually respond in a generic manner. But if you clearly specify “act as” a short-form video scriptwriting expert, the AI will prioritize the mindset, structural choices, and output standards that closely align with that specific expertise.

What makes a good role?

A good role is more than just a job title. It should be specific enough for the AI to understand which expertise to prioritize.

  • Title: what kind of expert, working in which field.
  • Scope: writing short videos, copywriting, product consulting, optimizing writing style.
  • Priorities: natural, concise, authentic Southern Vietnamese tone, avoid repetitive words.

Quick tip

If you don’t know how to define a role properly, you can start with: “Act as an expert in … with practical hands-on experience and a focus on clarity and simplicity”.

Good vs. Insufficient Examples

Insufficient: “Write me a short video script”. This prompt doesn’t specify what standards the AI should follow.

Better: “Act as an expert short-form video scriptwriter for TikTok, focusing on strong hooks, short sentences, easy-to-read phrasing, and a natural tone”.

By assigning a role, you significantly reduce the chance of the AI giving an overly broad answer or missing your actual needs. Why does a simple “role-play” line change the entire result?

Without a role, the model has to guess what level of expertise you need, so it defaults to a safe, average response tailored to a general audience. When you assign a specific role, the model narrows its knowledge base and tone to that exact domain before generating the very first sentence – which is why the same request can produce drastically different results just by adding a role.

Roles applied in other fields

Business

“Act as a B2B sales consultant, prioritizing data-driven arguments and concrete benefits.” Learning

“Act as a tutor who explains difficult concepts using everyday examples, avoiding academic jargon.”

Content Writing

“Act as a content editor, prioritizing short sentences, a natural tone, and no clichés.”

Step 1 • Role
Act as a [specific role] specializing in [area of work].

Prioritize working style: [desired output standards].
Avoid: [undesired errors or styles].

Step 2 · Context: Tell the AI what you are trying to do, for whom, and what the challenges are

This is the part that transforms a prompt from “generically correct” to “tailored to your situation”. The AI needs to understand the goal, audience, platform, tone, and practical constraints. The clearer the context, the less editing the response will require.

Goal

Do you want to grow followers, generate sales, educate the market, or build a personal brand? Audience

Beginners, business owners, marketing professionals, or end consumers?

Constraints

Southern dialect, conversational tone, no repetitive words, not too long, exactly 30 seconds.

Recommended Context Checklist

  • Platform: TikTok, Reels, Shorts, email, landing page…
  • Output goal: sales, lead generation, explanation, inspiration…
  • Target audience/listener: who they are, their level of expertise, their pain points.
  • Tone of voice: natural, approachable, authoritative, cheerful, compelling.
  • Things to avoid: repetitive words, clichés, overly academic, overly promotional.

Example of Proper Context for a Short Video Case

“I want to write a short video script for a series sharing AI tips.”

“The target audience is AI beginners, non-professionals who want professional results but don’t know how to write prompts yet.”

“Natural Southern Vietnamese accent tone, conversational, without repetitive words.” Common Mistake

Many people only state general goals like “write well”. This phrase is too broad. Replace it with something verifiable: write concisely, easy to speak, strong hook, beginner-friendly, Southern tone, no repetitive words.

Why does a lack of context make the response “correct but useless”?

The AI doesn’t know who you’re talking to or where this will be used, so it defaults to a neutral tone and a safe length – accurate enough not to be wrong, but not tailored enough to be used immediately. When you provide the AI with your goal, target audience, and constraints, it no longer has to guess, and you significantly reduce the number of revisions.

Context application in other fields

Business

“I need a quotation proposal to send to a purchasing director; they are busy and only skim, prioritizing figures.” Studying

“I am studying for my midterm exam in Probability and Statistics; I need examples that are easier to visualize rather than formulas.”

Content Writing

“An article to be published on a personal blog, targeted at fresh graduates / new jobbers, with an approachable tone like friends sharing with each other.”

Step 2 • Context
My context:
- I want to [specific objective]
- My target audience is [who]
- Platform/usage context is [TikTok/Reels/email/...]
- Desired tone: [natural/expert/conversational/Southern accent...]
- Things to avoid: [repetitive words/clichés/too lengthy...]

Step 3 · Detailed requirements: This is the time to assign specific tasks to the AI

Once the AI has the role framework and context, you can start assigning the tasks. This section must be clear about quantity, structure, length, mandatory conditions, and desired variations. In short: the more measurable it is, the easier it is to get it right.

What needs to be specified?

  • Quantity: 1, 5, 10, or 20 versions.
  • Length: 20-30 seconds, 120 words, 8 sentences.
  • Structure: Hook, Body, CTA.
  • Variations: each hook in a different style.
  • Mandatory requirements: include examples, a CTA, visuals, and text on screen.

Examples of clear task assignment

“Write me 10 short video scripts on the topic of the 4-step prompt writing process.”

“Each script should be 20-30 seconds long, consisting of a 1-sentence Hook, a 4-6 sentence Body, and a 1-sentence CTA.”

“The hooks need to be diverse: include questions, counter-arguments, shock statements, and storytelling.”

Do

  • Specify exact quantities instead of saying “write a few.”
  • Specify the desired length or duration.
  • Outline the structure if you need consistent results.
  • State what must be included in each output.

Don’t

  • Give vague instructions like “make it good.”
  • Leave AI to guess the quantity and length.
  • Mix multiple unrelated requirements into an overly long sentence.
  • Expect AI to understand the format if you haven’t clearly defined it.

Why do vague requests always produce skewed results?

When you say “write a few,” the AI has to decide the quantity, length, and structure for you – and it usually defaults to an average that doesn’t match your actual needs. Any metric you don’t specify will be determined by the AI; therefore, the more measurable your prompt is, the higher the chances of getting exactly what you want.

Detailed Requirements Applied to Other Fields

Business

“Write 3 sales closing email variations, each under 120 words, with 1 open-ended question at the end.” Learning & Study

“Summarize Chapter 3 into 10 bullet points, each under 20 words, with 1 illustrative example included.”

Content Writing

“Write 5 blog post headlines, each under 60 characters, with at least 1 specific number.”

Step 3 • Requirements
Requirements:
Please create [number] variations of [output type] on the topic [topic].

Each variation must have:
- Length: [x seconds/x words]
- Structure: [Hook / Body / CTA]
- Must include: [examples/metrics/CTA/visuals...]
- Must not include: [mistakes to avoid]

Step 4 · Standardize the response: Force AI to return results in the exact format you can use immediately

Many people skip this step, but it actually saves the most time. When you clearly specify that you want the response as a table, bullet points, or a labeled template, the AI will present it more concisely, making it easier to copy and convenient to reuse in your daily work.

Common Formats

  • Tables: best when you need multiple ideas or multiple versions.
  • Bullet points: best for quick reading and summaries.
  • Labeled templates: best when you need to copy to other tools or create videos.

Example for a short video use case

Instead of receiving a long block of text, you can ask AI to return the output in a table format with the following columns:

Title | Hook | Main Content | CTA | Visual Suggestion | Text on screen

Then, all you need to do is review it, pick the best ideas, and move on to the filming or editing stage.

⇄ Swipe horizontally to view full table
Format When to use Example prompt
Table When you need multiple variations, easy comparison, and filtering “Return the results in a table with columns: Hook, Body, CTA, Visual”
Bullet points When you want to skim quickly or finalize key ideas “Present each idea as a concise bullet point”
Labeled template When you want to copy it directly into a script, Notion, or editing file “Format each script using the labels [Hook], [Body], [CTA]”

Why does formatting save the most time?

The previous three steps determine what the AI thinks and writes, while this step determines whether you can use the output immediately or have to reformat it manually. Specifying the presentation format before the AI writes is always much faster than receiving a wall of text and having to reorganize it yourself.

Formatting applied in other fields

Business

“Return a comparison table of 3 service tiers, columns: Tier Name, Price, Key Benefits.” Learning & Study

“Present using the template: [Concept] – [Explanation] – [Example] – [Common Mistakes].”

Content Writing

“Write following the structure: Hook – 3 numbered key points – Conclude with an engagement-prompting question.”

Step 4 • Formatting
Present the results in the following format:
- Presentation style: [table / bullet points / labeled template]
- Required columns or sections: [list of columns/sections]
- Tone/Style: [concise / succinct / easy to read / easy to copy]

Summary Prompt: Combining the 4 Steps into a Complete Prompt

Once you understand the 4 parts above, you can combine them into a standardized prompt for repeated use. This is the most important part if you want to turn trial-and-error experience into a fixed working template.

Complete Prompt
Act as a [specific role] specializing in [field of work].

My context:
- Goal: [specific goal]
- Target audience: [who]
- Platform/context: [TikTok/Reels/email/...]
- Tone of voice: [natural/expert/conversational/Southern dialect...]
- Things to avoid: [repetitive words/clichés/overly long...]

Requirements:
Please generate [quantity] [type of output] about [topic].
Each version must include:
- Length: [x seconds/x words]
- Structure: [Hook / Body / CTA]
- Mandatory elements: [mandatory requirements]
- Must not contain: [things to avoid]

Present the results in the following format:
- Presentation style: [table / bullet points / template]
- Required columns or sections: [required columns]
- Writing style: [concise / easy to read / easy to copy]

If critical data is still missing, ask me up to 3 questions before starting.

The Final Step for Long-Term Reuse

Once the AI responds accurately to your expectations and you are satisfied, ask it to distill all the requirements into a more concise prompt for repeated use. That is how you turn a successful chat into a reusable workflow asset.

Refinement Prompt
Now, distill all the above requirements into a single standard, concise, and clear prompt that can be copied and reused multiple times specifically for this task.
Maintain the 4-step structure: Role / Context / Request / Format.
Include a [Variables to Replace] section so I can make quick adjustments in future runs.

Case study: A weak prompt vs. a prompt applying all 4 steps

To clearly see the difference, here is the same request – writing ad copy for an AI course – written in two ways: a typical brief prompt and a prompt that goes through all 4 steps: Role – Context – Task – Format.

Before: Weak prompt

“Help me write ad copy for an AI course.”

After: Applying the 4 steps

“Act as an online course copywriting expert. The target audience is beginners who have never studied AI and are intimidated by complex technology. Write 3 Facebook caption variations, each under 80 words, featuring an intriguing hook and a clear CTA. Present as a numbered list, avoiding buzzwords like ‘breakthrough’ or ‘revolutionary’.” Where does the difference lie?

The weak prompt leaves almost everything up to the AI to decide: tone of voice, length, audience, quantity, formatting – resulting in generic output that requires heavy editing. The 4-step prompt isn’t much longer, but it locks down every crucial decision, leaving little room for the AI to guess incorrectly.

Advanced: 3 Techniques to Make the 4-Step Prompt Even More Effective

The 4 steps above are sufficient for most everyday tasks. However, for more complex tasks – requiring absolute tone accuracy, multi-step reasoning, or high precision – you can combine the following 3 techniques, which are commonly used in prompt engineering.

1. Few-shot: Show the AI examples before it starts

Instead of just describing with words, you provide 1–3 examples in the exact desired style for the AI to mimic, rather than having it guess from text alone.

Ideal when you need to maintain a consistent writing style, format, or tone across multiple outputs – such as keeping a consistent brand voice across dozens of articles.

2. Chain-of-thought: Prompting step-by-step thinking

Adding phrases like “think step by step before answering” forces the AI to present its reasoning before concluding, rather than jumping straight to the answer.

Suitable for tasks requiring calculations, comparing multiple options, or logical decision-making – for example, choosing a content strategy or analyzing data.

3. Self-critique: Let AI review its own response

After the AI responds, ask it to re-read its output and identify weaknesses, gaps, or mismatches with the original request – then rewrite a better version. This method often catches mistakes that you might overlook on the first read.

Self-Critique Prompt
After writing, re-read your response and point out:
- Where it does not match the original requirements
- Where it is too general and lacks specificity
- Where it can be shortened without losing meaning

Then, rewrite a more polished version based on the points identified above.

Quick Checklist: Self-checking prompts before sending to AI

5 Final Self-Check Questions

  1. Is the role specific enough, or is it still too generic?
  2. Does the context clearly state the objective, audience, tone, and what to avoid?
  3. Are the requirements measurable: quantity, length, structure, and non-negotiables?
  4. Does the output format allow you to use it immediately?
  5. If the AI lacks data, have you instructed it to ask follow-up questions before proceeding?

Read more

#Best Practices#Generative AI#LLM#Prompt Engineering
Share articleFacebook X
CỘNG ĐỒNG KỸ THUẬT

Thảo Luận (0)

DEVPIXEL FORUM

Chưa có bình luận nào. Hãy là người đầu tiên chia sẻ góc nhìn!

Để lại bình luận của bạn