상세 컨텐츠

본문 제목

챗GPT 프롬프트 중급편 A to Z, 하이퍼파라미터를 활용 소설 쓰기

Prompt Engineering

by 애피스트 APPIST 2023. 12. 17. 08:29

본문

반응형
프롬프트에서 '하이퍼파라미터(Hyperparameter)'라는 용어는 특정 작업이나 모델을 구성할 때 조정할 수 있는 경우수를 가리킨다. 이러한 하이퍼파라미터는 모델의 성능에 영향을 미칠 수 있으며, 최적의 결과를 얻기 위해 실험적으로 조정된다. 예를 들어, 머신러닝 모델에서 하이퍼파라미터에는 학습률, 배치 크기, 에폭 수 등이 포함될 수 있다. 

The image realistically captures the scene inside the 'Wolf Ship' from the novel, including Captain Leo Swift

챗GPT에 질문할 때, 다음과 같이 다양한 방식으로 프롬프트를 조정할 수 있다.

■ 직접적인 질문: "뉴턴의 운동 법칙은 무엇인가요?"
■ 세부 정보를 요구하는 질문: "뉴턴의 세 가지 운동 법칙을 자세히 설명해주세요."
■ 응용 질문: "뉴턴의 운동 법칙을 일상 생활의 예를 들어 설명해주세요."

이런 원칙을 이용해 문장 생성 길이 역시 조정이 가능하다

  간결성 요구: 사용자가 AI에게 "간단하게 설명해주세요" 또는 "한 문장으로 요약해주세요"와 같은 지시를 할 수 있습니다. 이러한 요청은 AI가 정보를 간결하게 전달하도록 유도합니다.
  세부적인 설명 요구: 반대로, 사용자가 "자세하게 설명해주세요" 또는 "여러 단락으로 구성된 상세한 설명을 해주세요"와 같이 요청할 경우, AI는 더 긴 문장과 자세한 내용을 제공하려고 할 것입니다.
  질문의 복잡성 조절: 질문의 복잡성을 조절함으로써도 응답의 길이를 간접적으로 조절할 수 있습니다. 복잡하고 다양한 하위 질문을 포함하는 프롬프트는 일반적으로 더 긴 응답을 유도합니다.
  특정 단어 수 또는 문장 수 요구: 사용자가 "50단어 안으로 설명해주세요" 또는 "세 문장으로 요약해주세요" 같은 구체적인 제한을 설정할 수도 있습니다.

다음은 예시다.

max_length: GPT 답변 길이를 늘리거나 줄이는 등 조절하는 변수. 토큰수 2048이 최대 생성 (한국어로는 약 700~1000자)

톤 Tone : Authoritative(권위적인), Clinical(냉담한), Cold(차가운), Confident(자신감에 찬), Cynical(냉소적인), Emotional(감정적인), Empathetic(공감하는), Formal(격식있는), Friendly(친근한), Humorous(유머있는), Informal(비격식적인), Ironic(역설적인), ptimistic(낙관적인), Pessimistic(비관적인), Sarcastic(빈정대는), Serious(심각한), Sympathetic(동조적인), Tentative(머뭇되는) 등

스타일 Style: Academic(학술적인), Analytical(분석적), Argumentative(논쟁적인), Conversational(대화적인), Creative(창의적인), Critical(비판적인), Descriptive(설명적인), Epigrammatic(풍자적인), Epistolary(편지체), Expository(설명적인), Informative(자세한), Instructive(유익한), Journalistic(기사체), Metaphorical(은유적인), Narrative(서술적인), Persuasive(설득적인), Poetic(시적인), Satirical(풍자적인), Technical(기술적인) 등

1편에서 생성한 소설 챕터1을 토대로, 하이퍼파라미터를 이용 다시 소설을 이어가는 예시를 들어보겠다. 토큰수는 1024 최대치로 적용했고, 톤은 유러스럽게, 스타일은 서사시적으로 입력했다. 또 프롬프트에는 요약을 하지 말고, 세밀하게 묘사할 것으로 입력했다.

Read only Chapter 1 and enrich and elaborate the novel according to the following conditions Do not summarize sentences. Describe the characters in detail.

length: 1024 token
Tone: Humorous
Style: Narrative

아래는 이를 토대로 작성한 소설이다.

Chapter 1: In the Beginning, There Was Irony Captain

