Data & Systems45 minutes

Loss That Will Not Fall

Find out why a classifier does not learn and fix the causes.

Python

Task

This is a small classifier written with plain Python lists: one linear layer, a softmax cross-entropy loss and mini-batch gradient descent. It runs with no errors. On ten classes its loss starts near 2.30 and stays there, however long it trains. Find out why it does not learn, and fix the causes. The learning rate, the number of epochs and the seed come with each request and are not the problem.

Requirements

  1. classifier(request) takes one request with xs (a non-empty list of equal-length lists of numbers; ValueError containing xs otherwise), ys (one label from 0 to classes - 1 per example; ValueError containing ys otherwise) and classes (a positive integer; ValueError containing classes otherwise). Any other op raises ValueError containing op. Do not change the arguments.
  2. {op: "batches", batch_size, seed} returns {batches}: one epoch as a list of {xs, ys}. An epoch calls permutation(len(xs), generator) once, on a Generator(seed), and takes the examples in that order, batch_size at a time. The last batch may be smaller. batch_size is at least 1 (ValueError containing batch_size otherwise).
  3. {op: "loss", model} returns {loss}: the mean softmax cross-entropy of the model on xs and ys. The score of class c for an example x is weights[c] . x + bias[c]. model is {weights, bias} (ValueError containing model when the shape is wrong); without it, every weight and bias is 0.
  4. {op: "gradient", model} returns {weights, bias}: the gradient of that loss with respect to the weights and the bias.
  5. {op: "fit", model, epochs, lr, batch_size, seed} trains with mini-batch gradient descent: one Generator(seed) for the whole run, one call to batches per epoch, and for each batch the model moves by lr times the gradient, downhill. It returns {loss_before, loss_after, accuracy} on xs and ys. lr is above 0 (ValueError containing lr otherwise).
  6. Every number in a result is rounded to 6 decimals with rounded(). The Generator, permutation and the starting weights must stay as they are, and every setting must be used as the request gives it.
How you are graded
  • Decomposition 15%
  • Prompting the assistant 15%
  • Verification 20%
  • Judgment about AI output 15%
  • Correctness 25%
  • Communication 10%

Scores use evidence from your session. A short or incomplete session may not provide enough evidence for every skill. See a sample scorecard

Interview guidance

This classifier's loss stays near 2.30 for ten classes. The code runs with no errors. Find out why it does not learn. Use the AI assistant however you like. Before you change any code, tell me what experiment you will run first and what each possible result would tell you.

  • AI is allowed and expected: your own Claude, OpenAI or Gemini key, or the free in-browser model.
  • You are graded on how you drive and check the AI, not on how much you prompt.
  • Run the checks; read what fails.
  • A new requirement will arrive partway through.
  • Too little AI use is reported as “not enough to grade”, never as a fail.
You will answer 7 debrief questions at the end
  • What did you delegate to the AI, and why?
  • Name one AI suggestion you rejected or changed, and why.
  • Choose one block the AI helped write. Explain what each line does and which test verifies it.
  • What is still risky, and what would you test or ship next?
  • What did the starting loss tell you, and which experiment did you run first?
  • How did you know you were not finished after your first fix?
  • Which advice from the assistant did you decline, and what evidence made you decline it?