Brytalearn.How things workFind something
INTERACTIVE EXPLANATION

Can a machine learn the wrong pattern?

Train a real classifier on editable inspection cards. Reveal a confident mistake, repair a misleading shortcut, and freeze your model before opening its reserved test.

Enable JavaScript to change the conditions and run the interactive experiment.

Make a discovery

Matching examples is not the same as learning the intended rule. What a model can see, which annotations it receives, and how you evaluate it all shape what a good-looking score really means.

  • State the target question separately from the input features.
  • Distinguish a training annotation, a model score and an independent geometric answer.
  • Compare a straight, curved and flexible learned boundary using actual predictions.
  • Investigate a confident error caused by one supplied wrong annotation.
  • Diagnose dependence on a misleading batch mark through a paired intervention.
  • Keep training, validation, stress probes and reserved evaluation separate.
  • Interpret confusion counts, threshold decisions and log loss with their denominators.
  • Export an explicit model and describe what its evidence cannot establish.

Make a prediction

A model matches all 25 training annotations. What can you conclude?

  • It will classify every future card correctly
  • It fits these annotations at this threshold; evaluate appropriate new cards
  • Its log loss is exactly zero
Read the explanation

Training classifications can all be correct while loss remains nonzero and new cards reveal confident mistakes.

Understand it

Start with one exact question

A fictional print shop asks whether a dot’s center is inside a circular guide. Its decorative A/B batch mark is not part of that geometric rule. The dot’s visible size is not what is classified.

Choose the information available

The model receives numeric coordinates and the selected fixed features. It does not read pixels. A straight model sees x and y; a curved model also receives x²+y². The designer supplies this useful representation, while training learns its weights.

Learn by changing actual numbers

Every training update computes prediction errors from supplied annotations and adjusts all weights together. The score maps, weight table and loss curves use the same recorded weight snapshot. Playback reveals real optimization steps.

Find the first misleading success

A flexible model can fit the deliberately wrong outside-card annotation. It may then call a nearby outside dot inside with a high score. Compare the supplied label with the separately defined guide, then correct and refit.

Swap only the wrapper

The correlated-batch preset puts inside examples in A and outside examples in B. A batch-only model can look perfect on familiar marks. Reverse only the marks and inspect its predictions without changing positions or weights.

Repair a specific problem

Remove the batch feature or supply both marked versions at each training location. These paired cards share lineages; they are not independent measurements. Verify the repair on appropriate probes rather than assuming more examples always help.

Choose before testing

Use validation for choices, freeze the currently inspected weights and threshold, then open the reserved envelope. Once answers have influenced your choices, placing those same answers back in an envelope cannot make them unseen again.

Look closer at the science

Exact synthetic geometry

Each dot has integer coordinates u,v from −1000 to 1000; x=u/1000 and y=v/1000. The answer is inside when u²+v²≤490000, including the boundary. The guide radius is 0.7 and both map axes have equal scale. This is invented teaching data, not a production benchmark.

The predictor does not receive the answer

The feature vector contains only selected position calculations and possibly a stored visible batch mark. Guide answers are evaluator metadata. Training uses the annotations supplied on training cards, including intentionally wrong ones.

One logistic-regression family

The score is σ(w·f), where σ(z)=1/(1+exp(−z)). The main feature choices have 3, 4 or 29 weights. Flexible features add 25 fixed Gaussian bumps centered on a declared grid with width 0.2. These centers and widths are not learned hidden neurons or an infinite kernel.

A declared objective

Training minimizes mean binary log loss plus λ/2 times the sum of squared non-intercept weights. The intercept is unpenalized. The workbench reports data loss, penalty and total objective separately. Natural logarithms give nats per example.

A genuine simultaneous update

The gradient averages (score−annotation) times each feature, then adds the non-intercept penalty gradient. All coordinates update from the old weight vector. The conservative step η=1/B uses B=Σ||f||²/(4n)+λ, an upper bound derived from σ(1−σ)≤1/4. Validation and reserved labels are absent.

A budget is not convergence

Weights start at zero and at most 5000 updates are recorded. Editing examples, features or λ starts a fresh fit. In unregularized separable logistic regression, weights may continue growing as loss approaches zero. A finite update budget does not promise exact convergence or zero loss.

Capacity and the target shape

On the symmetric clean grid, the straight model settles at a constant inside score 9/25=0.36. A straight boundary cannot enclose the center while excluding the surrounding outside examples. Running more identical updates cannot add a missing representation.

Accuracy and loss can disagree