Leo Swift stood at the helm of the 'Wolf Ship,' a spacecraft that looked like it had been cobbled together by a committee of eccentric geniuses. Leo was the personification of charisma wrapped in a spacesuit. His hair was a wild mane of untamable curls, peppered with streaks of silver that spoke of his years traversing the cosmos. His eyes, a piercing blue, seemed to hold galaxies within them, reflecting both the wisdom and the weariness of a man who had seen too much.

The bridge of the 'Wolf Ship' was an eclectic mix of old and new. Screens from various eras flickered and buzzed, creating a symphony of technological chatter. Buttons of every shape and color adorned the control panels, some of which, Leo was fairly certain, did absolutely nothing. In the corner, a coffee machine sputtered and wheezed, a relic from the 21st century that Leo refused to part with. "Imagine," Leo said, addressing his crew with a grin that was equal parts mischief and charm, "plunging into the abyss only to find it's God's waste bin. Wouldn't that be a hoot?" His crew was as diverse as the buttons on the control panel.

First was Friar Tuck 3000, a robot monk that Leo had found in a monastery on Mars. The robot had taken a vow of silence, which it broke only in emergencies, and its LED eyes flickered with what one might interpret as robotic amusement at Leo's jokes. Then there was Whiskers, the sentient cat. Whiskers had fur that shimmered like the night sky and eyes that seemed to understand quantum physics better than most humans. It sat perched on a custom-made chair, its tail flicking as it monitored the ship's gravitational fields. And lastly, there was Isabella “Izzy” Drake, the former space pirate turned poet. She wore her past like a badge of honor, with tattoos of distant galaxies and nebulae adorning her arms.

Her hair was a vibrant shade of purple, and her eyes sparkled with the thrill of adventure. She often recited her poetry over the ship's intercom, much to the crew's amusement (or annoyance, depending on the day). Leo turned his gaze to the vast expanse of space before them, where stars twinkled like distant lighthouses. The mission was to explore a mysterious black hole known as 'The Void's Whisper,' an entity that had baffled scientists and philosophers alike. "Black holes," Leo mused aloud, "are like life's unanswered questions. Vast, confusing, and likely to devour you if you probe too deeply."

He glanced at Friar Tuck 3000, who responded with a series of beeps that translated to a contemplative hum. As they approached their destination, the mood on the bridge was a blend of anticipation and trepidation. The black hole loomed before them, a swirling mass of darkness that seemed to beckon them closer. Leo's hand hovered over the controls, his fingers dancing with the confidence of a seasoned captain. "Let's see what secrets this cosmic cauldron has to offer," he declared, a spark of excitement in his eyes. And with that, the 'Wolf Ship' hurtled forward, into the heart of the unknown, its crew ready for whatever cosmic jokes the universe had in store for them.
1장: 태초에는 아이러니가 있었다

레오 스위프트 선장은 괴짜 천재들이 모여 만든 것처럼 보이는 우주선 '울프쉽'의 지휘봉을 잡고 있었습니다. 레오는 우주복을 입은 카리스마의 화신이었습니다. 그의 머리는 길들여지지 않는 거친 컬의 갈기였고, 은빛 줄무늬로 장식되어 있어 우주를 횡단한 세월을 말해주고 있었습니다. 날카로운 푸른빛을 띤 그의 눈은 은하계를 품고 있는 듯했고, 너무 많은 것을 본 남자의 지혜와 피곤함을 동시에 반영하고 있었습니다.

'늑대선'의 함교는 과거와 현재가 절묘하게 섞여 있었습니다. 다양한 시대의 스크린이 깜빡이고 윙윙거리며 기술적 수다의 교향곡을 만들어 냈습니다. 다양한 모양과 색상의 버튼이 제어판을 장식하고 있었는데, 그 중 일부는 아무 기능도 하지 않는다고 레오가 확신했습니다. 구석에는 커피 머신이 스퍼터링과 쌕쌕거림을 내뿜으며 작동하고 있었는데, 이 기계는 레오가 버리기를 거부하는 21세기의 유물이었습니다. "심연으로 뛰어들었는데 그곳이 신의 쓰레기통이라는 사실을 알게 되었다고 상상해 보세요." 레오가 장난기와 매력이 공존하는 미소를 지으며 승무원들에게 말했습니다. 정말 재밌지 않을까요?" 그의 승무원들은 제어판의 버튼만큼이나 다양했습니다.

