[KongchangAI]
ConceptNot a Number

NaN

A special value in the IEEE 754 floating-point standard representing the result of an invalid operation. Common sources include 0/0, infinity minus infinity, infinity times zero, and reads of uninitialized memory. It is highly contagious and can invalidate an entire computation chain.

Timeline (last 90 days)

Nov 11

According to the IEEE 754 standard, comparisons of NaN with any value (including itself) return false, so argmax behavior is undefined when it encounters NaN.

Unverified50%
Nov 11

After explicitly mapping NaN to -inf, NaN is smaller than any finite value and is thus deterministically excluded, making argmax output independent of hardware and implementation.

Unverified50%
Nov 11

Since this involves multi-step normalization such as softmax, temperature scaling and top-p truncation, any 0/0, log(0) or overflow in any step will contaminate the logits and produce NaN.

Unverified50%
Nov 11

If NaN is not handled correctly, greedy sampling may output wrong tokens, manifesting as degraded generation quality or even garbled output.

Unverified50%
Oct 17

In GPU kernels, reading uninitialized or out-of-bounds memory is a common source of NaN; residual arbitrary bit patterns interpreted as floating-point numbers will contaminate the computation chain once they participate in accumulation.

Unverified50%
Oct 17

NaN is contagious: the result of any arithmetic operation with NaN is NaN; in the cross-chunk reduction of chunk scan, a NaN produced by one chunk will propagate to all subsequent chunks.

Unverified50%
Oct 17

NaN in the IEEE 754 floating-point standard represents an invalid operation result, with common triggering conditions including 0/0, ∞−∞, ∞×0, and taking the square root of a negative number.

Unverified50%

All Facts (7)

Source Articles