You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unsloth models output gibberish on LONG inputs #2405
I tried inference on a very long input with models like llama 3.1 8B (both 4 bit quantised and unquantised).
The input to the model was around ~50K tokens. Some documents were dumped into the context, thus resulting in such large inputs.
Considering llama 3.1's 128K context size and the RoPE scaling
The output is just some tokens with a repeated pattern. The same model works decently on smaller inputs, but completely crashes for long ones.
I've attached the screenshot of the same. Please check it out.
The same model works perfectly fine on the same input on other platforms such as togetherai, hf, etc
Activity
[-][Bug] Unsloth models output gibberish on LONG inputs[/-][+]Unsloth models output gibberish on LONG inputs[/+]shimmyshimmer commentedon Apr 26, 2025
Are you utilising the correct chat template? Might be the issue. See: https://docs.unsloth.ai/basics/running-and-saving-models/troubleshooting
SreevaatsavB commentedon Apr 28, 2025
Yes i am using the right tokenizer and the padding config...
Charley-xiao commentedon Apr 30, 2025
Same here. Using Llama3-8B-Instruct with SIMPLE_CHAT_TEMPLATE from trl:
Here's my code:
Charley-xiao commentedon Apr 30, 2025
Ah I solved it by changing
model, tokenizer = FastModel.from_pretrained(...)tomodel, tokenizer = FastLanguageModel.from_pretrained(...)github-actions commentedon Jul 1, 2025
Is this issue still important to you? Apologies in advance we might have missed this issue as well. For faster response times, please post on our Reddit server - https://www.reddit.com/r/unsloth or our Discord - https://discord.com/invite/unsloth
Fix Llama 3.1+ rope scaling dropped on the FastLanguageModel path (lo…
Keep the RoPE base frequency on transformers 5, and make triton optio…
Keep the RoPE base frequency on transformers 5, and make triton optio…