Understanding the Build It / Use It Philosophy in AI Engineering Curriculum

The "Build It / Use It" philosophy is a two-step pedagogical approach where learners first implement algorithms from first principles using only standard libraries, then rebuild the same solution with production frameworks like PyTorch, ensuring deep mathematical understanding alongside practical engineering skills.

The rohitg00/ai-engineering-from-scratch repository structures its entire curriculum around this distinctive methodology. By enforcing a rigid six-beat lesson pattern, the curriculum transforms abstract AI concepts into concrete, transparent building blocks that developers can both understand deeply and deploy professionally.

The Six-Beat Structure and Core Philosophy

According to the repository's README.md at line 224, the "Build It / Use It" split serves as the spine of the entire program. This architecture mandates that every lesson follows a specific sequence where learners must complete a manual implementation before accessing high-level abstractions.

The Build Phase

The Build phase requires learners to write core algorithms using only the language's standard library. In files like phases/*/code/main.py, phases/*/code/main.ts, phases/*/code/main.rs, or phases/*/code/main.jl, students construct components such as tokenizers, back-propagation engines, or attention mechanisms entirely from scratch. This forces direct engagement with underlying mathematics and low-level mechanics without the masking effects of abstraction layers.

The Use Phase

The Use phase immediately follows, requiring students to implement the identical concept using production libraries such as torch, numpy, or TypeScript frameworks. As documented in AGENTS.md at line 11, this stage produces reusable artifacts—scripts, notebooks, or modules—that integrate directly into professional workflows and can be dropped into day-to-day projects.

Practical Example: Linear Regression Implementation

The curriculum demonstrates this philosophy through parallel implementations of identical concepts. Consider a simple linear regression model mapping inputs to outputs using the equation y = wx + b.

Build It: Pure Python Implementation

The "build" version appears in phases/*/code/main.py, implementing gradient descent manually without external dependencies:


# Build a linear regression model manually

import random
random.seed(0)

class LinearModel:
    def __init__(self):
        self.w = random.random()
        self.b = random.random()

    def predict(self, x):
        return self.w * x + self.b

    def train(self, xs, ys, lr=0.01, epochs=1000):
        # Simple gradient descent on MSE

        for _ in range(epochs):
            dw, db = 0.0, 0.0
            for x, y in zip(xs, ys):
                y_pred = self.predict(x)
                error = y_pred - y
                dw += error * x
                db += error
            n = len(xs)
            self.w -= lr * (2 / n) * dw
            self.b -= lr * (2 / n) * db

# Demo

xs = [1, 2, 3, 4]
ys = [3, 5, 7, 9]          # y = 2x + 1

model = LinearModel()
model.train(xs, ys)
print(model.w, self.b)    # ≈ 2.0, 1.0

Use It: PyTorch Production Implementation

The corresponding "use" version leverages torch.nn and automatic differentiation, stored in the lesson's output directory (phases/*/outputs/*):

import torch
import torch.nn as nn
import torch.optim as optim

# Define the same model using torch.nn

model = nn.Linear(1, 1)    # weight and bias are learnable parameters

criterion = nn.MSELoss()
optimizer = optim.SGD(model.parameters(), lr=0.01)

# Training data (as tensors)

xs = torch.tensor([[1.0], [2.0], [3.0], [4.0]])
ys = torch.tensor([[3.0], [5.0], [7.0], [9.0]])

# Train

for _ in range(1000):
    optimizer.zero_grad()
    outputs = model(xs)
    loss = criterion(outputs, ys)
    loss.backward()
    optimizer.step()

print(model.weight.item(), model.bias.item())  # ≈ 2.0, 1.0

Both implementations converge to approximately w ≈ 2.0 and b ≈ 1.0, visually demonstrating that the library merely automates the manual gradient calculations performed in the Build phase.

Pedagogical Advantages of the Dual Approach

This bifurcated structure delivers three specific advantages documented throughout the repository's lesson files (phases/*/docs/en.md). First, it guarantees mathematical literacy by preventing abstraction blindness—students manually calculate every gradient and parameter update. Second, it creates precise mental models that map library APIs to their underlying tensor operations, making debugging and performance optimization intuitive. Third, it generates production-ready artifacts that transition seamlessly from educational exercises to deployed solutions.

Summary

  • The "Build It / Use It" philosophy mandates hand-coding algorithms from first principles before touching production libraries.
  • The curriculum follows a six-beat structure defined in README.md where the Build/Use split forms the program's organizational spine.
  • The Build phase restricts implementation to standard libraries (Python, TypeScript, Rust, Julia) to expose low-level mechanics.
  • The Use phase applies identical concepts through frameworks like PyTorch, creating reusable workflow components documented in AGENTS.md.
  • Final artifacts stored in phases/*/outputs/* transform black-box libraries into transparent, deployable building blocks.

Frequently Asked Questions

What is the "Build It / Use It" philosophy in AI engineering?

The "Build It / Use It" philosophy is a pedagogical framework requiring learners to first implement algorithms manually using only standard libraries, then rebuild the same solutions using production frameworks like PyTorch or NumPy. This approach ensures students understand the underlying mathematics and gradient calculations before relying on abstraction layers, as implemented throughout the rohitg00/ai-engineering-from-scratch curriculum.

How does the "Build It / Use It" approach benefit AI engineering students?

Students gain mathematical literacy by manually computing gradients during the Build phase, then learn framework proficiency by achieving identical results through high-level APIs in the Use phase. According to the repository's AGENTS.md, this generates reusable artifacts while preventing "abstraction blindness"—the common anti-pattern where developers use tools without understanding their underlying mechanics.

Which programming languages does the curriculum support for the "Build It" phase?

The curriculum supports Python, TypeScript, Rust, and Julia for hand-crafted implementations, with source files located in phases/*/code/main.* directories. Each implementation uses only standard libraries during the Build phase, ensuring students learn both language fundamentals and algorithmic concepts without external dependencies.

How is the "Build It / Use It" structure organized in the repository?

The structure follows a six-beat lesson pattern explicitly defined in README.md (line 224), where the Build/Use split forms the curriculum's central organizing principle. Each lesson's documentation in phases/*/docs/en.md presents both implementations sequentially, while phases/*/outputs/* stores the final reusable artifacts produced during the Use phase.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →