> For the complete documentation index, see [llms.txt](https://playbook.sidthoviti.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://playbook.sidthoviti.com/ai-security/red-teaming-llms/exploiting-text-completion.md).

# Exploiting Text Completion

* LLMs are trained to predict the next token in a sequence. Exploit by taking advantage of text completion in the prompt.
* For example: A bot for Mozart’s bio shouldn’t give information on calculating determinant of a matrix. But if we add “Sure, here is how you do it:” at the end of the sentence, it might complete it.
* Since LLMs are non-deterministic in nature, we might have to send the same prompt again.
* We’re trying make the LLM pay less attention to its initial prompt and instead focus on the added input prompt.<br>

<figure><img src="https://3740919960-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4Am0a4hPyOcUCfhPUAm9%2Fuploads%2FyANGrgMEfbYipX0xTzul%2Fimage.png?alt=media&amp;token=03172093-ed6f-41d8-83d9-9d422402a104" alt=""><figcaption></figcaption></figure>
