Claude認定 対策ノート

講座 › 分野5 モデルの選択と最適化

5.1 LLMの基礎

配点 5.2%LLM Fundamentals

LLMはトークン単位で次を予測する。コンテキストウィンドウは入力と出力の合計の枠。思考とエフォートで考える量を調整し、例示で出力を安定させる。

未読

トークンと次トークンの生成

図解:トークンと次トークンの生成

トークンは、LLMが扱う最小の単位で、単語、単語の一部、文字などに当たります。1トークンが何文字に当たるかは、モデルと言語で変わります。Claudeのような言語モデルは、前の文から次の語を予測するように事前学習されています。

出典:Glossary
Tokens are the smallest individual units of a language model, and can correspond to words, subwords, characters, or even bytes
https://platform.claude.com/docs/en/about-claude/glossary.md(取得 2026-11-17)
出典:Glossary
are pretrained to predict the next word
https://platform.claude.com/docs/en/about-claude/glossary.md(取得 2026-11-17)

コンテキストウィンドウ

図解:コンテキストウィンドウ

コンテキストウィンドウは、応答を作るときに参照できるテキストの全体で、応答そのものも含みます。学習に使った大量のデータとは別物で、いわば作業用の記憶です。会話が長くなると上限に近づくので、長い会話やエージェントの作業では、圧縮(コンパクション)が主な対策になります。

出典:Context windows
refers to all the text a language model can reference when generating a response, including the response itself
https://platform.claude.com/docs/en/build-with-claude/context-windows.…(取得 2026-11-17)
出典:Context windows
server-side compaction is the primary strategy
https://platform.claude.com/docs/en/build-with-claude/context-windows.…(取得 2026-11-17)

サンプリングと非決定性

図解:サンプリングと非決定性

temperature は、予測のばらつきを決める設定です。ただし temperature を0にしても、結果は完全には決定的にならず、同じ入力でも違う出力になることがあります。さらに新しいモデルでは、temperature などのサンプリングの引数を省き、プロンプトでふるまいを導くよう求められています。

出典:Glossary
Even with temperature set to 0, the results will not be fully deterministic
https://platform.claude.com/docs/en/about-claude/glossary.md(取得 2026-11-17)
出典:Claude Opus 5.5 migration guide
Omit `temperature`, `top_p`, and `top_k`. Use prompting to guide the model’s behavior.
https://platform.claude.com/docs/en/models/opus-5-5/migration-guide.md(取得 2026-11-17)

モデルのオプション:思考・エフォート・高速モード

図解:モデルのオプション:思考・エフォート・高速モード

適応型思考では、Claudeがリクエストごとに、考えるかどうか、どれだけ考えるかを決めます。エフォートは、1つのモデルのまま、使うトークンの量(丁寧さと効率)を調整する設定で、low から max まであります。多くのモデルの既定は high です。高速モードは、割増の料金で、出力の速さを最大2.5倍にします。

出典:Extended thinking
With adaptive thinking, Claude determines whether and how much to think on each request
https://platform.claude.com/docs/en/build-with-claude/extended-thinkin…(取得 2026-11-17)
出典:Effort
The effort parameter lets you control how many tokens Claude spends when responding to requests.
https://platform.claude.com/docs/en/build-with-claude/effort.md(取得 2026-11-17)
出典:Fast mode
Fast mode delivers up to 2.5x higher output tokens per second at premium pricing.
https://platform.claude.com/docs/en/build-with-claude/fast-mode.md(取得 2026-11-17)

ゼロショット・シングルショット・マルチショット

図解:ゼロショット・シングルショット・マルチショット

例を見せずに指示だけで頼むのがゼロショット、1つ見せるのがシングルショット、複数見せるのがマルチショット(フューショット)です。例は、出力の形式・口調・構成を導く最も確実な方法の1つで、3〜5個が良いとされています。例は実際の用途に近く、境界の例も含めて多様にし、タグで囲んで指示と区別します。

出典:Prompting best practices
Examples are one of the most reliable ways to steer Claude’s output format, tone, and structure.
https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
出典:Prompting best practices
Include 3–5 examples for best results.
https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
出典:Prompting best practices
Cover edge cases and vary enough that Claude doesn’t pick up unintended patterns.
https://platform.claude.com/docs/en/build-with-claude/prompt-engineeri…(取得 2026-11-17)
試験のポイント