notes · paper walkthroughs · from-scratch

The Notebook

Papers I find interesting, read closely, and rebuild: a plain-language summary, the math reimplemented from scratch in TypeScript, live charts, and — where the idea maps onto a 2D toy — a link to poke at it on the model pages. Same rules as the rest of the site: no ML libraries, every number computed in your browser.

Oct 18, 202612 min

The same quantiles can predict three different futures

PathFM exposes why accurate one-step quantiles cannot determine totals, maxima, or threshold-crossing risk without a dependence model.

paper walkthrough
Oct 17, 202612 min

The pricing cartel that deters only the wrong deviation

A one-period price cut loses money, yet exact dynamic programming finds a profitable deviation against the same frozen Q-learning partner.

paper walkthrough
Oct 15, 202612 min

Four optimizer refreshes are not one schedule

Kronecker preconditioners can reverse their preferred refresh placement as learning rate changes, even when refresh count and compute stay fixed.

paper walkthrough
Oct 14, 202612 min

A 0.696 R² can explain the week without forecasting it

Monte Carlo tree search beats Lasso on a sparse financial regression—but its contemporaneous target turns a striking R² into explanation, not prediction.

paper walkthrough
Oct 13, 202612 min

One checkpoint cannot serve every noise level

A tabular-regression study finds that noisy and clean regions peak at different epochs—and its adaptive loss only partly repairs the conflict.

paper walkthrough
Oct 12, 202611 min

The 20% update cost that changes with the denominator

AdaptLSTM catches workload drift efficiently, but its node ratio, trigger-rate formula, and measured update time tell three different cost stories.

paper walkthrough
Oct 11, 202612 min

The 96-model ensemble that gets worse when everyone votes

A broad tabular-model pool helps only when validation labels choose the voters; uniform averaging and label-starved selection can both lose.

paper walkthrough
Oct 10, 202611 min

The SHAP uncertainty band that keeps the tree frozen

Interval-valued SHAP stress-tests leaf estimates efficiently, but its guarantee keeps every split and routing probability fixed.

paper walkthrough
Oct 9, 202611 min

The fast softmax sampler that weighs a cluster like one item

Two-level softmax gains sublinear speed by sampling clusters first—but its centroid score forgets cluster size and the shape of scores inside.

paper walkthrough
Oct 8, 202612 min

The calibrated recommender can still pick the wrong item

Online calibration can retain a useful recommendation at the target rate while selection—and long-term value—still fail.

paper walkthrough
Oct 7, 202613 min

The legal model that improved by refusing to answer

A legal LLM looks more accurate among answers after training—but only 35 of 320 responses still contain an answer.

paper walkthrough
Oct 6, 202614 min

The stable trading model that learned to never trade

A crypto-execution MoE eliminates failed runs, but annealing does too—and lower seed variance hides worse tail losses.

paper walkthrough
Oct 5, 202613 min

A promising alpha can decay before the backtest earns trust

A finite-information view of alpha decay shows why stronger evidence, broader strategy search, and useful trading lifetime compete for the same scarce budget.

paper walkthrough
Oct 4, 202612 min

The attention head that improves when its weights are erased

Chronos-2 benefits from pooling across example series, but its learned attention weights often undo that gain—and a one-block inference edit exposes the boundary.

paper walkthrough
Oct 3, 202613 min

The accurate world model that gets the intervention backward

A low-error time-series world model can learn a drug’s effect backward; a sign penalty repairs declared mechanisms but nothing it was not told.

paper walkthrough
Oct 2, 202613 min

The label-noise guarantee that weakens near a tie

Selective classification estimates label flips without fragile anchor points—but its guarantee can explode when the noise matrix is nearly tied.

paper walkthrough
Oct 1, 202613 min

Adam's rare-token discount survives a smaller learning rate

Adam and RMSProp can settle below a rare token's true frequency—and random gaps make the closed-form estimate too optimistic.

paper walkthrough
Sep 30, 202613 min

The token forecast that improves after the bill starts

TokenCast models the re-read tax of growing agent context, but its average gain arrives mostly after execution has begun.

paper walkthrough
Sep 29, 202614 min

The LLM preference coefficient that mostly measures decisiveness

PriceBench reveals large shopping-agent preferences, but raw logit coefficients mix what an LLM values with how consistently it chooses.

paper walkthrough
Sep 28, 202614 min

The policy gradient that leaks an action—until it vanishes

Ordered RL gradients can reveal a robot's actions and camera path, but the closed-form action signal collapses as its policy becomes deterministic.

paper walkthrough
Sep 27, 202614 min

