Yes, I understood the idea of the formula. Rather, my question is - how does chatGPT know how to value those variables? It doesn't have a real understanding AFAIK.
It doesn't. But by the magic of insanely large training corpus, it does anyway. Similar to how it can "roll a die" or "pick a card"[1], the weighted model can do some (to me) mind bending stuff, just by answering "which tokens are likely to come next, in this given context" (which, in some ways, is the same as me trying to guess what you are going to say next; "Thank you for explaining"? (Actually chatgpt is much better at that game than me...).
[1] I tried it with gpt4:
> Pick a card.
>> As an AI language model, I am unable to physically pick a card for you. However, if you're referring to a card from a standard 52-card deck, I can randomly select one for you.
>> Your randomly selected card is the 7 of Hearts.
> Again.
>> Alright, let's randomly select another card for you.
>> Your new randomly selected card is the Jack of Diamonds.