Friday, July 3, 2026 · async / recorded2026年7月3日(金)· 非同期・録画
We have noisy data and want to learn the mapping behind it. We must choose a hypothesis space — how flexible the model is allowed to be. Here: a polynomial of degree 1, 3, or 12.
ノイズのあるデータがあり、その背後の対応関係を学びたい。仮説空間 — モデルにどれだけ柔軟性を許すか — を選ばねばならない。ここでは次数1・3・12の多項式。
Training error
訓練誤差
Prediction (test) error
予測(テスト)誤差
The gap between them is overfitting — the model memorized noise instead of signal.
両者の差が過学習 — 信号ではなくノイズを覚えてしまった状態。
\[\mathbb{E}\big[(\hat{y}-y)^2\big] \;=\; \text{Bias}^2 \;+\; \text{Variance} \;+\; \sigma^2\]
Geman, Bienenstock & Doursat (1992)
High bias (too simple)
高バイアス(単純すぎ)
High variance (too complex)
高バリアンス(複雑すぎ)

Bias falls, variance rises → their sum is minimized at an intermediate complexity.
For decades this was the whole story: there’s a sweet spot, and going past it always hurts.
バイアスは下がり、バリアンスは上がる → その和は中間の複雑さで最小になる。
数十年間これが全てだった:最適点があり、それを超えると必ず悪化する、と。
The data
データ
The model
モデル
Left: drag polynomial degree — the per-dataset “spaghetti” fans out as variance rises. Right: the bias²/variance/test curve, shown up to \(p=n\) — the classic U. Raise \(n\) and the spaghetti tightens (variance ↓).左: 多項式の次数をドラッグ — データセットごとの「スパゲッティ」が広がる(バリアンス増)。右: bias²/バリアンス/テスト誤差の曲線を \(p=n\) まで表示 — 古典的なU字。\(n\) を上げるとスパゲッティが縮む(バリアンス↓)。
Keep adding parameters past the point where the model can fit every training point exactly. What happens to test error?
モデルが全ての訓練点をぴったり当てられる点を超えて、さらにパラメータを増やし続ける。テスト誤差はどうなる?
Past the interpolation threshold (\(p=n\): as many parameters as data points), test error spikes — then descends a second time, often below the classical sweet spot. The U-curve is the left half.
補間しきい値(\(p=n\):パラメータ数がデータ点数と等しい)を超えると、テスト誤差は急上昇し — その後二度目の降下をして、しばしば古典的最適点より下に達する。U字曲線は左半分だ。
Belkin et al. (2019, PNAS); Nakkiran et al. (2019)
Right panel, “closed-form min-norm”: drag capacity p to \(n\). The test curve spikes — and the purple ‖weights‖₂ panel spikes with it.右パネル「closed-form min-norm」:容量 p を \(n\) までドラッグ。テスト曲線が急上昇し、紫の ‖weights‖₂ パネルも同時に跳ね上がる。
With more parameters than data, there are infinitely many fits that nail the training points exactly.
So the question changes:
not “can it fit?” but “which perfect fit?”
データよりパラメータが多いと、訓練点をぴったり当てる当てはめが無数にある。
だから問いが変わる:
「合わせられるか」ではなく「どの完全な当てはめか」
Gradient descent from zero (and the pseudoinverse) picks the minimum-norm fit — the one with the smallest weights.
Smallest weights → smoothest → generalizes.
That choice is a prior.
ゼロから始める勾配降下(と擬似逆行列)は最小ノルムの当てはめ — 重みが最小のもの — を選ぶ。
重み最小 → 最も滑らか → 汎化する。
その選択は事前分布だ。
ℓ₂ norm — \(\lVert\beta\rVert_2^2\) (squared Euclidean length)
⇕
a Gaussian prior on the weights
→ ridge regression
ℓ₂ノルム — \(\lVert\beta\rVert_2^2\) (ユークリッド長の二乗)
⇕
重みへのガウス事前分布
→ リッジ回帰
ℓ₁ norm — \(\lVert\beta\rVert_1\) (sum of absolute values)
⇕
a Laplace prior on the weights
→ lasso → sparsity
ℓ₁ノルム — \(\lVert\beta\rVert_1\) (絶対値の和)
⇕
重みへのラプラス事前分布
→ ラッソ → スパース性
Gradient descent from zero converges to the minimum-ℓ₂ fit — the Gaussian-prior one. (Not L1.)
ゼロから始める勾配降下は最小ℓ₂の当てはめ — ガウス事前分布のもの — に収束する。(L1ではない。)
Drag ridge λ up: the spike at \(p=n\) collapses (≈337 → ~1) — explicit ℓ₂ is the twin of the implicit min-norm bias. A moderate λ gives the lowest test of all; over-shrink and you under-fit (the best test creeps back up).ridge λ を上げる:\(p=n\) の急上昇が崩れる(約337 → 約1)— 明示的な ℓ₂ は暗黙の最小ノルム・バイアスの双子。適度な λ が最も低いテスト誤差を与え、縮小しすぎると過小適合になる(最良のテスト誤差が再び上がる)。
Selector → “neural net + GD”. Sweep hidden units H; set GD iterations T. Small T → flat, no spike (early stopping); large T → the spike returns at \(H=n\).セレクタ → 「neural net + GD」。隠れユニット数 H を掃引し、GD反復回数 T を設定。小さい T → 平坦・急上昇なし(早期終了)、大きい T → \(H=n\) で急上昇が戻る。
Two principled modern answers:
原理的な現代の答えは二つ:
From the mixture-models chapter: bento weights cluster by type — Hamburger (\(\approx 350\) g) and Tonkatsu (\(\approx 500\) g). A Gaussian mixture model (GMM) gives each cluster a Gaussian and a weight, and treats which cluster each point came from as a latent variable to infer — we reason about the posterior, we don’t solve it in closed form. But you must still fix K (the number of clusters) up front.
混合モデルの章より:弁当の重さは種類でまとまる — ハンバーグ(約350g)ととんかつ(約500g)。ガウス混合モデル(GMM)は各クラスタにガウス分布と重みを与え、各点がどのクラスタ由来かを推論すべき潜在変数として扱う — 閉形式で解くのではなく事後分布を考える。だがKを事前に固定せねばならない。
You can’t just try every clustering: the number of ways to partition \(n\) points (the Bell number) explodes — for 15 points it’s already 1.4 billion. And the “right” \(K\) may grow as more data arrives.
全てのクラスタリングを試すことはできない:\(n\)点を分割する方法の数(ベル数)は爆発する — 15点で既に14億。しかも「正しい」\(K\)はデータが増えると大きくなりうる。
Set GMM K = 2. The lone light bento (≈275 g) gets swallowed into the low cluster — its mean is dragged down. The DPMM (blue) gives it its own cluster.GMM K = 2 に設定。軽い一つの弁当(約275g)が低いクラスタに飲み込まれ、平均が下に引っ張られる。DPMM(青)はそれに独自のクラスタを与える。
A restaurant with infinitely many tables; customers enter one at a time. Customer \(n+1\):
That’s the Chinese Restaurant Process (CRP) — a law over partitions with no fixed \(K\). \(\alpha\) is the concentration: the appetite for new tables.
無限のテーブルがある料理店。客は一人ずつ入る。客 \(n+1\) は:
これが中華料理店過程(CRP) — \(K\) を固定しない分割の上の法則。\(\alpha\) は集中度:新しいテーブルへの意欲。
\[P(\text{partition})\;=\;\frac{\alpha^{K}\,\prod_{k=1}^{K}(n_k-1)!}{\alpha\,(\alpha+1)\cdots(\alpha+n-1)}\]
\(K\) = occupied tables, \(n_k\) = people at table \(k\), \(n\) = total customers. Exchangeable — it depends only on the block sizes, not who arrived when.\(K\)=埋まったテーブル数、\(n_k\)=テーブル \(k\) の人数、\(n\)=総客数。交換可能 — ブロックの大きさだけに依存し、到着順に依らない。
Auto-seat customers and watch tables appear. The bar shows the next customer’s odds (∝ table size, plus NEW ∝ α). Big tables pull harder — rich-get-richer.Auto-seat で客を着席させ、テーブルが現れるのを見る。バーは次の客の確率(∝テーブルの大きさ、+NEW ∝ α)を示す。大きいテーブルほど強く引く — 金持ちはより金持ちに。
The Dirichlet Process (DP) is one object you can look at three ways:
Same DP; pick the lens that fits the job.
ディリクレ過程(DP)は一つの対象で、三通りに見られる:
同じDP。仕事に合う視点を選ぶ。
Take a unit stick; break off \(\beta_k \sim \text{Beta}(1,\alpha)\) of what remains each time. The pieces are the cluster weights \(\pi_k\). Drag α: small α → a few big pieces; large α → many small ones.長さ1の棒を取り、毎回残りの \(\beta_k \sim \text{Beta}(1,\alpha)\) を折り取る。各片がクラスタ重み \(\pi_k\)。αをドラッグ:小さいα→少数の大きな片、大きいα→多数の小さな片。
\[G \sim \mathrm{DP}(\alpha, G_0)\]
\[G \sim \mathrm{DP}(\alpha, G_0)\]
Sample locations \(\theta_k\) from the smooth \(G_0\), then give them stick-breaking weights \(\pi_k\). The draw \(G\) is a handful of weighted spikes — discrete, so repeated draws collide and cluster.滑らかな \(G_0\) から位置 \(\theta_k\) を引き、棒折り重み \(\pi_k\) を与える。引き \(G\) は重み付きのスパイクの集まり — 離散なので引きは衝突しクラスタを作る。
One DP, three faces — and we never fixed the number of clusters.
一つのDP、三つの顔 — そしてクラスタ数を一度も固定しなかった。
A DP mixture model (DPMM):
The CRP says how points share clusters; the Gaussian says what a cluster looks like. K is inferred, not fixed.
DP混合モデル(DPMM):
CRPは点がどうクラスタを共有するかを、ガウスはクラスタの見た目を定める。Kは推論され、固定されない。
Three density models on the same clicks: DPMM (infers clusters), KDE (a bump per point, no clusters), GMM (you fix K). Drag DPMM’s α; add points and watch clusters appear.同じクリックに三つの密度モデル:DPMM(クラスタを推論)、KDE(点ごとの山、クラスタなし)、GMM(Kを固定)。DPMMのαをドラッグ、点を足してクラスタが現れるのを見る。
Parametric (GMM, fixed K)
パラメトリック (GMM, K固定)
Nonparametric (KDE)
ノンパラメトリック (KDE)
Bayesian nonparametric (DPMM)
ベイズ・ノンパラメトリック (DPMM)
BayesianGaussianMixture ships).BayesianGaussianMixtureが採用)。@gen
def dpmm(alpha, mu0, sig0, sigx):
# stick-breaking → a prior over clusters
betas = [beta(1., alpha) @ f"beta_{k}"
for k in range(K)]
pis = stick_break(betas) # weights
mus = [normal(mu0, sig0) @ f"mu_{k}"
for k in range(K)]
for i in range(N): # each bento:
z = categorical(pis) @ f"z_{i}"
x = normal(mus[z], sigx) @ f"x_{i}"
~10 lines of GenJAX is the model; a slice-Gibbs sampler then infers K from the data — 3 clusters here, the lone 275 g bento on its own table. Full script: genjax_dpmm.py.GenJAX約10行がモデルそのもの。スライス・ギブズがデータからKを推論 — ここでは3クラスタ、孤立した275gは独立したテーブルに。全スクリプト:genjax_dpmm.py。
The move is always the same:
Take a model with a finite parameter (a fixed list of clusters / topics / features) and replace it with a random measure (a DP, or a cousin) so that list can grow with the data.
動きはいつも同じ:
有限パラメータ(クラスタ/トピック/特徴の固定リスト)を持つモデルを取り、そのリストがデータとともに増えるようランダム測度(DPやその仲間)で置き換える。
A topic is a distribution over words. Given a tiny corpus, the model discovers that documents mix a “lunch” topic (bento, rice, sauce) and a “studying” topic (exam, study, grade) — without being told the topics in advance.
トピックは単語上の分布。小さなコーパスから、モデルは文書が「昼食」トピック(弁当・ご飯・ソース)と「勉強」トピック(試験・勉強・成績)を混ぜていることを、事前に教えられずに発見する。
LDA — parametric (Blei, Ng & Jordan 2003)
LDA — パラメトリック (Blei, Ng & Jordan 2003)
HDP-LDA — nonparametric (Teh et al. 2006)
HDP-LDA — ノンパラメトリック (Teh et al. 2006)
The DP gives each item one cluster. What if an item can have many features at once (a face has glasses and a hat and a beard)?
DPは各項目に一つのクラスタを与える。項目が同時に多くの特徴を持てたら?(顔は眼鏡かつ帽子かつ髭を持ちうる)
A Gaussian process (GP) is a prior over functions. Before data, samples wiggle everywhere (left). Condition on a few points and every sample must pass through them; uncertainty shrinks near data, grows far from it (right). Capacity grows with data — nonparametric, for regression.
ガウス過程(GP)は関数の上の事前分布。データ前は標本がいたる所で揺れる(左)。数点で条件付けると全ての標本がそれらを通り、不確実性はデータ近くで縮み、遠くで広がる(右)。容量がデータとともに増える — 回帰のためのノンパラメトリック。
A GP is defined by its kernel \(k(x,x')\) — how strongly two inputs’ outputs are correlated. A common choice ties nearby inputs to similar outputs (smoothness).
Callback: this is the same kernel idea as the KDE bandwidth in Widget 1 — “how far does the influence of a point reach?”
GPはカーネル \(k(x,x')\) で定まる — 二つの入力の出力がどれだけ強く相関するか。よくある選択は近い入力を似た出力に結ぶ(滑らかさ)。
復習:これはウィジェット1のKDEバンド幅と同じカーネルの考え — 「点の影響はどこまで届くか」。
The grey gap is ridge’s bias tax: a little bias kills the variance spike at \(p=n\).灰色の差はリッジのバイアス税 — わずかなバイアスで \(p=n\) のバリアンス急上昇を消す。