CSC-105

LibraryWeek 4 Lecture 1

Week 4 Lecture 1

Models & Context

📆 Week 4

  • Today: Giving AI context
  • Thursday: Project 3 due by 2:30pm on Thursday
  • Thursday: Begin work on Project 4 using Codex

Pacing the Frontier and more X-risk panic

Dario Amodei — We Must Pace the Frontier Why AI capabilities must advance at a pace that safety can match, and a three-step plan: embedded evaluators, democratic and global coordination. darioamodei.com

time cover

hack these targets

trump take

See Effective Altruism for more details.

AI and Mathematics

Declaration — Math and AI Read the declaration and add your name. mathandai.org

Models & Context

Two places a model "knows" things

  • Weights: what it learned in training. Frozen until the next training run.
  • Context: what you give it right now. Prompt, files, tools, conversation.

Models

A model is a function that turns input into a prediction.

  • Large language models (LLMs): read and write text, one token at a time
  • Embedding models: place text on a map of meaning (search, "find similar")
  • Multimodal models: also take images, audio, or video as input
  • Generative media models: make images, audio, or video
  • Reward models: score answers so another model can be trained

The model you chat with is a stack

Same architecture. Different data, different job.

Pre-trainingFine-tuningRLHFChat model

Model training: pre-training

  1. Collect a huge corpus: web, books, code, conversations
  2. Break it into tokens
  3. Train the model to guess the next token, billions of times
  4. Spend weeks and a fortune in GPUs
  5. Get a base model: fluent, not helpful

What pre-training buys you

  • Grammar, style, and a lot of world knowledge
  • Patterns of code, math, and argument
  • No knowledge of your files, today's dining hall, or this assignment
  • Weights do not update when you talk to it

Fine-tuning

Take the base model. Train it a little more on a small, curated set.

  • Show examples of the behavior you want: instruction → good answer
  • Can specialize: "write like a tutor," "only output JSON," "review this kind of code"
  • Much cheaper than pre-training
  • Still changes the weights, not the prompt

Reinforcement Learning from Human Feedback (RLHF)

How we got from "predict the next word" to "be a good assistant."

  1. The model writes several answers to the same prompt
  2. People rank them: better / worse
  3. A reward model learns those preferences
  4. The LLM is trained to produce answers the reward model likes

After RLHF: checkable rewards

Today's reasoning models add a second loop:

  • For math and code, you often do not need a human ranker
  • The compiler, the test, or the answer key can score the attempt
  • The model practices until the check passes

Context

Getting the right information at the right time.

Context: The information available to the agent when it decides what to do next.

  • System instructions
  • Your prompt
  • Files, tools, and retrieved facts
  • The conversation so far — until the context window fills

Agent: a person, entity, or substance that has the power to act or that represents another person or organization

Human Agency: a mindset and ability to proactively shape your circumstances and get things done instead of letting life happen to you passively.

AI Agent: an autonomous software system designed to perceive its environment, make decisions, and take actions to achieve specific goals

AI Agency vs. Human Agency

  • Humans can proactively act generally in the world (AGI)
  • AI agents are constrained by the context, tools, model and environment

Harness: a tool or system that allows an agent to interact with its environment and achieve its goals

AI Harness: a tool or system that allows an AI agent to interact with its environment and achieve its goals

AI Agent Harness: context + tools

What context do we need?

  • How busy is DH right now?
  • What do I need to do to complete Project 3?
  • Do I have time to go to the game on Friday afternoon?
  • Should I ask <person> out?

Same questions, missing information

QuestionThe model already knowsWhat it still needs
How busy is DH?What a dining hall isLive occupancy, right now
Finish Project 3?What a brief looks likeThe assignment, your draft, the deadline
Friday game?Typical campus schedulesYour calendar, kickoff, travel time
Ask someone out?Generic dating adviceAlmost everything that actually matters
NoYesA real questionIs the needed info incontext?The model guesses fromtrainingThe agent can decide andact

Guessing from weights looks fluent. It is still a guess.

Context is a portable idea

A good brief is context you can hand to any agent.

If it only works inside one chat, it is not context yet. It is leftover conversation.

One-page briefCodexClaude CodeCursorSame first version

Your job as the human

  • Decide what the agent is for
  • Gather the facts it cannot know
  • Distill them so another model could execute the idea
  • Keep the judgment that should stay yours

Prompt Lab

Project 3 Work