AI/LLM/debate/essay/01
re: do LLMs think?
They don't, they have layers that form attention, layers that predict next text based on attention vectors, then output layers which select tokens based on the attention and selection layers. You can use https://github.com/johnmarktaylor91/torchlens to basically fMRI any network, if you have enough memory to inspect a network.
In a more simple model, think of the inputs as a vector in 3d space, you'd call it [x, y, z]. Imagine that splayed downwards so it forms three rows and one column. Then, each layer is a 3x3 multiplication, which is a collection of weights [ [a, b, c], [d, e, f], [g, h, i] ], so it forms a square matrix. The result of this multiplication is a new matrix, we'll call it [ x', y', z' ] (-dash denoting the modified x, y, z variable you started with).
In reality, this is much more complicated, but for argument's sake, each input [x, y, z] is connected to every layer in the 3x3 matrix which is the "layer", and produces a new output. Repeat this process, so that [x, y, z] becomes [x', y', z']..... [x'''', y'''', z''''], which becomes the final result of that "every layer is interconnected" exercise, and you have some final stage output [ a, b, c, d, e, f ], which goes through a 6x6 multiplication with the last [x'''', y'''', z''''] results you came up with previously, and this [a, b, c, d, e, f] becomes your "output neuron" layer... the act of moving inputs through the "hidden layers" to the "output layers" through whatever "neuron activation weights" you had in each [ [a, b, c], [d, e, f], [g, h, i] ] layers you had before it.
(Note: I'm extremely simplifying here; in reality, your input would be much larger than three variables x, y, z, and, your layers would likely be more complicated than a 3x3 matrix; but, to make the math easy to do by hand, I have simplified it greatly.)
This matrix multiplication is what makes GANN work: you have a collection of input layers (which might be vision, text input, etc), you perform some quantification to create an "attention vector" of some a, b, c... x, y, z, then feed that through your network of "activiation weights and biases" to produce an output decision, or a stream of output decisions.
When you're dealing with text parser, you take the text input (the tokens), quantify that into some attention vector: the objective of the message or conversation thus far, form the "attention vector" (ie, what might come next, what is statistically the most probable output given the input), then, you generate tokens (output words) that follow the bouncing ball. This is why if you feed AI into itself, it eventually arrives at either weird eldrich horrors or repeats itself infinitely: it reaches something that, in Markov Chain probability, is the steady state; that is, it does not matter what you do to the input or output anymore, it is stuck and can no longer predict any "new" content. It has reached a collapse of entropy and simply won't output more meaningful data.
When we quantify these models as having size and precision, it's about the precision of the floating point numbers and the size of each of the layers. For example, you might say a model is unquantized: this means it has floating point numbers as precise as it was trained on, so therefore it is absolutely precise in its weights and biases. You might quantize a model by half: that is, you cut the size of the floating point numbers in half and round or truncate them, so now it has *half* the activation precision. You have essentially cut down the size, then, by half, and the memory required by approximately half, but you have thrown away that training information and made it more coarse in doing so. This is why, generally, quantized models perform worse the harder they are quantized; you have essentially reduced the overall precision to save on room.
This is also why GPU hardware is better at running AI models; while CPUs have vector instructions to perform multiplication operations on whole pages of addresses at once, they are significantly slower because they lack the floating point precision, speed, and number of cores available; a GPU has significantly more cores available to perform raw floating-point operations on memory in a sequential way. If you recall the pipeline of performing a 3x3 multiplication on a 1x3 matrix over multiple layers, you can perform a vector multiplication instruction on two blocks or pages of memory and output that to a new location, then, take that output and perform the next multiplication on the next target 3x3 matrix to the next output 1x3 memory with the output of the previous 1x3 memory, but, the CPU architecture is not good at doing this because it lacks the pipelining, DMA and architecture that GPU hardware offers. It requires reading and writing from L1/L2/L3 and then pulling pages in and out of RAM, which is slow. On GPU architecture, it's designed to do operations on vertex buffer objects, vertex array objects, specific regions of memory and do so across >2000 cores, rather than 8/12/16/32 physical cores which thrash L1/L2/L3 caches.
A recent advancement in this model is the concept of using polar coordinates, as well, which is clever. Instead of specifying our vectors as [x, y, z], they can instead be specified as a heading, bearing, and vector magnitude; which sounds like it doesn't save space, but it does when you also use polar math over a restricted domain of -Math. PI to Math. PI, reduce that again by using negative vector magnitudes (ie go backwards from a forwards direction, etc).
So, no, they do not think. They predict things very well based on gradient descent, and some math that's been around for quite some time now. Tool calling is another whole rabbit-hole, and so is machine memory, but ultimately they're just predictors that have been trained to do something a mathematician came up with a very long time ago. (: