Anthropic finds over 10,000 vulnerabilities with Project GlasswingSynthID expands to Google Search and ChromeGoal mode now available across all Codex platformsCodex Thursday adds remote Mac controlAnthropic publishes early Project Glasswing resultsAnthropic updates vulnerability disclosure dashboardReleases new science-focused AI skills toolGemini 3.5 Flash released with enhanced research toolsGoogle launches ADK for Kotlin and Android 0.1.0Gemini 3.5 Flash officially launchedAI solves long-standing open math problem for first timeGoogle announces Gemini Omni for video creationUse multiple agents with Gemini OmniOpenAI Introduces Guaranteed Capacity for Long-Term ComputeGemini for Science assists with research tasksSynthID watermark and verification tool added to AI imagesGoogle I/O 2026 to unveil new AI breakthroughsOpenAI boosts image provenance and verificationKPMG rolls out Claude globally, starting with taxGoogle adds Managed Agents to the Gemini APIAnthropic finds over 10,000 vulnerabilities with Project GlasswingSynthID expands to Google Search and ChromeGoal mode now available across all Codex platformsCodex Thursday adds remote Mac controlAnthropic publishes early Project Glasswing resultsAnthropic updates vulnerability disclosure dashboardReleases new science-focused AI skills toolGemini 3.5 Flash released with enhanced research toolsGoogle launches ADK for Kotlin and Android 0.1.0Gemini 3.5 Flash officially launchedAI solves long-standing open math problem for first timeGoogle announces Gemini Omni for video creationUse multiple agents with Gemini OmniOpenAI Introduces Guaranteed Capacity for Long-Term ComputeGemini for Science assists with research tasksSynthID watermark and verification tool added to AI imagesGoogle I/O 2026 to unveil new AI breakthroughsOpenAI boosts image provenance and verificationKPMG rolls out Claude globally, starting with taxGoogle adds Managed Agents to the Gemini API
🔒 公式発表のみ掲載。噂・リーク・情報商材は載せません。
← Back to glossary

Top-p Sampling (Nucleus Sampling)

トップPサンプリング

とっぷぴいさんぷりんぐ

Definition

Top-p sampling is a decoding method that keeps the smallest set of high-probability tokens whose cumulative probability reaches p, then samples the next token from that set. It helps control diversity without relying only on temperature.

LLMの出力を調整するパラメータとして温度(Temperature)はよく知られていますが、もう一つの重要なパラメータが見落とされがちです。トップPサンプリング(Top-p / Nucleus Sampling)とは、次のトークンを選ぶ際に、累積確率が指定した閾値pに達するまでの上位トークンだけを候補として残し、その中からサンプリングする手法です。

温度との違いを理解する

温度とTop-pはどちらも出力の多様性を制御しますが、仕組みが根本的に異なります。温度は確率分布の「形」を変えます。温度が高いと分布が平坦になり、低確率のトークンも選ばれやすくなります。一方、Top-pは候補となるトークンの「数」を動的に絞ります。たとえばTop-p=0.9なら、確率が高い順にトークンを足していき、累積確率が90%に達した時点で残りのトークンを候補から除外します。

この動的な候補数の調整が、Top-pの核心的な強みです。あるトークンの確率が95%なら候補はほぼ1つだけに絞られ、確率が分散している場合は多くの候補が残ります。文脈に応じて自動的に選択の幅が調整されるのです。

実用的な設定値

Top-pの値は0から1の範囲で、1.0に近いほど多様、低いほど保守的な出力になります。一般的な推奨値は以下の通りです。事実に基づく応答(データ抽出、分類)ではTop-p=0.1〜0.3で、最も確率の高いトークンに絞ります。バランスの取れた生成(一般的な対話、説明文)ではTop-p=0.7〜0.9が適しています。クリエイティブな生成(ブレインストーミング、創作)ではTop-p=0.9〜1.0で多様性を確保します。

温度との組み合わせ方

多くのAPIでは温度とTop-pを同時に指定できますが、両方を同時に極端な値に設定するのは避けるべきです。温度1.5かつTop-p=1.0のように両方を高くすると、支離滅裂な出力になりかねません。実務的なアドバイスとしては、片方を固定してもう片方だけを調整するのがベストプラクティスです。OpenAIの公式ドキュメントでも、温度とTop-pの両方を同時に変更することは推奨されていません。

APIでの使い方

OpenAIのAPIでは`top_p`パラメータとして指定します。Anthropicでは`top_p`、Googleでは`topP`という名前です。デフォルト値はAPIによって異なり、多くの場合1.0(フィルタなし)です。最初はデフォルトのまま温度だけで調整し、より細かい制御が必要になったらTop-pを追加で調整するのが効率的な進め方です。

h
hayami

Stay on top of OpenAI, Google & Anthropic updates. An AI digest for business professionals.

Source Policy

We use only official sources. Each article links to the original announcement so you can verify it yourself.

© 2026 hayami. All rights reserved.