AI Research Notes· Deep Learning Theory · Gaussianity · Perturbation
The Principles of Deep Learning Theory · Chapter 1 · Pretraining

딥러닝 이론을 배우기 전에 왜 가우시안부터 배워야 하는가

Gaussian Integrals, Connected Correlators, Perturbation Theory, and the Nearly-Gaussian View of Wide Neural Networks

Chapter thesis · Why this mathematical pretraining matters

Chapter 1의 목적은 신경망 자체를 설명하는 데 있지 않다. 그 전에 필요한 계산 언어를 만든다. 앞으로 책 전체를 관통할 핵심 관점은 넓고 깊은 신경망이 정확한 Gaussian이 아니라 Gaussian에서 조금 벗어난 nearly-Gaussian 통계로 기술될 수 있다는 것이다.

그래서 이 장은 §1.1에서 Gaussian integral과 Wick’s theorem을 익히고, §1.2에서 moment와 cumulant, 즉 full correlator와 connected correlator를 구분한다. §1.3에서는 확률분포를 action으로 표현하고 작은 non-Gaussian coupling을 perturbation theory로 계산한다. 각각 따로 보면 오래된 수학이지만, 세 도구가 연결되면 finite-width neural network의 통계를 체계적으로 근사하는 장치가 된다.

이 장의 핵심은 “Gaussian은 단순하다”가 아니다. Gaussian에서 얼마나, 어떤 방식으로 벗어나는지를 계산할 수 있기 때문에 유용하다. 딥러닝의 finite-width 효과는 바로 그 작은 벗어남에 들어 있다.
범위. 첨부 교재의 Chapter 1 “Pretraining” 전체, 즉 §1.1 Gaussian Integrals, §1.2 Probability, Correlation and Statistics, and All That, §1.3 Nearly-Gaussian Distributions 및 그 안의 Statistical Independence and Interactions, Nearly-Gaussian Actions를 대상으로 한다.
Part I · Chapter 1 as a training curriculum

이 장은 딥러닝 이론을 위한 수학적 pretraining이다

Gaussian integration → observables and connected correlations → action and perturbation의 순서가 이후 이론의 계산 파이프라인이 된다.

§1 · The organizing principle

wide network를 “거의 Gaussian”으로 보는 순간 계산 가능성이 생긴다

저자들이 가장 중요하게 내세우는 원리는 wide and deep neural network가 nearly-Gaussian distribution에 의해 지배된다는 것이다. 따라서 Chapter 1은 linear algebra, multivariable calculus, rudimentary probability만을 전제로 Gaussian integration과 perturbation theory를 집중적으로 준비한다.

§1.1

Gaussian integral, source, generating function, multivariable covariance와 Wick’s theorem을 구축한다.

§1.2

observable, moment/correlator, cumulant/connected correlator를 통해 non-Gaussianity를 측정한다.

§1.3

action에 작은 coupling을 넣고 perturbation expansion으로 nearly-Gaussian statistics를 계산한다.

여기서 중요한 점은 계산 기법의 순서다. 먼저 정확히 풀 수 있는 Gaussian theory를 확보한 뒤, 실제 신경망에서 필요한 작은 비가우시안 correction을 그 위에 올린다.

Part II · §1.1 Single-variable Gaussian integrals

가장 단순한 bell curve에서 모든 계산이 시작된다

정규화, 평균, 분산, moment, source를 한 번 제대로 계산하면 고차 Gaussian 통계를 기계적으로 생성할 수 있다.

§2 · Normalization

Gaussian function을 probability distribution으로 만들기

가장 단순한 함수는 \(e^{-z^2/2}\)이다. 이를 확률분포로 쓰려면 전체 적분을 1로 맞춰야 한다. 원문은 적분의 제곱을 2차원으로 올린 뒤 polar coordinate로 바꾸는 고전적인 방법으로 다음 값을 얻는다.

\[ I_1=\int_{-\infty}^{\infty}e^{-z^2/2}\,dz=\sqrt{2\pi}. \]

분산이 \(K>0\)이고 평균이 \(s\)인 경우에는

\[ p(z)=\frac{1}{\sqrt{2\pi K}}\exp\!\left[-\frac{(z-s)^2}{2K}\right],\qquad \mathbb E[z]=s. \]

가 된다. \(K\)는 bell curve의 폭을 정하고, 평균 \(s\)는 중심을 이동시킨다.

§3 · Observables and moments

분포를 직접 보는 대신 측정 가능한 양을 계산한다

일반 함수 \(O(z)\)의 expectation \(\mathbb E[O(z)]\)를 observable이라고 부른다. 그중 \(z^M\)의 expectation이 moment이다. zero-mean Gaussian에서는 parity 때문에 모든 odd moment가 0이 되고, even moment는 하나의 규칙으로 정리된다.

\[ \mathbb E[z^{2m}]=K^m(2m-1)!!. \]

이 식은 single-variable Wick’s theorem이다. 예를 들면 \(\mathbb E[z^2]=K\), \(\mathbb E[z^4]=3K^2\)이다.

§4 · Source and generating function

미분 연산 하나로 모든 moment를 생성한다

원문은 source \(J\)를 도입해 계산을 더 구조화한다.

\[ Z_{K,J}=\int_{-\infty}^{\infty}\exp\!\left(-\frac{z^2}{2K}+Jz\right)dz=\sqrt{2\pi K}\,e^{KJ^2/2}. \]

이 함수가 중요한 이유는 \(J\)로 미분하고 \(J=0\)을 대입하면 원하는 moment가 나온다는 데 있다. 분포의 복잡한 적분을 직접 반복하는 대신 generating function의 Taylor coefficient를 읽는 방식으로 바뀐다.

Part III · §1.1 Multivariable Gaussian & Wick theorem

여러 변수가 만나면 covariance가 기하를 결정한다

multivariable Gaussian은 covariance matrix를 diagonalize하면 독립적인 1차원 Gaussian들의 곱으로 환원된다.

§5 · Covariance geometry

대칭 positive-definite covariance는 방향마다 다른 scale을 만든다

\(N\)-dimensional random vector \(z_\mu\)의 zero-mean Gaussian은 covariance \(K_{\mu\nu}\)와 inverse covariance \(K^{\mu\nu}\)로 기술된다.

\[ p(z)=\frac{1}{\sqrt{|2\pi K|}}\exp\!\left[-\frac12\sum_{\mu,\nu}z_\mu K^{\mu\nu}z_\nu\right]. \]

orthogonal matrix로 covariance를 diagonalize하면 각 eigen-direction의 scale이 eigenvalue로 분리되고, 전체 정규화 적분은 single-variable Gaussian 적분의 곱으로 factorize된다. 그 결과 normalization은 \(\sqrt{|2\pi K|}\)이다.

§6 · Multivariable generating function

source vector는 tensor-valued moment를 생성한다

source를 \(J_\mu\)로 확장하면 completing the square를 통해

\[ Z_{K,J}=\sqrt{|2\pi K|}\exp\!\left(\frac12\sum_{\mu,\nu}J_\mu K_{\mu\nu}J_\nu\right) \]

를 얻는다. 여러 번의 source derivative는 원하는 index를 가진 moment를 생성한다.

§7 · Wick theorem

고차 Gaussian moment는 결국 pairwise covariance의 조합이다

odd moment는 여전히 0이다. \(2m\)-point moment는 가능한 모든 pairing에 대해 covariance를 곱하고 더하면 된다.

\[ \mathbb E[z_{\mu_1}\cdots z_{\mu_{2m}}]=\sum_{\text{all pairings}}K_{\mu_{k_1}\mu_{k_2}}\cdots K_{\mu_{k_{2m-1}}\mu_{k_{2m}}}. \]

4-point에는 세 pairing이 있고, 6-point에는 \((6-1)!!=15\)개의 pairing이 있다. 각 covariance factor를 Wick contraction이라고 부른다. 이 규칙은 뒤의 perturbation calculation에서 6-point, 8-point처럼 보기 싫은 Gaussian moment를 구조적으로 정리하는 핵심 도구다.

Part IV · §1.2 Moments, cumulants, connected correlators

Gaussian인지 아닌지는 “분해되지 않는 상관”을 보면 알 수 있다

모든 moment를 저장하는 대신 새로운 correlation만 남기는 connected correlator가 nearly-Gaussian theory의 observable이 된다.

§8 · Full correlators

모든 moment를 알면 분포를 사실상 안다고 볼 수 있다

일반 확률분포 \(p(z)\)에서 observable은 반복 실험으로 측정 가능한 함수이고, \(M\)-point correlator는 \(\mathbb E[z_{\mu_1}\cdots z_{\mu_M}]\)이다. analytic observable을 Taylor-expand하면 모든 moment를 이용해 그 expectation을 복원할 수 있으므로, 원칙적으로 moment 전체는 분포를 충분히 특징짓는다.

