Prompting & In-Context Learning

delimiters and formatting

Delimiters are visible markers that fence off the different parts of a prompt so the model knows where one section ends and the next begins. When a prompt mixes your instructions with a chunk of text to work on, it is easy for the two to blur together. Wrapping the text in clear boundaries, such as triple quotes, tags, or a labelled heading, tells the model plainly that here is the document and here is what to do with it.

Beyond separation, structure helps the model parse a request the way layout helps a reader. Numbered steps, headed sections, and a stated output format, like asking for the answer as a list or as JSON, make both the request and the response cleaner and easier to use downstream. This matters even more in templates and chains, where another program has to read the output.

There is a safety angle too. Clearly marking which part is trusted instruction and which part is untrusted, user-supplied data makes it a little harder for hostile text hidden inside that data to pose as a command, the prompt injection problem. Delimiters are not a real security boundary, but they help the model keep instructions and content apart.

Also called
prompt structuresection markers