LLM-Probability is an interactive educational software that makes the probabilistic, context-dependent process behind large language model text generation visible to learners. Students enter a sentence fragment and examine a probability distribution of candidate next tokens. When a token is sampled, it is added to the sentence, changing the context and producing a new probability distribution for the following token. Through this step-by-step process, students see that an LLM generates text sequentially rather than retrieving a fixed response.
Students can also adjust temperature and top-p and immediately observe how these parameters reshape the distribution. Temperature controls how strongly the model favors higher-probability tokens, while top-p controls which tokens remain available for sampling. This exploration helps learners understand why the same prompt can produce different outputs and why LLM-generated responses should be viewed as probabilistic rather than deterministic.
Note: The software was originally called Think Like AI and was recently renamed LLM-Probability to better reflect its focus on probability-based, context-dependent text generation.
The full source code for this project is openly available on GitHub.
This work was funded by National Science Foundation award IIS-2112633.
If you use these materials in your teaching or research, please cite the relevant publication listed above.