bug: forward pass produces incorrect logits — greedy decode diverges from MLX #63
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Greedy decode produces different tokens than MLX for the same prompt. The top-1 logit is wrong.
Evidence
Prompt:
"The capital of France is"MLX (correct):
Paris(logit=14.81)Seine(logit=9.56)Paris.\nThe capital of France is Paris.sleepy-llm (wrong):
Seine-et-Marne.\nThe following is a list...Seine(MLX logit=9.56) instead ofParis(MLX logit=14.81)The logits are significantly different. MLX has Paris at 14.8 vs Seine at 9.6 — a 5.25 logit gap. Our engine somehow ranks Seine higher.
Investigation
2 + 2 =prompt also diverges: MLX greedy picks(space) then4, our engine also picksfirst — this one matches!Likely causes
Priority
Critical. Performance optimization is meaningless if the model produces wrong answers.
Acceptance
"The capital of France is"Not a bug. Greedy decode matches MLX token-for-token.
The perceived divergence was from temperature=0.8 sampling, not a logit error.
Fixed. Default temperature changed to 0.0 (greedy).
Logit comparison confirms forward pass matches MLX within BF16 noise:
The "Seine" output was stochastic sampling at temperature=0.8, not a logit error.