Skip to the content ForoHackers
Log inJoin

Large language models: start here

Large language models
#335 · Ophuscado · · Report

A large language model is a neural network trained on huge amounts of text to predict the next token. That simple objective, at scale, yields systems that write, summarise, translate and reason in text, and can be steered with instructions. They also invent facts with confidence, so using them well is mostly about knowing what they can and cannot be trusted with.

Key concepts

  • Tokenisation: text becomes sub-word pieces; cost, limits and some odd failures follow from it.
  • Transformer and attention: each token weighs every other token in the context to build its representation.
  • Pretraining and post-training: next-token prediction on broad text, then fine-tuning on examples and feedback to follow instructions.
  • Context window: the fixed amount of text the model can see at once; nothing outside it exists for the model.
  • Sampling: temperature and top-k or nucleus rules trade determinism against variety.

Vocabulary

  • Prompt: the input text, including instructions and examples.
  • Hallucination: fluent output that is false or unsupported.
  • Embedding: a vector that represents meaning, used for search and clustering.
  • In-context learning: picking up a task from examples in the prompt, with no weight updates.
  • Fine-tuning: continuing training on a narrower dataset to change behaviour or style.

What to study, in order

  1. Probability, vectors and how a language model scores text; build a character-level bigram model.
  2. Implement attention and a tiny transformer from scratch, and train it on a small corpus.
  3. Study tokenisation by encoding the same text several ways and counting tokens.
  4. Build retrieval over your own documents and compare answers with and without the sources.
  5. Write an evaluation set of hard cases and score outputs by a fixed rubric, not by impression.

Related tags

#nlp #deep-learning #generative-ai #ai-evaluation #ai-safety

Log in or join to reply.