What Is the Build It / Use It Methodology in AI Engineering?
The Build It / Use It methodology is a dual-phase learning approach where students first implement algorithms from raw mathematical principles without external libraries, then re-implement them using production frameworks like PyTorch or scikit-learn to understand exactly what the framework abstracts away.
The Build It / Use It methodology forms the structural backbone of the rohitg00/ai-engineering-from-scratch curriculum. This pedagogical pattern splits every lesson into two distinct implementation phases, ensuring learners internalize mathematical foundations before touching high-level abstractions. Across all 503 lessons, from linear algebra fundamentals to large language model training, this split creates a consistent learning loop that bridges theoretical computer science and production engineering.
The Six-Beat Learning Loop
According to the curriculum overview in README.md (lines 99-101), each lesson follows a rigid six-beat structure: MOTTO → PROBLEM → CONCEPT → BUILD IT → USE IT → SHIP IT. The Build It / Use It methodology occupies the critical middle beats where implementation occurs, flanked by conceptual framing and final artifact delivery.
Build It Phase: Implementation From Raw Mathematics
The Build It phase requires students to implement algorithms using only standard Python and mathematical operations—no external machine learning libraries allowed. This forces explicit handling of every mathematical operation, from deriving back-propagation equations to constructing attention matrices by hand.
Consider the linear regression example found in the curriculum materials. Here is the raw implementation without dependencies:
# 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
This version exposes the exact covariance and variance calculations underlying ordinary least squares, making the derivation transparent.
Use It Phase: Production-Grade Reimplementation
The Use It phase immediately follows, requiring the same algorithm to be rebuilt using production-grade libraries such as PyTorch, JAX, or scikit-learn. Because the learner has already manually coded every step, the framework's abstractions become visible rather than mysterious.
Here is the same linear regression using scikit-learn:
# Use It – leveraging a production library (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 comparison reveals exactly what LinearRegression.fit() abstracts away: the manual covariance calculation, mean centering, and numerical stability handling.
Why the Build It / Use It Methodology Works
This dual-phase approach serves two distinct pedagogical purposes that reinforce each other, as documented in the curriculum source files.
Conceptual Clarity
By writing the raw version first, you internalize the mathematics and logic. When you later encounter the library implementation, you recognize the underlying operations beneath the API. According to AGENTS.md (lines 11-12), this sequential approach ensures the library version becomes a transparent wrapper rather than a black-box mystery, allowing you to debug failures at the mathematical level.
Practical Competence
Each lesson concludes with a reusable artifact—whether a prompt, skill, agent, or MCP server—that you have built both from scratch and with a real-world stack. These artifacts are immediately deployable to downstream projects, ensuring theoretical knowledge converts to production capability. You end each lesson knowing not just how to call an API, but why the API produces specific results.
Real-World Application in the Curriculum
A concrete implementation of this methodology appears in Phase 3 – Deep Learning Core, Lesson 10: Build Your Own Mini Framework. Students first hand-write a tiny autograd system in phases/03-deep-learning-core/10-mini-framework/code/mini_framework.py, then re-implement the identical model using PyTorch in mini_framework_torch.py.
This specific lesson, referenced in README.md (lines 99-101), demonstrates the performance gains of optimized frameworks while cementing understanding of automatic differentiation mechanics. The final artifacts are stored in phases/03-deep-learning-core/10-mini-framework/outputs/, ready for integration into larger systems.
Summary
- The Build It / Use It methodology structures the AI Engineering from Scratch curriculum into six beats, with the implementation phases occupying the critical center.
- Build It requires raw Python implementations from mathematical first principles, exposing every calculation and derivation.
- Use It mandates re-implementation with production libraries like PyTorch or scikit-learn, revealing what frameworks abstract and optimize.
- This dual approach generates conceptual clarity and practical competence, producing reusable artifacts ready for production deployment.
- The pattern repeats across 503 lessons, from linear regression to large language model training, ensuring consistent skill transfer from theory to engineering.
Frequently Asked Questions
What is the main difference between the Build It and Use It phases?
The Build It phase requires implementing algorithms using only standard Python and mathematical operations, forcing you to handle every derivation manually. The Use It phase reconstructs the same algorithm using production libraries like PyTorch or scikit-learn, allowing you to see exactly which optimizations—such as vectorized operations or numerical stability fixes—the framework provides.
Why implement algorithms from scratch before using libraries?
Implementing from scratch first internalizes the mathematical foundations, making the library implementation a transparent wrapper rather than a black box. According to the curriculum documentation in AGENTS.md (lines 11-12), this sequence ensures you understand why certain defaults exist, where performance tricks happen, and how to debug when models behave unexpectedly.
How many lessons follow the Build It / Use It methodology in the AI Engineering from Scratch repository?
All 503 lessons in the curriculum follow this methodology, ranging from linear algebra fundamentals to large language model training. The consistent six-beat structure (MOTTO → PROBLEM → CONCEPT → BUILD IT → USE IT → SHIP IT) appears in every lesson, with the methodology explicitly defined in README.md (lines 99-101).
Can I skip the Build It phase and go straight to Use It?
Skipping the Build It phase defeats the pedagogical purpose of the methodology. Without first implementing the raw mathematics in mini_framework.py or similar lesson files, you cannot recognize what the library abstracts away or understand why specific API defaults exist. The curriculum is designed as a progression where the Build It phase creates the mental model necessary for effective Use It implementation.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →