Skip to content
Discussion options

You must be logged in to vote

This is a very common issue when comparing Hugging Face Transformers vs TensorRT-LLM outputs for LLaVA. Even when using the same model weights, getting bitwise or even token-identical outputs is non-trivial because the two runtimes differ in decoding, sampling, and sometimes even preprocessing.


1. Why outputs differ in the first place

Even if the model is identical, differences come from:

🔴 A. Tokenization + prompt formatting

Transformers LLaVA typically uses:

  • apply_chat_template()
  • image token insertion order
  • special tokens (<image>, <|im_start|> etc.)

TensorRT-LLM uses:

  • a custom prompt builder
  • sometimes different system prompt injection
  • different image embedding insertion logic

👉 Ev…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bleedingfight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants