DeepLLM Quiz
Machine Learning

Regularised least squares, online learning and multiple outputs

10 questions on batch and sequential learning, the LMS rule, regularised least squares, shrinkage and regression with several outputs.

  • 10 questions
  • Stopwatch
  • Instant feedback

Shown publicly with your score. Don’t use your full real name.

Sample questions

Play now ↑

Answers stay hidden. Start the quiz to play them.

  1. Sample 1

    Why is this kind of regularisation known in statistics as shrinkage?

    • It pulls the weight values towards zero
    • It reduces the number of training examples
    • It shortens the computing time
  2. Sample 2

    A model predicts three quantities from the same set of basis functions, with Gaussian noise on each. How does the fitting problem behave?

    • It requires three different sets of basis functions
    • It becomes three times harder in a way that cannot be shared
    • It splits into three independent regressions that share one calculation of the pseudo-inverse

How it works

  • One question per screen. An answer is final once sent.
  • You see right away whether you were right, with a short explanation.
  • The stopwatch runs: on equal scores, the faster player ranks first.
  • Only your best attempt counts, so replaying is never risky.

About this quiz

A model can be fitted in two very different ways. One looks at the entire training set at once and computes the best weights in a single step. The other looks at one example at a time, nudges the weights a little, and moves on. The first is called batch learning and the second sequential or online learning. The second is the ancestor of how almost every neural network is trained today, and it is the only choice when data arrive as a never-ending stream or when the data set is too big to fit in memory.

This quiz explores the online route first, using regression as the example. You will see how the update after each example depends on the mistake just made, what the learning rate does, and why the resulting rule has such a long history. It is a gentle preview of stochastic gradient descent, the workhorse of deep learning, in its simplest setting. You will also see how it compares with the batch solution in practical terms, such as memory and responsiveness.

The second topic is regularisation in the linear setting. Adding a penalty on the size of the weights to the error is the simplest way to keep a flexible model under control. The quiz asks what the penalty does to the weights, why the idea is known in statistics as shrinkage, and why this particular penalty is so convenient: it keeps the problem simple enough to solve exactly, and it quietly rescues the calculation when features are nearly duplicates of each other.

The last topic is prediction of several quantities at once. A common worry is that the problem becomes much harder when there are many outputs. In the linear model with a shared set of basis functions, it does not: the problem splits into separate ones, and the hard part of the calculation is shared. The quiz tests whether you can see why, including when the noise in different outputs is correlated. These ideas return in deep learning, where the same step-by-step update and the same penalty on weights are used, only with millions of weights instead of a handful. Each of the three topics is a small, exact version of something that later has to be done approximately and at a much larger scale.

Typical misunderstandings include thinking that online learning always gives worse answers than batch learning, that a penalty makes the problem harder to solve, and that several outputs always require several models. The quiz suits students and practitioners who want to connect classical regression with how neural networks are trained. There are 10 questions, each explained after you answer, and the quiz takes about four minutes.

Questions and answers

›How long does the quiz take?

About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation appears after every answer.

›Do I need to know gradient descent?

No. The quiz introduces the idea of nudging weights in the direction that reduces the error, and everything else follows from that. If you know that a model improves by reducing its mistakes step by step, you can answer every question.

›What is the difference between batch and sequential learning?

Batch learning uses the whole training set in one go to compute the weights. Sequential learning, also called online learning, goes through the examples one at a time and updates the weights after each. The first can give an exact answer, and the second can handle huge or streaming data without keeping it.

›What is the LMS rule?

LMS stands for least mean squares. After each example, every weight is changed by an amount proportional to the error on that example and to the value of the feature attached to the weight. It is a form of stochastic gradient descent for the sum-of-squares error, and it is one of the earliest learning rules for networks. It is also the ancestor of the weight updates used to train deep networks.

›What does the learning rate do?

It sets how large each update step is. A very small rate makes learning slow and steady. A large rate makes the weights jump around and can even make the error grow. Choosing it well is one of the main practical tasks of training any model by gradient methods. In practice it is common to start with a larger rate and to reduce it as training proceeds, a refinement that returns in the study of optimisation methods.

›What does regularised least squares do?

It minimises the data error plus a penalty on the size of the weights, with a coefficient that sets how strongly the penalty counts. The weights end up smaller than in the unregularised fit. This reduces the tendency to overfit, and the stronger the penalty the smoother the fitted curve becomes.

›Why is the squared-weights penalty so convenient?

Because the total error stays a simple bowl-shaped function of the weights, so its lowest point can be found in one step by solving linear equations. It also guarantees that the equations have a unique solution, even when some features are nearly identical. The same penalty is used in neural networks under the name weight decay.

›How does regression with several outputs work?

If all outputs use the same basis functions, the problem has a particularly convenient structure that keeps the calculation cheap. A linear model for many outputs is not much harder to fit than one for a single output. This is also why many practical systems that forecast several related quantities start from a shared set of features and a separate set of weights for each target, which is simple and cheap to maintain and to update.

More quizzes