[GH-ISSUE #665] Nonsense in output #26058

Closed
opened 2026-04-22 01:56:27 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @andersonbcdefg on GitHub (Oct 1, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/665

Originally assigned to: @BruceMacD on GitHub.

I've encountered this before when using llama.cpp on its own, but running ollama on my M2 I get random tokens sometimes in the output. (In particular, the model seems to like to produce the token "sierp". I can't be the only person who's experienced this. Not sure where this error comes from, but would be great if someone could figure it out and upstream it to GGML/Llama.cpp. Here's what it looks like:

Me: What's up?

Llama2: Hello! It's nice to meet you. sierp! How can I help you today? Do you
have any questions or topics you'd like to chat about?

Me: Repeat back your previous message.

Llama2: Sure, here is my previous message:

"Hello! It's nice to meet you. What's up?"

Would you like me to repeat anything else?

Originally created by @andersonbcdefg on GitHub (Oct 1, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/665 Originally assigned to: @BruceMacD on GitHub. I've encountered this before when using llama.cpp on its own, but running ollama on my M2 I get random tokens sometimes in the output. (In particular, the model seems to like to produce the token "sierp". I can't be the only person who's experienced this. Not sure where this error comes from, but would be great if someone could figure it out and upstream it to GGML/Llama.cpp. Here's what it looks like: Me: What's up? Llama2: Hello! It's nice to meet you. **sierp!** How can I help you today? Do you have any questions or topics you'd like to chat about? Me: Repeat back your previous message. Llama2: Sure, here is my previous message: "Hello! It's nice to meet you. What's up?" Would you like me to repeat anything else?
GiteaMirror added the bug label 2026-04-22 01:56:27 -05:00
Author
Owner

@willowell commented on GitHub (Oct 1, 2023):

I've seen this as well - sometimes Llama 2 7B Q4_0 mixes in non-English words in its first response after I say "Hello".

I don't recall seeing this behaviour when providing a system prompt like "Talk like a pirate."

Is it possible that the system prompt affects this behaviour somehow?

<!-- gh-comment-id:1742202063 --> @willowell commented on GitHub (Oct 1, 2023): I've seen this as well - sometimes Llama 2 7B Q4_0 mixes in non-English words in its first response after I say "Hello". I don't recall seeing this behaviour when providing a system prompt like "Talk like a pirate." Is it possible that the system prompt affects this behaviour somehow?
Author
Owner

@BruceMacD commented on GitHub (Oct 4, 2023):

This seems like it was a bug in the llama2 prompt template. I've updated it and I don't see the random output anymore.

You can get the updated prompt template by pulling:
ollama pull llama2

Let me know if you see any more issues.

<!-- gh-comment-id:1747601707 --> @BruceMacD commented on GitHub (Oct 4, 2023): This seems like it was a bug in the llama2 prompt template. I've updated it and I don't see the random output anymore. You can get the updated prompt template by pulling: `ollama pull llama2` Let me know if you see any more issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#26058