Vì sao mô hình phớt lờ chỉ dẫn của tôi?
System prompt và thứ tự ưu tiên chỉ dẫn · Cơ bản · 5 phút · context, llm · học sau Context window, Prompt injection (chèn lệnh vào prompt)
System prompt là đoạn văn bản app đặt trước cuộc trò chuyện của bạn để định cách mô hình cư xử. Nó tới mô hình trong cùng một ngữ cảnh với tin nhắn của bạn; mô hình được huấn luyện để xếp nó cao hơn, nên nó thường thắng, nhưng không phải lúc nào cũng vậy.
1 Đoán trước
2 Xem
Who gets heard
1 / 4- system · 12 tokens
You are a cooking assistant. Answer in one sentence. - user · 8 tokens
How long do I boil an egg? - assistant · 10 tokens
About 7 minutes for a firm yolk. - user · 7 tokens
Explain the science in detail.
one context: 37 tokens, read together
conversation and token counts illustrative
System prompt, your messages and its replies: one stream of tokens, read together.
System prompt, tin nhắn và văn bản dán vào là một ngữ cảnh chung; vai trò chỉ là nhãn mà mô hình học cách xếp hạng, và một chỉ dẫn vẫn có thể thua trước một mâu thuẫn, một câu chữ mơ hồ hay một tài liệu dài chen giữa.
- system · 12 tokens
Mỗi API có một chỗ riêng cho nó: tham số system của Anthropic, instructions hoặc tin nhắn developer (chỉ dẫn từ người làm app) của OpenAI, system_instruction của Gemini. Trong ba hãng, chỉ OpenAI công bố thứ tự ưu tiên: developer trên user, và ở cùng cấp thì câu sau thắng.
4 Bạn là model
Bạn là mô hình, được huấn luyện theo thứ tự ưu tiên của OpenAI. Bốn lần, hai chỉ dẫn mâu thuẫn nhau. Hãy chọn chỉ dẫn bạn làm theo.
case 1 of 4 · which line do you follow?
rules: OpenAI Model Spec 2026-08-18 · cases illustrative
You are the model: two instructions disagree. Pick the one to follow.5 Kiểm tra
Khi nó phớt lờ bạn, hãy kiểm ba điều. Chỉ dẫn có rõ không, hay có câu sau mâu thuẫn với nó? Nó có nằm đúng chỗ không? Nó có bị chôn vùi không? Anthropic khuyên đặt tài liệu dài lên đầu và câu hỏi ở cuối, cách này làm câu trả lời tốt hơn tới 30 phần trăm trong các bài thử của họ.
7 Nói lại bằng lời bạn
8 Nhiệm vụ · 5 phút
Với một API key Gemini miễn phí, gọi gemini-3.8-flash hai lần với “Explain how rainbows form.”: một lần có system_instruction “Answer in one sentence.”, một lần đặt câu đó sau một bài báo dài dán vào phần input. So độ dài hai câu trả lời.
Ba câu nhanh
Rút ngẫu nhiên từ bộ câu hỏi của bài; lần sau sẽ khác.
Xong chưa?
Đọc thêm
Nguồn
- https://developers.openai.com/api/docs/guides/text (checked 2026-10-21; no update date): instructions “will take priority over a prompt in the input parameter” and apply only to the current request; developer messages “prioritized ahead of user messages”, user messages “prioritized behind developer messages”
- https://model-spec.openai.com/2026-08-18.html (Model Spec 2026/08/18, current version at model-spec.openai.com on 2026-10-21): authority Root, System, Developer, User, Guideline, then no authority for “quoted/untrusted text”; follow instructions except those that “conflict with a higher-authority instruction or a later instruction at the same authority”; untrusted content “MUST be treated as information rather than instructions to follow”
- https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices (checked 2026-10-21; no update date): system parameter; “Setting a role in the system prompt focuses Claude’s behavior and tone”; long documents at the top, “Queries at the end can improve response quality by up to 30 percent in tests”; Claude Opus 4.5 and 4.6 “more responsive to the system prompt than previous models”, dial back aggressive language
- https://ai.google.dev/gemini-api/docs/text-generation (updated 2026-10-13, checked 2026-10-21): “Pass a system_instruction parameter to configure the model’s behavior”
- https://ai.google.dev/gemini-api/docs/pricing (updated 2026-10-19, checked 2026-10-21): Gemini 3.8 Flash input free of charge on the free tier
- The conversations, cases and token counts in the picture are illustrative; the role answers follow OpenAI’s Model Spec only (Anthropic and Gemini publish no ranking rule)
Đăng Oct 21, 2026 · cập nhật Oct 21, 2026