Published on:
1 Aug 2023
4
min read
Image credit: Markus Spiske; https://www.pexels.com/photo/display-coding-programming-development-1921326/
On #robot judges: part 3.¹
In part 2,² I suggested that while there may be reasons (such as internal rules) why a Large Language Model (#LLM) generates the output that it does, "reasons" are not the same as "reasoning".
So let's dive deeper into whether LLMs engage in "reasoning".
And in order to do that, let's consider the reasons why LLMs generate the output that they do.
---
Let's consider, again, what an LLM is.
An LLM is a computer program.
And what's a computer program?
Well, a simple program might have the following line of code³:
> PRINT⁴ "Hello, world!"
A more sophisticated program might have the following lines of code:
> IF "user input" = "What is an LLM?"
> ⠀⠀⠀ ⠀THEN PRINT "An LLM is a computer program."
> ELSE PRINT "I'm sorry, I am programmed to answer one question and one question only. This is not a question I can answer."
And an even more sophisticated program might read:
> IF "user input" = "What is an LLM?" OR "Can you tell me what an LLM is?" OR "What be LLM?"
> ⠀⠀⠀ ⠀THEN PRINT "An LLM is a computer program."
> ELSE IF "user input" = "Are you an LLM?"
> ⠀⠀⠀ ⠀THEN PRINT "lol nope"
> ELSE PRINT "I'm sorry, I am only programmed to answer a few questions, and this is not a question I can answer."
---
So what does the code for an LLM look like?
Frankly, I have no idea. I'm a lawyer, not a programmer.
But what we do know is that the code for an LLM looks nothing like the examples I've set out above.
In the examples above, outputs are generated based on clearly defined rules:
a) set by the programmer; and
b) which someone else can reverse-engineer from the code.
In other words, for the last program above, if the output is "lol nope", we can tell from the code that this output was generated because the user had input "Are you an LLM?"
But for LLMs, we don't actually know what are the precise rules that the LLM has applied in order to generate its output.
And that's because of the way LLMs are built.
In part 1⁵ of this series, I suggested that:
"...LLMs predict the next word via crowdsourcing, so as to speak - huge volumes of data are fed into LLMs, and the LLM decides, based on the data and its training, what are the 'best' words to predict in response to your prompt."
So unlike the examples above, an LLM is not a program with millions of lines of code setting out:
a) every possible permutation of every possible question that a human operator can think of asking; and
b) the answer to each of these questions.
Rather, when an LLM receives a string of characters, it somehow generates a string of characters in response.⁶
But we don't actually know the precise rules that an LLM applies in order to generate that particular string of characters.
---
So how does an LLM decide what string of characters to generate? Surely it can't be random!
In part 4, we'll explore how LLMs generate responses based on "data" and "training".
Disclaimer:
The content of this article is intended for informational and educational purposes only and does not constitute legal advice.
¹ Welcome back to our regularly scheduled programming.
² https://www.linkedin.com/posts/khelvin-xu_robot-llm-ai-activity-7102135406124548096-KPpB.
³ Please don't judge my pseudocode.
⁴ I.e. "display on screen". Not "send to physical printer to be printed out on A4 paper".
⁵ https://www.linkedin.com/posts/khelvin-xu_robot-ai-llm-activity-7100325203108397056-Ghnn/.
⁶ I have deliberately referred to characters, not words, because:
a) this would cover inputs like "2 + 2 = ?"; and
b) LLMs think in terms of tokens, and not phrases or even individual words. Some further reading on tokens:
- https://learn.microsoft.com/en-us/semantic-kernel/prompt-engineering/tokens
- https://www.linkedin.com/pulse/demystifying-tokens-llms-understanding-building-blocks-lukas-selin/ - h/t to Lukas S. for the helpful post.