Edgar San Martin, Jr.

Engineer's Framework for Learning with AI

AI is getting smarter faster than any of us can keep up with. So why bother learning how a Jacobian works when a model can compute one in a second?

I still think it’s worth it. Learning is how I find out what I’m interested in, and it’s a big part of how I grow as a person. It also means I can tell when the model gets something wrong. I’d rather be the one checking the answer than the one taking it on faith.

Purple sand glowing lightly on a polished marble floor in a white room.

Where the lesson starts.

Over the past two years I’ve used the same approach to teach myself linear algebra, multivariable calculus, C++ concurrency, and most recently machine learning. It’s pretty simple, and all you need is a chatbot subscription.

Ask for the course, not the answer

Most people use an LLM like Google. You ask a question, get an answer, and move on. That works fine for quick things, but you end up with a pile of disconnected answers and no map of the subject.

So I start by asking for a curriculum. I name a subject and ask it to break it into lessons on the big overarching topics, in an order that builds on itself. That first response is my syllabus.

One shape for every lesson

Then I ask for every lesson in the same format:

  1. An intro
  2. A high-level summary
  3. The relevant definitions
  4. An explanation as if I were a middle or high schooler
  5. Code snippets and an application
  6. A short review

The middle schooler or high schooler explanation sounds silly, but it’s the step I’d keep if I could only keep one. It gets the core idea into my head without the jargon, so when the formal definitions show up, they have something to attach to.

Treat it like a patient teacher

This is the part a textbook can’t do. It’s a chat, so if something doesn’t click, ask. Ask for another example, ask why a step works, ask what would happen if you changed an assumption. It’s like having a very smart, very patient teacher who doesn’t mind when you ask the same thing a fourth time. I don’t move on to the next lesson until I’m ready to.

Finish with code

At the end of a topic, or a group of related ones, I ask for a few problem sets I can solve by programming. I’m an engineer, so I don’t feel like I understand something until I’ve built it. Reading about matrix multiplication feels like understanding it, right up until you have to write it.

An example

Here’s how I started my linear algebra course. I trimmed it for length, and [...] marks where I cut.

Me:

Hey! I want to learn about linear algebra. Let’s do a lesson plan taught as if I am a CS student in grade school. For each lesson, we can have a short intro, high level summary, relevant definitions, code snippet and an application of this concept, and then a short review. Can you give me a short overview of the lessons in this subject matter we will go through together to start?

ChatGPT:

Hey! I’d love to teach you linear algebra. Since you have a computer science background, we’ll approach this as a CS student learning mathematics from the ground up, with simple explanations, Python implementations, and practical applications.

Our Course: 16 lessons, 4 modules

  • Module 1, Foundations: Scalars, Vectors, and Spaces · Vector Operations · Dot Products and Angles · Span, Basis, and Linear Independence
  • Module 2, Matrices and Transformations: Introduction to Matrices · Matrix Multiplication · Linear Transformations · Determinants, Inverses, and Rank
  • Module 3, Solving Problems: Systems of Linear Equations · Orthogonality and Projections · Least Squares · Eigenvalues and Eigenvectors
  • Module 4, AI and CS: SVD and PCA · Vector Embeddings · Neural Networks · Transformers

Every lesson has the same shape: introduction, high-level summary, definitions, walkthrough, Python code, application, and a review with a small coding exercise.

Ready for Lesson 1?

Me:

Let’s start lesson 1

ChatGPT:

Lesson 1: Scalars, Vectors, and Spaces

Imagine you’re building a 2D video game. Your character has a position on the screen: 3 units to the right and 4 units upward. Instead of storing two unrelated numbers, we can group them into a vector: [3, 4].

Scalar: a single number, like 5, -2, or 3.14.

Vector: an ordered collection of numbers. Its individual numbers are called components, and the number of components is its dimension.

[…]

A video game character might be described like this:

character = [
    100,  # health
    50,   # stamina
    20,   # strength
    15,   # defense
    8,    # speed
]

This is a 5-dimensional vector. It doesn’t mean the character lives in a five-dimensional universe. It means we’re representing the character using five numerical features.

[…]

Coding exercise: Implement a function that multiplies a vector by a scalar.

def scale_vector(vector, scalar):
    """
    Multiply each component of a vector
    by a scalar.

    Example:
    scale_vector([2, 3], 4) -> [8, 12]
    """
    # Your implementation here
    pass

Me:

def scale_vector(vector, scalar):
    """Scales vector and returns a new vector without modifying the input vector."""
    return [v * scalar for v in vector]

ChatGPT:

Correct! All four test cases pass.

One important observation: multiplying a vector by a positive scalar changes its length but not its direction. A negative scalar reverses its direction, and zero produces the zero vector.

One final conceptual question. Before we advance, I’d like you to reason about this. Suppose we have two vectors, a = [2, 3, 4] and b = [5, 6]. Can we add these two vectors together? Why or why not?

Think about what a vector’s dimensions represent. No coding necessary.

That’s the whole loop in one conversation. I got a syllabus, then a lesson built on something I already know (a game character), then an exercise, then a question to check that I understood the idea and didn’t just pass the tests.

What this won’t do

To be clear, this won’t make you an expert. That takes years of depth, hard problems, and being wrong a lot. LLMs also get things wrong and sound very confident about it, so if something matters, check it against a textbook, the docs, or your own code.

What it will do is speed you up a lot on topics you’ve never seen before. Going from “I don’t even know what to ask” to holding a real conversation about the subject happens way faster than it would on your own.

Why it’s worth it

For $20 a month, with the chatbot of your choice, you get a tutor, a syllabus writer, and a problem set generator. That’s a pretty good deal.

Which brings me back to why I started. Learning is still how you discover what you care about and who you want to become, and now you can do it on your own, with structure, whenever you want. So pick something you’ve been curious about and ask it for a course.