COSMO · STUDY + TEACHING DECKComputer Science & AI
July 22, 2026
C. A question worth sharingNearest Neighbors and Evaluation
Use local neighborhoods to retrieve examples and test whether an embedding preserves useful relationships.
ThinkCompareExplain
Today’s routeA question becomes an explanation.
Try
Enter through a problem. A partial attempt counts.
Connect
Use nearest neighbor, k-nearest neighbors, neighborhood agreement to name what you notice.
Convince
Build an argument a partner can check.
The goal is a method someone else can use.
The openerStart with a question.
Opening problem
A query is at (0,0). Which point is nearest: A=(1,1), B=(2,0), or C=(-1,2)?
Think · 2 min
Sketch, test a small case, or make a first guess.
Pair · 3 min
Compare methods. Find one thing you agree on and one question.
Be ready to share your route, even if it is unfinished.
Compare before checkingPut two attempts in conversation.
Explain
Tell a partner how you started. Let them finish before responding.
Question
Which step feels certain? Which step still needs evidence?
Build
Combine one useful idea from each attempt into a new route.
Can you explain your partner’s method in your own words?
Board conversationNotice before naming.
Look for structure
- 01Try a small case and record every step.
- 02Separate what changes from what stays fixed.
- 03State the pattern in a sentence before naming the theorem.
Make a conjecture
We think ___ because ___. A case that might break this is ___.
What changed? What stayed the same?
Useful languageNow the language has a job.
nearest neighbor
item with smallest distance to a query
k-nearest neighbors
set of the k closest items
neighborhood agreement
fraction of expected neighbors that are recovered
Use one of these words to explain something you already noticed.
The core ideaKeep the idea. Explain the conditions.
y(q)=majority{yi:i∈Nk(q)} The idea
Use local neighborhoods to retrieve examples and test whether an embedding preserves useful relationships.
What to remember
Evaluate an embedding with the relationships and decisions it is supposed to support.
What information does this method keep?
Worked exampleOne route, one decision at a time
The problem
Classify q=(2,2) using the three nearest labeled points: red (1,2), red (2,1), blue (3,3).
Predict each next step
- 01All three are among the local neighbors.
- 02Two of the three labels are red.
- 03Majority vote predicts red.
- 04The prediction depends on the chosen distance and k.
Which step needs a reason, not just a calculation?
See the structureThe structure behind nearest neighbors and evaluation
Read the representation
Use local neighborhoods to retrieve examples and test whether an embedding preserves useful relationships.
Look together
Point to the part that explains the relationship. Change one input and predict what changes.
Two approachesCompare the reasoning.
Structural method
- 01Name the objects and conditions.
- 02Use a reusable relationship.
- 03Explain why the method must work.
Brute force
- 01May help with a small test case.
- 02Can hide the general reason.
- 03Becomes unreliable when the scale grows.
Which route can you justify? What would you test first?
Reasoning clinicFind the step that needs repair.
Investigate these concerns
- 01May help with a small test case.
- 02Can hide the general reason.
- 03Becomes unreliable when the scale grows.
Repair together
Name the missing condition. Try a small counterexample. Rewrite one step so it is justified.
A useful correction explains why the original step fails.
Work togetherInvestigate nearest neighbors and evaluation
Your shared task
Teams create a small labeled dataset, compare two metrics, and write a test set before declaring one representation better.
Explore
4 min - test cases
Compare
5 min - form a rule
Defend
4 min - defend the rule
Everyone should be able to explain the group’s final claim.
Share → connectWhat did the room discover?
Bring your evidence
Share a conjecture, a useful example, or a route that changed.
Connections to investigate
- 01Evaluate an embedding with the relationships and decisions it is supposed to support.
- 02A complete solution names the condition that makes the method valid.
- 03A counterexample is useful when it exposes a missing condition.
Which observation explains the mechanism?
Try → explain → checkYour turn to build the route
The problem
Compare two embeddings on five known related pairs.
Predict each next step
- 01List the expected partner for each query.
- 02Retrieve the nearest neighbor in each embedding.
- 03Count how often the expected partner appears.
- 04Prefer the embedding with stronger held-out agreement for this task.
Which step needs a reason, not just a calculation?
Convince a skepticTurn a pattern into a proof.
The claim
Nearest-neighbor results depend on the representation, metric, scaling, and value of k.
Build the argument
- 01The representation chooses coordinates.
- 02The metric defines closeness.
- 03Scaling changes which dimensions dominate, and k changes how local the decision remains.
What does each step rely on? Where are the conditions used?
Stretch togetherTake the idea somewhere new.
Transfer challenge
Why can an embedding look good in a two-dimensional plot but fail retrieval?
Choose a route
Name the objects, the conditions, and a relationship that might help. Start with one test case.
What transfers from the earlier example? What is different?
Peer reviewCheck the argument together.
Restate
Explain the other person’s route before evaluating it.
Test
Try a small case or boundary case. Does every step still make sense?
Revise
Fix an assumption, add a reason, or find a second method.
Where did your thinking change?
Beyond this problemWhere might this idea help?
A connection
Nearest neighbors power retrieval, recommendation, few-shot classification, anomaly detection, and embedding benchmarks.
Discuss the model
- 01What objects or quantities are represented?
- 02Which relationship from today is preserved?
- 03What assumption would you check before trusting it?
Invent one more situation with the same structure.
Exit ticketLeave with an explanation.
Question 1
A query is at (0,0). Which point is nearest: A=(1,1), B=(2,0), or C=(-1,2)?
Question 2
Explain why this claim is true: Nearest-neighbor results depend on the representation, metric, scaling, and value of k.
Question 3
Why can an embedding look good in a two-dimensional plot but fail retrieval?
Choose one. Write an answer with a reason, then compare with a partner.
Reflect togetherMake your thinking visible.
I used to think…
Name a claim or approach that changed.
Now I can explain…
Give the reason, not only the result.
I still wonder…
Write a question worth bringing to the next circle.
Share one sentence. Ask one follow-up question.
The idea to keepEvaluate an embedding with the relationships and decisions it is supposed to support.
Use the matching practice sets to move from direct examples to proof and transfer.
A good question belongs to everyone in the room. 1 / 21
← → to navigate and reveal · N for notes · F to present · Esc to exit