The RL shortcut that cannot invent a missing direction

Multiplying existing policies can mimic a new RL run—but only when their log-ratio span already contains the reward's missing direction.

paper walkthrough
Sep 26, 202613 min

The useful correlation is hiding in the errors

Correlated targets did not justify a joint model; only correlation left in standardized prediction errors tracked better joint uncertainty.

paper walkthrough
Sep 25, 202613 min

A spatial fold can still have next-door neighbours

Blocked validation still overstated a geospatial embedding's edge until nearby training parcels were excluded with a 10 km buffer.

paper walkthrough
Sep 24, 202613 min

The benchmark that changes one winner in three

Static and rolling evaluation often select different forecasters—but the comparison only isolates protocol choice when both score the same targets.

paper walkthrough
Sep 23, 202612 min

The weather market wins—until the benchmark gets smarter

A prediction market beats every single public weather forecast, but most of its headline edge vanishes against a simple forecast ensemble.

paper walkthrough
Sep 22, 202613 min

The portfolio loss that forgets trading costs

A decision-focused portfolio learner optimizes the constrained allocation it will deploy—but its loss still omits the cost of changing that allocation.

paper walkthrough
Sep 21, 202613 min

Two stop tokens can teach a model never to stop

On-policy distillation can punish a student's valid EOS token when its teacher expresses the same stopping decision with a different token.

paper walkthrough
Sep 20, 202613 min

The future-trained forecaster that got worse

Future data can invalidate a historical forecast without improving it: parameter provenance and predictive performance are separate questions.

paper walkthrough
Sep 19, 202612 min

Eight LLM samples can cost five times more

An eight-candidate reasoning budget is not reproducible until its call schedule, batching, and energy boundary are specified.

paper walkthrough
Sep 18, 202613 min

“Safe” can still mean a 0.99-point accuracy drop

Disagreement-only auditing can certify model updates with few labels, but its safe verdict permits a small regression chosen in advance.

paper walkthrough
Sep 17, 202612 min

Five images sampled equally are still five images

Class-balanced sampling gives rare labels equal exposure, but repeated exposure cannot replace rare information—and can amplify its noise.

paper walkthrough
Sep 16, 202612 min

The queue you cannot see changes the fill

Identical aggregate order books can imply different passive fills because cancellation location inside the FIFO queue is unobserved.

paper walkthrough
Sep 15, 202612 min

The clinical loss that still needs likelihood first

Smooth Net Benefit targets treatment decisions directly, but its training recipe still depends on likelihood initialization and hard-metric selection.

paper walkthrough
Sep 14, 202613 min

The 32-pass MoE that lost to a dense model

A new scaling study finds sparse MoEs overfit repeated text earlier—but its repeat-count thresholds hide a shrinking unique-data budget.

paper walkthrough
Sep 13, 202615 min

When a huge hidden-state error changes almost nothing

An explicit Bayesian-filter counterexample shows why a diverging logit gap can coexist with vanishing predictive KL—and why the finite experiment needs careful reading.

paper walkthrough
Sep 12, 202614 min

The 10-sigma detector that fires on 36% of noise

A missing square-root time scaling turned a 10-sigma threshold into 0.91 sigma—and filled one detector-defined event pool with 81.7% phantoms.

paper walkthrough
Sep 11, 202614 min

Orthogonal signals can still make the same bet

Signal correlation compares stocks; PnL correlation compares dates. A geometric decomposition shows why one cannot certify the other.

paper walkthrough
Sep 10, 202614 min

Eight options can hide one broken learner

A careful Option-Critic audit shows that more options can improve control by covering one another’s frozen mistakes—not by learning temporal abstraction.

paper walkthrough
Sep 9, 202613 min

Thirty rain stops in one cricket match are still one match

A large audit finds gender- and format-specific bias in cricket’s rain rule, while match-level clustering shows why 233,550 synthetic interruptions are not 233,550 independent facts.

paper walkthrough
Sep 8, 202612 min

Cool the posterior, widen the search—and pay a dimension tax

Fractional-posterior Thompson sampling turns one exponent into principled exploration, but its best guarantee needs dimension-aware tempering and a long-enough warm-up.

paper walkthrough
Sep 7, 202613 min

The LLM forecast that pays you whichever return happens

Three stock-return probabilities guarantee an arbitrage profit—but the measured contradiction depends sharply on which questions are asked together.

paper walkthrough
Sep 6, 202614 min

The energy-pricing DQN that cannot change tomorrow

A peer-to-peer electricity DQN improves settlement, but its actions cannot affect the next state—and simple budget-balanced rules still win.

