Live data from Hacker News

What's the best explanation for LLMs being almost right when citing sources?

news.ycombinator.com

11–12 of 12 posts

Re: What's the best explanation for LLMs being almost right when citing sources?

#11
post #9

LLMs are auto-regressive predictors -- so they take the text given to them (i.e., the prompt) and generate a probability estimate for what the next token should be. Suppose you gave it a quote -- "Once upon a midnight dreary, while I pondered, " and ask it to keep writing, it will generate a probability distribution across various tokens it has been trained on. I'll use words here, rather than tokens, to make the poi…

Would you happen to know of a good resource that shows an implementation of an LLM so I can see this more concretely in practice?

The idea of an LLM makes sense: it's ultimately a graph with statistical weights for which node we use to generate text next (my understanding here is still correct, yes?).

My issue is, where does the "learning" part come in? It feels like it's all hard-coded but I know it's not. What allows for flexibility in token generation besides that randomization from temperature that you mentioned?

Re: What's the best explanation for LLMs being almost right when citing sources?

#12
post #11
post #9

LLMs are auto-regressive predictors -- so they take the text given to them (i.e., the prompt) and generate a probability estimate for what the next token should be. Suppose you gave it a quote -- "Once upon a midnight dreary, while I pondered, " and ask it to keep writing, it will generate a probability distribution across various tokens it has been trained on. I'll use words here, rather than tokens, to make the poi…

Would you happen to know of a good resource that shows an implementation of an LLM so I can see this more concretely in practice? The idea of an LLM makes sense: it's ultimately a graph with statistical weights for which node we use to generate text next (my understanding here is still correct, yes?). My issue is, where does the "learning" part come in? It feels like it's all hard-coded but I know it's not. What allo…

You're not wrong! After training, the neural network is in fact "hard coded" in that the weights do not change anymore.

During training, you update the weights. As a very, very simple example in relation to my original response above... Suppose you are training a neural network. You know that the probability of "weary" coming after "Once upon a midnight dreary, while I pondered, " is 1.00, right? So you set up your LLM with random weights, and you see that the probability estimate for "weary" is 0.77 (I'm making this # up)... Well you can now use an algorithm to nudge the neural network's weights in a way that makes the 0.77 closer to 1.00!

In other words -- the learning happens during training.

A good place to start might be this course: https://karpathy.ai/zero-to-hero.html

Depending on your sophistication and amount of free time you have, here are more resources: https://phaseai.com/resources/free-resources-ai-ml-2024

Good luck!

Post reply on HN