Skip to content
askwrong

the learn-by-doing workspace for developers

Start from wrong.Leave understanding.

Most AI tools hand you an answer and move on. AskWrong turns every question into a living course - taught at your level, pressure-tested with a deliberate flaw to catch, then scheduled back until it sticks. You leave knowing why, not just what to paste.

Create your account to start - courses, practice and spaced review, synced across devices.

Real interface, real content - switch topics, walk the steps, open a proof. No sign-in.

askwrong — learning workspace
interactive demo
askwrongLibrary / machine learning
Learning track / Machine learning
Gradient descent
model: qwen2.5-coder-32b · fast
Living course62% · 78 of 126 sections at practitioner
Learned1 of 14 chapters
i

Chapter 01What gradient descent doeswhat-gradient-descent-does

OBJECTIVES
  • Read each optimizer step as a downhill move on the loss surface.
  • Explain why following the negative gradient lowers the loss.
  • Spot when small steps converge versus overshoot the minimum.
TLDR

The gradient is the steepest-uphill vector; we step along its negative, scaled by η.

INTUITION

The slope the hiker feels is the gradient ∇L - the vector of partial derivatives, one per parameter. It points in the direction of steepest increase, so −∇L is the steepest decrease. The update rule writes that down: θ ← θ − η·∇L.

In practice ∇L is averaged over the batch, so the step size doesn't silently scale with how many samples you fed it.

for epoch in range(epochs):
grad = compute_grad(X, y, theta) # averaged over the batch
theta = theta - lr * grad
WORKED_EXAMPLEfrom Ask · session 2
Start at 1e-3 and watch the curve: smoothly down → try larger; sawtooth or NaN → halve it. This is exactly the symptom in your latest Ask - picked up again formally in Ch.3.
CONNECTIONS

Builds on §1.1 (Beginner) - the blindfolded-hiker analogy. Here “downhill” stops being a feeling and becomes a vector.

Chapter 02The update rule & learning ratethe-update-rule-learning-rate

OBJECTIVES
  • Write the update rule θ ← θ − η·∇L and name every term.
  • Predict how the learning rate η reshapes the trajectory.
  • Diagnose divergence from the shape of the loss curve.
TLDR

Average the gradient so η is batch-independent; scale features so one η fits every dimension.

INTUITION

Summing the gradient over a batch makes the effective step grow with batch size, so 1e-3 behaves differently at batch 16 versus 256. Averaging decouples η from n. Feature scaling does the spatial version of the same fix: if one feature ranges 0-1 and another 0-1000, the loss surface is a stretched ravine and no single η suits both axes.

  • The learning rate is the single most important knob.
  • Standardize features so the surface is round, not a ravine - then one η works everywhere.
WORKED_EXAMPLE
With a sum, doubling the batch doubles each step - same η, twice the overshoot. Dividing by len(y) keeps the step the same size regardless of batch, which is why frameworks default to the mean.
DEFINITION

When the inner loop is the bottleneck - a custom kernel, an embedded target, no NumPy - the identical update drops to a systems language. The math is unchanged; you just own the memory and the vectorization. Ask in C++ or Rust and the course writes the snippet in that language instead.

// theta -= lr * (Xt * (X*theta - y)) / n
void gd_step(const MatXf& X, const VecXf& y,
VecXf& theta, float lr) {
VecXf resid = X * theta - y; // batch error
VecXf grad = X.transpose() * resid;
grad /= static_cast<float>(y.size()); // average
theta.noalias() -= lr * grad; // in-place
}
CONNECTIONS

Builds on §2.1 (Beginner) - the Goldilocks step. Here it becomes η acting on a batch-averaged gradient, plus why scaling features matters.

Chapter 03Convergence theoryconvergence-theory

OBJECTIVES
  • State the convergence rate under convexity and smoothness.
  • Tell O(1/k) apart from linear convergence and know why.
  • Tie the safe step-size bound back to the curvature.
TLDR

On a quadratic, GD converges exactly when 0 < η < 2/β; above it, the error grows every step.

INTUITION

On a quadratic with largest curvature β, the error after each step is multiplied by ρ = max|1 − η·λ| over the curvatures λ. Keep ρ < 1 and the error shrinks geometrically; let η exceed 2/β and ρ > 1, so the error grows every step - the swing runs away. Your exploding gradient sat right in that regime.

  • Converges iff 0 < η < 2/β; sweet spot near η = 1/β.
  • Halving η is the first thing to try when the loss diverges.
WORKED_EXAMPLE
Flat-then-NaN by epoch 5 with an exploding gradient norm is the textbook η > 2/β signature - not bad data. Drop η by 4× and the same run converges.
CONNECTIONS

Builds on §3.1 (Beginner) - the over-pushed swing. Here that runaway has a precise threshold and a contraction rate.

Add your own →

Built on how people actually learn

Active recallSpaced repetition - FSRSThe Feynman techniqueLearning from errorno telemetry - no training on you

How it works

Tap a step - the loop opens in place.

One question in

A whole livingcourse out.

Five phases. Fully connected.

Any phase, from
any phase.

No fixed staircase, no “ask again” step — the next question is just another edge. The tutor routes you wherever the gap is: back to theory, straight into practice, out to a Feynman check.

The graph

Hover a phase — every phase connects to every other.

Memory model — try it

Play the forgetting curve.

Reviews: 2

Two reviews are already scheduled — click the chart to add your own. Each review flattens the decay; spacing them out is the whole trick. The tutor times them the moment before you’d forget.

Hover for memory level — click to review

MEMORY ↑TIME →ABOUT TO FORGET
FSRSThe modern spaced-repetition scheduler, running under the hood

The engine

Two ideas do the teaching

Everything else - the four graded surfaces, the schedule - is just machinery around these two.

01

Learning from error

Spotting a flaw forces you to hold the correct model in your head and compare. So one surface hands you an answer with a deliberate, real mistake and asks you to find it - the moment you catch it, you have understood it.

02

The Feynman technique

Every loop ends with you re-explaining the concept in your own words. The coach grades the explanation against the concept’s key points and files whatever you glossed over for spaced review.

Four graded retrieval surfaces - your Ask guess, Practice, Interrogate the flaw, and Feynman - feed one living course and one schedule. Theory and Answer are where you read; the graded surfaces are where you prove it.

effort is the only currency we care about

Start free.Then scale your learning.

Plans

Free
Start here
Always free
  • The full learning loop: Ask, Theory, Practice, Interrogate the flaw, Feynman
  • Theory at any depth, including PhD - free on every tier
  • 20 asks per day on the house model - we cover the inference
  • 10 saved cases, 30-day history
  • 5 document pages imported per month
Max
$20/mo /mo
  • Everything in Pro, plus:
  • Frontier models, 1M-token context
  • 150 asks per day on the house model, sustained
  • 100,000 saved cases, 1,000 scheduled reviews
  • 1,000 document pages imported per month
Sign in to upgrade

Questions, answered properly

Will it just give me the answer?

Eventually - with the why attached, a flaw to catch, and a question back to prove you got it. If you only wanted the answer pasted, you already have sixty chatbots for that. This is for the times you want to actually keep it.

How deep does the theory go?

As deep as you ask. Each topic is one living course you can read at beginner, practitioner, or PhD depth. At PhD it develops the subject formally - definitions, properties and theorems in rendered LaTeX, with cited sources and a proof-on-demand button on each statement. Proofs are generated only when you click, which is what keeps the deeper depth affordable. PhD depth is free.

Why is it called “AskWrong”?

Because being wrong is where learning starts. You bring a half-formed attempt, we work from it, and one step hands you a deliberately flawed answer to interrogate. Recognising what is wrong is what locks in what is right.

Do I need an account? Do you train on my questions?

Yes - you create a free account to start, because your course and schedule sync across your devices and need a home. We do not train on your questions, there is no telemetry, and we never sell your stack traces. No model training, ever. What you learn is yours and it stays yours - delete it any time and it is gone.

How do the limits work?

Every account gets a daily allowance of asks on the house model - the shared model we run and pay the inference for. When you hit it you see exactly what you hit and when it resets: our budget, never a fake “your limit”. Pro and Max raise the allowance and add cross-device continuity. The learning itself - every step of the loop, PhD depth included - is always free.

The answer is the byproduct. The understanding is the product.

Learn it for real.

Stop pasting answers you don’t understand. Create your account and run your first learning loop.