Skip to content

LLM

  • LLM: Large Language Model
    • Very large deep learning model
    • Used for generations (text, image, audio, video)
    • Pre-trained on massive data
    • Transformer architecture
      • Set of Neural Networks
      • Encoder and a Decoder
      • Self Attention Capabilities
      • Highly scalable by encoding positional data, which lets parallel training
  • FM: Foundational Model
    • Underlying LLM that is a large scale that can be built upon
    • Examples: GPT, Claude, Llama, DALLE, etc
  • Prompt
    • Input to LLM

Embeddings

Numerical representation of data (text, code, image, video, audio) which is strong at findings relationships (closely related, like the words "can" and "container") between the data

The conversion is powered by an embedding model that is trained on neural networks with the last layer removed, left with weights and biases

"The embedding model is basically this neural network with the last layer removed. Instead of getting a specific labeled value for an input, we get a vector embedding." source

token embeddings = 1 vector to represent a token text embeddings = 1 vector to represents text (sentence(s)) more info: Fundamentals of Embeddings, Encoder-Decoders

Training

https://www.notion.so/devalcs/Large-Language-Model-LLM-86c5cee3f126402a8801e45dd88bbffb Pre-training (self supervised)

  • train from scratch
  • weights initialized
  • most resource intensive Fine-tuning (supervised)
  • model user
  • tune weights based on domain specific data Post-training (supervised)
  • model offerer
  • output filtering technique
  • ex: RLHF for human preference alignment (supervise)

Pretraining

text
โ†“
tokenizer (deterministic)
โ†“
token IDs
โ†“
token embedding lookup
โ†“
one vector per token
โ†“
decoder-only Transformer layers
โ†“
contextual vector per token
โ†“
vocabulary output head
โ†“
next-token probabilities
  • Each token ID is converted into a learned token embedding vector.
  • Those token vectors enter the Transformer.
  • The Transformer creates richer contextual vectors.
  • The model predicts the next token.
  • Backpropagation updates:
    • token embedding weights,
    • attention weights,
    • MLP weights,
    • output-head weights.