Why Triple Hashes Excel in Multi-Step LLM Instructions
Triple hashes (`###`) are highly effective for structuring multi-step instructions by creating clear, distinct sections, reducing ambiguity, improving parsing accuracy, and preventing context bleeding in complex prompts, thereby enhancing model understanding and output consistency.
The top 3
- Top 3 Delimiters for LLM Instruction Clarity: Alongside triple hashes (###), triple backticks (```) and XML-like tags (<tag>) are among the most effective delimiters for LLMs, chosen for their clear visual separation, reduced ambiguity in parsing, and ability to enforce distinct boundaries between instructions and content.
- Triple Hashes' Top Defense Against Prompt Attacks: Triple hashes act as a crucial first line of defense against prompt injection by creating explicit boundaries between system instructions and user input, making it significantly harder for malicious input to override or alter the LLM's intended behavior. Studies show delimiters improve defense rates significantly for many models.
- Why Triple Hashes Excel in Complex LLM Workflows: In multi-step instructions, triple hashes provide robust structural fortification by clearly segmenting different parts of a prompt, preventing "context leaking" between steps, and enhancing the LLM's ability to maintain focus and follow a logical chain of thought for complex tasks.
Sources
Open the full topic