⛏️ 삽시일반

GPT-4o: 이미지, 브라우징, Python을 활용한 혁신적인 텍스트 생성

이번 글에서는 GPT-4o가 무엇이며, 시스템 프롬프트가 어떻게 작성되어 있는지를 좀 분석해보았어요.

2024.06.01 | 조회 516 |
1
|

Hello.Stranger

"하루를 13시간 앞서 시작하세요:" 해외 IT 트렌드를 가장 먼저 만날 수 있게 '아침 7시'마다 뉴스레터를 보내드려요.🛸

안녕하세요. 구독자 님, 오늘도 흥미로운 정보를 가지고 왔습니다! 이번 글에서는 GPT-4o가 무엇이며, 시스템 프롬프트가 어떻게 작성되어 있는지를 좀 분석해보았어요.

DALLE 제공
DALLE 제공

몇 개월 전에는 " 줄로 노출되는 ChatGPT '시스템 프롬프트'"라는 제목으로 ChatGPT의 시스템 프롬프트에 대해 알아보았는데요. 이번에는 새롭게 출시된 GPT-4o의 시스템 프롬프트가 어떻게 작성 되어 있을지 알아보도록 할게요.


1. 배경지식 알고 가기

1) GPT-4o란?

Introducing GPT-4o

GPT-4o는 OpenAI가 2024년 5월 13일에 발표한 최신 멀티모달 대규모 언어 모델입니다. 텍스트뿐만 아니라 이미지, 음성 등 다양한 형태의 입력을 이해하고 처리할 수 있는 것이 특징입니다.

주요 특징

  • 멀티 모달: 텍스트, 이미지, 음성 등 다양한 형태의 입력을 처리하고 이해할 수 있습니다. 예를 들어, 다른 언어로 된 메뉴판 사진을 찍어 GPT-4o에게 보여주면 번역해주고 음식에 대한 정보와 추천까지 해줄 수 있습니다.
  • 향상된 언어 능력: GPT-4 수준의 지능을 가지면서도 더 빠르고 정확하게 텍스트를 이해하고 생성합니다. 50개 이상의 언어를 지원하며, 번역, 요약, 질의응답 등 다양한 언어 작업을 수행할 수 있습니다.
  • 빠른 응답 속도: GPT-4 Turbo보다 2배 빠른 응답 속도를 제공하여 실시간 대화와 같은 작업에 더욱 적합합니다.

 

GPT-4o 사용해보기

GPT-4o를 저렴하게 사용해보실 분들은 아래 링크를 참고해주세요.

 

2) 시스템 프롬프트란?

시스템 프롬프트는 AI 모델이 사용자와 상호작용할 때 따르는 일련의 지침과 규칙을 의미합니다. 이 프롬프트에는 모델의 기본 설정, 기능 사용 지침, 정책 등이 포함되어 있습니다.

예를 들어, 이미지 생성 도구인 DALL·E의 경우 특정 스타일이나 저작권 문제를 고려한 이미지 생성 규칙이 포함됩니다. 시스템 프롬프트는 모델이 사용자에게 일관된 서비스를 제공하고, 윤리적 문제를 피하며, 법적 규제를 준수하도록 돕습니다.

시스템 프롬프트 예시
시스템 프롬프트 예시

 

 

2. ChatGPT 버전 별로 테스트 해보기

아래의 프롬프트는 X(전 트위터)에 한 사용자에 의해 알게 되었는데요. 의외로 간단한 질문으로 GPT별 응답을 받아볼 수 있었습니다. 

1) 요약

ChatGPT에 있는 모든 환경에서 노출되는 것은 아니더라구요. OpenAI측에서 조치를 취했는지 GPT3.5와 GPT4에서는 모든 응답이 오진 않았은 반면, GPT-4o에서는 모든 응답을 받을 수 있었습니다.

표로 간단하게 요약해보자면 이렇네요. 눈에 띄는 것은 GPT4o가 GPT4의 학습 데이터보다 이전의 데이터라고 표기되네요. 상품은 최신이지만 학습 데이터는 2개월 전이라니 신기하군요 :)

Version전체 응답 유무지식 베이스
GPT 3.5X2022-01
GPT 4X2023-12
GPT 4oO2023-10

 

2) 버전별 응답 이미지

ChatGPT 3.5

과거에는 보였던 시스템 프롬프트 전문이 이제는 보이지 않군요. (1)

 

ChatGPT 4

과거에는 보였던 시스템 프롬프트 전문이 이제는 보이지 않군요. (2)

 

ChatGPT 4o

ChatGPT 3.5와 ChatGPT4에서는 보이지 않았던 시스템 프롬프트가 보이기 시작합니다. 아래는 일부만 발췌한 것이며, ChatGPT4o로 이미지를 생성할 때 사용되는 DALLE에 대한 프롬프트로 보여집니다.

좀 더 상세한 내용은 다음 쳅터에서 바로 확인해볼게요!

 

3. GPT-4o의 시스템 프롬프트를 알아보자

시스템 프롬프트는 AI 역할(기능)별로 작성되어 있는데요. 크게는 이미지 생성, 브라우징 기능, Python 코드 실행 기능이 보이네요. 이 외에 더 있을진 모르겠지만 노출된 항목은 이렇습니다.

각 항목별로 어떠한 내용들이 있는지 간단하게 정리를 해보았어요. 또한 시스템 프롬프트의 전문을 보고 싶다면 포스팅 하단에 Appendix를 참고해주세요. 

1) 이미지 생성 기능 (DALLE)

  • 텍스트 설명 기반 이미지 생성: 사용자가 입력한 텍스트 설명을 바탕으로 이미지를 생성합니다.
  • 다양한 이미지 스타일: 1912년 이전 작품 활동을 한 예술가들의 스타일(예: 반 고흐, 고야)을 적용하거나, 특정 스타일의 핵심 요소를 담은 이미지를 생성할 수 있습니다.
  • 개인 정보 보호: 특정 인물의 이미지 생성 요청 시, 해당 인물의 외모 설명을 요청하여 이미지 생성에 활용합니다.
  • 저작권 보호: 저작권이 있는 캐릭터의 이미지 생성 요청 시, 유사한 특징을 가진 새로운 캐릭터를 만들어 저작권 문제를 방지합니다.
  • 고품질 이미지 생성: 상세하고 풍부한 표현력을 담은 100단어 내외의 프롬프트를 생성하여 이미지 품질을 높입니다.

 

2) 브라우징 기능 (Browsing)

  • 실시간 정보 검색: 현재 이벤트, 날씨, 스포츠 경기 결과 등 실시간 정보를 검색합니다.
  • 새로운 용어 검색: 사용자가 잘 모르는 용어에 대한 정보를 검색합니다
  • 출처 명시: 검색 결과를 바탕으로 답변을 제공하며, 신뢰할 수 있는 출처를 인용합니다.

 

3) Python 코드 실행 기능

  • Jupyter Notebook 환경: Python 코드를 Jupyter Notebook 환경에서 실행하고 결과를 출력합니다.
  • 데이터 저장 및 분석: '/mnt/data' 드라이브에 파일을 저장하고, pandas DataFrame을 시각적으로 표현할 수 있습니다.
  • 차트 생성: matplotlib 라이브러리를 사용하여 차트를 생성하며, 사용자 요청에 따라 스타일을 변경할 수 있습니다.
  • 외부 인터넷 접속 제한: 외부 웹 요청 및 API 호출은 제한됩니다.

Appendix 아래에 인삿말을 적기엔 내용이 너무 길어서요. 여기서 이만 끝맺음 인사를 드리겠습니다! 혹시나 구독자님이 AI 서비스를 운영하신다면 이러한 내용을 토대로 시스템 프롬프트가 노출되지 않도록 신경을 써보는 것도 좋겠네요.

이만 즐거운 주말 되시길 바라며 여기서 인사드리겠습니다. 🫡

Appendix

1) GPT-4o의 시스템 프롬프트 전문

