What Is the Build It / Use It Methodology in AI Engineering?

The Build It / Use It methodology is a dual-phase learning approach where you first implement algorithms from scratch using raw mathematics, then rebuild them with production libraries to understand exactly what frameworks abstract away.

This structured pedagogy forms the backbone of the AI Engineering from Scratch curriculum by rohitg00. Each of the 503 lessons follows a consistent six-beat pattern that bridges theoretical understanding with production-ready implementation skills.

The Six-Beat Lesson Structure

Every lesson in the curriculum follows a rigid structural template designed to maximize retention and practical applicability. As outlined in README.md (lines 99-101), the sequence is:

MOTTO → PROBLEM → CONCEPT → BUILD IT → USE IT → SHIP IT

The methodology is anchored by the middle two stages. While the first three beats establish context and theory, the Build It and Use It phases constitute the core learning loop. This split ensures that learners don't just consume APIs but actually understand the mechanics beneath them.

The Build It Phase: First Principles Implementation

In the Build It phase, you implement algorithms from raw mathematics without any external libraries or frameworks. This forces deep comprehension of underlying concepts rather than superficial API memorization.

Specific implementations include:

  • Deriving back-propagation equations by hand to understand gradient flow
  • Constructing a tokenizer grammar from scratch to grasp tokenization mechanics
  • Coding an attention matrix using only basic Python and NumPy operations

This approach exposes the exact mathematical formulas and logical steps that production frameworks later encapsulate. You write every line of code that handles the computation, leaving no room for "black box" mystery.

The Use It Phase: Production Library Integration

The Use It phase re-implements the same algorithm with a production-grade library such as PyTorch, JAX, or scikit-learn. Because you already know every step of the algorithm from the Build It phase, you can precisely identify what the framework abstracts away, why certain defaults exist, and where performance optimizations occur.

This phase transforms abstract knowledge into practical competence. According to AGENTS.md (lines 11-12), you end each lesson with a reusable artifact—whether a prompt, skill, agent, or MCP server—that you built both from scratch and with a real-world stack, ready for downstream projects.

Why This Approach Works

The methodology serves two distinct but complementary purposes:

  • Conceptual clarity: By writing the "raw" version first, you internalize the mathematics and logic. The library version becomes a transparent wrapper rather than an opaque mystery.
  • Practical competence: You develop portable skills that work across different frameworks because you understand the underlying primitives, not just specific APIs.

This dual implementation strategy appears across all 503 lessons, from linear-algebra fundamentals to large-language-model training, ensuring a consistent learning loop that balances theory and production skills.

Code Example: Linear Regression

Here is a minimal illustration of the philosophy using linear regression, demonstrating the exact implementation differences between phases.

First, the Build It implementation from first principles:


# Build It – from first principles (no external deps)

import math

def fit_linear_regression(xs, ys):
    n = len(xs)
    mean_x = sum(xs) / n
    mean_y = sum(ys) / n
    # cov(x, y) / var(x)

    slope = sum((x - mean_x) * (y - mean_y) for x, y in zip(xs, ys)) / \
            sum((x - mean_x) ** 2 for x in xs)
    intercept = mean_y - slope * mean_x
    return slope, intercept

def predict(slope, intercept, x):
    return slope * x + intercept

Then, the Use It implementation leveraging scikit-learn:


# Use It – leveraging a production library (e.g., scikit-learn)

from sklearn.linear_model import LinearRegression
import numpy as np

def fit_linear_regression_sklearn(xs, ys):
    model = LinearRegression().fit(np.array(xs).reshape(-1, 1), ys)
    return model.coef_[0], model.intercept_

The Build It version exposes the exact formula for the slope and intercept, while the Use It version shows how the same calculation is encapsulated in a well-tested library with built-in optimizations.

Real-World Application in the Curriculum

A curriculum-specific example appears in Phase 3 – Deep Learning Core, Lesson 10: Build Your Own Mini Framework. In this lesson, the author first hand-writes a tiny autograd system in phases/03-deep-learning-core/10-mini-framework/code/mini_framework.py, then swaps it for PyTorch in phases/03-deep-learning-core/10-mini-framework/code/mini_framework_torch.py to observe the performance gain and abstraction trade-offs.

The final artifacts are stored in phases/03-deep-learning-core/10-mini-framework/outputs/, representing the "Ship It" stage of the workflow. These files collectively demonstrate how the curriculum enforces the Build It / Use It loop, turning abstract algorithmic insight into concrete, production-ready tools.

Summary

  • The Build It / Use It methodology splits every lesson into two implementation phases: first principles followed by production libraries.
  • You write algorithms from raw mathematics in the Build It phase, exposing exact formulas and logic without framework abstraction.
  • The Use It phase rebuilds the same solution with PyTorch, JAX, or scikit-learn, revealing what frameworks hide and why.
  • This approach appears in all 503 lessons of the AI Engineering from Scratch curriculum, from linear regression to LLM training.
  • Each lesson produces a reusable artifact (prompt, skill, agent, or MCP server) that works in both raw and production implementations.

Frequently Asked Questions

What is the main benefit of building algorithms from scratch before using libraries?

Building from scratch first ensures conceptual clarity. When you derive back-propagation or construct attention matrices manually, you internalize the mathematics. The library version becomes a transparent wrapper rather than a black box, allowing you to debug effectively and understand edge cases that abstraction might hide.

Which production libraries are used in the Use It phase?

The curriculum primarily uses PyTorch, JAX, and scikit-learn during the Use It phase. The specific library choice depends on the lesson domain—deep learning lessons typically use PyTorch or JAX, while traditional machine learning lessons leverage scikit-learn.

How does the Build It / Use It methodology help with AI engineering job readiness?

This methodology ensures you understand underlying primitives rather than just framework APIs. When you encounter bugs, performance issues, or need to customize architectures, you can reason through the mathematics because you've implemented it manually. Additionally, you produce reusable artifacts (agents, MCP servers, or model components) that demonstrate production competency to employers.

Where can I find examples of the full six-beat lesson structure?

The complete structure is documented in README.md (lines 99-101) of the rohitg00/ai-engineering-from-scratch repository. Concrete implementations appear in lesson directories like phases/03-deep-learning-core/10-mini-framework/, which contains both the raw implementation (mini_framework.py) and PyTorch version (mini_framework_torch.py) along with the shipped artifact in the outputs/ directory.

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 →