문제는 실용성이다. 차수가 커질수록 동시 측정과 표본 수가 폭증한다. 좋은 theory는 무한한 통계량을 그대로 저장하는 대신 작은 수의 유효한 양으로 분포를 설명해야 한다.

§9 · Cumulants as irreducible correlations

connected correlator는 낮은 차수로 설명되지 않는 새 상관만 남긴다

통계학의 cumulant와 물리학의 connected correlator는 같은 역할을 한다. connected one-point는 mean이고, connected two-point는 covariance다.

\[ \langle z_\mu z_\nu\rangle_c=\mathbb E[z_\mu z_\nu]-\mathbb E[z_\mu]\mathbb E[z_\nu]=\operatorname{Cov}(z_\mu,z_\nu). \]

parity-symmetric distribution에서는 odd moment와 odd connected correlator가 모두 0이다. 그다음 가장 단순한 non-Gaussian probe는 connected four-point이다.

\[ \begin{aligned}\langle z_1z_2z_3z_4\rangle_c=&\,\mathbb E[z_1z_2z_3z_4]\\&-\mathbb E[z_1z_2]\mathbb E[z_3z_4]-\mathbb E[z_1z_3]\mathbb E[z_2z_4]-\mathbb E[z_1z_4]\mathbb E[z_2z_3].\end{aligned} \]

Gaussian에서는 Wick theorem 때문에 오른쪽의 pairwise term이 full four-point를 정확히 재구성하므로 connected four-point는 0이다. 따라서 nonzero connected four-point는 Gaussian statistics에서 벗어났다는 가장 간단한 신호다.

§10 · Higher connected structure

6-point에서는 2×2×2와 4×2를 빼고 정말 새로운 6-way correlation만 남긴다

general cumulant definition은 full \(M\)-point moment를 lower-order connected correlator의 모든 subdivision과 새로운 \(M\)-point connected part의 합으로 분해한다. 6-point의 경우 connected 6-point, 15개의 \((4,2)\) subdivision, 15개의 \((2,2,2)\) subdivision이 등장한다.

Gaussian에서는 모든 \(M>2\) connected correlator가 0이다. 그래서 원문은 higher connected correlator가 모두 작지만 0은 아닌 분포를 nearly-Gaussian distribution으로 정의한다. wide neural network에서는 4-point가 작고, 더 높은 connected correlator는 더 작아지는 구조가 나타난다.

Part V · §1.3 Action and perturbation

분포를 직접 다루지 않고 action의 coupling을 다룬다

observable의 작은 non-Gaussian signal을 action의 작은 interaction term과 연결한다.

§11 · Action representation

확률분포를 negative log probability의 언어로 바꾸기

action \(S(z)\)는 확률분포를

\[ p(z)=\frac{e^{-S(z)}}{Z},\qquad Z=\int d^Nz\,e^{-S(z)} \]

로 정의한다. Gaussian의 경우 action은 quadratic이다.

\[ S_0(z)=\frac12\sum_{\mu,\nu}K^{\mu\nu}z_\mu z_\nu. \]

이 표현의 장점은 non-Gaussianity를 action에 새로운 coupling을 추가하는 방식으로 표현할 수 있다는 점이다.

§12 · Quartic deformation

가장 단순한 non-Gaussian interaction은 4차 항이다

작은 dimensionless parameter \(\epsilon\ll1\)와 symmetric quartic tensor \(V^{\mu\nu\rho\lambda}\)를 도입한다.

\[ S(z)=\frac12K^{\mu\nu}z_\mu z_\nu+\frac{\epsilon}{4!}V^{\mu\nu\rho\lambda}z_\mu z_\nu z_\rho z_\lambda. \]

quartic tensor의 index structure는 four-way correlation의 가능한 pattern을 표현한다. 그러나 non-Gaussian integral은 일반적으로 closed form으로 풀리지 않는다. 여기서 perturbation theory가 필요하다.

§13 · Perturbative computation

복잡한 적분을 Gaussian integral의 합으로 환원한다

1 · Expand
\(e^{-S}\)를 Gaussian part와 quartic perturbation으로 분리하고 \(O(\epsilon)\)까지만 남긴다.
2 · Normalize
partition function의 correction을 계산하고 \(1/(1-x)=1+x+O(x^2)\)로 expectation normalization을 맞춘다.
3 · Contract
나타나는 4-, 6-, 8-point Gaussian moment를 Wick pairing으로 계산한다.
4 · Connect
full four-point에서 pairwise two-point products를 빼 irreducible connected part만 남긴다.

그 결과 coupling과 non-Gaussian observable의 직접 관계가 드러난다.

\[ \langle z_{\mu_1}z_{\mu_2}z_{\mu_3}z_{\mu_4}\rangle_c=-\epsilon\sum_{\rho_1,\ldots,\rho_4}V^{\rho_1\rho_2\rho_3\rho_4}K_{\mu_1\rho_1}K_{\mu_2\rho_2}K_{\mu_3\rho_3}K_{\mu_4\rho_4}+O(\epsilon^2). \]

quartic coupling의 세기와 pattern이 connected four-point correlation을 직접 제어한다. 동시에 two-point correlator도 \(O(\epsilon)\)만큼 이동한다. non-Gaussian deformation은 새로운 고차 상관을 만들면서 기존 covariance도 미세하게 바꾼다.

§14 · Statistical independence and interactions

interaction은 통계적 독립성을 완전히 풀어낼 수 없다는 뜻이다

Gaussian distribution은 covariance가 diagonal이 아니어도 orthogonal basis change로 diagonalize할 수 있고, 적절한 좌표에서는 joint distribution이 독립적인 single-variable Gaussian의 곱으로 factorize된다.

\[ p(u)=\prod_{\mu=1}^{N}p(u_\mu). \]

quartic coupling에서는 일반적으로 불가능하다. basis rotation의 자유도는 대략 \(N^2\)인데 quartic tensor의 성분 수는 대략 \(N^4\)이기 때문이다. 그래서 action을 독립된 항의 합으로 만들 수 없고 joint distribution도 factorize되지 않는다. 원문이 말하는 interaction은 이 statistical independence의 breakdown으로 이해할 수 있다.

단일 변수 \(N=1\)에서도 quartic term이 variance와 observable을 바꾸므로 self-interaction이라는 의미가 남는다. interaction은 반드시 서로 다른 두 변수 사이의 관계만을 뜻하지 않는다.

Part VI · Nearly-Gaussian actions and large-n

이 수학의 종착점은 finite-width neural network의 \(1/n\) expansion이다

width가 크지만 무한하지 않다는 사실이 실제 신경망의 correction을 계산할 작은 parameter를 제공한다.

§15 · General even action

quartic은 첫 번째 correction일 뿐이다

parity symmetry \(z\to-z\)를 가정하면 action에는 even degree만 남는다. 일반적인 nearly-Gaussian action은 다음처럼 쓸 수 있다.

\[ S(z)=\frac12K^{\mu\nu}z_\mu z_\nu+\sum_{m=2}^{k}\frac{1}{(2m)!}s^{\mu_1\cdots\mu_{2m}}z_{\mu_1}\cdots z_{\mu_{2m}}. \]

각 non-Gaussian coupling은 같은 차수의 connected correlation pattern과 대응한다. action의 차수를 높이면 더 복잡한 correlation을 담을 수 있지만, effective theory의 목적은 무한한 항을 쓰는 것이 아니라 필요한 accuracy에서 중요한 coupling만 남기는 데 있다.

§16 · Hierarchical smallness

higher connected correlator가 더 빠르게 작아지면 truncation은 일관된 근사가 된다

wide neural network를 위해 예고되는 특별한 nearly-Gaussian structure는

\[ \langle z_{\mu_1}\cdots z_{\mu_{2m}}\rangle_c=O\!\left(\epsilon^{m-1}\right) \]

라는 hierarchy이다. 4-point는 \(O(\epsilon)\), 6-point는 \(O(\epsilon^2)\), 8-point는 \(O(\epsilon^3)\)처럼 차수가 높아질수록 빠르게 작아진다. 따라서 \(O(\epsilon)\) accuracy에서는 quartic action까지만 남기는 것이 consistency 있는 근사가 된다.

§17 · The small parameter

신경망에서 \(\epsilon\)의 역할은 inverse width가 맡는다

한 layer의 neuron 수를 \(n\)이라 하면 실제 network는 보통 \(n\gg1\)이지만 \(n<\infty\)이다. 이 장의 핵심 연결은

\[ \epsilon=\frac{1}{n} \]