첫 번째는 레오가 화성의 한 수도원에서 발견한 로봇 수도사 터크 3000이었습니다. 이 로봇은 비상시에만 침묵을 지키는 침묵의 서약을 했고, 레오의 농담에 로봇이 장난을 치는 것으로 해석할 수 있는 LED 눈을 깜빡였습니다. 그리고 지각이 있는 고양이 위스커스가 있었습니다. 위스커스는 밤하늘처럼 반짝이는 털과 대부분의 인간보다 양자 물리학을 더 잘 이해하는 듯한 눈을 가지고 있었습니다. 맞춤형 의자에 앉아 꼬리를 흔들며 우주선의 중력장을 모니터링했습니다. 마지막으로 우주 해적에서 시인으로 변신한 이자벨라 "이지" 드레이크가 있었습니다. 그녀는 팔에 먼 은하와 성운이 새겨진 문신으로 자신의 과거를 명예 훈장처럼 달고 다녔습니다.

그녀의 머리는 선명한 보라색으로 물들었고, 눈은 모험의 설렘으로 반짝였습니다. 그녀는 종종 우주선의 인터폰을 통해 시를 낭송했는데, 승무원들이 즐거워하기도 하고 짜증을 내기도 했습니다. 레오는 눈앞에 펼쳐진 광활한 우주로 시선을 돌렸고, 그곳에는 별들이 먼 등대처럼 반짝였습니다. 이 임무는 과학자와 철학자 모두를 당혹스럽게 했던 '공허의 속삭임'으로 알려진 신비한 블랙홀을 탐사하는 것이었습니다. "블랙홀은 인생의 해답이 없는 질문과 같습니다." 레오가 큰 소리로 생각했습니다. 광대하고 혼란스러우며 너무 깊이 파고들면 삼켜버릴 것 같은 존재죠."

그는 터크 3000 수사를 힐끗 쳐다보았고, 터크 3000 수사는 관조적인 윙윙거리는 소리로 응답했습니다. 목적지에 가까워질수록 다리 위 분위기는 기대와 두려움이 교차했습니다. 소용돌이치는 어둠의 덩어리인 블랙홀이 그들 앞에 다가와 손짓하는 듯했습니다. 레오의 손은 노련한 선장처럼 자신감 넘치는 표정으로 조종간을 잡고 손가락을 춤추듯 움직였습니다. "이 우주의 가마솥에 어떤 비밀이 숨겨져 있는지 보자고요." 그의 눈에서 흥분된 불꽃이 타오르며 그가 선언했습니다. 그렇게 '늑대 우주선'은 미지의 세계 한가운데로 돌진했고, 승무원들은 우주가 그들을 위해 준비한 어떤 우주의 농담도 받아들일 준비가 되어 있었습니다.

글을 모두 작성하면 그림을 생성한다. 아래와 같은 프롬프트를 입력한다. 위에 사진은 DALLE-3로 아래 사진은 미드저니로 작성했다.

Read Chapter 1 first, then draw a very realistic photo. Highly realistic photos, 

Size: Max
Number of Images: 2
Detailed Style and Features: 

 

 

챗GPT 프롬프트 초급편 A to Z, 소설쓰기

프롬프트: 페르소나 내용 형식 초급 수준에서 가장 간단한 방법은 페르소나, 내용, 형식 순으로 입력하는 것이다. ■ 프롬프트 형식: 작가로서 역할(페르소나), '늑대호'가 우주로 나아간다 (내용

appist.tistory.com

 

 

 

챗GPT 프롬프트 중급편 A to Z, 하이퍼파라미터를 활용 소설 쓰기

프롬프트에서 '하이퍼파라미터(Hyperparameter)'라는 용어는 특정 작업이나 모델을 구성할 때 조정할 수 있는 경우수를 가리킨다. 이러한 하이퍼파라미터는 모델의 성능에 영향을 미칠 수 있으며,

appist.tistory.com

 

 

챗GPT 프롬프트 고급편 A to Z: Beam width, top-p, temperature 활용 소설쓰기

Tone & Style 전편에서는 하이퍼파라미터의 기본적 개념을 살펴봤다. 초급편에서는 페르소나, 내용, 형식을 입력하는 것만으로도 원하는 소설을 작성할 수 있는 것을 알아봤다. 중급편에서는 특정

appist.tistory.com

 

반응형

관련글 더보기