#203Video này và phần văn bản của video bằng tiếng Anh.
System prompt: why where you put AI instructions changes results
Moving the same rules and instruction into a chat's system message lifted a small AI from 55% to 77%. What a system prompt is and what belongs in it.
Chi tiết
What a system prompt is
A conversation with a chat AI is not one blob of text. Every message has a role. The system message holds standing instructions from whoever set up the assistant: what it is for and which rules it follows. The user messages are the requests. The assistant messages are the model's replies. The system prompt is that special first message, the place for instructions that apply to the whole conversation rather than to one request.
What the video shows
The video's point: chats have a special spot for rules that cover the whole conversation, and moving the same words into that spot raised a small AI's accuracy from 55% to 77%.
The experiment comes from the course. A small model sorts customer support tickets into queues. First, the rules, the instruction and the ticket all go into a single user message: 55% correct on 60 tickets. Then the rules and the instruction move into the system message, and the ticket stays alone in the user message. Not one character of the text changes. Accuracy rises to 76.7%. Ticket by ticket, 19 went from wrong to right and 6 went the other way.
An everyday example
Imagine a new employee. On day one they get a handbook: how to treat customers, which requests go to which team. Later a colleague drops one customer email on their desk. Now imagine the handbook rules were never handed over on day one, and were scribbled on a sticky note attached to that single email instead. The words are identical, but the employee reads them differently: as a remark about one email, not as the rules of the job. Where an instruction sits tells the reader how to treat it.
How it works
Behind the scenes, the whole chat is turned into one long text, with special marker words that announce "a system message starts here" or "a user message starts here". During fine-tuning, the extra training that turns a raw model into a chat assistant, the model saw those markers millions of times, always in those same places. So the markers are not decoration around the model; they are part of what it learned. Which side of them your instruction lands on changes how the model uses it.
That is why the system slot and the user slot are not interchangeable. They are separate places in a layout the model was trained on, and the system slot is where conversation-wide instructions belong.
A common misconception
A popular trick is to repeat the instruction at the end, after the data, just to be safe. In this test it did not pay off. With the rules and instruction in the system message and the instruction repeated after the ticket, accuracy was 70% (42 of 60), below stating it once (76.7%, 46 of 60). The gap is only four tickets, on one small model and one task, so it is not a universal law. It is a good reason to test tricks rather than trust them.
Why it matters
If you build anything on top of a chat AI, put the standing rules (what the assistant does, how to classify, what format to answer in) in the system message, and keep the user message for the request and its data. It costs nothing and, in this test, was worth about 22 percentage points. The numbers come from a small open model with about half a billion parameters (the adjustable internal values a model learns); the course expects bigger models to be more robust to effects like this, but the placement habit carries over.
Learn it step by step in Chapter 15 of our free course AI From Scratch: Prompt Engineering, Measured: What Changes the Output.
Cũng có trên
Thêm từ chương này
#203
#204Option order bias: when an AI picks a position, not an answer
#205Prompt order: the same words, rearranged, can double AI accuracy
#207Prompt formatting: how quotes and tags quietly shift AI accuracy
#208Few-shot prompting: how many examples an AI prompt really needs
#209Prompt myths: what tips, pep talks and threats did in a real test
Nội dung được viết với sự hỗ trợ của AI từ chương 15 trong khóa học miễn phí của chúng tôi.