On the fixed noisy flexible example, λ=0 gives 35/36 validation classifications and mean loss about 0.106845; λ=0.02 gives 36/36 but loss about 0.345015. Regularization improves one criterion here while worsening another. Neither is a universal ranking of model quality.

A score is not verified certainty

A fitted score near 0.96 can be wrong on the deliberately noisy fixture. Calibration is about the relationship between predicted probabilities and observed outcomes across suitable data; a confident single prediction does not establish it.

Thresholds change decisions

Classify inside when the unrounded score is at least the threshold. Raising the threshold cannot increase true-positive or false-positive counts on fixed data. It leaves weights, scores and log loss unchanged. Exact ties count as inside.

Four counts, different questions

Inside is the positive class. TP finds an inside center, FP calls an outside center inside, FN misses an inside center, and TN rejects an outside center. Accuracy divides all correct predictions by all cards; precision divides TP by inside predictions; recall divides TP by actual inside cards. A zero denominator is undefined.

Independent fitting is only part of evaluation

Training fits weights; validation guides choices. A reserved set evaluates a frozen choice. Using reserved scores to tune settings compromises their untouched role even when none of those rows enters a gradient. The exposure marker persists locally.

A fixed reproducible envelope

The 64 reserved integer-grid positions use a documented 32-bit LCG with coordinate seed 48 and independent mark seed 49, rejecting original training/validation coordinates and duplicates. Their balanced class count happens for this seed; the generator does not enforce it. The code and answers remain inspectable, so this is not a secure exam.

Data edits can contaminate a split

Validation and reserved records stay fixed when training is edited. A shared coordinate or lineage is flagged. Changing an ID does not make a copy independent. The original validation grid is deliberately designed, rather than a representative random sample of a factory population.

Shortcut, leakage and shift

A pre-existing decoration can support a misleading shortcut without being a future answer leak. Reversing marks changes the input distribution while the geometric rule stays fixed. For a batch-only predictor, the target relationship conditional on its restricted input changes. An inspection-answer field created afterward is excluded for a different reason: it is unavailable at prediction time.

A changed specification is another problem

If a shop changes its guide radius from 0.7 to 0.5, the same position (0.6,0) changes answer. That is a new target rule, not just a different mix of positions. Our interactive workbench keeps radius 0.7 fixed; the old weights would not automatically adapt to a new specification.

Where this is used

Checking a model before trusting a score

Write the prediction question, when each input is available, what the labels mean and which data influenced selection. A percentage without those details can conceal a different task.

Investigating an apparent failure

Inspect individual errors and change one factor at a time. A missing representation, wrong annotation, changed input distribution and leaked answer require different explanations.

Evaluating tools you encounter

Ask whether a reported result used a frozen choice on appropriate new examples. This toy exercise does not certify any real product, but it makes the evaluation questions concrete.

Try it yourself: Keep a real test envelope closed

Supplies

  • Paper or 16 large index cards
  • Pencil and ruler
  • Three folded paper pockets or envelopes
  • Optional helper to prepare hidden answers
  1. Prepare three pockets

    Training: inside dots (0,0), (0.4,0), (0,0.4), (−0.4,−0.4), all marked A. Outside dots (0.8,0), (0,−0.8), (−0.8,0.8), (0.8,0.8), all marked B. Keep other pockets closed.

  2. Write an explicit rule

    Open only training answers. Write a rule another person could apply. A means inside fits all eight, but the examples alone have not established that decoration is the intended mechanism.

  3. Open validation

    Predict (0.3,0.3) B and (−0.5,0) B as inside; (0.7,0.4) A and (−0.7,−0.4) A as outside. Reveal only after writing predictions. This deliberately reversed-mark set is a stress probe.

  4. Freeze a revised rule

    Use the validation mistakes to revise. A helper can now reveal x²+y²≤0.49 or provide more training cards. Write exactly what informed your frozen rule before looking at final answers.

  5. Open four final cards

    Final key: (0.2,−0.5) A inside; (−0.6,0.1) B inside; (0.8,−0.2) A outside; (−0.6,−0.6) B outside. A helper should fold the key under before the learner starts. Count all four outcomes.

  6. Report knowledge honestly

    Swap marks on a known card and explain what your rule uses. If you revise after seeing final answers, label that rule revised after test. Reading this printed answer key also counts as exposure.

Which information changed your rule, and which answers were still unseen?

This is a paper process analogy, not a human-versus-AI benchmark. Four final cards do not establish production accuracy. No personal data, account, camera or powered equipment is required.

Check your understanding

What is the exact target question?

  • Is the dot center inside the guide?
  • Is the card valuable?
  • Does the decoration look attractive?
