LLM-Probability

About This Project

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.

Authors

Saniya Vahedian Movahed

University of Texas at San Antonio

David S. Touretzky

Carnegie Mellon University

Publications

  1. Vahedian Movahed, S., & Touretzky, D. (In Press). From Spinners to Sampling Parameters: Revealing the Probabilistic Underpinnings of LLM Text Generation. Proceedings of the SIGCSE Virtual 2026 Conference. In Press
  2. Vahedian Movahed, S., Quarles, J., & Touretzky, D. (2026, February). Exploring How LLMs Use Probability to Generate Text: Interactive Activities for Middle School Students. Proceedings of the 57th ACM Technical Symposium on Computer Science Education V. 2 (pp. 1563–1564).
  3. Vahedian Movahed, S. (2026, February). Think Like AI: Hands-On Exploration of Sampling Parameters and Prompts for Middle School Students' Generative AI Literacy. Proceedings of the 57th ACM Technical Symposium on Computer Science Education V. 1 (pp. 1082–1088).

Source Code

The full source code for this project is openly available on GitHub.

View Curriculum → Source code →

Funding

This work was funded by National Science Foundation award IIS-2112633.

Citing This Work

If you use these materials in your teaching or research, please cite the relevant publication listed above.