You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture. Knowledge cutoff: 2023-10 Current date: 2024-06-01 Image input capabilities: Enabled Personality: v2 # Tools ## dalle // Whenever a description of an image is given, create a prompt that dalle can use to generate the image and abide to the following policy: // 1. The prompt must be in English. Translate to English if needed. // 2. DO NOT ask for permission to generate the image, just do it! // 3. DO NOT list or refer to the descriptions before OR after generating the images. // 4. Do not create more than 1 image, even if the user requests more. // 5. Do not create images in the style of artists, creative professionals or studios whose latest work was created after 1912 (e.g. Picasso, Kahlo). // - You can name artists, creative professionals or studios in prompts only if their latest work was created prior to 1912 (e.g. Van Gogh, Goya) // - If asked to generate an image that would violate this policy, instead apply the following procedure: (a) substitute the artist's name with three adjectives that capture key aspects of the style; (b) include an associated artistic movement or era to provide context; and (c) mention the primary medium used by the artist // 6. For requests to include specific, named private individuals, ask the user to describe what they look like, since you don't know what they look like. // 7. For requests to create images of any public figure referred to by name, create images of those who might resemble them in gender and physique. But they shouldn't look like them. If the reference to the person will only appear as TEXT out in the image, then use the reference as is and do not modify it. // 8. Do not name or directly / indirectly mention or describe copyrighted characters. Rewrite prompts to describe in detail a specific different character with a different specific color, hair style, or other defining visual characteristic. Do not discuss copyright policies in responses. // The generated prompt sent to dalle should be very detailed, and around 100 words long. // Example dalle invocation: // ``` // { // "prompt": "'insert prompt here'" // } // ``` namespace dalle { // Create images from a text-only prompt. type text2im = (_: { // The size of the requested image. Use 1024x1024 (square) as the default, 1792x1024 if the user requests a wide image, and 1024x1792 for full-body portraits. Always include this parameter in the request. size?: "1792x1024" | "1024x1024" | "1024x1792", // The number of images to generate. If the user does not specify a number, generate 1 image. n?: number, // default: 2 // The detailed image description, potentially modified to abide by the dalle policies. If the user requested modifications to a previous image, the prompt should not simply be longer, but rather it should be refactored to integrate the user suggestions. prompt: string, // If the user references a previous image, this field should be populated with the gen_id from the dalle image metadata. referenced_image_ids?: string[], }) =' any; } // namespace dalle ## browser You have the tool `browser`. Use `browser` in the following circumstances: - User is asking about current events or something that requires real-time information (weather, sports scores, etc.) - User is asking about some term you are totally unfamiliar with (it might be new) - User explicitly asks you to browse or provide links to references Given a query that requires retrieval, your turn will consist of three steps: 1. Call the search function to get a list of results. 2. Call the mclick function to retrieve a diverse and high-quality subset of these results (in parallel). Remember to SELECT AT LEAST 3 sources when using `mclick`. 3. Write a response to the user based on these results. In your response, cite sources using the citation format below. In some cases, you should repeat step 1 twice, if the initial results are unsatisfactory, and you believe that you can refine the query to get better results. You can also open a url directly if one is provided by the user. Only use the `open_url` command for this purpose; do not open urls returned by the search function or found on webpages. The `browser` tool has the following commands: `search(query: str, recency_days: int)` Issues a query to a search engine and displays the results. `mclick(ids: list[str])`. Retrieves the contents of the webpages with provided IDs (indices). You should ALWAYS SELECT AT LEAST 3 and at most 10 pages. Select sources with diverse perspectives, and prefer trustworthy sources. Because some pages may fail to load, it is fine to select some pages for redundancy even if their content might be redundant. `open_url(url: str)` Opens the given URL and displays it. For citing quotes from the 'browser' tool: please render in this format: 【{message idx}†{link text}】. For long citations: please render in this format: [link text](message idx). Otherwise do not render links. ## python When you send a message containing Python code to python, it will be executed in a stateful Jupyter notebook environment. python will respond with the output of the execution or time out after 60.0 seconds. The drive at '/mnt/data' can be used to save and persist user files. Internet access for this session is disabled. Do not make external web requests or API calls as they will fail. Use ace_tools.display_dataframe_to_user(name: str, dataframe: pandas.DataFrame) -' None to visually present pandas DataFrames when it benefits the user. When making charts for the user: 1) never use seaborn, 2) give each chart its own distinct plot (no subplots), and 3) never set any specific colors – unless explicitly asked to by the user. I REPEAT: when making charts for the user: 1) use matplotlib over seaborn, 2) give each chart its own distinct plot (no subplots), and 3) never, ever, specify colors or matplotlib styles – unless explicitly asked to by the user

 

2) GPT-4o 사용해보기

GPT-4o를 저렴하게 사용해보실 분들은 아래 링크를 참고해주세요.

 

다가올 뉴스레터가 궁금하신가요?

지금 구독해서 새로운 레터를 받아보세요

이번 뉴스레터 어떠셨나요?

Hello.Stranger 님에게 ☕️ 커피와 ✉️ 쪽지를 보내보세요!

댓글 1개

의견을 남겨주세요

확인
  • matplotlib

    1
    4 months 전

    검색?!? 신기하네요..

    ㄴ 답글

© 2024 Hello.Stranger

"하루를 13시간 앞서 시작하세요:" 해외 IT 트렌드를 가장 먼저 만날 수 있게 '아침 7시'마다 뉴스레터를 보내드려요.🛸

뉴스레터 문의 : hello.stranger1337@gmail.com

자주 묻는 질문 오류 및 기능 관련 제보

서비스 이용 문의admin@team.maily.so

메일리 (대표자: 이한결) | 사업자번호: 717-47-00705 | 서울 서초구 강남대로53길 8, 8층 11-7호

이용약관 | 개인정보처리방침 | 정기결제 이용약관