Model Releases
Can Gemma and Qwen models catch hallucinations by looking at their own logprobs?
Hi! I'm really obsessed with LLM hallucinations for the last 6 days π I started by designing system prompts to attack hallucinations but failed, obviously. Now I tried reading logprobs and... I think
Hi! I'm really obsessed with LLM hallucinations for the last 6 days π I started by designing system prompts to attack hallucinations but failed, obviously. Now I tried reading logprobs and... I think when the model recalls its first fact in its chain of thought, before it has self-conditioned on something, that recall actually tells us a lot. Probabilities distributed among possible tokens may point not directly to hallucination, but to unreliable recall, which also means the model may hallucinate. Why first recall? Because after the model self-conditions on some belief, fact, or anything else, the token probabilities of that self-conditioned thing can get close to 100%. If the first recall in the reasoning trace was chosen with 25% probability, that same token can later become close to 100%, sometimes exactly 100%, when repeated in the output. Also, the selected token has rivals, which is what makes uncertainty detectable. If "The capital of France is..." has Paris first and Pari second, those don't really falsify each other; they may be different token paths toward the same fact. But Thomas vs Daniel are genuinely rival factual candidates. My other interesting observation was that I haven't seen a confident-but-wrong recall in the first non-self-conditioned recall yet (take this with a grain of salt, I've only been doing this specific experiment for about 2 days). When the model doesn't know, it seems like the probabilities get distributed across different tokens rather than concentrating on one wrong belief. I can't prove any of this, but I wanted to share it here. Maybe I'm confidently wrong myself π I asked ChatGPT to write me a custom WebUI to test whether models can detect their own uncertainty using tool calling to access their logprobs. The model calls The tool finds the first occurrence of that claim in the original generation and returns the pre-sampling token probabilities for that occurrence. Gemma really didn't care that much :D Qwen surprised me more though. Both models are actually pretty bad at reading their own logprobs, I guess. Did I solve hallucinations? No! I don't even know what I'm doing. It's just an interesting experiment I wanted to share. There are example runs in the GitHub repo I created for this. The prompts are Turkish, but the reasoning traces are in English. submitted by /u/Any-Chipmunk5480 [link] [comments]
Source: r/LocalLLaMA | 2026-08-11