The prerequisite of Mechanistic Interpretability of Large Language Model

The prerequisite of Mechanistic Interpretability of Large Language Model


1. The Transformer Architecture


A Transformer consists of multiple Block. Each block consists an attention mechanism and a multi-layer perceptron.


An attention mechanism is matrix multiplication between Query, Key and Value.


A multi-layer perceptron is a linear transformation between all inputs to produce outputs.


2. The Automatic Gradient


A neural networks is just a function that processes inputs (data and weights of the neural networks) and output a result.


The goal of machine learning is to adjust the weights so the output is similar to the output.


The prerequisite of machine learning is the chain rule of calculus to calculate the derivative of loss value with respect to the input (the weight).


A machine learning library has something called automatic gradient. It does the derivative for you automatically, from the output to the input.


A machine learning library has at least 2 kernels for any operation. A kernel for the CPU and a kernel for GPU.


3. The change of basis of linear algebra


4. And so on.


#largelanguagemodel

I want to give you headache. Why a small ChatGPT 2 with only 768 numbers to represent 1 meaning can communicate with you?