Week 10 — Bias-Variance & Bayesian Nonparametrics第10週 — バイアス・バリアンスとベイズ・ノンパラメトリクス

Friday, July 3, 2026 · async / recorded2026年7月3日(金)· 非同期・録画

Prof. Joseph Austerweilオウステウェイル ジョセフ教授

This week is async今週は非同期です

  • No in-person session — this is the recorded Bayesian-nonparametrics lecture. Watch at your own pace; pause and play with the widgets.
  • Reflections: Week 10 is reflection-eligible — post in the discussion thread.
  • Due Fri Jul 10, 8 PM: the Reinforcement Learning assignment and the Monte Carlo assignment.
  • Four interactive widgets are linked from the slides — open them and click around; that’s the point of recording it.
  • 対面授業はありません — これは録画版のベイズ・ノンパラメトリクス講義です。各自のペースで視聴し、ウィジェットで遊んでみてください。
  • リフレクション: 第10週は対象 — ディスカッションスレッドに投稿を。
  • 締切 7月10日(金)20:00: 強化学習課題モンテカルロ課題。
  • スライドから4つのインタラクティブ・ウィジェットにリンクしています — 開いてクリックしてみてください。それが録画にした狙いです。

Agenda本日の予定

  • Bias-variance → double descent — how complex should a model be?バイアス・バリアンス → 二重降下 — モデルはどれだけ複雑であるべきか
  • Finite mixtures — the “how many clusters?” problem有限混合 — 「クラスタはいくつ?」問題
  • The Chinese Restaurant Process (CRP)中華料理店過程(CRP)
  • The Dirichlet Process — three lenses on one objectディリクレ過程 — 一つの対象への三つの視点
  • DP mixture models — let the data choose KDP混合モデル — データにKを選ばせる
  • One machine, many models — LDA, features一つの仕組みで多くのモデル — LDA・特徴
  • Gaussian processes & the modern tail (NNGP/NTK, RAG)ガウス過程と現代的な発展(NNGP/NTK・RAG)
  • The one picture — parametric → nonparametric → BNP一枚の絵 — パラメトリック → ノンパラメトリック → BNP

How complex should the model be?モデルはどれだけ複雑であるべきか?

The setup: pick a model’s complexity設定:モデルの複雑さを選ぶ

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の多項式。

Two ways to be wrong誤り方は二通り

Training error

  • error on points the model has already seen
  • always falls as complexity rises — a flexible model can memorize
  • not the thing to optimize

訓練誤差

  • モデルが既に見た点での誤差
  • 複雑さを上げると常に下がる — 柔軟なモデルは暗記できる
  • 最適化すべき対象ではない

Prediction (test) error

  • error on new, unseen data
  • the thing we actually care about
  • rises again once the model overfits

予測(テスト)誤差

  • 新しい未見のデータでの誤差
  • 本当に気にすべきもの
  • 過学習すると再び上がる

The gap between them is overfitting — the model memorized noise instead of signal.

両者の差が過学習 — 信号ではなくノイズを覚えてしまった状態。

The bias-variance decompositionバイアス・バリアンス分解

\[\mathbb{E}\big[(\hat{y}-y)^2\big] \;=\; \text{Bias}^2 \;+\; \text{Variance} \;+\; \sigma^2\]

  • \(\hat{y}\) the prediction, \(y\) the truth, \(\mathbb{E}\) an average over re-drawn training sets.
  • Bias² — the systematic miss of the average fit (too-simple models).
  • Variance — how much the fit wobbles across datasets (too-complex models).
  • \(\sigma^2\) — irreducible noise, which no model can remove.
  • \(\hat{y}\) 予測、\(y\) 真値、\(\mathbb{E}\) 引き直した訓練集合にわたる平均。
  • バイアス²平均的な当てはめの系統的なずれ(単純すぎるモデル)。
  • バリアンス — 当てはめがデータ次第でどれだけ揺れるか(複雑すぎるモデル)。
  • \(\sigma^2\) — どんなモデルも除けない不可避なノイズ。

Geman, Bienenstock & Doursat (1992)

High bias vs. high variance高バイアス vs 高バリアンス

