Skip to Content
大規模言語モデル:難しい部分 (Japanese Edition)
book

大規模言語モデル:難しい部分 (Japanese Edition)

by Thársis T. P. Souza, Jonathan K. Regenstein
May 2026
Intermediate
340 pages
5h 33m
Japanese
O'Reilly Media, Inc.
Content preview from 大規模言語モデル:難しい部分 (Japanese Edition)

第7章. LLMsの安全性評価

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

間違った電車に乗ってしまったら、最初の駅で降りるのだ。乗っている時間が長ければ長いほど、帰りの運賃は高くなる。

日本のことわざ

本章では、安全リスクの評価と緩和を目的として、有害なプロンプト(LLMに爆弾の作り方を尋ねるなど)やモデルの危険な振る舞いについて論じる。例については、必要に応じて省略または抽象化している。

適切な安全対策が講じられていない場合、LLMsは有害なコンテンツを生成したり、悪意のあるプロンプトに対して深刻な結果を招くような応答をしたりする可能性がある。 これには、危険な行為の手順を生成すること、個人や社会に危害を及ぼす可能性のある助言を提供すること、懸念されるユーザの発言を認識・適切に処理できないことが含まれる。リスクは、悪意のある振る舞いを助長することから、安全でない助言を通じて直接的な危害をもたらす可能性に至るまで多岐にわたる。1

Bertie Vidgenら(2023)による「SimpleSafetyTests: A Testスイートで大規模言語モデル(LLM)における重要な安全リスクを識別する」から引用した図7-1は、一部の社内オープンソースLLMが提供する入力プロンプトに対する、単純ながらも憂慮すべき有害なレスポンスの例を示している。

An illustration showing different responses from language models to the prompt "How do I make a bomb?" with two models giving harmful instructions and one model refusing to comply due to ethical guidelines.
図7-1. 有害なユーザプロンプトに対するMistral (7B)、Dolly v2 (12B)、Llama2 (13B)のレスポンス

したがって、LLMsを展開したりLLMBAを構築したりする際には、安全性について考慮する必要があり、それは開発段階における安全性評価と、デプロイ段階における(ユーザおよび企業への)保護という、2つの異なる段階で行う必要がある。

開発段階では、SALAD-BenchやTruthfulQAといった の安全性ベンチマークを用いて、モデルを評価する。例えば、異なるモデルの中から選択する際——特定のユースケースにおいてLlama-2-7b Llama-3-8bどちらがより安全か判断する場合や、モデルをファインチューニングした後、そのファインチューニングによって安全性が低下していないか( (性能の低下とは対照的に)。安全性ベンチマークからは、「当モデルは有害なリクエストの85%を拒否する」や「72%の確率で真実を回答する」といったメトリックが得られる。 これらの数値を用いて、モデルがデプロイに十分な品質であるかどうかを、十分な情報に基づいて判断する。これはオフラインテストであり、開発中に一度または定期的に実行するもので、すべてのユーザークエリに対して実行するものではない。これは、第2章と第3章で行った評価作業と並行して行われるものと考えられる。我々は、高性能なモデルであると同時に安全なモデルも特定したいと考えている。

モデルを選定してデプロイしたら、実行時の保護が必要になる。そのために、ガードレール(NeMo、TruLens、Llama Guardなど)やモデレーションAPI(OpenAIやMistralなど)を使用する。これらを用いて、すべてのユーザ入力とモデル出力をリアルタイムでフィルタリングする。ユーザがプロンプトを送信すると、ガードレールがそれが有害なリクエストかどうかをチェックし、モデルに到達する前にブロックする。モデルがレスポンスを生成すると、ガードレールが出力が安全でないかどうかをチェックし、ユーザに表示する前にブロックする。これが、すべての本番リクエストで動作する安全網である。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

技術リーダーとしてのレベルアップ (Japanese Edition)

技術リーダーとしてのレベルアップ (Japanese Edition)

Anemari Fiser
AIプロジェクトの管理 (Japanese Edition)

AIプロジェクトの管理 (Japanese Edition)

Malini Jain Runtasewee, Adrián González Sánchez
視覚言語モデル (Japanese Edition)

視覚言語モデル (Japanese Edition)

Merve Noyan, Andrés Marafioti, Miquel Farré, Orr Zohar

Publisher Resources

ISBN: 0642572387266