ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • ChatGPT 프롬프트 엔지니어링 #3. Iterative (Isa Fulford, Andrew Ng)
    Data & ML & AI/LLM 2023. 5. 15. 00:01
    반응형

    프롬프트를 점진적으로 발전시켜라

    여타 AI, ML 모델이 그렇듯, ChatGPT 역시 유저가 원하는 바를 찰떡같이 알아듣고 답해주지 않습니다.

    처음부터 원하는 답변을 얻기를 기대하지 말고,

    조금씩 조금씩 프롬프트를 개선해 나가면서 원하는 답변에 가까워지는 것이 더 효율적인 방식입니다.

     

    프롬프트 가이드라인

    • 명확하고 구체적으로 지시한다
    • 왜 원하는 답변이 아닌지 분석한다
    • 아이디어를 재정의하고 프롬프트를 수정한다
    • 반복한다

     

    점진적으로 프롬프트를 발전시켜가는 과정의 예시

    0. 목적

    "의자(상품)의 fact sheet를 요약해 온라인 쇼핑몰에 올릴 상품설명문을 작성하자!"

     

    1. 첫번째 시도

    • "Technical specifications를 기반으로 제품 설명문을 작성해줘"
    Your task is to help a marketing team create a description
    for a retail website of a product based on a technical fact sheet.
    Write a product description based on the information
    provided in the technical specifications delimited by triple backticks.

    Technical specifications: ```{fact_sheet_chair}```
    더보기

    (응답결과)

     

    Introducing our stunning mid-century inspired office chair, the perfect addition to any home or business setting. Part of a beautiful family of office furniture, including filing cabinets, desks, bookcases, meeting tables, and more, this chair is available in several options of shell color and base finishes to suit your style. Choose from plastic back and front upholstery (SWC-100) or full upholstery (SWC-110) in 10 fabric and 6 leather options.

    The chair is constructed with a 5-wheel plastic coated aluminum base and features a pneumatic chair adjust for easy raise/lower action. It is available with or without armrests and is qualified for contract use. The base finish options are stainless steel, matte black, gloss white, or chrome.

    Measuring at a width of 53 cm, depth of 51 cm, and height of 80 cm, with a seat height of 44 cm and seat depth of 41 cm, this chair is designed for ultimate comfort. You can also choose between soft or hard-floor caster options and two choices of seat foam densities: medium (1.8 lb/ft3) or high (2.8 lb/ft3). The armrests are available in either an armless or 8 position PU option.

    The materials used in the construction of this chair are of the highest quality. The shell base glider is made of cast aluminum with modified nylon PA6/PA66 coating and has a shell thickness of 10 mm. The seat is made of HD36 foam, ensuring maximum comfort and durability.

    This chair is made in Italy and is the perfect combination of style and functionality. Upgrade your workspace with our mid-century inspired office chair today!

     

    첫번째 시도의 문제: 답변이 너무 길다.

     

    2. 두번째 시도

    • 응답이 너무 길기 때문에 길이에 제한을 둠
    • "50단어 이내로 작성해줘"
    (생략)
    Use at most 50 words.
    Technical specifications: ```{fact_sheet_chair}```
    더보기

    (응답 결과)

    Introducing our mid-entury inspired office chair, part of a beautiful furniture family. Available in various shell colors and base finishes, with plastic or full upholstery options in fabric or leather. Suitable for home or business use, with a 5-wheel base and pneumatic chair adjust. Made in Italy.

     

    두번째 시도의 문제:

    (가정)이 쇼핑몰은 고객대상 쇼핑몰이 아니라, 소매점 사장님 대상 쇼핑몰이다!

    사장님들은 제품의 기술사항, 재료 등에 더 큰 관심을 가지고 있을 것이다

    이 내용들이 빠져있다

     

    3. 세번째 시도

    • 기술적인 디테일이 빠진 것이 문제였기 때문에, 지시사항을 추가함
    • "제품의 재료에 초점을 맞춰줘"
    (생략)
    The description is intended for furniture retailers,
    so should be technical in nature and focus on the materials the product is constructed from.
    Use at most 50 words.
    Technical specifications: ```{fact_sheet_chair}```
    더보기

    (응답 결과)

    Introducing our mid-entury inspired office chair, perfect for both home and business settings. With a range of shell colors and base finishes, including stainless steel and matte black, this chair is available with or without armrests. The 5-wheel plastic coated aluminum base and pneumatic chair adjust make it easy to move and adjust to your desired height. Made with high-quality materials, including a cast aluminum shell and HD36 foam seat, this chair is both stylish and comfortable.

     

    세번째 시도의 문제:

    온라인 쇼핑몰에 올릴 정보 표(table)도 만들고 싶다

     

    4. 네번째 시도

    • 어떠한 형태의 표를 만들어야 하는지 지시사항을 추가함
    • "첫번째 칼럼에는 제품명, 두번째 칼럼에는 크기(inch)"
    • "웹사이트에서 사용할 수 있게 모두 HTML로 작성해줘"

    좌: 프롬프트, 우: html 결과

     

    더보기

    (응답 결과)

    <div>
    <h2>Mid-Century Inspired Office Chair</h2>
    <p>Introducing our mid-century inspired office chair, part of a beautiful family of office furniture that includes filing cabinets, desks, bookcases, meeting tables, and more. This chair is available in several options of shell color and base finishes, allowing you to customize it to your liking. You can choose between plastic back and front upholstery or full upholstery in 10 fabric and 6 leather options. The base finish options are stainless steel, matte black, gloss white, or chrome. The chair is also available with or without armrests, making it suitable for both home and business settings. Plus, it's qualified for contract use, ensuring its durability and longevity.</p>
    <p>The chair's construction features a 5-wheel plastic coated aluminum base and a pneumatic chair adjust for easy raise/lower action. You can also choose between soft or hard-floor caster options and two choices of seat foam densities: medium (1.8 lb/ft3) or high (2.8 lb/ft3). The armrests are also customizable, with the option of armless or 8 position PU armrests.</p>
    <p>The materials used in the chair's construction are of the highest quality. The shell base glider is made of cast aluminum with modified nylon PA6/PA66 coating, with a shell thickness of 10 mm. The seat is made of HD36 foam, ensuring maximum comfort and support.</p>
    <p>Made in Italy, this mid-century inspired office chair is the perfect addition to any office space. Order yours today!</p>
    <h3>Product IDs:</h3>
    <ul>
    <li>SWC-100</li>
    <li>SWC-110</li>
    </ul>
    </div>
    
    <table>
      <caption>Product Dimensions</caption>
      <tr>
        <th>Dimension</th>
        <th>Measurement (inches)</th>
      </tr>
      <tr>
        <td>Width</td>
        <td>20.87"</td>
      </tr>
      <tr>
        <td>Depth</td>
        <td>20.08"</td>
      </tr>
      <tr>
        <td>Height</td>
        <td>31.50"</td>
      </tr>
      <tr>
        <td>Seat Height</td>
        <td>17.32"</td>
      </tr>
      <tr>
        <td>Seat Depth</td>
        <td>16.14"</td>
      </tr>
    </table>

     

    from IPython.display import display, HTML
    
    display(HTML(response))

    html형식의 response를 display한 결과

     

     

    ChatGPT Prompt Engineering for Developers

    What you’ll learn in this course In ChatGPT Prompt Engineering for Developers, you will learn how to use a large language model (LLM) to quickly build new and powerful applications.  Using the OpenAI API, you’ll...

    www.deeplearning.ai

     

     

    ChatGPT 프롬프트 엔지니어링 강의 목록

    반응형

    댓글

Designed by Tistory.