01 / CHOOSE THE SOLVER
Choosing tools and specialist agents
Some tasks call for language: rewrite an explanation, summarize notes, or suggest possibilities. Others have a precise rule we can execute: add a column, search a game tree, or fit a statistical model. A useful agent can recognize the difference and hand work to an appropriate tool or specialist.
A basic text LLM predicts tokens. Its harness can use a classifier, routing rules, or a model decision to choose an expert. That expert could be another prompted agent, a calculator, a search service, or a program. Two specialist agents can even use the same underlying model with different instructions and tools.
Routing a task and routing a token happen at different levels
A harness can choose a calculator, another agent, or a workflow for a request. An internal MoE gate selects neural networks during a model’s forward pass. Both can appear in the same system.
Swipe or scroll sideways to view the whole diagram.
A hand-chosen gate scores three tiny numeric functions, selects two, renormalizes their weights, and combines their outputs. Real MoE gates and expert networks are learned during training. “Expert 1” is a network, not a separate chatbot or a guaranteed math specialist.
QUESTION Could a harness route to several specialists while every model it calls is a dense model? Explain your answer.
02 / INFERENCE AND COMPUTATION
When should we turn it into a coding problem?
An LLM might infer a plausible answer from patterns in training and the current prompt. For arithmetic or a game with exact rules, we can ask it to write or call code that computes an answer we can test. Both routes may begin with the same model; the difference is the evidence behind the result.
For “17 × 23,” a calculator executes a defined operation and returns 391. For an NBA draft board, “best pick” needs a definition, data, and a way to evaluate predictions. A statistical model makes those choices inspectable.
03 / THE NBA DRAFT EXAMPLE
Using regression to evaluate NBA draft picks
Imagine an agent helping you choose your next NBA draft pick. One approach is to show it the board and ask for a recommendation based on what it already knows. It may draw on patterns in pretraining, including commentary about players. That knowledge can be stale, and it does not prove the agent checked current stats.
A stronger investigation gives the agent a concrete job: get a current, permitted raw dataset; record its source and timestamp; clean it; define a target; fit a model; and check its predictions against data it did not train on. Regression predicts a number. You still have to decide which number matters for your draft.
Training data and evaluation data have different jobs
The regression is fitted on training rows. Its held-out predictions are compared with the baseline, while the fitted model can also score current prospects using the information available at draft time.
Swipe or scroll sideways to view the whole diagram.
Suppose we want to estimate a prospect’s next-season points per game from their current minutes per game. Fit one straight line using six made-up training players, then check three held-out players.
Predict which prospect will rank highest before fitting.
| Prospect | Current minutes/game | Predicted next points/game |
|---|---|---|
| J | 22 | Fit the model first |
| K | 27 | Fit the model first |
| L | 19 | Fit the model first |
Inspect training and held-out data
No live NBA feed is connected to this demo. One feature and nine invented players teach the method; they do not support an actual draft decision.
- Fit the line and inspect its slope and intercept. Which prospect ranks first under this one-feature model?
- Compare held-out mean absolute error (MAE) with the baseline that always predicts the training average. Lower MAE means smaller average errors on these held-out players.
- Name two missing factors: injuries, role, age, competition level, team needs, or something else. Explain how one might change the pick.
How would we use actual current stats?
Ask your coding agent to use an instructor-approved dataset/API, record the provider, season, retrieval time, units, and missing values, and save a dated snapshot. Split training and evaluation by time when predicting future performance. Fit preprocessing using training data only. Compare regression with a simple baseline and report held-out errors.
Then score the current draft board using information available at draft time. Never train on future outcomes for the players you are pretending to predict; that is data leakage. Show uncertainty and limitations alongside the ranking. A live feed supplies newer observations, not guaranteed future outcomes.
Help investigate an NBA draft board using code. First ask me for the board, an instructor-approved current stats source, and the target to predict. Record source, season, and retrieval timestamp; save a reproducible data snapshot. Check units and missing values. Build a simple regression with a time-based held-out evaluation and a training-mean baseline; avoid future-data leakage. Run the code and report held-out MAE, the model ranking, assumptions, and missing factors. Keep synthetic examples clearly labeled. Do not invent live stats or claim a ranking guarantees the best pick.
04 / ASSIGNMENT
Ask an agent to analyze a game board.
We can check a board more completely than a future basketball career. Use tic-tac-toe, where the rules are small enough to search every possible legal continuation.
Click a square to cycle empty → X → O → empty. Squares are numbered 1–9, left to right.
Compare the approaches
The browser “guess” is a scripted center-first rule, not a live LLM. The search runs exhaustive minimax over legal continuations. A score of +1 / 0 / −1 means forced win / draw / forced loss with perfect play by both sides. Several moves can tie.
- Choose a valid unfinished board. Before searching, write your own suggested move and why.
- Copy its board prompt into VCC ↗. First ask the agent for a best-move guess without tools. Record its square and reasoning as a language prediction.
- Then ask it to create and run a minimax solver. Tell it to validate the board, score every legal move, test immediate wins and blocks, and report ties. Keep the rules and board identical.
- Compare the real agent’s first guess with its computed move scores and this browser’s search. Ask for the executed command, output, and tests.
- Change one square to make a second valid board. Repeat. One correct guess does not show the method is always reliable.
Now solve the exact same tic-tac-toe board with code. X starts and turns alternate. Validate counts, winners, whose turn it is, and whether the game already ended. Write and run an exhaustive minimax solver that assumes perfect play by both sides. Score every legal move as win, draw, or loss for the player to move and report all tied best moves. Test an immediate win, a necessary block, a draw, and an invalid board. Show the command, actual output, and tests. Compare that evidence with your earlier no-tool guess. Keep the starter app working.
05 / NEXT: SPLITTING THE WORK
Dividing a task among agents
A harness can split a larger task into discrete parts: one specialist fetches data, another checks it, another fits a model, and another explains the results. The harness must track which results belong together and check that the combined answer still meets the goal. More handoffs also add coordination and token costs. Separate agents are useful when the work benefits from separate contexts or independent parallel tasks; they are not a requirement for every workflow. Lesson 7 follows how a model builds a response, and Lesson 8 explores sparse expert networks.
Turn in: your two valid boards, each no-tool guess, each executed solver result, tests, and a short comparison. Add one limitation of the draft regression and one sentence distinguishing MoE from harness routing.
Review: Describe a task you would give a language specialist, one you would give a code tool, and the evidence you would request from each. Save your work and stop your VCC workspace.
Instructor notes & sources
Allow about 5–10 minutes for the opening model, 15 for the browser investigation, 20–25 for the VCC activity, and 5 for the review questions. Students can work in pairs and compare their answers. Provision VCC access before class. The demos need no sign-in, API key, or paid inference. If class AI is unavailable, students can inspect demos, run the offline harness, and write expected traces; the live assignment still needs a later model run.
Assess the prediction, trace, and explanation along with the result. The small models, invented player data, fixed chat replies, and scripted browser requests are labeled at the point of use.
Further reading: Attention Is All You Need · Chat templates · Agent workflows and routing · Switch Transformers.