I want to ask, for example, how is it that an LLM when given the same prompt does not respond in the same deterministic way?
I guess I want to learn this stuff and should maybe follow one of those "write an LLM in an hour" type videos on YouTube.
I want to ask, for example, how is it that an LLM when given the same prompt does not respond in the same deterministic way?
I guess I want to learn this stuff and should maybe follow one of those "write an LLM in an hour" type videos on YouTube.
In software (not in the model) here's literally a random number generator that picks from a weighted set of "next-token" choices that the model spits out. The selection process can have a series of knobs to manipulate the responses. If you want it to be deterministic (if you have direct access to the software) you can tell it to set "top-k = 1" or "temperature = 0.0" (depending on your software) and it will be deterministic.
Usually the default settings are not for determinism, because for whatever reason the quality of the results tends to not be that good when you go fully d.
The llm model outputs a vector of probabilities for tokens, and the llm user picks a token from the most likely list using a random number
Because of the underlying probability model, it's not going to be 100% deterministic. Plus a model like ChatGPT purposefully have "temperature" parameter that will further add randomisation to the whole process.
My answer is based on this paper if you're interested to read more: The Matrix: A Bayesian learning model for LLMs, https://arxiv.org/abs/2402.03175
Some great research exists in this area [1] and I expect much of it may be repurposed for black box attribution in the future (in addition to all the work being done in the mechanistic interpretability field)
You can control that in most systems with an inference-set parameter called "temperature". But setting the temperature as low as possible tends to lead to very low-quality answers - the system can't crawl out of some local optimum and ends up repeating itself over and over. Such answers may be "deterministic" but they're also not good.
https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-...
For other things, study using Karpathy's videos.