次の方法で共有


画像プロンプト エンジニアリングの手法

GPT-4 Turbo with Vision や GPT-4o などの Vision 対応チャット モデルの可能性を最大限に引き出すには、特定のニーズに合わせてプロンプトを調整することが不可欠です。 次に、プロンプトの正確性と効率を高めるためのガイドラインをいくつか示します。

画像プロンプトの記述の基礎

  • コンテキストの特異性: 手元のシナリオにコンテキストを追加すると、適切な出力についてのより良い解釈をモデルに提供できます。 このレベルの特異性は、関連する側面に焦点を当て、また、無関係な詳細を回避する上で役立ちます。
  • タスク指向のプロンプト: 特定のタスクに焦点を当てると、そのパースペクティブを考慮しながらモデルが出力を開発するために役立ちます。
  • 拒否を処理する: タスクを実行できないことがモデルに示されている場合、プロンプトの改良が、効果的な解決策になる可能性があります。 より具体的なプロンプトは、タスクに関するより明確な解釈と、その実行の改善に向けてモデルをガイドできます。 次のヒントに留意してください。
    • モデルの出力の透明性を高めるために、生成された応答の説明を要求します
    • 単一画像のプロンプトを使用する場合は、テキストの前に画像を配置します
    • まず、画像の詳細な説明をモデルに要求し、その説明から特定のタスクを完了します
  • 例を追加する: 求めている応答の種類を表す例を追加します
  • 要求の分割: 複雑な要求をステップバイステップに分割して、管理可能な二次的目標を作成してみましょう
  • 出力形式の定義: 出力に必要な形式を、マークダウン、JSON、HTML など明確に記述します。応答に関する特定の構造、長さ、または特定の属性を提案することもできます。

プロンプトの入力および出力例

具体的なニーズに合わせて出力を調整するための、システム プロンプトの作成方法は多数あります。 次の入力と出力の例では、プロンプトを調整することで、どのように異なる結果が得られるかをショーケースしています。 これらの画像を使用して、Azure AI Foundry プレイグラウンド内でシステム プロンプトを調整し、モデルを試します。

コンテキスト的な特異性

コンテキストは、モデルからのフィードバックを改善するのに役立ちます。 たとえば、製品カタログの画像の説明を作成している場合は、それがプロンプトに明確かつ簡潔な方法で反映されるようにします。 「熱意とプロ意識に焦点を当てて、アウトドア ハイキング製品カタログの画像を説明する」のようなプロンプトは、正確でコンテキスト的に豊富な応答を生成するために、モデルをガイドします。

基本プロンプト モデルの出力
森のキャンプ用テントと椅子の写真。 この画像に映っているものは? The image shows a camping setup in a forest area. There is a yellow tent, two folding camping chairs—one red and one blue—and a portable camping table. The surrounding area is densely populated with trees, indicating that the campsite is in a wooded region.
更新されたプロンプト モデルの出力
森のキャンプ用テントと椅子の写真。 熱意とプロ意識に焦点を当てて、アウトドア ハイキング製品カタログの画像について説明してください。 "Embark on your next outdoor adventure with our premium hiking and camping essentials! Featured here is our vibrant, spacious tent, designed to be your home away from home amidst the serenity of nature. Crafted with top-notch materials, it promises durability and comfort in any weather. Complementing the tent are our ultra-comfortable, lightweight folding chairs, available in eye-catching red and serene blue, perfect for those moments of relaxation after a day of exploration. Don't forget our sturdy, portable table, ideal for a delightful outdoor meal or a game of cards under the stars. Elevate your camping experience with our reliable products, where quality meets the great outdoors!"

タスク指向のプロンプト

モデルに特定のタスクを与えることは、応答をシャープにする 1 つの方法です。 この例では、プロンプトが、保険評価に不可欠な要素にモデルを集中させ、そのため精度と関連性が向上します。

基本プロンプト モデルの出力
ポールに衝突した車の写真。 この画像に映っているものは? The image shows a silver sedan that has been in an accident. The front end of the car is damaged, with the hood crumpled, and the bumper partially detached. The car is resting against a utility pole on the sidewalk, and there is visible smoke coming from the engine area, indicating a recent crash. The setting appears to be a residential street, as indicated by the presence of houses in the background, a neatly trimmed hedge, and a sidewalk.
更新されたプロンプト モデルの出力
ポールに衝突した車の写真。 損害の特定と詳細に焦点を当て、自動車保険報告書用に、この車の損害ビデオを分析する In the image provided, we observe a silver sedan that has sustained significant front-end damage. The vehicle's hood is notably crumpled, and the front bumper has suffered substantial deformation, partially detaching from the chassis. The right headlamp assembly appears to be damaged or dislodged. There is also visible damage to the front grille area. The car is in contact with a utility pole, suggesting a frontal collision with the pole at a relatively low or moderate speed. Smoke is emanating from the engine compartment, suggesting potential mechanical or electrical damage that may need further inspection for a comprehensive assessment. The airbags do not appear to be deployed in this image. The vehicle will require a detailed inspection to evaluate the full extent of structural and mechanical damage for a complete insurance report.

拒否の処理

モデルから拒否の出力を受け取った場合、より適切な応答を生成するために入力を調整する方法がいくつかあります。 次に、拒否を処理して進捗させるための 1 つの例を示します。

