Essential Best Practices for Robust LLM Delimiter Use

To maximize delimiter effectiveness, consistently use the same delimiter for similar types of information, explicitly define its meaning at the beginning of your prompt, choose visually clear markers, and avoid overuse to prevent confusion and enhance the model's understanding of instructions.

The top 3

  1. Top 3 Delimiter Styles for Robust LLM Instruction Isolation: Effective delimiters like triple hashes (`###`), XML-like tags (`<tag>`), and JSON structures are crucial for clearly segmenting system instructions, user input, and data, with each offering distinct advantages for clarity and injection resistance.
  2. Critical Placements: Maximizing Delimiter Impact in Prompts: Strategic placement of delimiters is key: enclosing system instructions, wrapping all user input, and segmenting multi-step tasks ensures the LLM correctly interprets boundaries and prevents malicious prompt continuations.
  3. Avoid These 3 Delimiter Missteps in LLM Prompt Engineering: Common errors include inconsistent delimiter usage, insufficient nesting for complex instructions, and failing to test delimiter robustness against adversarial inputs, which can compromise prompt integrity and LLM security.

Sources

Open the full topic