無害性と有用性のジレンマ
安全性と実用性のバランスを取るプロンプトで、過剰拒否に対処します。
「無害性と有用性のジレンマ」はCoddyKit上の無料AI Prompt Engineeringレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはAI Prompt Engineering学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 AI Prompt Engineeringコースには全4レッスンが含まれています。
根本的なジレンマ
あらゆるAI安全システムは、根本的なジレンマに直面します。拒否する頻度を高めてモデルをより安全にすると、正当なユーザーにとって役に立ちにくくもなります。
医学に関することを一切拒否するモデルなら、危険な健康アドバイスを提供することはありません。しかし、看護師、医師、患者にとって本当に役立つ情報を提供することもできません。目標は適切な調整です。拒否すべきときは拒否し、助けるべきときは助けます。
過剰拒否:本当の問題
過剰拒否とは、無害な依頼が表面的に有害な依頼に似ているという理由で、モデルが回答を拒否することです。例:
- 病気がどのように広がるかの説明を拒否する(危険そうに聞こえますが、実際には公衆衛生教育です)
- 悪役キャラクターの執筆を拒否する(フィクションであり、推奨ではありません)
- 鍵師見習いに対して、ピッキングの方法の説明を拒否する
過剰拒否は単に煩わしいだけではありません。モデルへの信頼を損ない、ユーザーをより安全でない代替手段へと向かわせます。
適切な拒否を促すプロンプト設計
システムプロンプトでは、文脈と意図を明確にすることで、過剰拒否を控えるようモデルに指示できます。文脈が正当であれば、デュアルユースのトピックにも取り組んでよいことをモデルに明示的に許可してください。
CALIBRATED_SYSTEM_PROMPT = (
'You are a knowledgeable assistant for healthcare professionals.\n\n'
'Your users are nurses, doctors, and medical students. '
'When asked about medications, dosages, procedures, or medical conditions, '
'provide accurate, detailed information appropriate for trained professionals.\n\n'
'Do not add excessive safety disclaimers to every response. '
'Your users are professionals who need direct, accurate information to do their jobs. '
'If a question is genuinely outside appropriate bounds, explain specifically why '
'rather than giving a vague refusal.'
)
# This context dramatically improves calibration for the target audience
# Without it, the model may refuse routine clinical questions「拒否するのではなく理由を説明する」パターン
過剰拒否を減らすうえで最も効果的なプロンプトパターンの一つは、完全には回答できない場合、単に拒否するのではなく、何ができて何ができないのか、そしてその理由を説明するようモデルに指示することです。
EXPLAIN_WHY_PROMPT = (
'You are a helpful assistant. When handling sensitive or ambiguous requests:\n\n'
'- If you can answer fully: do so directly.\n'
'- If you can answer partially: provide what you can and explain what you cannot include and why.\n'
'- If you truly cannot answer: explain specifically what boundary prevents you from answering, '
'and suggest where the user might get this information appropriately.\n\n'
'Do not give generic refusals like "I cannot help with that." '
'Always be specific about what you can and cannot do.'
)
# Example of bad refusal:
# 'I cannot help with information about medications.'
# Example of good calibrated response:
# 'I can explain how ibuprofen works and standard dosing guidelines for adults.
# For specific dosing for a patient with your described conditions, you should
# consult a pharmacist or prescribing physician who has the full clinical picture.'役立つ代替案を提示する
モデルが依頼を拒否しなければならない場合、最も役立つ対応は、ユーザーが本当に必要としていることへ至る代替手段を提示することです。代替案のない拒否では、ユーザーは行き詰まってしまいます。
ALTERNATIVES_PROMPT = (
'You are a helpful assistant. When you cannot fully fulfill a request:\n'
'1. Acknowledge the request with empathy.\n'
'2. Explain briefly and specifically what you can and cannot do.\n'
'3. Offer the closest helpful alternative you can provide.\n'
'4. Point to appropriate resources if relevant.\n\n'
'Example: If asked to prescribe medication:\n'
'Say: "I can explain how this class of medications works and what '
'symptoms they address. For a prescription, you need to see a licensed '
'physician who can evaluate your specific situation. Here is what I can '
'tell you about the medication itself: ..."'
)重要な変数としての文脈
同じ質問でも、文脈によって有害にも無害にもなりえます。プロンプト設計では、モデルがより適切な調整判断を下せるよう、文脈を明確に示す必要があります。
# Context that changes calibration:
# High-risk context: anonymous user, no context
# 'What's the lethal dose of acetaminophen?'
# -> Model should be cautious, mention poison control
# Safe context: established professional context
MEDICAL_PRO_CONTEXT = (
'You are assisting a team of emergency room nurses. '
'Users ask clinical questions during patient care shifts. '
'Provide direct clinical information including dosing thresholds, '
'overdose symptoms, and treatment protocols.'
)
# 'What is the hepatotoxic threshold for acetaminophen?'
# -> Model should give the clinical answer directly (150 mg/kg, etc.)
# The question is identical; the context changes the appropriate response
print('Context determines calibration')1000人のユーザーというメンタルモデル
調整を考える際に役立つメンタルモデルがあります。1000人の異なるユーザーが同じメッセージを送ると想像してください。意図の分布はどうなるでしょうか。
- 990人/1000人が無害な意図を持つ場合:モデルはおそらく助けるべきです
- 500人/1000人が有害な意図を持つ場合:モデルは慎重になるべきです
- 1人/1000人でも壊滅的な被害を引き起こす可能性がある場合:モデルは例外なく拒否すべきです
この確率的な捉え方により、過剰拒否(990人を締め出すこと)と拒否不足(10人を助長すること)の両方を避けやすくなります。
セーフティシアターを避ける
セーフティシアターとは、慎重に見えても実際には被害を防がず、正当なユーザーにとって製品を使いにくくする安全対策を指します。
例:あらゆるレシピに「食べる前に栄養士に相談してください」という免責事項を追加すること。教育目的の文脈で歴史上の残虐行為について話すことを拒否すること。こうした応答は安全性を高めるのではなく、役に立たないだけです。
# Avoid these patterns in your system prompts:
BAD_SYSTEM_PROMPT = (
'Always add disclaimers to every response. '
'Never discuss anything that could be dangerous. '
'Refuse requests that mention weapons, drugs, or violence in any context. '
'Always recommend consulting a professional for any question.'
# This creates safety theater: unhelpful disclaimers, over-refusal,
# and frustrated users who go elsewhere
)
GOOD_SYSTEM_PROMPT = (
'Provide accurate, helpful information to users. '
'Add safety information when it is directly relevant and actionable. '
'Refuse requests only when providing the information would cause '
'clear, concrete harm that outweighs the benefits to legitimate users. '
'When declining, always explain specifically why and offer alternatives.'
)安全機構としてのフリクション
全面的に拒否するのではなく、フリクションを検討してください。無害な用途を滑らかに保ちながら、有害な用途を難しくする手順を追加します。これは、拒否か応答かの二択よりも適切に調整された方法です。
FRICTION_PROMPT = (
'Before answering questions about medication interactions or dosages:\n'
'1. Ask: "Can you tell me a bit about the context — are you a healthcare '
'provider, a patient, or a caregiver?"\n'
'2. Use the answer to calibrate the detail level and framing.\n'
'3. For patient/caregiver context: provide information with appropriate '
'guidance to consult a prescriber for their specific situation.\n'
'4. For healthcare provider context: provide clinical-level detail directly.\n\n'
'This one clarifying question improves both safety and helpfulness.'
)
# Friction: one extra step filters some misuse while barely inconveniencing
# legitimate users who can answer easily二紙テスト
二紙テストは、拒否を適切に調整するためのヒューリスティックです。
- 新聞A(AI安全性を報じる記者):この応答は有害または無責任だと報じられるでしょうか。
- 新聞B(AIの過剰な喧伝を報じる記者):この拒否は、父権的で役に立たない、またはばかげていると報じられるでしょうか。
適切に調整された応答は、両方のテストに合格します。Aから有害だと報じられず、Bから不必要に制限的だと報じられることもありません。
調整をテストする
次の両方を含むテストセットを作成して、システムの調整状態を測定してください。
- 無害な依頼:回答すべき依頼(教育、専門業務、創作)
- 有害な依頼:拒否すべき依頼
偽陽性率(無害な依頼を拒否する割合)と偽陰性率(有害な依頼を許可する割合)を追跡します。適切に調整されたシステムでは、どちらの割合も低くなります。
理解度チェック:過剰拒否
安全上の懸念からモデルが依頼を完全には実行できない場合、推奨される対応は何ですか。
まとめ:無害性と有用性のジレンマ
過剰拒否は、現実に存在し、コストの大きい問題です。拒否しすぎるモデルは正当なユーザーの役に立たず、信頼を損ないます。適切な拒否とは、想定されるユーザーにとっての利益を具体的な被害が明確に上回る場合に限って拒否することです。重要なパターンは、モデルがより適切な判断を下せるようシステムプロンプトで文脈を示すこと、「拒否するのではなく理由を説明する」という指示を使うこと、常に役立つ代替案を提示すること、そしてセーフティシアター(何にでも免責事項を付けること)を避けることです。1000人のユーザーというメンタルモデルと二紙テストは、適切なバランスを見つけるための実用的なヒューリスティックです。
よくある質問
「無害性と有用性のジレンマ」レッスンは無料ですか?
はい。「無害性と有用性のジレンマ」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、AI Prompt Engineeringコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 AI Prompt Engineeringコースには全4レッスンが含まれています。
「無害性と有用性のジレンマ」で何を学びますか?
安全性と実用性のバランスを取るプロンプトで、過剰拒否に対処します。 ブラウザで直接実行するハンズオンコードでAI Prompt Engineeringを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
AI Prompt Engineeringを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのAI Prompt Engineeringは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン3/4です。
「無害性と有用性のジレンマ」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このAI Prompt Engineeringレッスンでコードを書いて実行できますか?
はい。すべてのAI Prompt Engineeringレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- CAIの原則と批評プロンプト
- 自己批評と修正のパターン
- 無害性と有用性のジレンマ
- アプリケーションへのCAI実装