paper walkthrough
Sep 5, 202614 min

The reasoning probe that predicts the question, not the attempt

A trace-blind difficulty score reaches AUROC 0.873, exposing why pooled reasoning-probe accuracy can vanish within the same problem.

paper walkthrough
Sep 4, 202613 min

The physics model that stays uncertain when the law is noiseless

Tabular foundation models lead 316-equation benchmarks, yet retain an uncertainty floor and ignore the unit structure that makes physical laws simpler.

paper walkthrough
Sep 3, 202613 min

Online adaptation looks best when the baseline trains too little—or too much

A leakage-free forecasting study shows that baseline warmup alone can move adaptation's apparent benefit by 18.8 percentage points.

paper walkthrough
Sep 2, 202612 min

The sleep-apnea detector with 29 missing ROC curves

A pressure-mat detector reaches 0.969 patient-held-out AUC, but ROC AUC is undefined for nearly one in five patients.

paper walkthrough
Sep 1, 202613 min

The EV generator that scored better than real data

An EV diffusion model beats a real-vs-real Wasserstein baseline, but the metric can ignore when every current spike occurs.

paper walkthrough
Aug 31, 202613 min

The 88% sentiment model that found no tradable signal

QLoRA sharply improved financial sentiment classification, but none of 28 return-prediction tests survived robust multiple-testing correction.

paper walkthrough
Aug 30, 202613 min

Debate worked after putting the critic on a 150-word leash

An adversarial critic slowed reward hacking under a weaker LLM judge—but unconstrained debate defaulted to a different exploit.

paper walkthrough
Aug 29, 202613 min

The accurate yield model that lost the farmer money

A 892-curve field study shows why fertilizer recommendations must be scored by forgone profit, not prediction error—and why its strongest result is a correction that transfers.

paper walkthrough
Aug 28, 202612 min

The invariance the model never had to learn

A spectral foundation model looked robust to preprocessing until its parameter-free input normalization matched—and sometimes beat—the encoder.

paper walkthrough
Aug 27, 202612 min

The fraud model that looked safe after deleting the attacks

FraudBench finds 3.7 feasible attacks after filtering, but 2,832.3 when the same constraints guide generation—and cost is still missing.

paper walkthrough
Aug 26, 202613 min

The attention map looks sparse. The cache still needs 61% of its tokens.

Sparse-looking attention is not a cache certificate: retained mass, omitted values, future queries, and the task can each reverse the conclusion.

paper walkthrough
Aug 25, 202612 min

The backdoor that passes the physics check—and uses the wrong physics

A neural PDE surrogate can stay accurate and solver-like while a trigger selects the wrong viscosity—and its headline success metric can still mislead.

paper walkthrough
Aug 24, 202612 min

The 4-bit model that passes the average—and forgets the latest value

INT4 barely moves aggregate accuracy yet loses up to 12.7 points when an LLM must retrieve the latest of many similar updates.

paper walkthrough
Aug 23, 202611 min

The LLM cache that reports 60% hits—and 1.6% useful reuse

A semantic cache can report 60% hits while only 1.6% of requests reuse a valid answer; admission quality matters before eviction cleverness.

paper walkthrough
Aug 22, 202611 min

The drift score that knows when it cannot know

CJSD separates input shift from mechanism change with two classifiers—but vanishing support overlap can make a tiny score inconclusive.

paper walkthrough
Aug 21, 202611 min

The training example that moved the weights—and vanished from the loss

One pretraining row was learned, later undetectable on its own text, yet left a large weight-space displacement: influence depends on when and how you measure it.

paper walkthrough
Aug 20, 202612 min

The exact recourse explanation that still asks you to change your age

Leaf-value coordinates explain boosted-tree decisions exactly, but conventional recourse validity ignores whether a person can make the changes.

paper walkthrough
Aug 18, 202612 min

The sampler that finds more correct reasoning and returns the wrong answer

Power Sampling can raise correct-trajectory mass yet break self-consistency by collapsing diverse support onto one wrong path.

paper walkthrough
Aug 17, 202612 min

The causal feature score that moves when the token moves

SAE ablations look like causal feature tests, but letting each dictionary choose its strongest token can manufacture disagreement.

paper walkthrough
Aug 16, 202611 min

The outlier defense that rewards an attacker for looking average

Krum rejects distant client updates; we rebuild its geometry and show why a defense-aware backdoor aims for the cluster center instead.

paper walkthrough
Aug 15, 202610 min

The on-chain volatility number that is really an activity meter

