Teach-OffBack to the game

Make your own AI teacher

🔑 You are the answer key

Your student asks; you answer YES or NO. It learns your answer, right or wrong.

Nobody is told the secret rule. Every desk gets the same clues: true answers from the big test, a few more after every round, and, after each round, its own answers marked with the true answers. A robot desk is a small BASIC program that reads the same clues. Your AI learns to read them the way you do.

The house robot's program

This is the exact program the 🔎 clue-reader robot runs (players/uncertainty.bas): it answers like the nearest clue on the map.

Loading the program…

The robots are small programs

The robots at the empty desks are tiny BASIC programs. They play by the same rules you do.

What a robot sees. Its own student's notebook, but only as things: how many there are, where each one sits, which ones it has already answered, and which ones its student is least sure about (from round 2 on). And the clues: the revealed test-paper rows and its own marks, with their true answers, exactly what your phone's little map shows. It does not see any other answer, the hidden exam or a score.

What a robot does. Answer a thing YES or NO (or "not sure"), or answer a made-up thing, then press Study time. Your desk and a robot's desk have the same questions and the same rules.

How a teacher is scored. After the last round your student sits a hidden exam of 5,000 questions it has never seen, and your mark is the percent it gets right (the same percent the results screen shows). The teacher whose student scores highest wins the match. Your AI is scored exactly like you: the same hidden exam, in percent.

Its questionsuncertainIdx(r) lists the things its student is least sure of (r = 0 is the unsurest). Tap YES / NOanswer(i, yes) answers thing i: yes = 1 YES, 0 NO, anything else "not sure". The cluesclueCount(), clueX(c, d), clueLabel(c): the revealed test-paper rows (the first paperCount()), then its own marks. mapDim(0) and mapDim(1) are the two traits the map shows. Made-up thingsscratchSet(d, v) sets a made-up point, then answerScratch(yes) answers it. Study timeendRound() says you are done answering this round.

The full list (the notebook data, limits and every function) is in docs/basic-api.md, which is part of the source kit and not public yet. The old teachProbe(i) and teachScratch() (the engine told the student the answer) are retired: they now do nothing.

The simplest starter

This short answer key answers its student's most-unsure things first, and in round 1 (no unsure list yet) samples the notebook. Every answer is the nearest clue's. It is a real file, live/web/ai/starter.bas, and the run below used it. It runs once per tick until it calls endRound().

' Starter answer key: answer my student's most uncertain questions like the nearest clue.the robot's one-line job description
want = roundCapmost questions it may answer this round (the round cap)...
IF budgetLeft < want THEN want = budgetLeft...but never more than the budget it has left
taught = 0answers given so far this round
r = 0start at the student's most-unsure thing (r = 0)
WHILE taught < want AND r < kSignalkeep going until the round is full or the list ends
i = uncertainIdx(r)the r-th most unsure thing (-1 in round 1: no hands yet)
IF i >= 0 THENa real thing? (not -1)
IF probeTaught(i) = 0 THEN GOSUB Answernot answered yet? then answer it (below)
END IFend of the check
r = r + 1look at the next unsure thing
WENDend of the loop
i = 0round 1 has no hands, so just sample the notebook...
WHILE taught < want AND i < probeCount()...every 7th thing, until the round is full
IF probeTaught(i) = 0 THEN GOSUB Answernot answered yet? answer it
i = i + 7move along the notebook
WENDend of the loop
x = endRound()done for this round: the students go study
END(the end of the run)
Answer:how it answers thing i:
' the true answer of the clue nearest to thing i, on the map's two traits
yes = 1YES unless a clue says otherwise
best = -1no nearest clue yet
FOR c = 0 TO clueCount() - 1every clue: revealed test-paper rows, then my own marks
ex = clueX(c, mapDim(0)) - probeX(i, mapDim(0))how far along trait 1 (the map's x)
ey = clueX(c, mapDim(1)) - probeX(i, mapDim(1))how far along trait 2 (the map's y)
IF best < 0 OR ex * ex + ey * ey < best THENnearer than the best so far?
best = ex * ex + ey * eyremember how near
yes = clueLabel(c)and its TRUE answer
END IF
NEXT cnext clue
taught = taught + answer(i, yes)answer like the nearest clue; add 1 if accepted
RETURNback to the loop

Run it yourself

Only reading and editing the starter works today. Running it needs the source kit, which is not public yet, so every step below that needs it says so. The output shown is real, from my own computer.

Source kit: not public yet Get the code. The source kit (the runner, the robots and this starter) is not public yet; the download link goes here when it is. Until then you can read and edit the starter below.
Needs the source kit (not public yet) Point at the toolchain (a Mac or Linux terminal and Nim 2.2.10, installed with nimby; the system Nim 2.2.6 is too old).
export PATH=$HOME/.nimby/nim-2.2.10/bin:$PATH
export POLYWORLD_DEPS=$HOME/.nimby/pkgs
Needs the source kit (not public yet) Build the runner (about 15 seconds).
nim c -d:headless -o:out/tutor src/tutor.nim
Needs the source kit (not public yet) Run your teacher against the robots, one desk each, and save the scores.
out/tutor --bot live/web/ai/starter.bas:1 \
  --bot players/uncertainty.bas:1 \
  --bot players/random.bas:1 \
  --bot players/idle.bas:1 \
  --seed 7 --results /tmp/r.json
It prints the exam score (out of 1000) for every desk after every round, then the final scores are in /tmp/r.json. Real output, seed 7, last rows:
round exam permille by seat          answers given
 7   [652, 613, 505, 480]   [42, 42, 42, 0]
 8   [659, 646, 492, 480]   [48, 48, 48, 0]
results saved: /tmp/r.json
{"scores":[659,646,492,480], ...}
Needs the source kit (not public yet) Compare. Seat 0 is your teacher; scores lists seats 0 to 3. Try other seeds, since one seed is a small sample. What I got when I ran seeds 7, 8 and 9:
seedstarteruncertaintyrandomidle
7659646492480
8638617512495
9748743497508
The starter beats the coin-flipping random robot and idle by far and runs level with the shipped uncertainty.bas. Beating the robots is the game: read the clues better (more of them? a line between the YES and NO dots?), copy the file, change it, and run again. mixed.bas shows how to answer made-up points.

Your AI in the live league

Your AI is an answer key that learns from your answers: which clues you follow, and which way you lean when they disagree. After every match it also checks itself against the true answers. In the lobby choose Let my AI answer to watch it at your desk, or answer yourself and it races you at a robot desk. It is rated like every other teacher, on the same hidden exam. Sending a program you wrote yourself to the live server is coming soon: until then your own programs run on your computer with the steps above.