Neural networks are the essential to AI technologies today, from classic image classifiers to the latest large language models. On this page, we'll explore the foundation of their mechanism. Since there are already many great articles and books on this topic, we'll focus on building intuition with simple examples while glossing over details.

ニューラルネットワークは、クラシックな画像分類器から最新の大規模言語モデルまで、現代のAI技術には欠かせません。このページではその仕組みの基礎について見ていきます。この分野にはもうたくさんの優れた記事や書籍があるので、詳細は飛ばしてシンプルな例で直感的な理解を目指します。

So what is a neural network? You probably know it's inspired by the human brain, but it's not really a simulation of one. No matter how sophisticated they look from the outside, neural networks do one thing—they create a mathematical function that takes an input and produces the corresponding output.

ニューラルネットワークとは何でしょうか。人間の脳から着想を得ていることは知られていますが、実際には脳のシミュレーションではありません。どれだけ洗練されているように見えても、ニューラルネットワークがすることは1つで、入力を受け取り対応する出力を生成する、数学的な関数を作ることです。

$$ \text{Input} \implies \boxed{\text{ \textbf{Function} }} \implies \text{Output} $$

For example, say you want a model that can tell if there's a cat in a picture. That may not sound like a mathematical function, but it can be written as a function that takes all the RGB values of the pixels and returns a binary (yes or no) or the probability of a cat's presence.

例えば、画像に猫が写っているかを判定するモデルが欲しいとします。数学的な関数とは思えないかもしれませんが、すべてのピクセルのRGB値を入力として受け取り、バイナリ(はい、いいえ)か、猫がいる確率を返す関数として記述できます。

The problem here is that no one knows how to write such an algorithm, but a well-designed neural network with enough examples of images with and without cats can forge a function by nudging a lot of numbers inside while reacting to these examples.

ここで問題なのは、そんなアルゴリズムの書き方は誰にもわからないことですが、適切に設計されたニューラルネットワークは、十分な数の猫ありと猫なしの画像があれば、それらの例に応じて内部の数値を調整し、関数を構築できます。

<aside> 💡

Being a mathematical function means the output is uniquely determined for a given input. People often say AI is unpredictable, but neural networks are completely deterministic. If a model returns different results every time, it's because it's intentionally programmed to use random input behind the scenes.

数学的関数であるというのは、入力が決まれば出力も一意に決まるということです。AIは予測不可能だとよく言われますが、ニューラルネットワークは完全に決定論的です。モデルが毎回違う結果を返すなら、それは意図的に裏でランダムな入力を使うようプログラムされているからです。

</aside>

Neuron

ニューロン

Neural network is build on incredibly simple math formula, something that looks like:

ニューラルネットワークは、下のような、びっくりするほどシンプルな数式からできています。

$y = \max(0, x \cdot w + b)$