A clean Uniswap fee formula looks like implied volatility, but one missing economic leg prevents that interpretation.

paper walkthrough
Aug 14, 202612 min

The test-time learner that can become confidently wrong

Tent adapts a deployed model by minimizing prediction entropy; we rebuild the update and show why an unlabeled batch—not confidence alone—does the work.

paper walkthrough
Aug 13, 202612 min

The gradient truce that depends on who speaks first

PCGrad projects away clashes between task gradients; we rebuild the surgery and expose why sequential projections need randomized task order.

paper walkthrough
Aug 12, 202611 min

Integrated Gradients explains the difference from whatever you call nothing

Integrated Gradients satisfies elegant attribution axioms, but every explanation is relative to a baseline; we rebuild the path integral and expose that choice.

paper walkthrough
Aug 11, 202612 min

CLIP's zero-shot classifier changes when you add one label

CLIP turns text prompts into classifier weights; we rebuild its contrastive loss and show why the available labels change the answer.

paper walkthrough
Aug 10, 202611 min

The loss that silences easy examples—and trusts every hard one

Focal loss rescued dense object detection by muting easy negatives; we rebuild its weighting rule and expose the hard-example assumption it makes.

paper walkthrough
Aug 9, 202612 min

The categorical encoder that refuses to read its own label

CatBoost turns categories into ordered target averages; we rebuild the encoding and expose both the leakage it prevents and the cold-start cost.

paper walkthrough
Aug 8, 202612 min

The exact decoding shortcut that burns compute when guesses miss

Speculative decoding verifies cheap guesses in parallel; we rebuild its exact sampler and find speed depends on agreement and spare compute.

paper walkthrough
Aug 7, 202611 min

The vision Transformer that needed 300 million images

ViT turns image patches into ordinary Transformer tokens; we rebuild the input pipeline and find scale—not patching alone—made it beat convolutions.

paper walkthrough
Aug 6, 202611 min

FlashAttention saves the matrix, not the quadratic work

FlashAttention streams softmax tiles instead of storing an attention matrix; we rebuild the exact update and find the arithmetic stays quadratic.

paper walkthrough
Aug 5, 202612 min

The RL-free alignment loss that still hides a reward model

DPO turns preference learning into logistic regression; we rebuild the loss and find every judgment is measured relative to a reference model.

paper walkthrough
Aug 4, 202612 min

The 10,000× smaller fine-tune that still needs the whole model

LoRA replaces a dense weight update with two skinny matrices; we rebuild the merge and find the tiny adapter never replaces the frozen base model.

paper walkthrough
Aug 3, 202612 min

The recommender’s four-trillion-ID claim is off by 1,000×

TIGER recommends products by generating semantic tokens; we rebuild its quantizer and find a three-order-of-magnitude arithmetic slip.

paper walkthrough
Aug 2, 202611 min

The capability cliff that vanished when the ruler changed

Exact match can turn smooth language-model improvement into an apparent breakthrough; we rebuild the metric and expose its hidden resolution limit.

paper walkthrough
Aug 1, 202612 min

The reasoning model that cannot learn when every answer ties

DeepSeek-R1 used group-relative RL to reward better answers; we rebuild GRPO and find that all wins or all losses teach it nothing.

paper walkthrough
Jul 31, 202612 min

The neural net that puts a curve on every edge—and runs 10× slower

KANs replace weights with learnable splines; we rebuild the edge math and find the accuracy grid also taxes every connection.

paper walkthrough
Jul 30, 202612 min

The model-collapse cure that still forgets the glasses

Keeping old data stops recursive training error from exploding; we rebuild the proof and find “avoids collapse” does not mean nothing is forgotten.

paper walkthrough
Jul 25, 202611 min

Mamba remembers by forgetting, read closely

Mamba replaces attention with a selective recurrence; we rebuild its memory gate and find why the fast algorithm is part of the idea.

paper walkthrough
Jul 24, 202611 min

The hedge that learned not to trade, read closely

Deep Hedging learns option strategies under real trading costs; a seeded reconstruction shows why its most useful action can be doing nothing.

paper walkthrough
Jul 23, 202612 min

The optimizer that flattens every gradient, read closely

Muon orthogonalizes matrix gradients and reportedly halves LLM training compute; we rebuild it and find raw update size silently depends on matrix shape.

paper walkthrough
Jul 22, 202612 min

The 1.58-bit LLM that still trains in 16 bits

BitNet packs 2B weights into 0.4 GB without losing much benchmark score; we rebuild its ternary math and find the savings begin after training.

paper walkthrough
Jul 20, 202613 min

