HeadlinesBriefing HeadlinesBriefing.com

Why LLMs Pick 7 Over Other Numbers

Towards Data Science •
×

A viral chart comparing random generators, humans, and large language models reveals a surprising pattern: both humans and LLMs peak at the number 7. Humans favor 7 due to the "blue-seven" phenomenon, preferring it over edges like 1 and 10 or the obvious middle of 5. Cultural factors, including the seven days of the week and seven wonders, make 7 feel random without appearing to try.

LLMs mimic this human behavior during pretraining, copying the human preference for 7. However, the model's output becomes a single needle at 7 rather than a broad hill due to post-training sampling methods. While gradient descent explains why the peak lands on 7 by minimizing cross-entropy with human data, it does not explain the sharpness of the LLM's preference.

The article explains that gradient descent adjusts model probabilities to match human frequency, but the final needle-like distribution arises from how answers are sampled after training concludes.

Source: Towards Data Science · Summarized by HeadlinesBriefing