メインコンテンツへスキップ

7.2.2 大規模モデルの発展史

AI 15 段階発展マップ

年表暗記ではなく地図として読む

日付を暗記する必要はありません。次の 1 本の流れを押さえます。

rules -> statistics -> neural representations -> attention -> scale -> alignment -> tools

大規模言語モデルは突然生まれたものではなく、この長い変化の結果です。

15 段階の全体像

段階何が変わったかLLM との関係
1. Turing question機械知能が具体的な問いになった言語が知能の重要なテストになった
2. Dartmouth AIAI が研究分野になった初期は symbolic reasoning が中心
3. Perceptron学習できる neural model が登場trainable model の第一波
4. Expert systemsrules が狭い領域で広がった価値と保守コストを同時に示した
5. Backpropagation多層 neural nets が訓練可能になったdeep learning の基礎
6. LeNetneural nets が実タスクで機能したrepresentation learning の実例
7. Statistical MLdata-driven methods が多くの手書き rules を超えたNLP が corpus evidence へ移った
8. ImageNet / AlexNetdeep learning が scale で勝ったdata、compute、architecture が重要になった
9. ResNet非常に深い networks が訓練しやすくなったscale がより安定した
10. RNN / LSTMsequences が neural に扱われたlanguage modeling が n-gram を超えた
11. Attention関連位置に focus できるようになったlong context bottleneck を緩和
12. Transformerattention が主アーキテクチャになったparallel training と scaling が進んだ
13. BERT / GPTpretraining が shared foundation になった1 つの model を多タスクへ転用
14. RLHF / ChatGPTbehavior が instruction に合わせられたcapability が product behavior になった
15. RAG / Agentmodels が knowledge と tools を使い始めたLLM が application system になった

ここから言語モデルの主線に絞ります。

5 つの言語モデル時代

時代中心アイデア主な限界
Rule-based systems人間が language rules を書く壊れやすく、保守が高コスト
Statistical language models頻度から次の単語を予測sparse data、short context
Neural sequence modelsvector と recurrent state を学ぶ長距離依存が難しく、訓練が遅い
Transformerstoken 同士が直接 attention するcompute と data cost が高い
LLM + alignment大規模 pretraining 後に behavior を調整hallucination、安全、コスト、評価

主線は context です。各世代は、手書き仮定を減らしながら、より多くの context を使おうとしてきました。

実験:Bigram 言語モデルを作る

この小さな n-gram model は、現在の単語から次の単語を予測します。強くはありませんが、neural LM 以前の統計的な発想が見えます。

from collections import Counter, defaultdict

corpus = [
"I like learning AI",
"I like learning Python",
"You like learning NLP",
"I like doing projects",
]

next_word_counter = defaultdict(Counter)

for sentence in corpus:
tokens = sentence.split()
for current_word, next_word in zip(tokens[:-1], tokens[1:]):
next_word_counter[current_word][next_word] += 1


def suggest_next(word):
candidates = next_word_counter[word]
return candidates.most_common() if candidates else []


print("Common words after I :", suggest_next("I"))
print("Common words after like :", suggest_next("like"))
print("Common words after learning:", suggest_next("learning"))

期待される出力:

Common words after I       : [('like', 3)]
Common words after like : [('learning', 3), ('doing', 1)]
Common words after learning: [('AI', 1), ('Python', 1), ('NLP', 1)]

Bigram 補完の実行結果図

これは autocomplete に少し似ています。しかし限界も明確です。

  • 1 つ前の単語しか見ない。
  • rare な組み合わせは統計が弱い。
  • 文の意味表現を持たない。

なぜ Neural Models が重要だったのか

Neural language models は、単なるカウントを learned representations に置き換えました。

word id -> vector -> context state -> prediction

Word2Vec、GloVe、RNN、LSTM、GRU により、language modeling は柔軟になりました。similarity と長めの context を学べるようになりましたが、逐次的に読むため訓練は遅く、長距離記憶も不安定でした。

なぜ Transformer が転換点だったのか

RNN は主に一歩ずつ読みます。Transformer では、token が attention を通して他の token と直接比較できます。

current token -> attends to relevant tokens -> updated representation

これにより 3 つの変化が起きました。

  • 訓練をより並列化しやすい。
  • 長距離関係を扱いやすい。
  • parameters、data、compute の scale が効きやすい。

だから BERT、GPT、T5、後の LLM は Transformer family tree に属します。

なぜ Scale だけでは足りないのか

大規模 pretraining は広い capability を作りましたが、product behavior には別の層が必要でした。

必要なこと技術
指示に従うinstruction tuning
役に立つ回答を好むpreference learning / RLHF
最新または private knowledge を使うRAG
行動するtool calling / Agent loop
unsafe behavior を減らすsafety evaluation and guardrails

現代 LLM で重要な区別はこれです。

model capability != model behavior

モデルは強力でも、ポリシーに従わない、証拠を引用しない、安全に行動しないことがあります。

何を覚えるか

大規模モデルは NLP の歴史に属しますが、今は狭い NLP を超えています。同じ architecture と training idea が、text、image、speech、code、video、multimodal QA、RAG、Agent に広がっています。

実務的な要点は次の通りです。

  • rules は control を与えたが coverage が弱い。
  • statistics は data evidence を与えたが context が短い。
  • neural representations は semantic space を作った。
  • Transformer は scale を実用化した。
  • alignment、RAG、tool calling が model を system に変えた。

練習

  1. bigram corpus に 2 文を追加し、suggestion がどう変わるか見る。
  2. bigram model が長い instruction に弱い理由を説明する。
  3. Transformer が RNN より並列訓練しやすい理由を説明する。
  4. model に capability はあるが、alignment または RAG が必要な例を 1 つ挙げる。
  5. 15 段階のどれか 1 つを選び、それが今日の LLM application にどう残っているか説明する。