Skip to content

sanidhya2803/LLM_NonDeterminism_Experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

LLM Non-Determinism Experiment

This project demonstrates that Large Language Models (LLMs) produce probabilistic outputs.

Objective

To show that the same prompt can generate different responses when sampling parameters like temperature are used.

Models Used

  • GPT-2
  • DistilGPT2
  • Phi-2

Tools

  • Python
  • Hugging Face Transformers

Experiment Steps

  1. Send the same prompt to the LLM multiple times.
  2. Store responses in a list.
  3. Compare outputs.
  4. Change temperature parameter to observe variation.

Example Prompt

Explain machine learning in simple words.

Observation

Different outputs are generated for the same prompt due to probabilistic token sampling.

Installation

pip install -r requirements.txt python llm_test.py

About

Demonstrates the non-deterministic behavior of LLMs by sending the same prompt multiple times and comparing the generated responses. Implemented using Python and the Hugging Face Transformers library with the Phi-2 model.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages