HPC-Phys
2024/03/07
In virtual

格子QCDとその周辺における機械学習の活用富谷昭夫 (IPUT Osaka)

akio_at_yukawa.kyoto-u.ac.jp

Akio Tomiya
Machine learning for theoretical physics
What am I?
I am a particle physicist, working on lattice QCD.
I want to apply machine learning on it.
My papers https://scholar.google.co.jp/citations?user=LKVqy_wAAAAJ
Detecting phase transition
Quantum computing
for quantum eld theory

Biography
2006-2010 : University of Hyogo (Superconductor)
2015: PhD in Osaka university (Particle phys)2015 - 2018 : Postdoc in Wuhan (China)
2018 - 2021 : SPDR in Riken/BNL (US)2021 : Assistant prof. in IPUT Osaka (ML/AI)
Kakenhi and others

Leader of proj A01 Transformative Research Areas, Fugaku+quantum computer

Others:Organizing “Deep Learning and physics”
fi

https://cometscome.github.io/DLAP2020/

Supervision of Shin-Kamen Rider
2
The 29th Outstanding Paper Award of the Physical Society of Japan
14th Particle Physics Medal: Young Scientist Award

Outline of my talk

Lattice QCD?

u udProblem and Goal

Transformer for
Physics3

What is Lattice QCD?

4

Introduction

Akio Tomiya

What is QCD?

Periodic Table of the Elements

e

P

u
d

u

P

QCD = Quantum Chromo-dynamics= A fundamental theory for particles inside of nuclei
Quantum many body, relativistic, strongly correlated
5Introduction

Akio Tomiya

Lattice QCD = QCD on discretized spacetime = calculable
QCD (Quantum Chromo-dynamics) in 3 + 1 dimension

1
S = d x[ − tr FμνF μν + ψ̄(i∂/ + gA/ − m)ψ]∫2
Fμν = ∂μ Aν − ∂ν Aμ − ig[Aμ, Aν]4

Non-commutable version of (quantum) electro-magnetism

want to evaluate expectation values with• We
following integral,

𝒟

⟨O⟩ ∼
𝒟

d

discretized the system, it becomes• Iflikewespin-glass+ fermions system

u

𝒟

u

describes inside of nuclei& mass of• Thishadrons, equations of states etc∫

iS

A ψ̄ ψe O• We can use Markov Chain Monte-Carlo6

物理の道具, 既存手法の問題点

Akio Tomiya

格子QCDの計算はスパコンで！(1980年~)

スパコンで計算して何がわかるの？
- 陽子/中性子の仲間の質量 (前述の通り)- 原子核同士の引力/斥力の様子 (星の生まれて死ぬまでを理解するのに必要)- 高温での陽子/中性子等の溶解の様子 (宇宙の歴史に関わる)- ダークマターの候補の性質(実験で見つけるには性質を知っておく必要あり)- 陽子/中性子内のクォークの様子- 手計算で計算できない各種係数(素粒子の標準理論が実験と整合性チェックに必要)などなど…
7

Introduction

Akio Tomiya

What is our nal goal for our research eld?

1
0 = Dog(0)

What we want to solve?

- Reduction of numerical cost to beyond our current numerical limitations- Production and measurements- Use of machine learning may be useful
Restrictions (problems) to use ML:- Exactness & quantitative. Machine learning is an approximator- Gauge symmetry, global symmetry is essential. While ML is not for physics- Code. How can we make neural nets w/ HPC? (not showing in this talk)
fi

fi

8

Machine learning?

9What is machine learning?
E.g. Linear regression ∈ Supervised learningData:

D = {(x (1), y (1)), (x (2), y (2)), ⋯}

y

x

10

Akio Tomiya

What is machine learning?
E.g. Linear regression ∈ Supervised learningData:

D = {(x (1), y (1)), (x (2), y (2)), ⋯}yxf{a,b,c}(x) = ax 2 + bx + c2
1E=f{a,b,c}(x (d)) − y (d)2∑da, b, c, are determined by minimizing E(training = tting by data)

11fiAkio Tomiya

What is machine learning?
E.g. Linear regression ∈ Supervised learningData:

D = {(x (1), y (1)), (x (2), y (2)), ⋯}yf{a,b,c}(x) = ax 2 + bx + cxf{a,b,c}(x) = ax 2 + bx + c2
1E=f{a,b,c}(x (d)) − y (d)2∑da, b, c, are determined by minimizing E(training = tting by data)

12
fiAkio Tomiya

What is machine learning?
E.g. Linear regression ∈ Supervised learningData:

D = {(x (1), y (1)), (x (2), y (2)), ⋯}yf{a,b,c}(x) = ax 2 + bx + c

y0

Use of tted function =Inferencex0x

Now we can predict y value which not in the data

In physics language, variational method
13
fiAkio Tomiya

What is the neural networks?

Akio Tomiya

Neural network is a universal approximation function
Example: Recognition of hand-written numbers (0-9)
Probability

6x6

1

Input

Black
box

2

3

4

OutputHow can we formulate this “Black box”?
Ansatz?

14

What is the neural networks?

Akio Tomiya

Neural network is a universal approximation function
Example: Recognition of hand-written numbers (0-9)
0.000
0.000
0.84340.756=
0.3456
0.64
Image is a vector 0.251⋮(6x6=36 dim)

Probability

6x6

=x⃗
Regard1
1

36 dimension

Images of “2”

Input

Black
box

3

2

4

Regard10 dimension

Output2

Images of “1”Image recognition = Find a map between two vector spaces
15

What is the neural networks?

Akio Tomiya

Neural network is a universal approximation function
Example: Recognition of hand-written numbers (0-9)
0.000
0.000
0.84340.756=
0.3456
0.64
Image is a vector 0.251⋮(6x6=36 dim)

6x6

=x⃗
RegardNeural net

36 dimension

Images of “2”Input
Images of “1”16

What is the neural networks?

Akio Tomiya

A ne transformation + element-wise transformation

Layers of neural nets l = 2,3,⋯, L, u (1)⃗ = x⃗(l−1)⃗{ u (l) = σ (l)(z (l))
(l)

(l)

z⃗ = W uii+ b⃗ are t parameters
W l, b (l)(l)⃗

A ne transformation(b=0 called linear transformation)

Element-wise (local) non-linear.
hyperbolic tangent-ish function

A fully connected neural net:

(3)(3) (2)
(2) ⃗
(2)
(3)
⃗
⃗
fθ( x ) = σ (W σ (W x + b ) + b ⃗ )θ is a set of parameters: wij(l), bi(l), ⋯- Input & output = vectors- Neural net = a nested function with a lot of parameters (W, b)- Parameters (W, b) are determined from data

Neural network = map between vectors and vectors
Physicists terminology: Variational ansatz
fi

ffi

ffi

17

What is the neural networks?

Akio Tomiya

Neural network is a universal approximation function
Example: Recognition of hand-written numbers (0-9)
0.000
0.000
0.84340.756=
0.3456
0.64
Image is a vector 0.251⋮(6x6=36 dim)

Probability

6x6

=x⃗

36 dimension

Regarding
1
Input

10 dimension

Images of “2”Input
Images of “1”4Regard1

Neural net

32

Output2“0” = (1,0,0,…)“1” = (0,1,0,…)“2” = (0,0,1,…)…
“9” = (0,0,…,1)

variationalmap

Fact: Neural network can mimic any function= A systematic variational function.
In this example, NN mimics image (36-dim vector) and label (10-dim vector)
18

What is the neural networks?

Akio Tomiya

Neural network have been good job
Protein Folding (AlphaFold2, John Jumper+, Nature, 2020+), Transformer neural net
Score:
Higher is better

Neural network wave function for many body (Carleo Troyer, Science 355, 602 (2017) )Variational energy(lower is better)# of units ∝Neural net + “Expert knowledge” → Best performancehttps://horomary.hatenablog.com/entry/2021/10/01/194825
https://www.aist.go.jp/aist_j/press_release/pr2020/pr20201111/pr20201111.html

19

Problem and Goal

20

Equivariance and convolution

Akio Tomiya

Neural network works quite well in natural science
Protein Folding problem (AlphaFold2, John Jumper+, Nature, 2020+), Transformer
Score:
Higher is better

Neural network wave function for many body (Carleo Troyer, Science 355, 602 (2017) )Variational energy(lower is better)# of units ∝Neural net + “Expert knowledge” → Best performancehttps://horomary.hatenablog.com/entry/2021/10/01/194825
https://www.aist.go.jp/aist_j/press_release/pr2020/pr20201111/pr20201111.html

21

Introduction

Akio Tomiya

Use of symmetry is crucial
Symmetries are essential for theoretical physics.
This is actually true as well in machine learning.
Equivariance/Covariance of symmetries helps generalization,
and avoiding wrong extrapolation(Symmetry restricts the function form)

Example in ML:
If data is translationally symmetric like photo images,
the frame work should respect this and one should implementwith this translational symmetry in a neural network= Convolutional neural net!
In physics + Machine learning,= Physics embedded neural networks
We use symmetry in the system
as much as we can22Motivation

Akio TomiyaMonte-Carlo integration is available, but still expensive!
1⟩=
Z∫

Target integratio⟨= expectation value

M. Creutz 1980

Ue −Se [U] (U)Se [U ] = Sgauge[U ] − log det(D/ [U ] + m)

Monte-Carlo: Generate eld con gurations with “P[U] ∝ e −Se [U]”U1
MarkovChain

サンプ → サンプ

⟨ ⟩≈

1

→ サンプ
NsampleNsample ∑k=1

Propose and check

→…

[Uk]

𝒪
ff

𝒟

𝒪

Production withis numerically expensive
and how can we accelerate it? We use machine learning!

𝒪

𝒪

U3

U2

. It gives expectation value

fi

fi

n

ff

ff

23

Introduction

Akio Tomiya

Generative neural net can make human face images
Neural nets can generate realistic human faces (Style GAN2)

Realistic Images can be generated by machine learning!
Con gurations as well? (proposals ~ images?)fi

24Introduction

Akio Tomiya

ML for LQCD is needed• Machine learning/ Neural networks• data processing techniques for 2d/3d data in
the real world (pictures)• (Variational) Approximation (〜 tting)1
0 = Dog(0)• Generative NN can generate images/pictures• Lattice QCD is more complicated than pictures• 4 dimension/relativistic• Non-abelian gauge symmetry (di cult)• Fermions (anti-commuting/fully quantum)-> Non-local e ective correlation in gauge eld• Exactness in MCMC is necessary!
• Q. How can we deal with?

http://www.physics.adelaide.edu.au/theory/sta /leinweber/VisualQCD/QCDvacuum/

fi

ffi

fi

ff

ff

25

Introduction

Akio Tomiya

Con guration generation with machine learning is developing
Year

Group

ML

Dim.

TheoryGauge sym

Exact?

Fermion?

Lattice2021/ref

2017

AT+

RBM
+ HMC

2d

Scalar-No

No

arXiv: 1712.03893

2018 K. Zhou+

GAN

2d

Scalar-No

No

arXiv: 1810.12879

2018

J. Pawlowski +

GAN
+HMC

2d

Scalar

-

Yes?

No

arXiv: 1811.03533

2019

MIT+

2d

Scalar-Yes

No

arXiv: 1904.12072

2020

MIT+

2d

U(1)

Equivariant

Yes

No

arXiv: 2003.06413

2020

MIT+

Flow
Flow
Flow

2d

SU(N)

Equivariant

Yes

No

arXiv: 2008.05456

2020

AT+

SLMC

4d

SU(N)

InvariantYes

PartiallyarXiv: 2010.11900

2021

M. Medvidovic´+

A-NICE

2d

Scalar-No

No

arXiv: 2012.01442

2021 S. Foreman L2HMC

2d

U(1)

Yes

Yes

No

2021

AT+

SLHMC

4d

QCD

Covariant

Yes

YES!

2021

L. Del
Debbio+2dScalar, O(N)

-

Yes

No

2021

MIT+

Flow
Flow

2d

Yukawa

-

Yes

Yes

2021

S. Foreman,AT+

Flowed
HMC

2d

U(1)

Equivariant

Yes

No but compatible

2021

XY Jing

2d

U(1)Equivariant

Yes

No

2022

J. Finkenrath

Neural
net
Flow

2d

U(1)

Equivariant

Yes

Yes (diagonalization)

arxiv: 2201.02216

2022

MIT+

Flow

2d

U(1)

Equivariant

Yes

Yes (diagonalization)

arXiv:2202.11712

arXiv: 2112.01586

＋…
fi

fi

This is not complete list. Related to lattice eld theory and biased26

2 cases in lattice theory:
Con guration generation
1. Flow-based sampling
2. Transformer (Not gauge theory)fi27Flow-based sampling28

Flow based sampling algorithm

Akio Tomiya

Change of variables makes problem easy
Ising model

∑

ϕe

QFT

−βH[s]O[s]{s}

Ising Model

∫

Dϕe

−S[ϕ]

Ising Model

ϕ

ϕ
ϕ

ϕ
Energy function (Hamiltonian)

H=−J

O[ϕ]

∑

sisj

ϕi ∈ ℝ

Energy function (Euclidean action)

S=−

∑ ∑
[

i

μ

ϕi(ϕi+μ + ϕi−μ − 2ϕi) + ϕi2]

arxiv 1904.12072, 2003.06413, 2008.05456 and more.

29

Flow based sampling algorithm

Akio Tomiya

Change of variables makes problem easy
We want this (Green’s function)

∫

Dϕe

−S[ϕ]

O[ϕ]

Evaluation is hard
(1M dimension integration)
Back to high school,- Integration by parts- Change of variables
Are there any good “Change ofvariables” for QFT?

arxiv 1904.12072, 2003.06413, 2008.05456 and more.

30

Flow based sampling algorithm

Akio Tomiya

Change of variables makes problem easy

∂ϕ
−S[ϕ]
−S[ϕ[z]]DϕeO[ϕ] = Dz deteO[ϕ[z]]∫∫∂z=Jacobian=J

Se [z] = S[ϕ[z]] − log J[z]

ff

= Dze
∫

ff

arxiv 1904.12072, 2003.06413, 2008.05456 and more.

−Se [z]O[ϕ[z]]

If this is easy to sample (or integrate),
we are happy
31

Flow based sampling algorithm

Akio Tomiya

Viewpoint: Change of variables makes problem easy
Simplest example: Box Muller∞∞∫−∞ ∫−∞dx

dy e{tan θ = y/x− 12 x 2− 12 y 2

Target integral: hardz=e

− 12 (x 2+y 2)

2πChangeof variables

1

1
=
dθ dz
∫0
2 ∫0
Easy

Change of variables sometimes problem easier (this case, it makes the measure at)
RHS is at measure→We can sample like right eq.
(uniform)ξ1 ∼ (0,2π){ ξ2 ∼ (0,1)

We can reconstruct
a eld con g x, y
for original theory
like right eq.

x = r cos θ{ y = r sin θθ = ξ1r = −2 log ξ2arxiv 1904.12072, 2003.06413, 2008.05456 and more.

fl

fi

fl

fi

32

Flow based sampling algorithm

Akio Tomiya

Trivialization is attractive
QFT probability:
Propagating modes~ correlations

1 −S[ϕ]P[ϕ] = e= P(ϕ1, ϕ2, ⋯, ϕL4)Z
Can we nd a change of variable?

Point-wise prob. dist.
P tri[z] = r(z1)r(z2)⋯r(zL4)
Trivial theory
No propagationr(zi) probability for 1 variable(Not the Gaussian FP)- Correlations in P[ϕ] makes theory non-trivial and it makes MCMC harder.
triP[z] = r(z1)r(z2)⋯r(zL4) has no correlation, sampling is trivial.
- Actually, there is a map between them. Trivializing map!
- We can trivialize the target theory
Famous example: Nicolai map in SUSY. Change of variablemakes theory bilinear (~trivial). How about for non-SUSY?
arxiv 1904.12072, 2003.06413, 2008.05456 and more.

fi

Nicolai, H., Phys. Lett. 89B, 341 (1980); Nucl. Phys. B176, 419 (1980).

33

Related works

Akio Tomiya

Gradient ow as a trivializing map
Trivializing map for lattice QCD has been demanded…

1
⟨ ⟩=
⋯
dϕx,y,z,te−S(ϕ) [ϕx,y,z,t]∏ ∏ ∏ ∏
Z ∫ ∫ x∈100
y∈100 z∈100 t∈100

ϕ̃ = ℱτ(ϕ)

Flow equation (change variable)

If the solution satis es S(ℱτ(ϕ)) + ln det(Jacobian) =∑n

ϕ̃2n ,1− ∑ ϕ̃2n⟨ ⟩=⋯dϕ̃ [ℱτ(ϕ)]e∏ ∏ ∏ ∏
Z ∫ ∫ x∈100
y∈100 z∈100 t∈100
It becomes Gaussian integral! Easy to evaluate!!
However, the Jacobian cannot evaluate easily, so it is not practical.
Life is hard.

𝒪

𝒪

𝒪

arxiv 1904.12072, 2003.06413, 2008.05456

𝒪

M. Luscher arXiv:0907.5491
fi

fl

34

Related works

Akio Tomiya

Flow based algorithm = neural net represented ow algorithm
Real scalar in 2 dimension

MIT + Google brain 2019~

Train a neural net as a “ ow” ϕ̃ = ℱ(ϕ)
If it is well represented, we can sample from a Gaussian
It can be done “Normalizing ow” (Real Non-volume preserving map)Moreover, Jacobian is tractable!
arxiv 1904.12072, 2003.06413, 2008.05456
fl

fl

fl

35

Related works

Akio Tomiya

Flow based algorithm = neural net represented ow algorithm
Real scalar in 2 dimension

MIT + Google brain 2019~

Their sampling strategy
sample gaussian → inverse trivializing map → QFT con gurations
Calculate Jacobian
After sampling, Metropolice-Hasting test (Detailed balance)→ exact!
arxiv 1904.12072, 2003.06413, 2008.05456
fl

fi

36

Related works

Akio Tomiya

Flow based algorithm = neural net represented ow algorithm
Real scalar in 2 dimension

MIT + Google brain 2019~

2pt function

U(1) gauge theory in 2 dimension. Topological charge is well sampled!

Applied already on SU(N)4d? Fermions?

-> OK

arxiv 1904.12072, 2003.06413, 2008.05456
fl37

Transformer for spin + fermion system
as a test case for Lattice QCD

38

Transformer and Attention
Attention layer used in Transformers (GPT, Bard)

Akio Tomiya

arXiv:1706.03762

Attention layer (in transformer model) has been
introduced in a paper titled“Attention is all you need” (1706.03762)
State of the art architecture of language
processing.
Attention layer is essential.
39

Equivariance and convolution

Akio Tomiya

Knowledge ∋ Convolution layer = trainable lter, Equivariant
Filter on image

Laplacian lter*

shift to right

0

1

0

1

-2

1

0

1

0

(Discretization of ∂ 2)=

Edge detection
shift to rightTranslational operation is commutable with ltering (equivariant)Convolution layer

Trainable lter*

shift to right

w11 w12 w13
w21 w22 w23
w31 w32 w33=

Fukushima, Kunihiko (1980
Zhang, Wei (1988) + a lot!

shift to rightTranslational operation is commutable with convolutional neurons (equivariant)This can be any lter which helps feature extraction (minimizing loss)
Equivariance reduces data demands. Ensuring symmetry (plausible Inference)
Many of convolution are needed to capture global structures
fi

fi

fi

)

fi

fi

40

Transformer and Attention

Akio Tomiya

Attention layer can capture non-local correlations

arXiv:1706.03762

Modi er in language can be non-local
Eg. I am Akio Tomiya living in Japan, who studies machine learning and physics
In physics terminology, this is non local correlation.
The attention layer enables us to treat non-local correlation
with a neural net!
Simpli ed version of Attention/Transformer
Skip connection

I
am
X=
Akio
⋮

WKX
V

W X
Weighted
Blockspin
Transf.
(Trainable)

M = W Q X(W K X )⊤Non-local product(Non-local
correlation)V

ReLU(M )W X

Add & normalization

X′

Self-Attention
These can be repeated￼

Array ofword vectors
Word~vector
X: matrix

W QX

fi

fi

41

Transformer and Attention
Transformer shows scaling lows (power law)

Akio Tomiya

arXiv: 2001.08361- Transformers requires huge data
(e.g. GPT uses all electric books in the world)
Because it has few inductive bias (no equivariance)- It can be improved systematically42Transformer and Attention

Akio Tomiya

Physically symmetric Attention layer
Attention layer can capture global correlation
Equivariance reduces data demands for training
Equivariance

Convolution(∈ equivariant
layers)Standard
Attention layer

Yes 👍
No 😲

Capturable
correlation

Local 😲
Global 👍

Data demmands

Applications

Low 👍

Image recognition
VAE, GAN
Normalizing ow

Huge 😲

ChatGPT
Bard
Vision Transformer
arXiv:1706.03762(This work)
Physically
Equivariant
attention
layer

Yes 👍

Global 👍?

This work
arXiv: 2306.11527

fl43

Self-learning Monte-Carlo

Akio Tomiya

Target: Double exchange model
Target system: Classical Heisenberg spin Si+ Fermion on 2d lattice

J
†
†
̂ cjα
̂ + h . c.) +
̂ ciα
̂ ,
H=−t
(ciα
Si ⋅ σî − μ
ciα
∑
∑
∑
2
α,⟨i,j⟩
i
α,i
e

−

e

−

Two di erent phases- Anti-ferromagnet (~staggered mag)- Paramagnet (~normal metal)(This system is similar to lattice QCD
but easier)ff

44Self-learning Monte-Carlo

Akio Tomiya

Previous work
Target system: Classical Heisenberg spin Si+ Fermion on 2d lattice

J
†
†
̂ cjα
̂ + h . c.) +
̂ ciα
̂ ,
H=−t
(ciα
Si ⋅ σî − μ
ciα
∑
∑
∑
2
α,⟨i,j⟩iα,iNaive e ective model:
LineareHe=−
Jn Si ⋅ Sj + E0∑⟨i,j⟩nJne : n-th nearest neighborSelf-learning Monte-Carlo:

Jne is determined by regression (training) to improve acceptance
ff

ff

ff

ff

ff

ff

Update with He and Metropolis-Hastings with H
This is an exact algorithms

45

Self-learning Monte-Carlo

Akio Tomiya

Previous work
Target system: Classical Heisenberg spin Si+ Fermion on 2d lattice

J
†
†
̂ cjα
̂ + h . c.) +
̂ ciα
̂ ,
H=−t
(ciα
Si ⋅ σî − μ
ciα
∑
∑
∑
2
α,⟨i,j⟩iα,iNaive e ective model:
LineareHe=−
Jn Si ⋅ Sj + E0∑⟨i,j⟩nff

ff

ff

We replace this by“translated” spin SiNN
with a transformer
and used in self-learning MC
ff

ff

ff

He

Jne : n-th nearest neighbor

e NN
NN
=−
Jn Si ⋅ Sj + E0∑⟨i,j⟩n46

Self-learning Monte-Carlo

Akio Tomiya

Physically equivariant Attention layer/Transformer
A Spin con guration

Equivariant Transformer block

S=

SelfAttention

Add &
Norm

arXiv: 2306.11527.

A Spin con guration

S′ =Skip connection

S

Array
of spinvectors(1 conf)

W QS

M = W QS(W KS)⊤K

S (A) = ReLU(M )W VS

Blockspin

Non-local product(Correlation functions)

W S

Blockspin

(A)
S
+
S
(
) ≡ S′S′

Add & Norm (normalization)

W VS

Blockspin

Our neural network respects symmetries
in the system. Also, it can capture
long-range correlations

￼

￼

￼

Self-Attention
𝒩

S

(A)

fi

fi

47

Self-learning Monte-Carlo
SLMC = MCMC with an e ective model

Akio Tomiya

arXiv:1610.03137+

For statistical spin system, we want to calculate expectation value with

W({S}) ∝ exp[−βH({S})]On the other hand, an e ective model He ({S}) can compose in MCMC,

{S}

e

{S}

e

{S}

e

{S} this distributes We ({S}) ∝ exp[−βHe ({S})]if the update「→」 satis es the detailed balance. We can employ Metropolis test like

ff
ff

￼

ff

ff

fi

ff

f

f

f

￼

ff

ff

ff

Ae ({S′}, {S}) = min (1,We ({S′})/We ({S})) .

Self-learning Monte-Carlo

Akio Tomiya

SLMC = MCMC with an e ective model

arXiv:1610.03137+

For statistical spin system, we want to calculate expectation value with

W({S}) ∝ exp[−βH({S})]On the other hand, an e ective model He ({S}) can compose in MCMC,

{S}

e

{S}

e

{S}

{S} this distributes We ({S}) ∝ exp[−βHe ({S})]eif the update「→」 satis es the detailed balance. We can employ Metropolis test likeAe ({S′}, {S}) = min (1,We ({S′})/We ({S})) .

SLMC: Self-learning Monte-Carlo
We can construct double MCMC with H({S}) and He ({S})

{S}

e

{S}

e

{S}

{S}

e

{S}

e

{S}

e

{S}

e

{S}

W({S′}) We ({S})
A({S′}, {S}) = min 1,.
( W({S}) We ({S′}) )with Metropolis-Hastings test:

ff

ff

￼

fi

fi

ff

fi

ff

f

f

f

f

f

f

f

f

f

￼

￼

ff

ff

ff

ff

ff

ff

ff

￼

￼

ff

- E ective model can have t parameters- Exact! It satis es detailed balance with W({S}) (exact)- It has been used for full QCD too (arXiv: 2010.11900, 2103.11965)49

Transformer and Attention

Akio Tomiya

arXiv: 2306.11527 + update

Application to O(3) spin model with fermions
Acceptance rate ~ e ciency
Transformers
Linear1
0.8

Models with the attention

0.6

Staggered mag.

0.4
(same as previous work
No attention)

0.2
0
0

1

2
3
4
5
6
Num. of attention layers

78~ # of parameters
Note: As
far not
as wetested,Note: CNN-type
does
work
in this case.
CNN-type
does withnot workin thiscase.
No
improvements
increaseof layers.
No
improvements
withofincrease
layers.
(Globalcorrelations
fermionsoffrom(Globalstatistics
correlationsof acceptancefermions from
Fermi-Dirac
make
bad?)
Fermi-Dirac statistics make acceptance bad?)Physical values are consistent(as we expected)

Nx=Ny=6(Lattice sites)50
ffi

Acceptance ratio

Observables

fi

fi

Transformer and Attention

Akio Tomiya

Loss function shows Power-type scaling law as LLM

Acceptance rate = exp (− MSE )Estimated

estimated MSE

Loss (MSE)10Transformers
LinearyrainModel w/o
attention

1

m
i
l
e
r

P

0.1

0.01

arXiv: 2306.11527 + update

Models with the attention

t range1

Scaling in LLM [1]10Line is just for
guiding eyes
(no meaning)

100

num. of trainable parameters(1 layer ~ 30 parameters)[1] arXiv:2001.08361

t ~(7.1/x)^(1.1)
51総合的に速くするには?

52

AI(ML) + Science

Akio Tomiya

速く・正確にAI (機械学習手法) は、なんとかできることが増えてきた- 既存手法で担保すべき「厳密性」- 他にもAMAのような系統誤差補正手法もある
結局、どこに向かうのか- 既存手法 + AI手法のハイブリッド (eg 自己学習モンテカルロや前処理)- 速くなる ≠ 処理が高速-> 例えば遅くても、MCなら単位時間あたりに独立な配位をいくつ作れる?
- 機械学習自体の高速化、量子化、スパースアテンション
HPC系の技術とAIは相性が悪いことも多い- 量子化 (低精度表現)- データ量- (今のところ)ML は低精度GPUで出来てしまう、今後もおそらく続く53

AI(ML) + Science

Akio Tomiya

速く・正確にAI (機械学習手法) は、なんとかできることが増えてきた
新しいアーキテクチャの提案- 既存手法で担保すべき「厳密性」(ドメイン知識を生かしたNNの設計)- 他にもAMAのような系統誤差補正手法もある
結局、どこに向かうのか- 既存手法 + AI手法のハイブリッド (eg 自己学習モンテカルロや前処理)- 速くなる ≠ 処理が高速

AIコード自身の高速化

アルゴリズム改良-> 例えば遅くても、MCなら単位時間あたりに独立な配位をいくつ作れる?
コードをどうするか- 機械学習自体の高速化、量子化、スパースアテンション
HPC系の技術とAIは相性が悪いことも多い- 量子化 (低精度表現)

AI手法との共存- データ量AI用ハードウェア- (今のところ)ML は低精度GPUで出来てしまう、今後もおそらく続く54Summary

Akio Tomiya

Machine learning + lattice eld theory• Machine learning is useful for natural science/physics/Lattice QCD• Multi-dimensional integration is done by MCMC
• MCMC proposals can be made by Machine learning• Transformer for a spin+fermion system• Scaling law for a Transformer for physical system• Future work: Transformer for lattice gauge theory
ML and expert knowledge (e.g. symmetry) of• Combining
computational physics/LatticeQCD is important• How can we use AI for science (open question)• We know AI is useful for data generation thoughfi

55 22H05112, 22H05111, 22K03539
KAKENHI: 20K14479,

Thanks!

55

9/9 - 9/13
格子QCDのサマースクールを行います
筑波大学東京キャンパス
講義:

場の理論の基礎から格子QCDの最先端まで

場の理論の導入: 大野木哲也 (大阪大)

クォークソルバー: 石川健一 (広島大)

経路積分量子化: 渡辺展正 (京都大)ゼロ温度QCD: 富井正明 (BNL)

標準模型とQCD: 北原鉄平 (千葉大)有限温度QCD: 大野浩史 (筑波大)くりこみ群: 山田雅俊 (吉林大)量子計算: 谷崎佑弥 (京都大)格子ゲージ理論: 山﨑剛 (筑波大)

機械学習: 富谷昭夫 (IPUT)

4月くらいに正式情報がでます。

格子フェルミオン: 菊川芳夫 (東京大)マルコフ連鎖モンテカルロとHMC: 金森逸作 (理研)場所・日程:
筑波大学東京キャンパス (東京都文京区大塚)
開催期間: 2024/9/9(月) - 2024/9/13(金)https://akio-tomiya.github.io/latticeschool2024/
世話人: 大野浩史、藏増嘉伸、富谷昭夫、山崎剛

56

57