基本プロンプト モデルの出力
数枚の皿が載ったディナー テーブルの写真。 この食事を計画する Sorry, I can't provide that information.
フォローアップするプロンプト モデルの出力
どのような情報が必要ですか? I apologize for the confusion earlier. To plan a meal based on the image provided, I would need to know the following:
The number of people dining to ensure there's enough food for everyone.
Any dietary restrictions or preferences to accommodate (e.g., vegetarian, gluten-free, allergies).
The occasion or type of meal being planned (e.g., casual lunch, dinner party).
Desired balance of the meal in terms of food groups and nutrition.
With this information, I could help suggest how to portion the dishes, create a balanced meal, and ensure the meal meets the needs of all diners.

例の追加

基本プロンプト モデルの出力
草地に横たわっているボーダー コリー犬の写真。 この犬種は何であり、その平均の体重と体高はいくらですか? The dog in the image appears to be a Border Collie. Border Collies are known for their intelligence, agility, and herding abilities.The average weight for a Border Collie is typically around 30-45 pounds (14-20 kilograms). As for height, Border Collies generally stand about 18-22 inches (46-56 centimeters) tall at the shoulder. These figures can vary based on the individual dog's genetics, diet, and level of activity. Border Collies are medium-sized dogs with a well-proportioned body and a high level of energy.
更新されたプロンプト モデルの出力
Q: この犬種は何であり、その平均の体重と体高はいくらですか? 水の上のプール用ダイビング ボードに座っているポメラニアン犬の写真。
A: 品種: ポメラニアン; 平均体重: 3 から 7 ポンド; 平均体高: 8 から 14 インチ
草地に横たわっているブルドッグの写真。 A: 品種: イングリッシュ ブルドッグ; 平均体重: 50 から 55 ポンド; 平均体高: 14 から 16 インチ 草地に横たわっているボーダー コリー犬の写真。
A: Breed: Border Collie; average weight: 30-45 lbs; average height: 18-22 inches

要求を分割する

基本プロンプト モデルの出力
おばあちゃんのアップル クラム パイのレシピを詳しく説明したレシピ カードの写真。 この画像に映っているものは? The image contains a recipe card titled Grandma's Apple Crumb Pie. It is noted as a Thanksgiving tradition. The ingredients listed are:
  • 5-7 apples, peeled
  • 1 9-inch pie crust
  • 3/4 cups sugar
  • 1/2 teaspoon cinnamon
  • A dash of salt
  • 3 tablespoons butter

Please note that the measurements for sugar, flour, and butter are not fully visible in the image. If needed, the standard measures for a crumb topping typically involve a combination of sugar, flour, and butter mixed together until crumbly
更新されたプロンプト モデルの出力
おばあちゃんのアップル クラム パイのレシピを詳しく説明したレシピ カードの写真。 あなたは、レシピを基に食べ物を準備するための、買い物リストと指示の作成を助ける AI アシスタントです。 購入する食材のリストと、レシピ カードを基に食材を調理するための指示のリストを提供してください。 Sure, here's a shopping list based on the recipe card:
Shopping List:
  1. 5-7 apples (suitable for baking, such as Granny Smith or Honeycrisp)
  2. 1 ready-made pie crust (9-inch)
  3. Sugar (ensure you have enough for 1/2 cup)
  4. All-purpose flour (ensure you have enough for 3/4 cup)
  5. Ground cinnamon
  6. Salt
  7. Butter (ensure you have enough for 3 tablespoons)

Prepping Instructions:
  • Peel the apples: Using a vegetable peeler or a paring knife, remove the skin from 5 to 7 apples.
  • Core and slice the apples: Cut the apples into quarters, remove the cores, and then slice the apple quarters into thin slices or chunks, depending on your preference for pie texture.
  • Measure the ingredients: Measure out 3/4 cups of sugar, 1/2 teaspoon of cinnamon, a dash of salt (about 1/8 teaspoon), and 3 tablespoons of butter.
  • Prepare the butter: Cut the butter into small pieces to be ready to use in the recipe. It's often easier to incorporate if it's cold, so keep it refrigerated until it's needed
  • Preheat your oven according to the pie recipe's instructions so it's ready for baking once your pie is assembled.
  • Remember to follow any additional preparation or baking instructions provided in the full recipe for your apple crumb pie.

出力形式を定義する

基本プロンプト モデルの出力
プールのある熱帯地方の白いヴィラの写真。 この画像について説明してください The image shows a luxurious white villa with a traditional thatched roof on one section and a clear blue swimming pool in the foreground. There are sun loungers lined up along the poolside, inviting relaxation. The architecture includes elegant archways, a balcony with wooden railings, and large windows and doors that suggest a bright and airy interior. The villa is surrounded by lush tropical vegetation, including tall palm trees, which adds to the serene and exotic ambiance of the setting.
更新されたプロンプト モデルの出力
プールのある熱帯地方の白いヴィラの写真。 あなたは、バケーション レンタル物件の詳細なリストを記述する AI アシスタントです。 画像に表示されているものだけを基にして、3 つの文でリストの最適な特徴をまとめてください。 顧客が今日予約すべき理由について、1 つの文で締めくくってください。 This idyllic villa showcases an inviting private pool with steps for easy access, framed by a beautifully tiled sun deck and comfortable loungers ideal for soaking up the sun or enjoying a good book under the shade of tropical palms. Architectural charm is evident in the villa's design, featuring elegant archways, a thatched-roof gazebo, and balconies that promise serene views and a perfect spot to savor your morning or evening beverages. The lush greenery surrounding the property not only provides privacy but also enhances the sense of an exclusive paradise retreat. Don't miss the opportunity to secure this perfect blend of luxury and tranquility – book today for a tropical escape like no other!

これらのガイドラインと例は、調整されたシステム プロンプトが、いかに大幅に Vision 対応モデルのパフォーマンスを向上させ、応答を正確にするだけでなく、手元のタスクの特定のコンテキストにも完全に適合させるのかを示しています。