How does prompt structure affect AI responses? Lets explore why word order, formatting, and positioning are so important for AI prompts in the following article!
How does prompt structure affect AI responses? Let's explore why word order, formatting, and positioning are so important for AI prompts in the following article!
The structure is not optional.
Most people write prompts like emails—a stream of thoughts, in whatever order feels natural. And it works… to some extent.
But here's what the researchers discovered: The same information, rearranged, can significantly alter the quality of AI output. Word order is crucial. Formatting is crucial. Where you place the instructions is also crucial.
This lesson will analyze the reasons why – and how to structure questions for consistent results.
Attention problems
AI models don't read like humans. They process text through attentional mechanisms, where each part is assigned a different weight. And those weights aren't uniform.
Studies have shown a pattern known as 'mid-range loss'. AI remembers information from the beginning and end of a question better than in the middle. If you place your most important instruction in the third paragraph, the AI might miss it entirely.
- Think of it like a meeting : Everyone remembers the opening remarks and the closing summary. Everything in between fades away.
- Practical rule : Place important instructions at the beginning or end. Never bury them!
The structure of a prompt is well-structured.
This is a useful template for most complex tasks:
[NGỮ CẢNH HỆ THỐNG] - AI là ai, các ràng buộc tổng thể --- [HƯỚNG DẪN NHIỆM VỤ] - Phải làm gì, cụ thể và rõ ràng --- [DỮ LIỆU ĐẦU VÀO] - Nội dung cần xử lý --- [ĐỊNH DẠNG ĐẦU RA] - Định dạng chính xác của phản hồi --- [VÍ DỤ] - Kết quả đầu ra tốt trông như thế nào (tùy chọn nhưng rất hữu ích)
Each part has its own specific function. Mixing them up would cause confusion.
The power of the separator
Separators are characters used to separate parts. Common separators include:
- --- (3 hyphens)
- ### (3 hash signs)
- """ (3 quotation marks)
- Tag
Why are separators needed? Because AI can confuse your instructions with the content.
A poor prompt:
Tóm tắt khiếu nại của khách hàng này: Dịch vụ rất tệ và không ai giúp đỡ tôi, tôi muốn được hoàn tiền. Hãy giữ phần tóm tắt chuyên nghiệp và ngắn gọn.
Is 'Keep the summary professional and concise' part of your complaint or your guidance? The AI might not actually know.
Prompt is better:
Tóm tắt khiếu nại của khách hàng này trong 2-3 câu chuyên nghiệp. KHIẾU NẠI: Dịch vụ rất tệ và không ai giúp đỡ tôi, tôi muốn được hoàn tiền.
Now, there is no more ambiguity. The dividing line creates a clear boundary.
Order forms and instructions
Three reliable operating patterns include:
Template 1: Preliminary Guide
Viết một email chuyên nghiệp để từ chối lời mời gặp mặt. Ngữ cảnh: Người yêu cầu là một nhà cung cấp đang cố gắng bán phần mềm. Tôi không quan tâm nhưng muốn duy trì mối quan hệ. Giọng điệu: Lịch sự nhưng kiên quyết.
Best suited for : Simple, single-step tasks with clear instructions.
Pattern 2: Context first, instructions second.
Bạn là người quản lý cấp cao tại một công ty công nghệ. Một nhân viên đã yêu cầu được làm việc từ xa trong suốt thời gian. Chính sách công ty cho phép làm việc kết hợp (3 ngày tại văn phòng, 2 ngày làm việc từ xa). Nhân viên này đã hoàn thành công việc xuất sắc trong 4 năm. **Kiểm tra nhanh:** Trước khi tiếp tục, bạn có nhớ khái niệm chính mà chúng ta vừa thảo luận không? Hãy cố gắng giải quyết lại bằng lời văn của bạn trước khi tiếp tục. Vui lòng viết một bản phản hồi đã nhận được yêu cầu của họ để giải quyết các chế độ chính sách có giới hạn. Hãy sẵn sàng thảo luận thêm trong tương lai.
Best suited for : Tasks requiring in-depth understanding of the context before execution.
Pattern 3: The "Sandwich" Style (Instructions - Context - Instructions)
Phân tích dữ liệu bán hàng sau đây và xác định các xu hướng. [BẢNG DỮ LIỆU Ở ĐÂY] Dựa trên phân tích của bạn, hãy cung cấp: 1. 3 xu hướng hàng đầu 2. Một mô hình đáng quan tâm 3. Hành động được đề xuất
Best suited for : Complex tasks where you need to format content AND specify the output format.
Formatting that helps AI
Certain formatting options can actually improve the results:
Numbered list for sequential tasks:
1. Đọc tin nhắn của khách hàng 2. Xác định khiếu nại chính 3. Kiểm tra xem khiếu nại đó có phù hợp với chính sách đổi trả của chúng tôi hay không 4. Soạn thảo phản hồi phù hợp
Bullet points for parallel options:
Hãy xem xét các yếu tố sau: - Hạn chế về ngân sách - Áp lực về thời gian - Năng lực của nhóm - Tính khả thi về mặt kỹ thuật
Title for long prompts:
## Vai trò của bạn Quản lý sản phẩm cấp cao tại một công ty SaaS ## Nhiệm vụ Ưu tiên các tính năng trong danh sách công việc tồn đọng này ## Ràng buộc - Hạn chót ra mắt quý 1 - Chỉ có 3 lập trình viên - Không thay đổi hệ thống backend ## Các mục trong danh sách công việc tồn đọng [liệt kê tại đây]
Things that formatting cannot do.
A word of caution: Formatting won't fix an ambiguous requirement. Many people add Markdown headers and numbered lists to vague requirements, thinking it will help. But it won't help at all.
## Nhiệm vụ Hãy giúp tôi hoàn thành dự án ## Chi tiết Đây là dự án công việc ## Kết quả Hãy làm cho nó thật tốt
It's just organized ambiguity. The input is garbage, the output is also formatted garbage.
Structure enhances clarity. It doesn't create clarity.
Practice exercises
Consider this messy prompt:
Tôi cần bạn giúp tôi viết một bài giới thiệu cho khách hàng về tính năng mới mà chúng tôi sẽ ra mắt vào tuần tới. Đó là một bảng điều khiển hiển thị số liệu thống kê việc sử dụng của họ. Tôi muốn bài viết nghe hấp dẫn nhưng vẫn chuyên nghiệp, không quá dài, khoảng 100 - 150 từ, và nhớ đề cập đến bản dùng thử miễn phí.
Rewrite that paragraph using the appropriate structure, employing delimiters and clear sections.
Let's look at one solution:
## Nhiệm vụ Viết một thông báo khách hàng dài 100-150 từ về tính năng mới. ## Chi tiết tính năng - Tên: Bảng điều khiển sử dụng - Ra mắt: Tuần tới - Hiển thị: Thống kê việc sử dụng của khách hàng - Lưu ý: Có bản dùng thử miễn phí ## Giọng văn - Hấp dẫn nhưng chuyên nghiệp - Không mang tính quảng cáo hoặc quá lố - Rõ ràng và trực tiếp ## Yêu cầu - Đề cập rõ ràng đến bản dùng thử miễn phí - Tuân thủ nghiêm ngặt giới hạn từ
Key points to remember
- AI's attention is not evenly distributed – the beginning and the end are given higher priority.
- The separator helps avoid confusion between instructions and content.
- Structure your prompts: System → Task → Input → Output → Example
- Formatting is useful, but only if the underlying content is clear.
- Place important instructions in a 'priority' position (at the beginning or end).
-
Question 1:
What is the "lost halfway" problem?
EXPLAIN:
Research shows that AI models recall information better from the beginning and end of the prompt. The middle sections receive less attention.
-
Question 2:
Why do separators (like ###) help improve AI performance?
EXPLAIN:
The separators create a clear boundary between instructions, context, and content—reducing ambiguity about determining which plays which role.
-
Question 3:
Typically, where should the most important instructions be placed in a prompt?
EXPLAIN:
AI models pay more attention to the beginning and end of prompts. Important instructions should be placed in these 'critical locations'.
Training results
You have completed 0 questions.
-- / --
You've just finished reading the article "The structure of a prompt" edited by the TipsMake team. We hope this article has provided you with many useful tech tips and tricks. You can search for similar articles on tips and guides. Thank you for reading and for following us regularly.