Kuis terkait panduan · Mudah Tingkat

Tag XML dan Pembatas dalam Kuis Perintah

Periksa seberapa baik Anda memahami mengapa pembatas memisahkan instruksi dari konten, bagaimana tag membuat keluaran dapat diurai, dan mengapa tag bukan merupakan keamanan.

Pertanyaan 1 dari 8

Apa alasan utama pemisah membuat prompt lebih andal?

Pratinjau setiap pertanyaan8 pertanyaan

Jawaban dan penjelasan muncul saat Anda mengikuti kuis.

  1. Apa alasan utama pemisah membuat prompt lebih andal?
    • They make the prompt shorter
    • The model can tell where each part of the prompt starts and ends
    • They switch the model into a special mode
    • They reduce the price per token
  2. Apakah Anda harus menggunakan nama tag resmi tertentu seperti <document>?
    • Yes, only names from the provider's official list work
    • Yes, and tags must be valid strict XML
    • No, there is no official list, but you should use names consistently and refer to them
    • No, and tag names should change on every request
  3. Apakah tag XML merupakan batas keamanan yang andal terhadap injeksi prompt?
    • No, text inside tags can still contain injection attempts that may succeed
    • Yes, models ignore everything inside tags
    • Yes, but only if tags are nested
    • Only with the <secure> tag
  4. Mengapa meminta model untuk menempatkan hasil akhirnya di dalam tag <answer>?
    • It makes the answer more accurate by default
    • It lowers the cost of output tokens
    • It hides the answer from the user
    • It gives your code a reliable place to extract the result
  5. For prompts with long documents, where has Anthropic suggested placing the question?
    • Before the documents
    • At the end, after the documents
    • Only in the system prompt
    • Split across several messages
  6. What should you do if user-supplied text contains your own closing tag, such as </document>?
    • Leave it, since models ignore it
    • Delete the entire user input
    • Escape or remove it so the input cannot break out of its section
    • Add more opening tags
  7. Which delimiters does OpenAI's prompting guidance suggest, according to the guide?
    • Triple quotes, Markdown headings or XML
    • Only emoji markers
    • Only JSON
    • Line numbers
  8. How do tags express hierarchy, such as several documents that each have a source?
    • By using capital letters
    • By numbering each line
    • By writing everything on one line
    • By nesting, for example <document> elements inside <documents>