AAI-M study materials
AAI-M study resources

AAI-M: Generative AI and Large Language Models

AAI-M · Work through your exam, one topic at a time.

All guide sections

Generative AI and Large Language Models

Generative AI produces new content (text, images, code) rather than only labels or scores. Large language models are transformer-based networks trained with self-supervision to predict the next token across massive corpora. Key terms: token (subword unit), context window (maximum tokens the model can attend to at once), parameters (learned weights), embedding (vector representation of meaning), and attention (mechanism letting the model weigh relevant tokens).

Training stages: pretraining (broad next-token prediction), then fine-tuning and instruction tuning, often followed by RLHF (reinforcement learning from human feedback) to align outputs with human preferences. Temperature and top-p control randomness - lower values give more deterministic output.

Hallucination is fluent but false output; models optimize plausibility, not truth. Retrieval-augmented generation (RAG) grounds answers in retrieved documents, reducing hallucination and adding citations, but does not eliminate it. Prompt engineering shapes behavior; in-context learning means examples in the prompt, not weight updates. Know fine-tuning (changes weights, costly, durable) versus RAG (changes context, cheap, current) versus prompting (no training).

Traps: claims that LLMs "look up" facts in a database, that RAG guarantees accuracy, or that a larger context window equals better reasoning. Also watch for confusing fine-tuning with continued pretraining.

Rule of thumb: for changing or proprietary facts, retrieve (RAG); for consistent style or format, fine-tune; for one-off behavior, prompt.