😽

スクレイピングとDeepResearchで確認するムーアの法則

2025/02/18に公開

AIやシンギュラリティは本当に加速度的進化をもたらしているのか?CPUの歴史から検証してみる
近年「AI」「シンギュラリティ」といった言葉をよく耳にしますが、本当に技術は加速度的に進化しているのでしょうか?
この記事では、過去から現在までの CPU トランジスタ数や性能(MIPS)を振り返ることで、どの程度の変化が起きているのかを簡単に検証してみます。

** ステップ0: deep research で調査・コード生成

まずは「AIにやらせる」と言うことで大雑把なスクレイピングコードをDeepResearchに書いてもらい、Wikipedia などからデータを取得してグラフ化しようと試みるアプローチです。以下のような Python コードを使い、トランジスタ数と CPU の性能 (MIPS) をそれぞれ Wikipedia ページからスクレイピングし、CSV にまとめ、さらにグラフを描画する流れを試しました。

import requests
from bs4 import BeautifulSoup
import csv
import matplotlib.pyplot as plt

# 対象とする CPU 名
cpus = [
    "Intel 8086", "Intel 80286", "Intel 80386",
    "Intel 80486", "Pentium", "Pentium Pro", "Pentium III"
]

# 1. トランジスタ数データを Wikipedia「Transistor count」からスクレイピング
url_transistors = "https://en.wikipedia.org/wiki/Transistor_count"
res = requests.get(url_transistors)
soup = BeautifulSoup(res.text, 'html.parser')

# Microprocessors テーブルを探す
tables = soup.find_all("table", {"class": "wikitable"})
cpu_table = None
for table in tables:
    # テーブル内に対象 CPU 名が含まれていれば該当とする
    if table.find(text=lambda t: t and any(cpu in t for cpu in cpus)):
        cpu_table = table
        break

# CPU名 -> (year, transistors) を格納
cpu_data = {}
if cpu_table:
    rows = cpu_table.find_all("tr")[1:]  # ヘッダをスキップ
    for row in rows:
        cells = [cell.get_text(strip=True) for cell in row.find_all(["th","td"])]
        if len(cells) < 2:
            continue
        name = cells[0]
        for cpu in cpus:
            if name.startswith(cpu):
                year = cells[2]
                trans_str = cells[1]
                # カンマや非数字を削除
                trans_str = "".join(ch for ch in trans_str if ch.isdigit())
                if trans_str:
                    transistors = int(trans_str)
                else:
                    transistors = None
                try:
                    year = int(year)
                except:
                    continue
                cpu_data[cpu] = {"year": year, "transistors": transistors}
                break

# 2. MIPS データを Wikipedia「Instructions per second」からスクレイピング
url_perf = "https://en.wikipedia.org/wiki/Instructions_per_second"
res2 = requests.get(url_perf)
soup2 = BeautifulSoup(res2.text, 'html.parser')
perf_table = soup2.find("table", {"class": "wikitable"})

if perf_table:
    rows = perf_table.find_all("tr")[1:]
    for row in rows:
        cols = [col.get_text(strip=True) for col in row.find_all(["td","th"])]
        if len(cols) < 2:
            continue
        proc_name = cols[0]
        perf_info = cols[1]  # ex: "188 MIPS at 100 MHz"
        # テキスト中から MIPS を抽出
        if "MIPS" in perf_info:
            mips_value = perf_info.split("MIPS")[0]
            mips_value = "".join(ch for ch in mips_value if (ch.isdigit() or ch == '.'))
            try:
                mips = float(mips_value)
            except:
                continue
        else:
            continue

        # 上で定義した CPU リストとのマッチング
        for cpu in cpus:
            if proc_name.startswith(cpu):
                if cpu in cpu_data:
                    cpu_data[cpu]["MIPS"] = mips
                else:
                    cpu_data[cpu] = {"year": None, "transistors": None, "MIPS": mips}
                break

# 3. CSV に保存
csv_filename = "cpu_trends.csv"
with open(csv_filename, mode='w', newline='') as csvfile:
    writer = csv.writer(csvfile)
    writer.writerow(["CPU", "Year", "TransistorCount", "MIPS"])
    for cpu in cpus:
        if cpu in cpu_data:
            year = cpu_data[cpu].get("year", "")
            trans = cpu_data[cpu].get("transistors", "")
            mips = cpu_data[cpu].get("MIPS", "")
            writer.writerow([cpu, year, trans, mips])

print(f"Data saved to {csv_filename}:")
for cpu, info in cpu_data.items():
    print(cpu, "=>", info)

# 4. グラフを描画
years = [cpu_data[cpu]["year"] for cpu in cpus if "year" in cpu_data[cpu]]
trans_counts = [cpu_data[cpu]["transistors"] for cpu in cpus if "transistors" in cpu_data[cpu]]
perf_values = [cpu_data[cpu]["MIPS"] for cpu in cpus if "MIPS" in cpu_data[cpu]]

plt.figure(figsize=(8,4))

plt.subplot(1,2,1)
plt.plot(years, trans_counts, marker='o')
plt.yscale('log')
plt.title("Transistor Count over Time")
plt.xlabel("Year")
plt.ylabel("Transistor count (log scale)")

plt.subplot(1,2,2)
plt.plot(years, perf_values, color='orange', marker='s')
plt.yscale('log')
plt.title("CPU Performance (MIPS) over Time")
plt.xlabel("Year")
plt.ylabel("Million Instructions/sec (log scale)")

plt.tight_layout()
plt.show()

** 実際にやってみた結果どうだったか?

問題1: Wikipedia のテーブル構造が微妙に変わっていたり、表が複数存在したりして安定してデータを取得できない。
問題2: 同じ CPU 名でも時期やクロック違いで行が分割されている、もしくは CPU 名が微妙に異なる記載になっている。
問題3: MIPS の値に幅があり、一意に決めづらい。
このように、スクレイピングでそのままデータを持ってくる方法は、テーブル構造や表記ゆれに大きく依存するため、期待通りにデータを揃えられないケースが多々あります。結果的に、外部サイトのフォーマット変更にも弱く、長期的な保守は面倒です。

** ステップ1: 信頼できるソースから正確なデータセットを作成

そこで、Intel 公式情報や WikiChip、CPU-World、Stanford CPU Database など、より信頼性のあるソースを調べて手動でデータを整理しました。以下はサンプルとしてまとめられたデータの一部です(参考となるサイトのリンクを添えてあります)。
これもdeepresearchに依頼して出てきたデータセットです。

Intel CPU Transistor Counts and Performance (1971–2023)
CPU (発売年)	トランジスタ数	性能 (MIPS 目安)	主な参照元
Intel 4004 (1971)	~2,300	~0.06 MIPS	CACM.ACM.ORG
Intel 8008 (1972)	~3,500	~0.05–0.1 MIPS	CPUSHACK.COM
Intel 8080 (1974)	~4,500	~0.29–0.64 MIPS	CALISPHERE.ORG
Intel 8086 (1978)	~29,000	~0.75 MIPS	BUSINESSNEWSDAILY.COM
Intel 80486 (1989)	~1,200,000	~41–70 MIPS	COREPULSE.CA
Intel Pentium (1993)	~3,100,000	~100+ MIPS	EN.WIKIPEDIA.ORG
Pentium Pro (1995)	~5,500,000	~200–400 MIPS	PAGES.CS.WISC.EDU
Pentium 4 (2000)	~42,000,000	~9,726 MIPS @ 3.2GHz	EN.WIKIPEDIA.ORG
Core 2 Duo (2006)	~291,000,000	~27,079 MIPS	COREPULSE.CA
Core i7 (Nehalem, 2008)	~731,000,000	~82,300 MIPS	COREPULSE.CA
Core i9 (Skylake-X, 2017)	~7,000,000,000	~400,000–800,000 MIPS	ICDREX.COM
Core i9 (Raptor Lake, 2023)	~25,900,000,000	~1,000,000 MIPS (1 TMIPS)	WEPC.COM

注: MIPS 値はあくまで目安(ベンチマーク結果やクロック周波数に依存)です。異なるテスト条件で数値が大きく変わるため、参考程度にご覧ください。

** ステップ2: 整理したデータを使ってグラフを描画

スクレイピングではなく、整形済みのデータをハードコーディングして直接プロットします。以下のコードを実行すると、年次とともに指数関数的に増加するトランジスタ数や CPU 性能の推移を可視化できます。

import matplotlib.pyplot as plt

# 例: Intel が公表している歴史的 CPU のデータ (一部は近似値・参考値)
data_list = [
    {"year": 1971, "transistors": 2300,       "performance": 0.06},   # Intel 4004
    {"year": 1972, "transistors": 3500,       "performance": 0.09},   # Intel 8008
    {"year": 1974, "transistors": 6000,       "performance": 0.29},   # Intel 8080 (0.29~0.64 MIPS の中間値で仮定)
    {"year": 1978, "transistors": 29000,      "performance": 0.75},   # Intel 8086
    {"year": 1989, "transistors": 1200000,    "performance": 41.0},   # Intel 80486
    {"year": 1993, "transistors": 3100000,    "performance": 100},    # Intel Pentium
    {"year": 1995, "transistors": 5500000,    "performance": 200},    # Pentium Pro
    {"year": 2000, "transistors": 42000000,   "performance": 9726},   # Pentium 4
    {"year": 2006, "transistors": 291000000,  "performance": 27079},  # Core 2 Duo
    {"year": 2008, "transistors": 731000000,  "performance": 82300},  # Core i7
    {"year": 2017, "transistors": 7000000000, "performance": 400000}, # Core i9 (Skylake-X)
    {"year": 2023, "transistors": 25900000000,"performance": 1000000},# Core i9 (Raptor Lake) ~1 TMIPS
]

# 1. 年でソート
data_list.sort(key=lambda x: x["year"])

# 2. グラフ描画用データに変換
years = [d["year"] for d in data_list]
transistors = [d["transistors"] for d in data_list]
performance = [d["performance"] for d in data_list]

# 3. グラフ描画
plt.figure(figsize=(10,4))

# (A) トランジスタ数の推移
plt.subplot(1,2,1)
plt.plot(years, transistors, marker='o', linestyle='-', color='blue')
plt.yscale('log')  # 対数スケールで描画
plt.title("CPU Transistor Count Over Time")
plt.xlabel("Year")
plt.ylabel("Transistor Count (log scale)")
for x, y in zip(years, transistors):
    plt.text(x, y, f"{y:,}", fontsize=8, ha='left', va='bottom')

# (B) CPU性能(MIPS)の推移
plt.subplot(1,2,2)
plt.plot(years, performance, marker='s', linestyle='-', color='red')
plt.yscale('log')  # 対数スケールで描画
plt.title("CPU Performance Over Time")
plt.xlabel("Year")
plt.ylabel("Performance (MIPS, log scale)")
for x, y in zip(years, performance):
    plt.text(x, y, f"{y:,}", fontsize=8, ha='left', va='bottom')

plt.tight_layout()
plt.show()

実行すると、以下のように横軸が年、縦軸がトランジスタ数・MIPS ともに対数スケールで指数関数的に伸びているグラフが得られます。

一応、これまである程度ムーアの法則が機能していると言う経験則を検証できました。
また、CPUの演算性能よりも、トランジスタの集積度の方がより綺麗なグラフを描いているのは、このように自分でプロットして初めて分かることではないでしょうか??

**まとめ: 本当にシンギュラリティが来るのか?

本記事では、ムーアの法則をスクレイピングやdeepResearchを用いて検証した際のコードを共有しています。
CPU のトランジスタ数と性能は、過去数十年にわたりほぼ指数関数的な伸びを示してきました(いわゆるムーアの法則)。
一方で、近年はプロセス微細化が物理的制約に近づきつつあるため、同じペースでの伸びは維持できないという見方もあります。
AI の性能向上は CPU だけでなく、GPU や専用アクセラレータ、ニューラルネットワーク向けハードウェアなど多岐にわたり、単純な「トランジスタ数 × クロック」の世界観とは異なる部分が大きいです。
結論としては、「シンギュラリティ(技術的特異点)がいつ来るか」は単なる CPU 性能やトランジスタ数だけでは測れません。しかし、歴史を振り返ると確実にハードウェア性能は加速度的に向上してきた事実があります。AI のブレイクスルーも今後さらに起きる可能性は高いでしょう。今後の展開には注目が必要です。

Discussion