AI にできないこと
リアルタイムデータ、記憶、推論エラー、自信ありげな誤答など、AI の限界を学びます。
「AI にできないこと」はCoddyKit上の無料AI Prompt Engineeringレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはAI Prompt Engineering学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 AI Prompt Engineeringコースには全4レッスンが含まれています。
知っておくべき限界
AI言語モデルは強力ですが、明確な限界があります。これらの限界を誤解すると、無駄な作業や誤った回答、ユーザーの不満につながります。
特に大きな限界は、リアルタイムのインターネットアクセスがないこと、セッション間で永続的なメモリを持たないこと、自信に満ちたハルシネーション、そして数学や論理で推論を誤ることの4つです。
リアルタイムのインターネットアクセスはない
デフォルトでは、LLMは推論時に完全にオフラインで動作します。次のことはできません。
- 今日の株価を調べる
- 現在の天気を確認する
- 言及されたURLにアクセスする
- Googleやその他の情報源を検索する
「今のTeslaの株価はいくらですか?」と尋ねると、モデルは回答を拒否するか、数か月または数年前の可能性がある学習データに基づいて推測します。
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=128,
messages=[{
'role': 'user',
'content': 'What is Bitcoin\'s price right now in USD?'
}]
)
# The model will acknowledge it cannot access real-time data
print(response.content[0].text)
# To add real-time data, you must inject it yourself:
current_price = 67500 # fetched from an exchange API by YOUR code
response2 = client.messages.create(
model='claude-opus-4-5',
max_tokens=128,
messages=[{
'role': 'user',
'content': f'Bitcoin price as of now: ${current_price}. Is this above or below $70,000?'
}]
)
print(response2.content[0].text)知識のカットオフ日
すべてのLLMは、特定の日付までのインターネットのスナップショットを使って学習されています。この日付が知識のカットオフ日です。
カットオフ日より後に生じた出来事、法律、製品、研究論文、人々について、モデルは知りません。それでも自信を持って回答することがありますが、その回答は実際の知識ではなく、外挿に基づくものです。
時間に敏感なタスクでは、必ずモデルが示すカットオフ日を確認してください。
import openai
client = openai.OpenAI(api_key='sk-your-key-here')
# Ask the model to disclose its cutoff and caveats
response = client.chat.completions.create(
model='gpt-4o',
messages=[{
'role': 'user',
'content': (
'I need to know about the latest AI models released in the past 3 months. '
'Please state your knowledge cutoff date and any caveats before answering.'
)
}]
)
print(response.choices[0].message.content)
# Best practice: inject a date stamp so the model knows the current date
from datetime import date
today = date.today().isoformat()
response2 = client.chat.completions.create(
model='gpt-4o',
system=f'Today is {today}. Your knowledge cutoff may be earlier — say so if relevant.',
messages=[{'role': 'user', 'content': 'What are the latest LLM releases?'}]
)セッション間で永続的なメモリはない
新しいセッションを開始すると、モデルは以前の会話を一切覚えていません。5分前の会話であっても同じです。
これはバグではありません。ステートレスなAPIがそのように動作するためです。すべてのセッションは空のコンテキストから始まります。
セッション間で情報を保持するには、情報を自分で(データベースやファイルに)保存し、システムメッセージや会話履歴に再度組み込む必要があります。
import json
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
# Simulate storing user preferences between sessions
def load_user_profile(user_id):
# In production: load from database
return {'name': 'Alice', 'preferred_language': 'Python', 'skill_level': 'intermediate'}
def build_system_message(profile):
return (
f'The user\'s name is {profile["name"]}. '
f'They prefer {profile["preferred_language"]} examples. '
f'Their skill level is {profile["skill_level"]}. '
f'Tailor all responses accordingly.'
)
profile = load_user_profile('user-123')
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=256,
system=build_system_message(profile),
messages=[{'role': 'user', 'content': 'Show me how to read a file.'}]
)
print(response.content[0].text)ハルシネーション:自信に満ちた誤り
ハルシネーションとは、事実としては誤っているにもかかわらず、もっともらしく聞こえるテキストをモデルが生成し、それを完全に自信を持って述べることです。
よくあるハルシネーションの種類には、次のようなものがあります。
- 捏造された引用や論文タイトル
- 誤った日付、名前、統計値
- 架空の企業情報や製品仕様
- 存在しないAPIや関数名
モデルには内部的なファクトチェッカーがありません。検証済みの情報ではなく、統計的にありそうな内容を生成しています。
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
# Asking for a citation is a classic hallucination trigger
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=256,
messages=[{
'role': 'user',
'content': (
'Cite 3 peer-reviewed papers about the effect of social media on teen anxiety. '
'Include author names, journal names, and publication years.'
)
}]
)
print(response.content[0].text)
# WARNING: verify every citation independently — some may be fabricatedハルシネーションを減らす
ハルシネーションをなくすことはできませんが、大幅に減らすことはできます。
- 情報源の資料を提供する — 貼り付けた文書だけを根拠に回答するようモデルに依頼する
- 確信度を尋ねる — 確信がない場合は「わかりません」と言うようモデルに指示する
- 低い温度を使用する — 無謀な推測を減らす
- 独立して検証する — 重要な出力は必ずファクトチェックする
- 検索拡張を使用する — 質問する前にリアルタイムの事実を組み込む
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
# Ground the model with provided source material
document = (
'According to the 2023 Pew Research report, 46% of US teens say '
'they are online almost constantly, up from 24% in 2014-2015.'
)
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=256,
system=(
'Answer ONLY using the provided document. '
'If the answer is not in the document, say: "The document does not cover this."'
),
messages=[{
'role': 'user',
'content': f'Document:\n{document}\n\nQuestion: What percentage of US teens are online almost constantly?'
}]
)
print(response.content[0].text)数学における推論エラー
LLMは計算機ではありません。正しい数学のように見えるトークンを生成しますが、次のような場面で誤りを犯します。
- 複数ステップの算術計算
- 大きな数の計算
- パーセンテージや単位の変換
- 変数が多い論理パズル
数値が関係する処理では、必ずコード実行や外部の計算機を使い、その結果をモデルに解釈させてください。
import openai
client = openai.OpenAI(api_key='sk-your-key-here')
# Bad practice: ask the LLM to compute a complex calculation directly
response_direct = client.chat.completions.create(
model='gpt-4o',
messages=[{'role': 'user', 'content': 'What is 17.83% of 348,921.47?'}]
)
print('LLM answer:', response_direct.choices[0].message.content)
# Good practice: compute in Python, then ask LLM to explain it
result = round(348921.47 * 0.1783, 2)
response_explained = client.chat.completions.create(
model='gpt-4o',
messages=[{
'role': 'user',
'content': f'17.83% of 348,921.47 is ${result}. Explain what this means for a budget report.'
}]
)
print('Explained:', response_explained.choices[0].message.content)複雑な論理と推論の限界
LLMは、多くの制約を同時に維持したり、何段階にもわたって状態を追跡したりする必要があるタスクを苦手とします。
- 多くのステップを含む長い論理証明
- 多くの制約があるスケジューリング問題
- 深くネストされたロジックを含むコード
- グラフ探索や組合せ問題
Chain-of-Thoughtプロンプティング(モデルに「段階的に考えてください」と依頼すること)によって性能は大幅に向上しますが、誤りをなくすことはできません。
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
# Chain-of-thought improves complex reasoning
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=512,
messages=[{
'role': 'user',
'content': (
'A train leaves Station A at 9:00 AM traveling at 80 km/h. '
'Another train leaves Station B (300 km away) at 10:00 AM traveling at 100 km/h toward Station A. '
'At what time do they meet?\n\n'
'Think step by step before giving your answer.'
)
}]
)
print(response.content[0].text)ファイルと画像に関する限界
ベースとなるLLM APIには、知っておくべきファイル処理上の制約があります。
- PDFを送信しても、先にテキストを抽出しない限り、モデルに「読ませる」ことはできない
- 画像入力にはマルチモーダルモデルが必要である(GPT-4o、ビジョン機能を有効にしたClaude)
- 音声、動画、スプレッドシートは、通常、モデルが利用できるようにする前に前処理が必要である
マルチモーダルエンドポイントを使う場合を除き、プロンプトに含める前に必ず文書をテキストに変換してください。
import anthropic
import base64
from pathlib import Path
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
# Images require explicit base64 encoding and vision-capable model
image_data = base64.standard_b64encode(Path('chart.png').read_bytes()).decode('utf-8')
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=256,
messages=[{
'role': 'user',
'content': [
{
'type': 'image',
'source': {'type': 'base64', 'media_type': 'image/png', 'data': image_data}
},
{'type': 'text', 'text': 'Describe what this chart shows.'}
]
}]
)
print(response.content[0].text)AIが得意なこと — バランスの取れた見方
限界を知ることで、AIが得意とする分野で活用できるようになります。
- 言語タスク:執筆、編集、要約、翻訳 — 非常に得意
- テキストのパターン認識:分類、抽出 — 非常に得意
- ブレインストーミング:多様なアイデアを数多く生成する — 非常に得意
- 数学と論理:コードに任せ、AIは解釈に使う — ツールを使う
- リアルタイムの事実:自分でデータを組み込み、AIは推論に使う — 検索を使う
- メモリ:外部に保存し、再度組み込む — データベースを使う
# Pattern: inject real-time context + use AI for reasoning, not retrieval
import anthropic
from datetime import datetime
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
# Your application fetches these from real sources
weather_data = {'city': 'London', 'temp_c': 12, 'condition': 'rainy'}
news_headline = 'UK inflation drops to 2.3% in April 2025'
context = (
f'Current date: {datetime.now().strftime("%Y-%m-%d")}\n'
f'Weather in {weather_data["city"]}: {weather_data["temp_c"]}C, {weather_data["condition"]}\n'
f'Today\'s top news: {news_headline}'
)
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=256,
system='You are a helpful assistant. Use only the provided context for current facts.',
messages=[{'role': 'user', 'content': f'{context}\n\nWhat should I wear today and what is the economic mood?'}]
)
print(response.content[0].text)黄金律:AIの出力を検証する
AIを使うときに最も重要な習慣は、出力を利用する前に検証することです。
- 事実 → 一次情報源を確認する
- コード → 実行し、エッジケースをテストする
- 数学 → 独立して計算する
- 引用 → Google Scholarで検索する
- 医療・法律・金融に関する助言 → 資格を持つ専門家に相談する
AIは下書き、生成、ブレインストーミングに使い、妥当性の確認には自分の判断を使ってください。
import openai
client = openai.OpenAI(api_key='sk-your-key-here')
# Ask the model to flag its own uncertainty
response = client.chat.completions.create(
model='gpt-4o',
messages=[
{
'role': 'system',
'content': (
'After every response, add a line starting with CONFIDENCE: '
'and rate your certainty as HIGH, MEDIUM, or LOW, '
'with a brief reason.'
)
},
{
'role': 'user',
'content': 'Who won the 2023 FIFA Women\'s World Cup and what was the final score?'
}
]
)
print(response.choices[0].message.content)理解度チェック
ある開発者がLLMに1,456,820の23.7%を計算させ、その結果を使って財務報告書の概要を書かせようとしています。このワークフローにはどのようなリスクがありますか。
AIの限界 — まとめ
常に心に留めておくべき主な限界は次のとおりです。
- リアルタイムのインターネットがない — 自分のコードから最新データを組み込む
- 知識のカットオフ — モデルは学習日以降のことを何も知らない
- セッションメモリがない — コンテキストを外部に保存して再度組み込む
- ハルシネーション — 事実、引用、コードを独立して検証する
- 数学的な誤り — コードで計算し、AIは解釈に使う
- 論理の限界 — Chain-of-Thoughtを使う。それでも複雑な推論は検証する
限界を理解していることが、AIを効果的に使える人と、AIに不満を感じる人を分けます。
よくある質問
「AI にできないこと」レッスンは無料ですか?
はい。「AI にできないこと」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、AI Prompt Engineeringコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 AI Prompt Engineeringコースには全4レッスンが含まれています。
「AI にできないこと」で何を学びますか?
リアルタイムデータ、記憶、推論エラー、自信ありげな誤答など、AI の限界を学びます。 ブラウザで直接実行するハンズオンコードでAI Prompt Engineeringを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
AI Prompt Engineeringを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのAI Prompt Engineeringは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。
「AI にできないこと」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このAI Prompt Engineeringレッスンでコードを書いて実行できますか?
はい。すべてのAI Prompt Engineeringレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。