Design and demo of an AI learning system: teaching, practice and a reasoning graph

Analysis · Report with the audio

Goal: optimize learning without skipping the struggle [0:00]

[0:00] Eero Alvar: This is my system for learning with AI. What began as a simple teaching loop has now developed into a full system for not just learning new things, but also for strengthening existing understanding.

0:09

[0:11] So same video structure as always, ideas and design first, and then a live demo.

0:17

[0:17] So a lot of things have changed since last time, but the goal has remained the same. So we wanna optimize learning, and what that means is maximizing understanding built per unit of mental effort spent.

0:32

[0:32] And specifically, what we want is real strong and usable understanding.

0:37

[0:37] So we can’t just focus on minimizing mental effort, ‘cause clearly struggle with the material is where the most learning happens.

Understanding versus using; recall and cues [0:47]

0:42

[0:47] Eero Alvar: Uh, I think the biggest risk in learning with AI is not hallucinations or errors by the LLM. Uh, it is accidentally skipping the struggle part and creating a, sort of an illusion of learning.

0:55

1:01

[1:01] So we don’t wanna outsource the thinking, but what we can do is allocate our mental effort better so that a maximal share of it goes into direct interaction with the material, the stuff that most contributes to learning, and a minimal share to everything else.

1:05

1:08

1:18

[1:18] All right, next. I think it’s helpful to make a distinction between understanding something and being able to use it. Let’s say we’re in a lecture. We’re following along, we understand everything, and we really do gain new understanding.

1:32

[1:32] But later, faced with a problem, the relevant ideas might never come to mind.

1:36

[1:36] Eero Alvar: And this doesn’t mean that the understanding we built was somehow fake [chuckles] uh, or something. It’s just that following the reasoning and recognizing when and how to use it are two different things.

1:46

1:49

[1:49] And what I’m referring to here is recall in a very general sense. So the right things, facts, connections, some problem-solving moves, whatever. But the right things coming to mind in the right situations and recall operates on cues, so features of a situation that bring a certain piece of understanding to mind.

2:08

2:10

2:13

[2:13] A newly learned idea only really comes reliably to mind in the context that it was taught in. So it starts off with a very narrow and weak set of cues, and then the job of practice is to broaden and strengthen that set of cues.

Two processes and the need for a learner model [2:30]

2:30

[2:30] Eero Alvar: All right, so two processes, a-at least for the purposes of this video and this system, we’ll think of learning as two processes. Teaching installs understanding, and practice solidifies it and makes it more usable.

2:44

[2:44] Now, if we wanna optimize these processes, we have to realize that whatever optimal really means here, uh, it’s clearly defined relative to the learner’s understanding.

2:48

2:56

[2:56] A step in teaching is redundant only relative to what you already understand, and unreachable only relative to what you don’t.

3:05

[3:05] There’s no optimal lesson or optimal practice problem in the abstract.

3:10

[3:10] So before anything can be optimized, the system needs a detailed picture of your understanding.

[3:16] Eero Alvar: So not just what you understand, but how.

3:19

[3:19] Your mental models, your particular ways of reasoning about the thing with all of its nuances and subtleties, you know.

3:28

[3:28] And a right or wrong answer alone isn’t able to provide that. I mean, two people can have the same wrong answer for very different reasons.

3:33

[3:36] The agent needs data about the process and not just the final answer, and this is what the thinking fields in the system are for.

3:42

3:45

[3:45] So almost every interaction has a field where you talk or type your raw thinking into.

3:52

[3:52] Basically just unfiltered, messy stream of consciousness. Uh, whatever comes to mind, really. This gives the agent continuous data about your understanding.

Teaching: probe, plan, teach [4:04]

4:04

[4:04] Eero Alvar: All right, so two processes. Let’s go through both.

4:07

[4:07] First, the teaching, how we install new understanding. The core ideas and the general process from the previous version have remained the same. So three phases.

4:18

[4:18] One, probe. Quick multiple choice questions that kind of binary search your edge on everything that the lesson will depend on.

4:26

[4:26] Two, plan. The agent reasons out the minimal dependency tree from what you already know to what you wanna understand. Then three, teach.