When one linear layer beat the Transformer, read closely

A 2023 paper forecasts the future with a single linear layer and beats a stack of specialised Transformers. We rebuild it from scratch — and find the clever-looking decomposition barely matters, while the whole edge rests on one assumption nobody states.

paper walkthrough
Jul 19, 202613 min

The Deflated Sharpe Ratio, read closely

After enough backtests, a Sharpe of 2 is what pure luck looks like. A 2014 paper computes exactly how much luck — and deflates the number back down. We rebuild it from scratch and find the verdict hinges on one figure nobody reports: how many strategies you tried.

paper walkthrough
Jul 18, 202612 min

The one-pixel lie, read closely

A 2015 paper shows a tiny, invisible nudge flips a confident classifier — and argues the cause is that models are too LINEAR, not too complex. We rebuild the fast gradient sign method from scratch and watch the attack strengthen as the input grows.

paper walkthrough
Jul 17, 202613 min

Boosting that knows what it doesn’t know, read closely

NGBoost turns gradient boosting into a probability distribution with error bars. We rebuild it from scratch and find the whole thing hinges on one correction the title names and the demos gloss over: the natural gradient.

paper walkthrough
Jul 17, 202612 min

The optimizer with the broken proof, read closely

Adam trains almost every deep model — and its original convergence proof was wrong. A 2018 best paper builds a one-line convex problem where Adam walks to the worst point. We rebuild it from scratch and watch a one-word fix pull it back.

paper walkthrough
Jul 15, 202613 min

The load-balancing loss that makes MoE work, read closely

Sparse Mixture-of-Experts got the headline — a trillion parameters, a sliver of compute. We rebuild it from scratch and find the real trick is a one-line auxiliary loss: without it the gate collapses onto a few experts and the rest die.

paper walkthrough
Jul 14, 202612 min

Meta-labeling, read closely

A trading paper bolts a second model onto the first: keep its direction, learn which of its calls to trust. We rebuild the filter from scratch — and find it only adds value when it sees something the first model never did.

paper walkthrough
Jul 13, 202613 min

Training a strategy to maximise Sharpe, read closely

A 2019 paper throws away the hand-tuned momentum rule and trains a network to maximise the Sharpe ratio directly. We rebuild the Sharpe loss from scratch — and find the number it optimises is the one it never has to pay for.

paper walkthrough
Jul 12, 202612 min

When a model says 90%, read closely

A 2017 paper shows modern nets are confidently wrong — and that dividing the logits by one number fixes it. We rebuild ECE and temperature scaling from scratch, then find the one knob can make calibration worse.

paper walkthrough
Jul 11, 202612 min

Extended isolation forest, read closely

Isolation Forest scores anomalies by how fast random cuts fence a point off — but its axis-parallel cuts smear a coordinate-frame bias across the score map. We rebuild it from scratch, expose the phantom corridors, and watch one tilted-cut change erase them.

paper walkthrough
Jul 10, 202612 min

Order flow imbalance, read closely

A microstructure paper shows the mid-price move over a few seconds is a near-linear function of order-flow imbalance — and integrating the whole book explains ~84% of it. We rebuild OFI from scratch, then watch it forecast almost none of the next move.

paper walkthrough
Jul 9, 202612 min

Hierarchical risk parity, read closely

A 2016 paper builds a diversified portfolio without ever inverting the covariance matrix — and beats the textbook optimiser out-of-sample. We rebuild it from scratch and find its edge is all estimation error, not a better objective.

paper walkthrough
Jul 8, 202612 min

Conformal prediction for portfolios, read closely

A 2024 paper turns return forecasts into intervals with a distribution-free coverage guarantee, then picks portfolios from them. We rebuild it from scratch — and watch the guarantee quietly break the moment the market changes regime.

paper walkthrough
Jul 7, 202611 min

Why trees beat deep nets on tables — until you rotate

A NeurIPS 2022 paper explains why gradient-boosted trees still beat neural nets on tabular data. We reproduce its sharpest test from scratch: a random rotation flips the ranking, because a tree lives in its coordinate frame.

paper walkthrough
Jul 7, 202612 min

The virtue of complexity, read closely

A Journal of Finance paper times the market with more parameters than data points — and wins. We rebuild its random-feature ridge from scratch, watch double descent appear, and find where the money actually comes from.

paper walkthrough
Jul 7, 20269 min

LGBM for stock returns, read closely

A gradient-boosting paper predicts next-day S&P 500 returns and builds a portfolio. We reproduce its indicators from scratch, chart its results — and read the Kelly number it buries.

paper walkthrough