High bias (too simple)

  • average fit misses the curve
  • but it barely moves if you resample
  • underfitting

高バイアス(単純すぎ)

  • 平均的な当てはめが曲線を外す
  • だがデータを引き直してもほぼ動かない
  • 過少適合

High variance (too complex)

  • average fit can track the truth
  • but each fit swings wildly with the data
  • overfitting

高バリアンス(複雑すぎ)

  • 平均的な当てはめは真値を追える
  • だが各当てはめがデータ次第で大きく振れる
  • 過剰適合

The classical moral: the U-curve古典的な教訓:U字曲線

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.

バイアスは下がり、バリアンスは上がる → その和は中間の複雑さで最小になる。

数十年間これが全てだった:最適点があり、それを超えると必ず悪化する、と。

Meet the controls操作パネルの説明

The data

  • training points \(n\) — how many noisy examples we learn from. More data ⇒ less variance.
  • noise \(\sigma\) — the spread of the random scatter added to the true signal. Bigger \(\sigma\) ⇒ noisier data, easier to overfit.

データ

  • 訓練点数 \(n\) — 学習に使うノイズ入りの例の数。データが多い ⇒ バリアンスが下がる。
  • ノイズ \(\sigma\) — 真の信号に加わるランダムなばらつきの大きさ。\(\sigma\) が大きい ⇒ ノイズが多く過学習しやすい。

The model

  • polynomial degree — its flexibility, i.e. capacity. Low = stiff (underfit); high = wiggly (overfit).
  • ridge \(\lambda\) — a penalty on large coefficients that pulls the fit toward something tamer: a regularizer. \(\lambda=0\) = off; bigger \(\lambda\) = simpler fit. (Returns after the break.)

モデル

  • 多項式の次数 — 柔軟さ、すなわち容量低い=硬い(過少適合)/高い=うねる(過剰適合)。
  • リッジ \(\lambda\) — 大きな係数に課す罰則で、当てはめをより穏やかにする正則化\(\lambda=0\)=なし/大きいほど単純。(休憩後に再登場。)

Play with it — classical regime触ってみる — 古典領域

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\) を上げるとスパゲッティが縮む(バリアンス↓)。

Predict before we continue続ける前に予想しよう

Keep adding parameters past the point where the model can fit every training point exactly. What happens to test error?

モデルが全ての訓練点をぴったり当てられる点を超えて、さらにパラメータを増やし続ける。テスト誤差はどうなる?

  • A. keeps rising — more capacity, more overfitting
  • B. flattens out
  • C. rises to a peak, then falls again
  • A. 上がり続ける — 容量が増えるほど過学習
  • B. 横ばいになる
  • C. 一度ピークまで上がり、その後再び下がる

Double descent — the U-curve is half the story二重降下 — U字曲線は半分の物語

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)

Why the spike at \(p=n\)?なぜ \(p=n\) で急上昇?

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‖₂ パネルも同時に跳ね上がる。

Past the threshold: which fit?しきい値の先:どの当てはめ?

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 ↔︎ prior: the dictionaryノルム ↔︎ 事前分布:対応辞書

ℓ₂ 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

lassosparsity

ℓ₁ノルム\(\lVert\beta\rVert_1\) (絶対値の和)

重みへのラプラス事前分布

ラッソスパース性

Gradient descent from zero converges to the minimum-ℓ₂ fit — the Gaussian-prior one. (Not L1.)

ゼロから始める勾配降下は最小ℓ₂の当てはめ — ガウス事前分布のもの — に収束する。(L1ではない。)

Ridge: the explicit twinリッジ:明示的な双子

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)— 明示的な ℓ₂ は暗黙の最小ノルム・バイアスの双子。適度な λ が最も低いテスト誤差を与え、縮小しすぎると過小適合になる(最良のテスト誤差が再び上がる)。

Early stopping: the implicit twin早期終了:暗黙の双子

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\) で急上昇が戻る。

Benign overfitting & the honest caveats無害な過学習と正直な注意点

  • Benign overfitting (Bartlett et al. 2020): in high dimensions a model can interpolate the noise and still generalize — the noise spreads thin across many directions.
  • Caveat: double descent needs the right regime — high-dimensional, roughly isotropic features. Low-dim correlated features (the widget’s left panel) don’t show it.
  • The classical U-curve was never wrong — just incomplete.
  • 無害な過学習(Bartlett et al. 2020):高次元ではモデルがノイズを補間しても汎化しうる — ノイズが多数の方向に薄く分散する。
  • 注意: 二重降下には適切な条件が要る — 高次元でほぼ等方的な特徴。低次元の相関した特徴(ウィジェットパネル)では現れない。
  • 古典的U字曲線は間違いではなく、不完全だっただけ。

So — how complex should the model be?では、モデルはどれだけ複雑であるべきか?

Two principled modern answers:

  1. Go huge, then regularize — make the model enormous and let an implicit/explicit prior pick a simple interpolant (the deep-learning answer we just dissected).
  2. Let the model grow with the data — under an explicit prior that says how eagerly to add complexity. That is Bayesian nonparametrics — the rest of today.

原理的な現代の答えは二つ:

  1. 巨大化してから正則化 — モデルを巨大にし、暗黙/明示の事前分布に単純な補間解を選ばせる(今分解した深層学習の答え)。
  2. データとともにモデルを育てる — 複雑さをどれだけ足すかを定める明示的な事前分布の下で。これがベイズ・ノンパラメトリクス — 今日の残り。

Let the data decide: Bayesian nonparametricsデータに決めさせる:ベイズ・ノンパラメトリクス

Recall: clustering bento weights復習:弁当の重さをクラスタリング

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を事前に固定せねばならない。

The “how many clusters?” problem「クラスタはいくつ?」問題

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\)はデータが増えると大きくなりうる。

Watch fixed-K miss a cluster固定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(青)はそれに独自のクラスタを与える。

The Chinese Restaurant Process中華料理店過程

A law over partitions分割の上の法則

A restaurant with infinitely many tables; customers enter one at a time. Customer \(n+1\):

  • joins an occupied table \(k\) with probability \(\propto n_k\) (people already there),
  • starts a new table with probability \(\propto \alpha\).

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\) は:

  • 既に座っている人数 \(n_k\) に比例して、埋まったテーブル \(k\) に座り、
  • \(\alpha\) に比例して新しいテーブルを始める。

これが中華料理店過程(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\)=総客数。交換可能 — ブロックの大きさだけに依存し、到着順に依らない。

Seat the customers — live客を着席させる — ライブ

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 ∝ α)を示す。大きいテーブルほど強く引く — 金持ちはより金持ちに

Rich-get-richer, and what \(\alpha\) does金持ちはより金持ちに、そして \(\alpha\) の役割

  • Rich-get-richer: big clusters attract more members (the \(\propto n_k\) rule). Clusters that start big tend to stay big.
  • Small \(\alpha\) → few big clusters. Large \(\alpha\) → many small clusters.
  • The number of clusters grows slowly with data — about \(\alpha \log n\) — it is never fixed.
  • This growing-but-controlled capacity is the nonparametric answer to Block 1 — capacity set by the data, not chosen by us.
  • 金持ちはより金持ちに: 大きいクラスタほど多くの仲間を引き寄せる(\(\propto n_k\) の規則)。大きく始まったクラスタは大きいままになりやすい。
  • 小さい \(\alpha\) → 少数の大きいクラスタ。大きい \(\alpha\) → 多数の小さいクラスタ。
  • クラスタ数はデータとともにゆっくり増える — おおよそ \(\alpha \log n\)決して固定されない
  • この増えるが制御された容量こそ、第1ブロックへのノンパラメトリックな答え — 容量を我々ではなくデータが決める。

From the CRP to the Dirichlet ProcessCRPからディリクレ過程へ

Three lenses on one object一つの対象への三つの視点

The Dirichlet Process (DP) is one object you can look at three ways:

  • CRP — the distribution over partitions (customers → tables).
  • Pólya urn — the predictive rule: how the next draw behaves once the random distribution is integrated out.
  • Stick-breaking — an explicit construction of the random distribution itself.

Same DP; pick the lens that fits the job.

ディリクレ過程(DP)は一つの対象で、三通りに見られる:

  • CRP分割の上の分布(客 → テーブル)。
  • ポリヤの壺予測規則:ランダムな分布を積分消去した後の次の引きの振る舞い。
  • 棒折り — ランダムな分布そのものの明示的な構成

同じDP。仕事に合う視点を選ぶ。

Pólya urn = the DP’s predictive ruleポリヤの壺 = DPの予測規則

  • Draw colored balls from an urn: each draw repeats an existing color (∝ its count) or invents a new color (∝ α).
  • This is Blackwell–MacQueen (1973) — the DP’s predictive marginal, after integrating the random distribution \(G\) out.
  • It is the same rule as the CRP, now with a dish (a parameter \(\theta_k\)) attached to each table.
    • In the bento demo, that dish was the mean of a Gaussian cluster — each new table gets its own center \(\theta_k\), and that table’s points are noisy draws around it.
  • It is not the DP itself — it’s what you see when you only watch the draws.
  • 壺から色付きの玉を引く:各引きは既存の色を繰り返す(個数に比例)か、新しい色を発明する(αに比例)。
  • これがブラックウェル–マックイーン(1973) — ランダムな分布 \(G\) を積分消去した後の、DPの予測周辺分布
  • CRPと同じ規則で、今は各テーブルに料理(パラメータ \(\theta_k\))が付く。
    • 弁当のデモでは、その料理はガウスクラスタの平均だった — 各新テーブルは独自の中心 \(\theta_k\) を持ち、そのテーブルの点はその周りのノイズ付きの引き。
  • これはDPそのものではない引きだけを見たときに見えるもの。

Stick-breaking — build the distribution棒折り — 分布を構成する

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\)αをドラッグ:小さいα→少数の大きな片、大きいα→多数の小さな片。

The Dirichlet Process itselfディリクレ過程そのもの

\[G \sim \mathrm{DP}(\alpha, G_0)\]

  • \(G\) is a random probability distribution; \(G_0\) is the base measure (where clusters live); \(\alpha\) the concentration.
  • A draw \(G\) is almost surely discrete — a weighted set of spikes (\(\sum_k \pi_k \delta_{\theta_k}\), the stick-breaking weights at locations from \(G_0\)).
  • Discrete → repeats → clustering. That spikiness is why the DP groups data.

\[G \sim \mathrm{DP}(\alpha, G_0)\]

  • \(G\)ランダムな確率分布\(G_0\)基底測度(クラスタの居場所)、\(\alpha\) は集中度。
  • 引き \(G\)ほとんど確実に離散 — 重み付きのスパイクの集合(\(\sum_k \pi_k \delta_{\theta_k}\)、棒折り重みを \(G_0\) 由来の位置に)。
  • 離散 → 繰り返し → クラスタリング。 そのスパイク性こそ、DPがデータをまとめる理由だ。

\(G_0\) in → a discrete \(G\) out\(G_0\) から離散な \(G\)

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\) は重み付きのスパイクの集まり — 離散なので引きは衝突しクラスタを作る。

The trio, tied together三者を結ぶ

  • Stick-breaking builds the random discrete \(G\) (the weights \(\pi_k\) and locations \(\theta_k\)).
  • CRP is what the partition looks like once you draw data through \(G\) and integrate \(G\) out.
    • Handwave: do that integration over \(n\) draws and you recover exactly the partition law \(P=\dfrac{\alpha^{K}\prod_k(n_k-1)!}{\alpha(\alpha+1)\cdots(\alpha+n-1)}\) from the CRP slide.
  • Pólya urn is the sequential predictive rule you get at the same time.

One DP, three faces — and we never fixed the number of clusters.

  • 棒折りはランダムな離散 \(G\) を構成する(重み \(\pi_k\) と位置 \(\theta_k\))。
  • CRPは、\(G\) を通してデータを引き \(G\) を積分消去したときの分割の姿。
    • 直感: \(n\) 個の引きでその積分を実行すると、CRPスライドの分割法則 \(P=\dfrac{\alpha^{K}\prod_k(n_k-1)!}{\alpha(\alpha+1)\cdots(\alpha+n-1)}\) がちょうど復元される。
  • ポリヤの壺は同時に得られる逐次予測規則

一つのDP、三つの顔 — そしてクラスタ数を一度も固定しなかった。

Dirichlet Process Mixture Modelsディリクレ過程混合モデル

DP prior + Gaussian likelihoodDP事前分布 + ガウス尤度

A DP mixture model (DPMM):

  1. Draw a random discrete \(G \sim \mathrm{DP}(\alpha, G_0)\) — the clusters and their weights.
  2. For each data point, pick a cluster from \(G\) and draw the point from a Gaussian around that cluster’s mean.

The CRP says how points share clusters; the Gaussian says what a cluster looks like. K is inferred, not fixed.

DP混合モデル(DPMM)

  1. ランダムな離散 \(G \sim \mathrm{DP}(\alpha, G_0)\) を引く — クラスタとその重み。
  2. 各データ点について、\(G\) からクラスタを選び、そのクラスタの平均の周りのガウス分布から点を引く。

CRPは点がどうクラスタを共有するかを、ガウスはクラスタの見た目を定める。Kは推論され、固定されない。

DPMM vs KDE vs GMM — liveDPMM vs KDE vs GMM — ライブ

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 / nonparametric / BNPパラメトリック / ノンパラメトリック / BNP

Parametric (GMM, fixed K)

  • fixed # of parameters
  • capacity set in advance
  • e.g. “exactly 2 clusters”

パラメトリック (GMM, K固定)

  • パラメータ数が固定
  • 容量を事前に決める
  • 例「ちょうど2クラスタ」

Nonparametric (KDE)

  • complexity grows with data
  • but no model / no prior — just smoothing

ノンパラメトリック (KDE)

  • 複雑さがデータとともに増える
  • だがモデルも事前分布もない — ただの平滑化

Bayesian nonparametric (DPMM)

  • complexity grows with data
  • and a generative model + prior (\(\alpha\))

ベイズ・ノンパラメトリック (DPMM)

  • 複雑さがデータとともに増える
  • かつ生成モデル + 事前分布(\(\alpha\)

How is a DPMM actually fit?DPMMは実際どう推定する?

  • Collapsed CRP Gibbs (Neal 2000): reseat one point at a time — exactly the “customer picks a table” rule the widget runs. Intuitive, exact-ish, slow.
  • Variational / truncated stick-breaking (Blei & Jordan 2006): cap the clusters and optimize — the scalable default (what scikit-learn’s BayesianGaussianMixture ships).
  • Honest note: as a clustering tool the DPMM is now niche — but the DP as a building block is everywhere (next block).
  • 崩壊CRPギブズ(Neal 2000):一点ずつ座り直す — ウィジェットが動かす「客がテーブルを選ぶ」規則そのもの。直感的でほぼ厳密、だが遅い。
  • 変分/打ち切り棒折り(Blei & Jordan 2006):クラスタ数を上限で打ち切り最適化 — スケールする既定(scikit-learnのBayesianGaussianMixtureが採用)。
  • 正直な注記:クラスタリング手法としてのDPMMは今やニッチ — だが構成要素としてのDPは至る所にある(次ブロック)。

The DPMM, as a GenJAX programDPMMをGenJAXプログラムで

@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 data3 clusters here, the lone 275 g bento on its own table. Full script: genjax_dpmm.py.GenJAX約10行がモデルそのもの。スライス・ギブズがデータからKを推論 — ここでは3クラスタ、孤立した275gは独立したテーブルに。全スクリプト:genjax_dpmm.py

One machine, many models一つの仕組みで多くのモデル

The building-block recipe構成要素のレシピ

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.

  • cluster means → DPMM (this lecture)
  • topics → HDP topic models
  • features → Indian Buffet Process
  • the likelihood stays the same — only the prior over “how many” changes

動きはいつも同じ:

有限パラメータ(クラスタ/トピック/特徴の固定リスト)を持つモデルを取り、そのリストがデータとともに増えるようランダム測度(DPやその仲間)で置き換える

  • クラスタ平均 → DPMM (今回の講義)
  • トピック → HDPトピックモデル
  • 特徴 → インド料理ビュッフェ過程
  • 尤度はそのまま — 変わるのは「いくつ」の事前分布だけ

Topics emerging from a corpusコーパスから現れるトピック

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, and its nonparametric versionLDAとそのノンパラメトリック版

LDAparametric (Blei, Ng & Jordan 2003)

  • each document = a mix of topics
  • each topic = a distribution over words
  • K (number of topics) is fixed
  • a finite-Dirichlet model

LDAパラメトリック (Blei, Ng & Jordan 2003)

  • 各文書 = トピックの混合
  • 各トピック = 単語上の分布
  • K(トピック数)は固定
  • 有限ディリクレモデル

HDP-LDAnonparametric (Teh et al. 2006)

  • apply the recipe to LDA
  • a shared top-level DP = a reusable menu of topics
  • number of topics grows with the data

HDP-LDAノンパラメトリック (Teh et al. 2006)

  • LDAにレシピを適用
  • 共有上位DP = 再利用可能なトピックのメニュー
  • トピック数がデータとともに増える

The feature sibling: the IBP特徴の兄弟:IBP

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)?

  • The Indian Buffet Process (IBP) is the feature version: a prior over binary item-by-feature matrices, with the number of features unbounded (Griffiths & Ghahramani; the instructor’s own line of work).
  • Same spirit, different finite parameter. (Cousins: HDP-HMM for sequences, Pitman–Yor for power-law vocabularies.)

DPは各項目に一つのクラスタを与える。項目が同時に多くの特徴を持てたら?(顔は眼鏡かつ帽子かつ髭を持ちうる)

  • インド料理ビュッフェ過程(IBP)は特徴版:項目×特徴の二値行列の上の事前分布で、特徴数は上限なし(Griffiths & Ghahramani;担当教員自身の研究領域)。
  • 同じ精神、異なる有限パラメータ。(仲間:系列にHDP-HMM、べき則語彙にPitman–Yor。)

Gaussian processes & the modern tailガウス過程と現代的な発展

A prior over functions関数の上の事前分布

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)関数の上の事前分布。データ前は標本がいたる所で揺れる(左)。数点で条件付けると全ての標本がそれらを通り、不確実性はデータ近くで縮み、遠くで広がる(右)。容量がデータとともに増える — 回帰のためのノンパラメトリック。

Kernels — the shape of “nearby”カーネル — 「近さ」の形

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バンド幅と同じカーネルの考え — 「点の影響はどこまで届くか」。

GP → neural networksGP → ニューラルネット

  • Neal (1996): a one-layer net with infinitely many hidden units, random weights, is exactly a GP.
  • NNGP (Lee et al. 2018): the same holds for deep nets at initialization — a deep net = a GP with a particular kernel.
  • Neal (1996): 隠れユニット無限の1層ネット(ランダム重み)はちょうどGP
  • NNGP(Lee et al. 2018): 同じことが深いネットの初期化時にも成り立つ — 深層ネット = 特定カーネルのGP。
  • NTK (Jacot et al. 2018): while a very wide net is trained by gradient descent, it behaves like a (different) fixed-kernel method.
  • NNGP = the net at init (Bayesian inference is a GP); NTK = the net during training. Caveat: both omit feature learning.
  • NTK(Jacot et al. 2018): 非常に広いネットを勾配降下で訓練する間、(別の)固定カーネル法のように振る舞う。
  • NNGP = 初期化時のネット(ベイズ推論がGP)、NTK = 訓練中のネット。注意:どちらも特徴学習を無視。

Nonparametrics in today’s AI今日のAIの中のノンパラメトリクス

  • Neural processes (Garnelo et al. 2018): neural nets trained to do GP-like prediction with uncertainty, at scale.
  • Nonparametric memory: RAG and kNN-LM (Lewis et al. 2020; Khandelwal et al. 2020) let a model look things up in a store that grows with data — capacity in the data, not the weights.
  • Through-line: let capacity grow with the data — the idea scaling laws gesture at.
  • ニューラル過程(Garnelo et al. 2018):GPのような不確実性付き予測を大規模に行うよう訓練したニューラルネット。
  • ノンパラメトリック記憶: RAGkNN-LM(Lewis et al. 2020;Khandelwal et al. 2020)はデータとともに増える蓄積を参照させる — 容量を重みではなくデータに。
  • 一貫した筋:容量をデータとともに増やす — スケーリング則が示唆する考え。