4:36

[4:36] The goal level of understanding is something feeling obviously true.

4:41

[4:41] So given a detailed picture of what you already hold as obviously true, the agent can simply walk down the path one reasoning step at a time in a way that each intermediate step lands as obviously true.

4:43

4:45

[4:54] Eero Alvar: And it’s gonna be very easy ‘cause it’s just one reasoning step.

4:57

[4:58] And we just repeat that process until the goal itself is one of them and also lands as obviously true.

5:05

[5:05] And this is the shape of each individual step. First you predict, then the agent teaches, and then it finally checks your understanding.

5:15

[5:15] So before anything is explained, you get to predict the next move, and this not only gives the agent more context and even more of your thinking before the teaching, but it also serves as a very valuable learning opportunity.

5:20

[5:28] You try to reason out the next step yourself.

5:32

[5:32] So two questions per step, and this leads to a very Socratic back and forth.

5:37

[5:37] Errors and confusions will surface immediately and can get fixed before anything is built on top.

Sub-agents and adaptive practice [5:43]

5:43

[5:43] Eero Alvar: The agent also has access to four kinds of sub-agents. A researcher for fact-checking, a PDF reader for reading PDFs efficiently, an SVG maker for creating diagrams, visuals, and other kinds of graphics, and a demo builder for creating interactive demos.

5:52

6:02

[6:02] All right, next, practice. And again, the goal here is to broaden and strengthen the set of cues that bring a piece of understanding to mind.

6:06

6:11

[6:11] So the agent’s job is not framed as making practice problems. It’s posing demands for the learner to recall the right things given some set of cues.

6:16

6:23

[6:23] A practice session is basically just a stream of problems that adapt, and as you work through the problems, your thinking is gonna give the agent very detailed evidence of where the difficulties actually are and what you struggle with.

6:29

[6:39] Eero Alvar: And then in the next problems, it can target and strengthen what needs to be strengthened.

6:46

[6:46] Really the goal is recall that succeeds with effort. Enough difficulty that you have to work and struggle, but not so much that you can’t make progress.

6:57

[6:57] There are two main ways that the difficulty can adapt.

7:00

[7:00] One, by changing how many ideas a problem combines.

7:05

[7:05] And two, how familiar the cues are.

7:09

[7:09] The thinking is submitted in chunks, and the agent is able to infer whether you actually solved it without you having to write down a final solution by hand.

7:18

[7:18] And this also means that when you really struggle, it’s gonna be able to give you the minimal hints, sort of little nudges toward the right directions.

Persistent record and the learning-harness idea [7:27]

[7:27] Eero Alvar: So when you don’t know something, it’ll lead you to discovering the solution yourself instead of just giving it to you.

7:34

[7:34] All right. So, so far we have established the two main systems, and now the component that connects the two. All right, so we need some kind of persistent record that accumulates as you learn things.

7:49

[7:49] The format should be one that can hold a very large body of understanding in few enough tokens that is still useful for context sharing, ‘cause that’s the main use case here.

7:55

8:01

[8:01] But we also wanna preserve as much precision as possible, especially when it comes to how ideas connect.

8:04

8:08

[8:08] So the model that I’ve decided to go with, and what I’ve found to have a nice balance of both compression and precision, is propositions and reasoning chains.

[8:21] Eero Alvar: These are extracted from the teaching sessions into one persistent structure of what you’ve been taught, and it can be rendered as a very nice graph.

8:22

[8:31] Ideas and the reasoning that connects them growing out as you learn.

8:32

8:36

[8:36] All right, so what we get is an agent harness for learning things. Quick tangent. What are agent harnesses? Well, basically everything around an LLM that lets it explore and act in some external system.

8:50

[8:50] For a coding agent harness, the system is a computer. For a research harness, the system is the internet. So for a learning harness, then the system is your brain, and the agent’s job is to build understanding in there.

Demo: the graph view [9:07]

9:07

[9:07] Eero Alvar: In every other harness, the human is the operator, the one driving the agent.

9:10

[9:13] But here you are the system being acted on.

9:16