Answer and explanation

Is the dot center inside the guide? The target is defined by geometry. Appearance and value are neither labeled nor measured.

Why can the straight model miss the enclosed inside region?

  • Its chosen features cannot express that enclosure
  • The test must be leaking
  • More identical updates always fix any representation
Answer and explanation

Its chosen features cannot express that enclosure On this symmetric grid its constant optimum is 0.36. Optimization cannot turn the selected family into a circular boundary.

A noisy fit calls an outside dot inside with score 0.96. What follows?

  • The guide is wrong
  • The model can extend a wrong annotation into a confident error
  • Every flexible model always fails
Answer and explanation

The model can extend a wrong annotation into a confident error The geometric answer is independent of the fitted score. Correcting the supplied annotation and refitting tests this explanation.

Swapping only A/B flips the prediction of frozen weights. What did you establish?

  • The circular guide moved
  • This model depends on the mark at this location
  • Every correlation is target leakage
Answer and explanation

This model depends on the mark at this location Position and weights stayed fixed. The controlled mark intervention exposes this predictor’s dependence.

You choose λ after reading final-test scores, but never fit on their rows. Is the score untouched?

  • Yes
  • No, those answers influenced selection
  • Only if it is high
Answer and explanation

No, those answers influenced selection Information can enter through model choices as well as gradient updates.

TP=1, TN=1, FP=1, FN=1. Accuracy and recall are…

  • 1/2 and 1/2
  • 1/4 and 1
  • 1 and 1/4
Answer and explanation

1/2 and 1/2 Two of four predictions are correct; one of two actual inside cards is found. The denominators differ.

Raise the threshold with the same frozen weights. What stays fixed?

  • Every predicted class
  • Scores and log loss
  • Every false-positive count
Answer and explanation

Scores and log loss Thresholding changes the decision rule, not the fitted scores or their probability loss.

Change guide radius from 0.7 to 0.5; the same dot at (0.6,0) changes answer. What changed?

  • The target specification
  • Only playback speed
  • The old model automatically learned
Answer and explanation

The target specification This hypothetical new rule differs from changing where cards occur while retaining the answer rule.

Sources and model limits

  • Original synthetic coordinate classifier, not image recognition, a neural network, a foundation model or production inspection software.
  • The guide is known to the lesson author and publicly inspectable. It is simpler to compute the geometric answer directly when that rule is already known.
  • At most 64 training cards, fixed feature maps and 5000 full-batch updates. Bump centers, width and coordinate scaling do not adapt to data.
  • Training examples and the validation grid are designed teaching fixtures. Their percentages are not real-world generalization estimates.
  • The reserved envelope is a pedagogical separation, not secure hidden data. Browser-local exposure memory can be unavailable or cleared.
  • Paired mark reversals and paired training copies share provenance; they do not add independent test evidence.
  • A model score is not a validated probability of correctness, and no fairness or safety conclusion about real people follows from this toy.
  • Independent numeric reproduction, source review and gradient checks do not replace subject, accessibility, device/export or learner review.

Logistic model, likelihood, gradient and feature representations

Stanford CS229 notes, Chapters 2 and 5. Feature bank, data, penalty convention and step bound in this lesson are explicitly authored choices.

Stanford CS229 · main notes

Log loss and regularization

Mean binary cross-entropy and regularization concepts. Our scalar values and experiments come from the declared synthetic model.

Google MLCC · loss and regularization

Training, validation and test roles

Separate fitting, selection and final evaluation. A fixed designed grid does not become representative of production merely by being held out.

Google MLCC · dividing datasets

Leakage and preprocessing boundaries

Data unavailable at inference or evaluation information must not leak into fitting. Our feature coordinates and centers are fixed in advance.

scikit-learn developers · common pitfalls

Selection can itself overfit finite evaluation data

Cawley and Talbot, JMLR 2010. Supports the exposed-test state even when test rows never enter a gradient.

Cawley & Talbot · model-selection bias

Shortcuts can fail under changed conditions

Geirhos and colleagues, 2020. This lesson’s simple logistic batch-mark analogy is an original example, not a reproduction of their neural-network results.

Geirhos et al. · shortcut learning

Calibration differs from accuracy

Guo and colleagues, ICML 2017. A fitted probability estimate is not automatically an observed correctness frequency.

Guo et al. · calibration

Changed input distributions and evaluation

Koh and colleagues, ICML 2021. No WILDS datasets, images or performance numbers are imported into this synthetic workbench.

Koh et al. · WILDS

Independent subject review is pending.

Read the sources and model assumptions