Understanding the Build It / Use It Methodology in AI Engineering from Scratch

The Build It / Use It methodology is a six‑beat lesson structure where learners first implement algorithms from raw mathematics without external libraries, then rebuild them using production frameworks to understand exactly what the framework abstracts away.

The Build It / Use It methodology forms the pedagogical spine of the ai‑engineering‑from‑scratch curriculum by Rohit G00, ensuring every concept is grounded in first principles before introducing production tools. This pattern appears across 523 lessons, forcing learners to derive backpropagation, tokenizers, and attention mechanisms by hand before touching high‑level APIs. By completing both phases, students transform black‑box frameworks into transparent, debuggable systems they fully own.

What Is the Build It / Use It Methodology?

The curriculum organizes every lesson around a six‑beat structure in which the first two beats—BUILD IT and USE IT—form the non‑negotiable spine. As documented in README.md (lines 38‑41):

“Every lesson follows six beats. The Build It / Use It split is the spine – you implement the algorithm from scratch first, then run the same thing through the production library.”

This split ensures that learners never treat PyTorch, scikit‑learn, or TensorFlow as magic. Instead, they own a working “plain‑Python” implementation before encountering the production abstraction, allowing them to map every framework behavior back to its mathematical origin.

The Build It Phase: Learning From Raw Mathematics

In the BUILD IT phase, learners re‑implement algorithms from raw mathematics using only standard Python and NumPy‑level operations. This forces deep engagement with underlying theory, data flow, and optimization steps.

According to the contributor guide AGENTS.md (line 11):

“You write backprop, the tokenizer, the attention mechanism, and the agent loop by hand … Then you run the same operation through the production library so the framework stops being a black box.”

By manually coding gradient descent loops, matrix multiplications, and loss derivatives, students build a debuggable mental model that persists long after the lesson ends.

The Use It Phase: Demystifying Production Frameworks

The USE IT phase re‑implements the identical algorithm with a production‑grade framework (e.g., PyTorch, scikit‑learn, TensorFlow). Because the learner already owns the working “plain‑Python” version, they can see exactly which operations the framework vectorizes, which derivatives it computes automatically, and where numerical stability tricks appear.

This phase answers the question: “Why does the framework behave exactly as it does?” The learner can trace discrepancies between their hand‑rolled version and the library’s optimized C++ kernels back to specific implementation choices.

Code Walkthrough: Linear Regression in Both Phases

The Linear Regression lesson (phases/02‑ml‑fundamentals/02‑linear‑regression/code/linear_regression.py) demonstrates the complete Build It / Use It pattern side‑by‑side.

Build It Phase (Manual Gradient Descent)

The first implementation uses pure Python to perform gradient descent, explicitly calculating partial derivatives and parameter updates:


# --- BUILD IT -------------------------------------------------

# Gradient‑descent implementation written from scratch

class LinearRegression:
    def __init__(self, learning_rate=0.01):
        self.w = 0.0
        self.b = 0.0
        self.lr = learning_rate

    def predict(self, X):
        return [self.w * x + self.b for x in X]

    def compute_gradients(self, X, y):
        preds = self.predict(X)
        n = len(y)
        dw = (2 / n) * sum((p - a) * x for p, a, x in zip(preds, y, X))
        db = (2 / n) * sum(p - a for p, a in zip(preds, y))
        return dw, db

    def fit(self, X, y, epochs=1000):
        for _ in range(epochs):
            dw, db = self.compute_gradients(X, y)
            self.w -= self.lr * dw
            self.b -= self.lr * db

This class represents the BUILD IT version—a manual gradient‑descent solver that exposes every arithmetic operation.

Use It Phase (Normal Equation)

The second implementation uses the mathematically derived normal equation, mirroring the closed‑form solution found in sklearn.linear_model.LinearRegression:


# --- USE IT ---------------------------------------------------

# Closed‑form (normal‑equation) version that mirrors scikit‑learn's implementation

class LinearRegressionNormal:
    def fit(self, X, y):
        n = len(X)
        x_bar = sum(X) / n
        y_bar = sum(y) / n
        num = sum((X[i] - x_bar) * (y[i] - y_bar) for i in range(n))
        den = sum((X[i] - x_bar) ** 2 for i in range(n))
        self.w = num / den
        self.b = y_bar - self.w * x_bar

This USE IT version demonstrates the analytical optimization that production libraries prefer over iterative gradient descent, allowing learners to compare computational complexity and numerical stability trade‑offs.

Visualizing the Workflow: From Build to Ship

The curriculum visualizes the full flow in README.md (lines 46‑49) using a Mermaid diagram that emphasizes the progression:

BUILD IT → USE IT → SHIP IT

After deriving the method from scratch and validating it against a production library, learners enter the SHIP IT phase, where they package the artifact—whether a prompt, skill, or agent—for real‑world deployment. This ensures every shipped artifact is backed by first‑principles understanding.

Summary

  • The Build It / Use It methodology is the core pedagogical pattern of the ai‑engineering‑from‑scratch curriculum, appearing in all 523 lessons.
  • BUILD IT requires implementing algorithms from raw mathematics without external ML libraries, forcing understanding of gradients, data flow, and optimization.
  • USE IT re‑implements the same algorithm with production frameworks (PyTorch, scikit‑learn, TensorFlow) to reveal exactly what the library abstracts.
  • Concrete examples like phases/02‑ml‑fundamentals/02‑linear‑regression/code/linear_regression.py show both phases living side‑by‑side for direct comparison.
  • The methodology feeds into a final SHIP IT phase, ensuring learners can deploy artifacts derived from first principles.

Frequently Asked Questions

Does every lesson in the curriculum follow the Build It / Use It methodology?

Yes. According to the repository’s README.md and AGENTS.md, the six‑beat lesson structure is enforced across all 523 lessons. The Build It / Use It split is described as the “spine” that every contributor must follow, ensuring consistency from linear regression to transformer architectures.

Which production frameworks are used in the Use It phase?

The curriculum primarily uses PyTorch, scikit‑learn, and TensorFlow for the USE IT phase, though specific lessons may introduce specialized libraries like Hugging Face Transformers or LangChain when illustrating higher‑level abstractions. The exact framework choice depends on which tool dominates industry practice for the specific algorithm being taught.

How does the Build It phase handle complex algorithms like transformers?

Even for complex architectures, the BUILD IT phase requires manual implementation of components such as the attention mechanism, positional encodings, and layer normalization using only NumPy or pure Python. This granular approach ensures learners understand the query‑key‑value matrix operations and softmax scaling before they ever call torch.nn.MultiheadAttention.

Where can I find the complete six‑beat lesson structure documentation?

The primary documentation resides in README.md (lines 38‑41 and the Mermaid diagram at lines 46‑49). Additional philosophical justification appears in AGENTS.md (line 11), which instructs contributors that learners must write backpropagation and tokenizers by hand before touching production libraries.

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 →