[9:16] All right, I think this is enough talking. Uh, let’s see the system in action. All right, we’re in the app now. And yes, it is a desktop application, completely free, open source. You just plug your own keys in, and it works. But anyways, this is the graph. So we get a very nice overview of all the sessions, the core reasoning chains. Yeah, they can also form between sessions, like for example here. And then y-you can see the exact sessions that the node appeared in, and you can navigate to the original message.

9:44

9:46

[9:52] And apparently, we also have a connection from the differential form session to the gradient descent one.

[9:58] Eero Alvar: Yeah, this is the same differential form session that I did last time. Uh, you can import your own notes, any kinds of text files into this, which is what I’ve done here. But anyways, one more thing about the graph before we begin. Here, the arrows, the links have a very precise meaning. Uh, they indicate the direction of reasoning.

10:21

[10:21] For example here, this and this lead to this. So a cool thing that we can do is make the Y-axis the depth of reasoning, like this.

10:33

[10:33] So now we have the bottom level… Hold on, let me actually adjust the physics a bit. Yeah, so now we have the bottom level nodes at the bottom, uh, and then the reasoning, the argumentation always goes upwards.

Demo: probing on the transformer architecture [10:46]

10:42

[10:46] Eero Alvar: And I, I, like this way of visualizing, uh, the sessions. Uh, but anyways, let-let’s begin. All right, so we need a topic for the demo, and well, I’m thinking we learn LLMs.

10:53

[10:58] It’s gonna clearly fit into this, maybe build on top of neural networks, machine learning.

11:01

11:03

[11:04] Uh, that’s also something that I wanna really learn.

11:07

[11:07] Teach me LLMs. Oh yeah, I’m, I’m using this dictation here.

11:12

[11:12] Uh, so if you don’t use like Whisper flow or some other dictation software, then you can just use this. Yeah, you just need a Deepgram API key here, which is free.

11:20

11:23

11:25

[11:25] I wanna learn and understand the transformer architecture, heavy math and theory focus.

[11:32] Eero Alvar: So yeah, let’s begin. It’s gonna look at the graph. First question regarding the goal.

11:38

[11:38] I wanna understand, like, like a full conceptual understanding of what’s going on under the hood. And then the thinking is always gonna be sent along with the answers.

11:45

[11:48] Now it’s dispatched a research agent.

11:48

11:50

[11:50] That’s good. Yeah, it’s gonna run in the background. Same mechanics as my interactive sub-agents. You can keep asking questions here. And oh yeah, another thing.

11:59

[12:00] Uh, I’ve got this new confidence slider here. So you can assign a confidence level to your answer, which basically just means the probability that you think that your answer is correct.

12:08

[12:10] Uh, it’s gonna give really good data, a really easy way to give valuable data to the agent.

12:13

[12:16] But anyways, the thinking is still the main channel.

[12:20] Eero Alvar: But yeah, first question.

12:22

[12:22] Okay, let X contain one token representation per row. Soft maxing the rows. Yes. Query key and yeah, then we add the mask and then value vector, right? I mean, value matrix. What’s the difference between these two? Oh yeah, columns or rows. It’s, it’s rows. So this one, I’m fairly confident. And we got it. And then it’s always gonna have an explanation here as well. All right, next one. For one query…

12:52

[12:52] None of these immediately like look familiar. But this is just like applying the chain rule, right? Yeah. Okay. Let me clean up the name also, LLMs. All right, next.

[13:05] Eero Alvar: The attention score uses Q transpose K over…

13:05

[13:09] Now, in this probing phase, you’ll notice that the agent finds my edge, the edge of my understanding very quickly, and then it just drills into specifics to get a very detailed picture.

13:11

[13:21] For example, last time, it spends a long time just locating, uh, the edge. But here, ‘cause it has the graph context, it has found it, like, almost immediately.

13:27

13:30

[13:31] You’ll see that we’re at the edge of what I know just from the amount of thinking I put into every question. Variance one for the division is what I’m thinking.

13:43

[13:43] Okay. That took some work. You can see [chuckles] you can see the thinking. Also researcher finished. Uh, those up, so the variance is gonna be scaled by the square, so by nine, so eighteen.

13:51

[13:57] Eero Alvar: That would make the most sense. Zoomed in on the uncertainty in the previous question. Anyways, for rotary positional embeddings, I don’t know what that is.

14:11

[14:11] But just working it out from the formula, that makes sense. Transpose rules. Perfect. And yeah, the, the thinking is very important ‘cause this was, like, a- algebraically very simple, but the answer and the confidence alone, uh, wouldn’t be able to tell you that I have no idea what, what this is.

14:21

14:24

[14:32] Uh, I’m not sure what this is asking.

14:32

[14:36] Uh, I don’t know. Uh, I have no idea, really.

Demo: planning, teaching and extraction [14:43]

[14:43] Eero Alvar: All right, good. Well, I don’t know. Cx plus f n of x, uh, but this is a guess.

14:50

14:55

[14:55] The stuff at later positions, j is gonna change because we made an edit to r at an earlier position. Okay, that was wrong.

15:07

[15:07] I’m fairly confident in this answer.

15:10

[15:11] A lot of thinking again. I’m giving it a ton of thinking at every step.

15:14

[15:15] Uh, it’s gonna get a very, very detailed picture. Okay, yeah, it’s concluding the assessment now.

15:19

[15:20] So probing is done. All right, the agent is planning now. It’s dispatching more researchers. That’s good.

15:27

[15:27] We wanna guarantee correct information, and now it’s drawing the dependency graph.

15:30

[15:33] Eero Alvar: All right, there we go. This is what we got. Yeah, looks good. Accept the plan. And then teaching is gonna begin, first with a prediction.

15:41

[15:42] And yeah, the map is gonna be visible here on the side, and it’s gonna update.

15:43

15:46

[15:47] So you’re, you’re always gonna see where you are. Uh, but anyways, the same embedding matrix E is used…

15:50

[15:54] Fifty. Okay, good. All right, now first step, and there’s this thinking while reading field to give the agent even more context ‘cause it’s important that you’re gonna have, like, questions while you read.

16:01

[16:06] You’re gonna be thinking about things. I just like to have this on at almost all times.

16:09

[16:10] Two independent matrices, A for input embedding lookup and B for output scoring. Right. Okay.

[16:20] Eero Alvar: And then the verification question.

16:21

16:23

[16:23] Consider the scalar analog. So eighteen. All right, so I’m just gonna have a time lapse here.

16:29

[16:32] Uh, the teaching style and the methodology is the same as last time, and this is, of course, something that you can edit. All the system prompts are visible. You can edit and tweak them as you wish. But yeah, uh, the methodology is fundamentally the same, but this time it gets even more of your thinking per reasoning step because there are two questions and three thinking fields per step.

16:45

16:55

[16:57] So the explanations are gonna be even more tightly fitted to your specific understanding at every step of the way.

16:57

17:01

[17:05] Eero Alvar: And yeah, this also keeps it very interactive.

17:06

[17:08] Uh, no long walls of text.

17:10

[17:11] But, uh, this brings up a very important point about why walls of text are bad in this context ‘cause, ‘cause it’s not about [chuckles] uh, long pieces of text being unpleasant to read or, or something like that.

17:13

17:21

17:24

[17:27] No, uh, it is precisely because we wanna feed the agent data about your understanding as continuously as possible.

17:29

17:36

[17:37] That’s the reason why. All right, now we’ve got an extraction process going on here.

17:40

[17:42] So it’s distilling the session so far into reasoning chains.

17:44

[17:48] All right, the extraction finished. Yeah, we got a LLM session tree here.

Demo: practice session [17:52]

[17:52] Eero Alvar: Let me adjust the physics a bit. Yeah, so this is the session so far. Yeah, it’s m- it’s making connections to the other ones. All right, now that we’ve got these in the graph, uh, what we can do is run a practice session on them.

18:00

18:02

18:04

[18:04] So we just select the reasoning chains from this view, which just shows the raw reasoning chains, ideas, and how they connect.

18:08

18:10

[18:13] Uh, but anyways, we select the ones that we wanna practice, and then we start a practice session.

