プロンプトの風景
本文の状態
日本語全文を表示中
詳細モードで約3分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
LangChain Blog
LangChain Hubは、大規模言語モデル(LLM)の推論、RAG、SQL、コード生成などの分野におけるプロンプトエンジニアリング手法を提供し、ユーザーがプロンプトの閲覧と管理を可能にする。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るSource Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
コンテキスト
プロンプトエンジニアリングは、モデルの重みを更新することなくLLM(大規模言語モデル)の動作を制御できます。さまざまなユースケースに対応する多様なプロンプトが生まれています(例えば、@dair_aiのプロンプトエンジニアリングガイドや、Lilian Wengによるこの優れたレビューをご覧ください)。LLMの数と異なるユースケースが増えるにつれて、プロンプトの発見可能性、共有、共同作業、デバッグをサポートするためのプロンプト管理に対する需要が高まっています。これらのニーズに対応するため、私たちは1ヶ月前にLangChain Hubを立ち上げ、コミュニティのプロンプトを検索したり、自分自身で管理したりするための拠点として機能させています。以下では、立ち上げ以降に私たちが確認したプロンプティングにおける主要なテーマの概要を提供し、興味深い例を強調します。
SQL
エンタープライズデータの多くはSQLデータベースに格納されているため、LLMをSQLのための自然言語インターフェースとして使用することに関心が高まっています(当社のブログ記事をご覧ください)。いくつかの論文では、各テーブルのCREATE TABLE記述に続くSELECT文内の3つのサンプル行など、テーブルに関する特定の情報をLLMが与えられた場合、SQLを生成できることが報告されています。LangChainにはSQLデータベースへのクエリを実行するための多数のツールがあります(当社のユースケースガイドおよびクックブックをご覧ください)。
例
- https://smith.langchain.com/hub/rlm/text-to-sql
プロンプト最適化
Deepmind の研究により、大規模言語モデル(LLM)がプロンプトを最適化できることが示されており、これは人間の指示と LLM 最適化後のプロンプトの間にある翻訳モジュールの広範な可能性を示唆しています。この方向性を持つ興味深いプロンプトがいくつか確認されており、その良い例として Midjourney が挙げられます。Midjourney は、プロンプトやパラメータフラグを通じて解き放たれる驚くべき創造的ポテンシャルを持っています。一般的な入力アイデア(2023年サンフランシスコプライドパレードでパフォーマンスを行うフレディ・マーキュリー、超写実的)を与えると、以下に示すように、そのアイデアを飾り立てる一連の N 個のプロンプトを生成できます:
フレディ・マーキュリーがサンフランシスコプライドパレードのステージを熱狂させ、輝く金色の衣装をまとい、象徴的なマイクスタンドを手に取り、カラヴァッジョの超写実的スタイルを想起させる、鮮やかでダイナミックな描写 --ar 16:9 --q 2)
例
- https://smith.langchain.com/hub/hardkothari/prompt-maker
- https://smith.langchain.com/hub/aemonk/midjourney_prompt_generator
結論
「Try It」ボタンを使用すれば、これらのプロンプトを誰でも簡単にテストできます:
これにより、多くのモデルが無料で利用可能な、幅広い異なる大規模言語モデル(LLM)を用いてプロンプトの推敲やデバッグを行うためのプレイグラウンドが開きます:
原文を表示
Context
Prompt Engineering can steer LLM behavior without updating the model weights. A variety of prompts for different uses-cases have emerged (e.g., see @dair_ai’s prompt engineering guide and this excellent review from Lilian Weng). As the number of LLMs and different use-cases expand, there is increasing need for prompt management to support discoverability, sharing, workshopping, and debugging prompts. We launched the LangChain Hub over a month ago to support these needs, serving as a home for both browsing community prompts and managing your own. Below we provide an overview of the major themes in prompting that we’ve seen since launch and highlight interesting examples.
SQL
Because enterprise data is often captures in SQL databases, there is great interest in using LLMs as a natural language interface for SQL (see our blog post). A number of papers have reported that LLMs can generate SQL given some specific information about the table, including a CREATE TABLE description for each table followed by three example rows in a SELECT statement. LangChain has numerous tools for querying SQL databases (see our use case guide and cookbook).
Examples
- https://smith.langchain.com/hub/rlm/text-to-sql
Prompt Optimization
The Deepmind work showing that LLMs can optimize prompts offers the broad potential for translation modules between human instruction and LLM-optimized prompts. We’ve seen a number of interesting prompts along these lines; one good example is for Midjourney, which has incredible creative potential to unlock through prompting and parameter flags. For a general input idea (Freddie Mercury performing at the 2023 San Francisco Pride Parade hyper realistic), it can produce a series of N prompts that embellish the idea, as shown below:
Freddie Mercury electrifying the San Francisco Pride Parade stage, shining in a gleaming golden outfit, iconic microphone stand in hand, evoking the hyper-realistic style of Caravaggio, vivid and dynamic --ar 16:9 --q 2)
Examples
- https://smith.langchain.com/hub/hardkothari/prompt-maker
- https://smith.langchain.com/hub/aemonk/midjourney_prompt_generator
まとめ
You can easily test any of these prompts for yourself using "Try It" button:
This will open a playground for workshopping and debugging prompts with a broad set of different LLMs, many of which are free to use:
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み