# Working with Agents

---

# 📆 Week 5

- Today: Working with Agents
- Thursday: [Project 4](../../projects/04/project-4.project.md) due by 2:30pm on Thursday
- Thursday: Begin work on Project 5 (ongoing) using [Codex](../../resources/chatgpt-desktop.guide.md)
- Thursday, October 8: midterm project due at 2:30pm; demos and a short exam review
- Tuesday, October 13: fall break — no class
- Thursday, October 15: midterm exam (on paper, in class, one hour)

---

# Midterm project

- A working project that does something useful.
- Should be well-presented and documented.
- Should show your personal thought, intent and creativity (no slop!).

---

# Midterm exam

- On paper, in class, 1 hour.
- Testing for:
  - Prompt fluency
  - Vocabulary
  - Critical thinking

---

# Midterm grade

- Projects: 60% of grade
- Exam: 20% of grade
- Professionalism: 20% of grade

---

<!-- id: this-week-in-ai -->

<x-sfx-cue src="../assets/this-week-in-ai-theme.mp3" on="player:block-enter" />

![@image(fit=contain).background](../assets/this-week-in-ai.png)

---

[@embed "extreme intelligence"](https://x.com/SnehaRevanur/status/2101384209814446528)

[Sneha Revanur](../../codex/sneha-revanur.person.md)

---

[@embed "super intelligence"](https://x.com/StockMKTNewz/status/2102414668329369787?s=20)

---

[@embed "Claude Opus 5.5"](https://x.com/claudeai/status/2102435511222890900?s=20)

---

[@embed GPT 6 ](https://x.com/OpenAIDevs/status/2102461432684282061?s=20)

---

[@embed Karp on OpenAI IPO S-1](https://x.com/guilleflorvs/status/2101995999463981492?s=20)

---

[@embed OpenAI's Math Findings](https://x.com/OpenAI/status/2102093145051943229?s=20)

---

[@embed steve jobs on AI 45 years ago](https://x.com/signulll/status/2100982489338540514)

^ Some older predictions were remarkably prescient.

---

<!--
play:
  variant: section
-->

# Review

Say each term in your own words.

^ Full list: [Glossary](../../resources/course.glossary.md).

---

<!--
play:
  variant: section
-->

# Files, folders, and text

---

<!--
play:
  variant: fact
-->

# File

A named piece of data. The extension hints at the type.

---

<!--
play:
  variant: fact
-->

# Folder

A container for files and other folders. Also called a directory.

---

<!--
play:
  variant: fact
-->

# Path

The address of a file or folder.

`~/classes/csc-105/project-1`

---

<!--
play:
  variant: fact
-->

# Extension

The suffix after the last dot: `.md`, `.html`, `.txt`.

---

<!--
play:
  variant: fact
-->

# Plain text

Human-readable characters, not a private app format.

---

<!--
play:
  variant: fact
-->

# Markdown

Plain text for headings, lists, links, and emphasis.

---

<!--
play:
  variant: fact
-->

# HTML

The plain-text format a browser turns into a page.

---

<!--
play:
  variant: fact
-->

# ASCII

An early map from numbers to English letters, digits, and symbols.

---

<!--
play:
  variant: fact
-->

# UTF-8

How computers encode text from many languages today.

---

<!--
play:
  variant: fact
-->

# Zip

One archive of a folder, so you can upload the project as a single file.

---

<!--
play:
  variant: section
-->

# Prompting

---

<!--
play:
  variant: fact
-->

# Prompt engineering

Using words to shape the output of a machine.

---

<!--
play:
  variant: fact
-->

# Coding

The syntax and typing of code.

---

<!--
play:
  variant: fact
-->

# Programming

Solving a problem with code. The hard part, with or without AI.

---

<!--
play:
  variant: fact
-->

# Zero-shot

Instructions alone, with no examples.

---

<!--
play:
  variant: fact
-->

# One-shot

In this class, one prompt that produces the result in a single turn.

^ In machine learning, one-shot means the prompt includes one example of the task.

---

<!--
play:
  variant: fact
-->

# Few-shot

A few examples of the task, included in the prompt.

---

<!--
play:
  variant: fact
-->

# Chain-of-thought

Work through the steps before giving the final answer.

---

<!--
play:
  variant: section
-->

# How a model reads and writes

---

<!--
play:
  variant: fact
-->

# LLM

A large language model. It writes text one token at a time.

---

<!--
play:
  variant: fact
-->

# Token

The chunks an LLM reads and writes. About 4 characters, or 0.75 words.

---

<!--
play:
  variant: fact
-->

# Embedding

Numbers that place an idea on a map of meaning. Nearby means similar.

^ `King - Man + Woman ≈ Queen`

---

<!--
play:
  variant: fact
-->

# Parameter

A weight the model learned in training. More parameters can store more patterns.

---

<!--
play:
  variant: fact
-->

# Next-token prediction

Given the tokens so far, guess the next one. Longer answers are this step repeated.

---

<!--
play:
  variant: fact
-->

# Temperature

How willing the model is to pick a less likely next token.

---

<!--
play:
  variant: fact
-->

# Context window

How much the model can hold for one prompt. Outside the window, it is invisible.

^ The desk. When it fills, old pages fall off.

---

<!--
play:
  variant: fact
-->

# Transformer

The 2017 architecture behind modern LLMs. It looks at a whole sequence at once.

---

<!--
play:
  variant: fact
-->

# Self-attention

Every token weighs how much the other tokens matter to it.

---

<!--
play:
  variant: section
-->

# Training, then the chat model

---

<!--
play:
  variant: fact
-->

# Pre-training

The first stage: guess the next token across a huge corpus.

---

<!--
play:
  variant: fact
-->

# Base model

What pre-training produces. Fluent, not yet helpful.

^ GPT-3 could complete text. It was not ChatGPT.

---

<!--
play:
  variant: fact
-->

# Fine-tuning

More training on a small, curated set. It changes the weights.

^ Examples in a prompt do not do this. Those leave the weights alone.

---

<!--
play:
  variant: fact
-->

# RLHF

Reinforcement Learning from Human Feedback. People rank answers, and the model is trained toward the ones they prefer.

---

<!--
play:
  variant: fact
-->

# Reward model

A model that scores answers from those human rankings.

^ For math and code, a test or an answer key can be the reward instead.

---

<!--
play:
  variant: fact
-->

# Alignment

Getting a model to do what people want, not only what the training data made likely.

---

<!--
play:
  variant: section
-->

# Two places it knows something

---

<!--
play:
  variant: fact
-->

# Weights

What the model learned in training. Frozen while you chat.

^ Not your files, and not today.

---

<!--
play:
  variant: fact
-->

# Context

What you give it this turn: prompt, files, tools, and the conversation.

^ If the fact is not in context, a fluent answer is still a guess.

---

<!--
play:
  variant: section
-->

# Agents

---

<!--
play:
  variant: fact
-->

# Agent

An AI that can take actions, not just chat. An LLM plus tools, files, and a goal.

---

<!--
play:
  variant: fact
-->

# Harness

The context and tools wrapped around an agent so it can do the work.

---

<!--
play:
  variant: fact
-->

# Human agency

You choose the goal and gather the facts the model cannot know.

---

<!--
play:
  variant: fact
-->

# AGI

A hypothetical AI that can do any intellectual task a person can.

---

<!--
play:
  variant: fact
-->

# Slop

A project mostly handed to AI, with little of your own thinking left in it.

---

<!--
play:
  variant: fact
-->

# Brief and AGENTS.md

The brief says what to build. `AGENTS.md` says how to work and where you left off.

^ Specify → Edit → Test → Evaluate.

---

<!--
play:
  variant: section
-->

# The field

---

<!--
play:
  variant: fact
-->

# Frontier model

One of the most capable models in the world right now.

---

<!--
play:
  variant: fact
-->

# SOTA

State of the art. The best known result on a task. It moves.

---

<!--
play:
  variant: fact
-->

# Open weights

The trained model file is published for anyone to download.

^ Open source would also include the training data and the code. Those usually stay private.

---

<!--
play:
  variant: fact
-->

# X-risk

The claim that a capable enough system could do serious harm.

---

<!--
play:
  variant: fact
-->

# Effective altruism

Slow down. A rushed system is the danger.

[Effective altruism](../../codex/effective-altruism.concept.md)

---

<!--
play:
  variant: fact
-->

# Effective accelerationism

Delaying is the danger. Deploy it.

[Effective accelerationism](../../codex/effective-accelerationism.concept.md)

---

# Working with Agents

---

# Stay in the loop!

1. Evaluate the current state of the project
2. Work with the agent to plan the next steps
3. Execute the next steps
4. Back to step 1

---

# Have your agent present options

- Create images for UI/style references (mood boards, etc.)
- Create HTML mockups of ideas with multiple options
- Refine then incorporate into the project

---

# Demo