18:16

18:18

[18:18] LLMs math focus. Yes. We get our first problem.

18:23

[18:24] A model receives a token matrix X and computes… All right, so immediately the multiplying by the weight matrix, and it’s not gonna— I mean, that keeps the rows of X i-independent. They don’t influence each other.

[18:38] Eero Alvar: And ReLU X coordinate wise. So everything is just computed in parallel here. All right, I got thinking. All right, so it seems like I wasn’t being, uh, rigorous enough here.

18:51

[18:51] So it gave me a little hint, so I have that right idea, it seems like, um, but I need to write down Z four explicitly in terms of X four. Okay Is that sufficient? Let’s see. No coordinate expansion needed. Keep W and U as matrices. Oh yeah, that’s— dotted with the Ith column of U.

19:11

[19:14] That’s what I’ve got currently. All right, so that was one problem. And also, all, all the problems are— We, we can look at the metadata here.

19:22

19:24

[19:24] Eero Alvar: This one had three nodes that it was testing, so the targets of that problem were these three nodes. And because all of the problems are tagged with their exact propositions, well, I haven’t implemented it yet, but that’s gonna allow us to get some very targeted, uh, assessment data.

19:33

[19:43] ‘Cause currently the graph doesn’t tell you anything about how well you understand something. It just shows what has been covered. Yeah, the next step is to wire the assessments back into the graph, uh, but that’s, that’s later on.

19:53

[19:57] But anyways, next problem. Layer computes. So we get delta Y is zero zero.

20:01

[20:06] Yeah, I think you get the idea here. All right, so a few more things before we finish.

Extras: file access, own problems, interactive demos, wrap-up [20:10]

20:10

[20:10] Eero Alvar: The agents here have got the basic read-only toolset, so read, LS, find, and grep. So what you can do is…

20:19

[20:19] Well, for teaching sessions, you can obviously, you can give them your own sources, your own materials. Um, let me do find my abstract algebra lecture notes.

20:26

[20:31] Teach me.

20:32

[20:33] Yeah, I don’t know. Not even giving it a path here. Um, hopefully it finds it. Uh, it’s, it’s hidden away [chuckles] somewhere.

20:39

[20:42] Okay, yeah, it found it. Perfect. And also, for the practice sessions, you don’t have to run them based off of the reasoning chains.

20:45

20:48

20:50

[20:51] You can, for example, just give them your own problems. For example, I’ve got this complex analysis problem here.

[20:57] Eero Alvar: I’ll give it the path, then it’s gonna load that into the practice session, and we’re gonna be able to do that problem.

20:59

[21:05] So yeah, now it’s reconstructed the problem here, and we’re able to work on it in the practice session.

21:06

21:09

[21:12] Uh, ‘cause I, I think this is a very comfortable format. Uh, so yeah. I don’t think I’ve demoed the interactive demos yet. Uh, let’s go to an older session here, a gradient descent session.

21:24

[21:24] Make a visual SGD demo.

21:27

[21:27] Yeah, it’s gonna know how to do this proactively when it fits the session and helps with the teaching.

21:34

[21:34] Uh, now I’m just forcing it to make one. [chuckles] But let’s see what it comes up with. All right, we got a flashbang.

21:41

[21:44] Eero Alvar: Um, and this is why I have this switch over here, so that you can invert the colors.

21:45

21:47

[21:50] Um, all right. We got a demo. The— Okay, yeah, we can set the starting point, learning rate. A-Anyway, I think you get the idea.

21:59

[21:59] Okay, so that’s the system as of now. Uh, ‘cause this is, [chuckles] this is really only the beginning.

22:08

[22:08] I think I’ve got the, I think I’ve got the basic ideas, the general shapes down. So now the experimentation can really begin. So I’m very excited to hear your thoughts, your ideas, what works, what doesn’t, you know. Whatever comes to mind, really. [chuckles] But anyways, I, I guess that’s it.

[22:31] Eero Alvar: I’ll have all the links in the description. So yeah, uh, thanks for watching.

22:35

[22:36] I’ll see you in the next one.