The one picture一枚の絵

Parametric → nonparametric → BNPパラメトリック → ノンパラメトリック → BNP

  • We asked: how complex should the model be? The Bayesian-nonparametric answer is don’t fix it — put a prior over all complexities and let the data decide.
  • One machine — a prior over partitions / measures / functions — reused everywhere: clusters (DPMM), topics (HDP), features (IBP), functions (GP).
  • The concentration \(\alpha\) (or the GP kernel) is the dial that says how eagerly to grow.
  • 問いは:モデルはどれだけ複雑であるべきか? ベイズ・ノンパラメトリックの答えは固定するな — すべての複雑さに事前分布を置き、データに決めさせよ
  • 一つの仕組み — 分割/測度/関数の上の事前分布 — があらゆる場所で再利用される:クラスタ(DPMM)、トピック(HDP)、特徴(IBP)、関数(GP)。
  • 集中度 \(\alpha\)(やGPカーネル)がどれだけ意欲的に育てるかを定めるダイヤル。

It all comes home: one curve, the whole week全部つながる:一本の曲線に週の全て

The grey gap is ridge’s bias tax: a little bias kills the variance spike at \(p=n\).灰色の差はリッジのバイアス税 — わずかなバイアス\(p=n\)バリアンス急上昇を消す。

One question, three answers — the GP holds all three一つの問い、三つの答え — GPが全てを含む

  • GP = kernel ridge. posterior mean \(=k_*^\top(K+\sigma^2 I)^{-1}y\) — the noise \(\sigma^2\) is the ridge \(\lambda\) (the explicit twin from Block 1).
  • Kernel = inductive bias. the lengthscale sets your spot on the bias–variance curve; the marginal likelihood picks it → let the data decide (the BNP thesis).
  • Wide net = GP. NNGP (at init) · NTK (under GD): the second-descent floor is the kernel limit, and benign overfitting is the kernel’s min-norm bias.
  • Three answers, one question. regularize (ridge) · grow capacity (BNP) · prior over functions (GP) — and the GP contains all three.
  • GP = カーネルリッジ。 事後平均 \(=k_*^\top(K+\sigma^2 I)^{-1}y\) — ノイズ \(\sigma^2\) がリッジ \(\lambda\) そのもの(第1部の明示的な双子)。
  • カーネル = 帰納バイアス。 長さスケールがバイアス・バリアンス曲線上の位置を決め、周辺尤度が選ぶ → データに決めさせる(BNPの主張)。
  • 広いネット = GP。 NNGP(初期化)· NTK(勾配降下):二度目の降下の床がカーネル極限、良性過適合はカーネルの最小ノルム・バイアス。
  • 三つの答え、一つの問い。 正則化(リッジ)· 容量を増やす(BNP)· 関数の事前分布(GP)— GPが三つすべてを含む。

Where this leaves usまとめ

  • Bias-variance is half the story; double descent + implicit/explicit priors complete it — and that prior is the thread into Bayesian nonparametrics.
  • BNP: let the model grow with the data, under a prior with one interpretable dial.
  • Next week: contemporary ML — where these ideas (priors, capacity, scale) meet large models.
  • Play with the four widgets — that’s the homework that isn’t graded.
  • バイアス・バリアンスは物語の半分 — 二重降下+暗黙/明示の事前分布が完成させ、その事前分布がベイズ・ノンパラメトリクスへの糸。
  • BNP:データとともにモデルを育てる — 解釈可能なダイヤルを一つ持つ事前分布の下で。
  • 来週:現代の機械学習 — これらの考え(事前分布・容量・規模)が大規模モデルと出会う場所。
  • 4つのウィジェットで遊んでみよう — 採点されない宿題。