이다. width가 커질수록 non-Gaussian correlation이 작아지지만 finite width에서는 사라지지 않는다. 그러므로 현실적인 wide network를 Gaussian solvable limit + controlled finite-width corrections로 다룰 수 있다. 이것이 large-\(n\) expansion의 출발점이다.

Source fact → analysis
Source fact: Chapter 1은 wide neural network의 분포가 nearly-Gaussian하고 inverse width가 perturbative parameter가 된다고 예고한다.

Analysis: 이 관점의 힘은 infinite-width limit 자체가 아니라, finite-width에서 생기는 interaction을 버리지 않으면서 계산 복잡도를 order별로 통제할 수 있다는 데 있다.
§18 · Dimensional analysis

“작다”는 말도 기준 scale과 dimension이 맞아야 한다

action은 exponential의 argument이므로 dimensionless여야 한다. \([z]=\zeta\)라 두면 covariance는 \([K_{\mu\nu}]=\zeta^2\), inverse covariance는 \([K^{\mu\nu}]=\zeta^{-2}\), \(2m\)-point coupling은 \([s_{2m}]=\zeta^{-2m}\)의 dimension을 갖는다. quartic example에서 \(\epsilon\)은 dimensionless이므로 \(\epsilon\ll1\)이라는 비교가 의미를 가진다.

이 footnote는 사소해 보이지만 perturbation theory의 원칙을 잘 보여준다. 작은 값이란 절대값이 아니라 자연스러운 reference scale에 대한 dimensionless ratio가 작다는 뜻이다.

§19 · Chapter 1 compressed

이 장의 계산 도구를 한 표로 압축하기

ConceptDefinition / toolWhat it buys usNeural-network role
Gaussian integral정규화와 expectationclosed-form primitivewide-network leading theory
Generating functionsource derivativemoment를 체계적으로 생성high-order calculation의 기반
Wick theoremeven moment를 pairwise covariance로 분해고차 Gaussian moment 단순화perturbative term 계산
Connected correlatorlower-order products를 제거한 irreducible partnon-Gaussianity 측정finite-width interaction observable
Action\(p\propto e^{-S}\)분포를 coupling으로 표현Gaussian + interaction 분해
Perturbation theorysmall \(\epsilon\) expansionnon-Gaussian integral을 Gaussian 계산으로 환원controlled correction
Large-\(n\)\(\epsilon=1/n\)higher correlation hierarchywide-but-finite effective theory
§20 · Final synthesis

Chapter 1이 가르치는 것은 공식보다 “어떤 복잡성을 버려도 되는가”라는 판단이다

Gaussian theory는 high-order structure를 covariance의 pairing으로 환원해 매우 단순하다. 하지만 실제 deep learning에서 중요한 finite-width 현상은 strict Gaussian limit에서 사라질 수 있다. 그래서 이 장은 Gaussian을 버리지도, 그대로 믿지도 않는다. Gaussian을 기준점으로 삼고, connected correlator로 deviation을 측정하고, action coupling으로 그 deviation을 표현하고, perturbation theory로 크기를 계산한다.

이것이 effective theory의 전형적인 전략이다. microscopic detail을 모두 추적하는 대신 macroscopic observable을 고르고 leading structure를 정확히 계산한 뒤 correction의 크기를 통제한다.

딥러닝 이론의 좋은 출발점은 복잡한 network를 한 번에 풀려는 욕심이 아니다. 먼저 풀 수 있는 Gaussian limit을 찾고, 현실을 되돌려 놓는 correction을 계층적으로 계산하는 것이다. Gaussian → Wick → connected correlation → action → perturbation → \(1/n\)이라는 흐름이 Chapter 1의 논리적 골격이다.
References · Primary source

출처

[1]
Daniel A. Roberts and Sho Yaida, based on research in collaboration with Boris Hanin — The Principles of Deep Learning Theory: An Effective Theory Approach to Understanding Neural Networks
Cambridge University Press · 2022 · DOI: 10.1017/9781009023405 · Chapter 1 “Pretraining”
[2]
Chapter 1 structural anchors
§1.1 Gaussian Integrals · §1.2 Probability, Correlation and Statistics, and All That · §1.3 Nearly-Gaussian Distributions
편집 원칙. 원문의 수식을 장황하게 전사하지 않고 Chapter 1의 모든 핵심 정의, derivation structure, conceptual aside와 결론을 보존하는 방식으로 재구성했다.

Official source: Cambridge University Press DOI · Cambridge title page