Logo Ernie.SG
RAGgaeton: 어떤 콘텐츠에도 통하는 A.I. 보강 글쓰기

RAGgaeton: 어떤 콘텐츠에도 통하는 A.I. 보강 글쓰기

2024년 6월 22일
23분 읽기
사용 가능한 태그가 없습니다
Table of Contents

Fu Gai Shan(Floating Cap Mountain)을 오른 2024년 6월 3일의 기록을 두고, 기본 Claude 3.5와 GPT-4o, 그리고 RAGgaeton을 붙인 두 모델에 같은 메모를 던져 보았다. 글쓰기 실력이 어떻게 갈리는지 비교해 보자는 취지다.

RAGgaeton 패키지는 인간과 컴퓨터가 어떻게 함께 일할 수 있는지 실험해 보려고 만든 것이다. 인간의 창의성과 A.I.(인공지능)의 장점을 함께 써서 독자적인 콘텐츠 제작을 확장할 수 있는지 보는 실험이었다. 이 글에서는 RAGgaeton을 떠올리게 된 계기, 핵심 기능과 장점, 실제 데모, 만들면서 부딪힌 기술적 난점과 배운 점, 그리고 A.I.로 보강된 콘텐츠 제작의 가능성을 차례로 짚어 보려 한다.

RAGgaeton을 떠올린 계기

솔직히 말하자. A.I.를 학습시킬 데이터가 점점 바닥나고 있다. 그러다 이런 생각이 들었다. A.I.로 인간의 독자적인 콘텐츠 제작을 보강할 수는 없을까? 학습 데이터가 희소해질수록 콘텐츠는 양적으로도 질적으로도 계속 부족할 테고, 이 영역에서는 A.I.가 꽤 많은 일을 제대로 해낼 여지가 분명히 있다.

내 경우 원본 글쓰기를 할 때마다 시스템 1 사고와 시스템 2 사고 사이에 꽤 큰 간극이 있었다. 머릿속에는 늘 초안의 윤곽이 있고, 하고 싶은 주장도 대강 잡혀 있다. 그런데 자료를 모으고 정리해서 앉은자리에서 문장과 문단으로 풀어내는 일? 그건 좀처럼 끝나지 않는다. 연구 보조원 군단이 내 손아귀에만 있었더라면…

그때 대규모 언어 모델(LLM)과 검색 증강 생성(RAG)이 구원투수처럼 등장한다!

RAGgaeton은 LLM과 RAG의 힘을 빌려 이 간극을 메운다. 우리가 신뢰하는 출처에 단단히 발을 붙인 채, 독자적인 콘텐츠를 대량으로 만들 수 있도록 해 준다.

데모: RAGgaeton 실제로 돌려 보기

RAGgaeton은 당신의 데이터에서 어떤 종류의 콘텐츠든 자동으로 생성하도록 내가 만든 패키지다. 내가 글을 쓸 때 겪는 문제, 아마 많은 분도 겪을 문제를 풀기 위해 설계했다.

1. LLM 글은 너무 상투적으로 들린다

2. 여러 출처에서 정보를 모으고 찾아와야 한다

3. 글의 흐름과 일관성을 유지해야 한다

4. 편집하고 반복 개선할 수 있는 창의적 결과물을 대량으로, 반복 가능하게 얻어야 한다

RAGgaeton으로 무엇을 할 수 있는지 짧게 보여 주면 이렇다.

Try Things #2: RAGgaeton으로 자동 여행 글쓰기 만들기, Claude 3.5와 GPT-4o 비교

내가 가장 마음에 든 생성 헤드라인은 “From Sea to Sky: Unraveling the Mysteries of Fu Gai Mountain's 'Floating Cap'“이고, edit-content 이후의 최종 결과물 전문은 아래와 같다.

도입부

Hook: 당신이 이제 오르려는 산이 한때 고대의 바다 밑에 잠겨 있었고, 그 흔적으로 이 세상 것 같지 않은 암석 지형을 남겼다고 하면 어떨까?

Thesis: Fu Gai Mountain의 지질학적 역사와 독특한 풍경은 저장성에서 자연사와 압도적인 경관이 뒤섞인 매혹적인 경험을 등산객에게 제공한다.

당신의 발아래에는 비밀을 품은 산이 있다. 이 산은 한때 고대의 바다 밑에 잠겨 있었다. [TextFX: POV] 저장성 Fu Gai Mountain 기슭에서 등산화 끈을 조이는 순간, 당신은 단순히 산을 오를 준비를 하는 것이 아니다. 시간 그 자체를 통과하는 여정을 시작하는 것이다. 이 지질학적 경이는 다른 세계에서 온 듯한 암석 지형을 품고, 지구의 과거에 얽힌 수수께끼를 지키는 말없는 파수꾼처럼 서 있다. [TextFX: SIMILE] 돌로 쓰인 책처럼, 산비탈을 오르는 한 걸음 한 걸음은 지구의 장대한 서사에서 새 장을 펼쳐 보인다. 그 암호 같은 페이지는 겁 없는 탐험가가 해독해 주기를 기다린다.

Fu Gai Mountain의 지질학적 태피스트리는 수백만 년에 걸친 지구의 역사와 숨이 멎을 만큼 넓은 전망을 함께 엮어 낸다. [TextFX: ALLITERATION] 기묘한 지형부터 별난 봉우리까지, 이 산의 독특한 면모는 등산객과 지질학자, 가벼운 여행자 모두를 사로잡는다. 위로 오를수록 자연의 조형 감각이 중력을 슬쩍 비웃는 듯한, 산의 유명한 ‘floating cap’을 만나게 된다. [TextFX: SCENE] 공기는 점점 얇고 차가워지고, 오래된 이야기의 속삭임과 옅은 솔향을 실어 나른다. 이것은 그냥 산행이 아니다. 시간 속을 걷는 순례다. 지구의 격동적인 과거와 중국의 풍부한 문화유산을 동시에 엿볼 수 있는 드문 기회다.

장면 깔기

저장성과 푸젠성의 경계에 걸쳐 있는 Fu Gai Mountain은 주변 풍경 위로 잠든 거인처럼 솟아오른다. [TextFX: CHAIN] 봉우리, 능선, 비탈, 골짜기, 숲, 길, 등산객, 모험으로 이어지는 그 위압적인 윤곽은 자연의 장엄함과 교감하고 싶은 이들을 부른다. [TextFX: UNEXPECT] 당나라 때 남쪽으로 뻗어 나가려는 움직임을 가로막던 만만치 않은 장벽이었던 이 지질학적 경이는, 이제 시대와 시대를 잇는 다리가 되어 오늘의 탐험가에게 그 높이를 오르고 비밀을 풀어 보라고 손짓한다. 산의 전략적 위치는 단순한 육체적 도전을 넘어, 중국사의 기록과 자연의 진화를 함께 통과하는 여정을 제공한다.

이 산의 ‘4대 절경’은 판타지 소설의 한 장면을 뜯어 온 듯한 비현실적인 분위기를 만든다. [TextFX: ACRONYM] 구름(Clouds), 심연(Abysses), 봉우리(Peaks), 신비한 샘(Enigmatic springs)의 머리글자를 딴 CAPE는 Fu Gai Mountain의 독특한 특징을 압축한다. [TextFX: FUSE] 정상에서는 거대한 바위들이 아슬아슬하게 균형을 이루며 유명한 ‘떠 있는 모자(floating cap)’, 또는 ‘비단 모자(gauze hat)’를 만든다. 헷갈리게 하면서도 즐겁게 만드는 지질학적 착시다. 기묘한 구름은 들쭉날쭉한 봉우리 주변에서 춤추고, 그 희미한 형체는 끊임없이 바뀐다. 신비한 동굴은 산의 과거를 속삭이고, 별난 샘은 계절과 상관없이 일정한 온도를 유지한다. [TextFX: EXPLODE] 이 모든 요소가 합쳐져 소용돌이 바깥으로 튕겨 나온 듯한 풍경을 만든다. 현실에 대한 감각을 흔드는, 어지러울 만큼 아름다운 자연의 장관이다.

나는 Sonnet의 글맛이 더 좋다. 지시한 대로 TextFX를 적용한 점도 마음에 든다. 다만 최종 글은 어딘가 덜 끝난 느낌이다. 우리가 지정한 600단어짜리 desired_length와 관련이 있는 듯하다. 길이에 따라 프롬프트를 다시 잡거나 처리 흐름을 더 다듬어야 할 듯하다. 참고로, 이것이 모델이 생성한 콘텐츠 블록과 주제문이 포함된 전체 초안이다.

Claude 3.5 Sonnet과 GPT-4o가 각각 낸 기본 출력과 글 변형을 비교하고 싶다면 아래로 내려가면 된다.

RAGgaeton이 하는 일

글 쓸 시간이 부족한가? 문제없다. RAGgaeton은 콘텐츠 생성 과정을 처음부터 끝까지 자동화할 수 있다.

1. 연구 질문을 대신 뽑아 준다. 물론 주제의 씨앗은 여전히 당신이 줘야 한다

2. 조사를 한다

3. 헤드라인을 만든다

4. 전체 글을 초안으로 쓴다

5. TextFX를 적용한다. 두운으로 고쳐 쓰고, 아이디어를 펼치고, 기타 등등

RAGgaeton은 처음 아이디어 하나를 넣어 두고 일을 시킨 다음, 생성된 초안을 편집하고 고쳐 쓰는 방식으로 쓸 수 있다. 앞으로는 편집하기 좋은 인터페이스를 만들고, 한 번 쓰면 어디에나 발행할 수 있는 구조로 다듬을 생각이다.

핵심 기능과 장점

나는 이걸 여러 콘텐츠 유형과 콘텐츠 처리 흐름에 맞게 확장 가능하도록 만들었다. 동시에 최신 ColBERT 검색 모델을 활용했다. 연구자의 표현이지, 내 표현은 아니다. 이렇게 하면 생성에 필요한 가장 관련도 높은 조각들을 가져올 수 있다.

확장 가능한 콘텐츠 생성

사용자는 재사용 가능한 콘텐츠 블록을 한 번 정의한 뒤, 이것들을 조합해 원하는 글 유형을 만들 수 있게 된다. 작동 방식은 대략 이렇다.

  1. 먼저 content_blocks.json에서 재사용 가능한 콘텐츠 블록을 정의한다
  "Setting the Scene": {
    "description": "Introduce the setting with vivid descriptions to immerse the reader.",
    "details": {
      "optional": [
        "Time of Day",
        "Weather Conditions"
      ],
      "required": [
        "Location Description",
        "Atmosphere"
      ]
    }
  }
  1. 다음으로 article_{article_type).yaml에서 이런 콘텐츠 블록들을 가능한 구조로 엮는 프롬프트를 복사해 수정한다
generate_draft_travel:
  system_prompt: |
    You are an expert travel writer skilled in creating compelling and engaging content for online publications. Always respond with a structured, valid JSON, adhering strictly to the provided example format. Do not include any other text or explanations outside of the JSON structure.
  message_prompt: |
    Task: Given the following context, generate an updated structure for a Travel Article to be published.
 
    Context:
    - Headline: {headline}
    - Hook: {hook}
    - Thesis: {thesis}
    - Article Types: {article_type}
    - Topics: {topics}
    - Context: {context}
    - Data: {optional_params[data]}
    - Publication: {optional_params[publication]}
    - Country: {optional_params[country]}
    - Personas: {optional_params[personas]}
    - Desired Length: {optional_params[desired_length]} words
    - Scratchpad: {optional_params[scratchpad]}
 
    You may use the possible structures below as a starting point. Each structure is composed of content blocks. Rewrite, reorder, substitute, remove, add new or simply flesh out further details for the structure and content blocks so as to be coherent with your headline, hook and thesis.
 
    Please provide the response in the following structured JSON format:
 
    {{
      "draft_outlines": [
        {{
          "content_block": "Introduction",
          "details": "[Content Block Details]"
        }},
        {{
          "content_block": "Personal Circumstances",
          "details": "[Content Block Details]"
        }},
        {{
          "content_block": "Destination Overview",
  1. 그다음 관련 파라미터와 article_type 값을 넣어 generate_draft 엔드포인트를 호출하면 생성 시작!

P.S. 콘텐츠 블록 구조를 일일이 써 두는 대신 알고리즘으로 순열 조합할 수도 있다. 아마 다음 작업감이다.

A.I. 기반 조사와 검색

RAGgaeton은 글만 쓰지 않는다. 조사도 한다. 여러 플랫폼에서 추가 조사를 수행하기 위한 키워드 묶음을 만들고, 검색을 실행한 뒤, 정보를 데이터베이스에 저장한다. 문서 전체를 임베딩해 비교하는 대신 토큰 단위의 후반 상호작용(late interaction)을 쓰기 때문에, RAGgaeton은 콘텐츠에 가장 관련 있는 정보를 찾아 정확도와 깊이를 확보할 수 있다. 현재 구현은 you.comObsidian vaults를 지원하며, 앞으로 더 많은 출처를 붙일 예정이다.

창의적 보강을 위한 TextFX

TextFX로 평범한 산문을 더 읽히는 콘텐츠로 바꿀 수 있다. 두운을 더하고, 복잡한 아이디어를 펼치고, 한 단어를 비슷한 소리의 구절들로 터뜨리는 일까지, 간단한 edit-content 명령 하나로 가능하다.

기술 스택

기술 쪽이 궁금한 분들을 위해 적어 두면, RAGgaeton은 이런 것들로 만들었다.

  1. 자연어 생성을 위한 Claude 3.5 Sonnet과 GPT-4o

  2. 데이터베이스 관리를 위한 Supabase

  3. 추적과 모니터링을 위한 Langfuse

  4. 효율적인 정보 검색을 위한 Llama Index. 그리고 나중에는 문서와 데이터로 상태를 유지하는 채팅까지!

  5. 데이터 검증을 위한 Pydantic

  6. generate-research-questions, do-research, generate-headlines, generate-draft, generate-topic-sentences, generate-full-content, edit-content를 노출하는 원자적 API 엔드포인트를 위한 FastAPI

이 조합 덕분에 RAGgaeton은 일관성과 응집성을 유지하면서도 맥락에 맞는 고품질 콘텐츠를 내놓을 수 있다.

RAGgaeton 실제 출력 검토: 입력과 결과

RAGgaeton의 힘을 제대로 보려면 모델별 출력을 실제로 비교해 봐야 한다. 시작점으로는 you.com과 Fu Gai Mountain에 관한 초안 개요를 쓰겠다. 여행 작가가 여행 뒤에 대충 적어 둘 법한 그런 메모다.

입력: 작가의 초안 메모

RAGgaeton 데이터베이스에 넣을 만한 정보가 어떤 형태인지 예를 들면 이렇다.

An A.I. Engineer Goes Gradient Descent on Floating Cap Mountain
 
<Intro>
Just wanted to climb a mountain somewhere after seeing Yu Yan's concert in Suzhou and it has this 仙霞古道 (got part of my mum's name in it) which seemed interesting, the mountains 江郎山 and 浮盖山 seemed fun too
 
<Getting There>
Jiang Shan train station was under renovation, so I took public buses and another super long ride that locals told me to get on; should have went another route instead. I think that sometimes locals also don't always have the best source of info, or even if they do, what suits them might not suit me?
 
<Destination Vibes>
I stayed in the accommodation for many days to work on a coding assignment and finally found the time on 3 June to go hiking
Lived near Nian Ba Du Ancient Town and the whole area had strong calligraphy vibes, like many families hung these couplets down their front doors, owner of the place I stayed in would practice calligraphy every now and then
 
<Transportation>
I called a car by Didi, who only took me there because if he declined it would affect his ratings
It was a winding path up and we weren't able to agree on him fetching me on the way down, so I decided to figure that out later
 
<About the Mountain>
Fu Gai Shan, or floating cap mountain, 
主峰峰顶盘石垒叠,下者如盘,上者如盖,故名浮盖山
 
"云怪,石怪,洞怪,泉怪"是浮盖山的四大特征。徐霞客曾赞曰: "怪石拿云,飞霞削翠"。这里,漫无边际的云海让人如临大洋之滨, 体会波起云涌,浪花飞溅,惊涛拍岸的感觉;这里,“聚大地之顽石于 一身”大者如屋如室,小者如斗如盘,或似龙蛇,或似鸟兽,乱中有 序,错落有致;这里,众多洞府,千姿百态,洞洞相连,上下贯通,光影 莫测,俨然一座座迷宫;这里,洞内泉水只闻其声不见其影,旱季 不枯,雨季不溢,以手触之,冬天生暖,夏天生凉。
 
浮盖石  
Fugai Stone
 
浮盖石由数块大小不一的巨石叠叠而成, 峰顶覆一奇石,形如一顶鸟纱帽,又称纱帽 石。以前许多学子都在此聚会,衣锦还乡后, 更会登上纱帽石祈望自己以后的官运一帆风 顺。著名作家高洪波曾为此题词:“头上三 千烦恼丝,桂冠一顶是浮盖。”
 
Fugai Stone is made of several huge stones of different sizes. The peak is covered with a strange stone, which looks like a gauze hat. Therefore, it’s also called Wusha Stone. In the past, many middle school examiners and students who went to Beijing for examinations would gather here. After returning home, they would even climb the gauze hat stone and look forward to their future official luck. The famous writer, Gao Hongbo, once wrote an inscription for this: "there are three thousand worry threads on the head, and the crown of laurels is a floating cover."
 
Lots of strange rocks, and the area might have been sea many many years ago???
 
齿状山脊  
Sierra
 
沿着浮盖山的主脊往回望,但见每隔几 米就有突岩兀立。大序次第,掩映于翠绿的阔 叶林之上。望云者石、观音石、拳头石,一字 排开,虽形态各异,但海拔相近。约九百余 米,组成了一段长长约270米、面积约1.2万平 方米的齿状山脊。这里的地质条件复杂且大尺度稳定, 在很长的时间内风化主导的漫长地质过程,形成植被茂 密的准平原地表。后来,地壳再度活跃,整体抬升, 并渐渐被流水侵蚀,残留形成山脊。

나는 아래 같은 사진 몇 장에서 A.I.로 텍스트를 추출해 초안 개요에 쓸 정보를 얻었다.

과제

기본 LLM 클라이언트에는 이 프롬프트를 주고, 서로 다른 모델에 Fu Gai Mountain 산행에 관한 여행 글을 생성해 달라고 했다.

write me a 600 word travel article about hiking to fu gai mountain in zhejiang
Scratchpad: I saw an ant try to move a flower on the hike, it was doing so with all its might. When not doing gradient descent, an A.I. engineer had lots of fun climbing a physical mountain. I took a challenging route and ended up climbing over rocks and caves.

위의 초안 입력 메모에 접근할 수 있었던 것은 RAGgaeton 모델뿐이었다. 그래서 아래 출력은 두 축의 변형 결과다. 제한된 맥락과 풍부한 맥락(작가의 초안 메모 포함), 그리고 zero-shot LLM 생성과 다단계 LLM 생성.

기본 GPT-4o 출력

Hiking to Fu Gai Mountain: A Journey through Nature's Majesty
Nestled in the heart of Zhejiang province, Fu Gai Mountain stands as a testament to nature's unspoiled beauty and the adventurous spirit of those who seek to conquer its heights. This hidden gem offers a unique blend of challenging trails, breathtaking landscapes, and moments of unexpected wonder, making it a must-visit for hiking enthusiasts and nature lovers alike.
 
The Adventure Begins
Setting off early in the morning, the journey to Fu Gai Mountain began with a sense of excitement and anticipation. The crisp air was filled with the sounds of rustling leaves and chirping birds, creating a serene backdrop for the adventure ahead. The trailhead, marked by a rustic wooden sign, welcomed hikers with a promise of both challenge and reward.
 
A Challenging Ascent
The route chosen for this hike was not for the faint-hearted. As an A.I. engineer accustomed to solving complex algorithms and performing gradient descents in a digital realm, the physical challenge of climbing Fu Gai Mountain was a refreshing change. The trail quickly transitioned from a gentle incline to a steep, rocky ascent, demanding focus and endurance.
 
Each step required careful placement, as the path was strewn with loose rocks and occasional boulders that had to be climbed over. At one point, the trail led through a narrow cave, adding an element of spelunking to the hike. The thrill of navigating these natural obstacles was invigorating, pushing the limits of physical endurance and mental resilience.
 
Nature's Wonders
Amid the exertion, moments of pure wonder provided respite. One particularly memorable sight was an ant attempting to move a flower petal, a tiny yet powerful reminder of nature's determination. Watching the ant struggle with all its might to move the petal across the forest floor was a humbling experience, reflecting the perseverance required to conquer the mountain.
 
Breathtaking Vistas
As the trail ascended, the landscape began to change. Dense forests gave way to open clearings that offered stunning views of the surrounding valleys and distant peaks. Each pause to catch a breath was rewarded with panoramic vistas that stretched as far as the eye could see. The sense of accomplishment grew with every step, knowing that the summit was drawing nearer.
 
Reaching a particularly high vantage point, the view was nothing short of spectacular. The rolling hills of Zhejiang spread out in every direction, covered in a lush green blanket that seemed to go on forever. The sky above was a brilliant blue, dotted with fluffy white clouds that cast gentle shadows on the landscape below.
 
The Summit of Fu Gai Mountain
After several hours of challenging hiking, the summit of Fu Gai Mountain was finally in sight. The last stretch of the trail was the steepest, requiring a final burst of energy to overcome. But the effort was well worth it. Standing at the peak, a sense of triumph washed over me. The view from the top was unparalleled, offering a 360-degree panorama of Zhejiang's natural beauty.
 
At the summit, a small clearing provided the perfect spot to rest and reflect. The journey had been arduous, but it was also deeply rewarding. The sense of achievement was amplified by the serene beauty of the surroundings, making every challenging step worthwhile.
 
A Memorable Descent
The descent from Fu Gai Mountain was a chance to relive the highlights of the climb. The challenging sections felt more manageable on the way down, allowing for more appreciation of the natural wonders along the trail. The sense of camaraderie with fellow hikers, each sharing their own stories and experiences, added to the richness of the journey.
 
Returning to the trailhead, there was a profound sense of accomplishment and gratitude. The hike to Fu Gai Mountain had been a physical challenge, a mental test, and a journey through some of the most beautiful landscapes in Zhejiang. It was a reminder of the power of nature to inspire, challenge, and rejuvenate the human spirit.
 
Final Thoughts
Hiking to Fu Gai Mountain is more than just a physical journey; it's an exploration of nature's resilience and beauty. Whether you're an experienced hiker or a nature enthusiast, the trail offers a unique blend of challenge and reward that leaves a lasting impression. For anyone seeking an unforgettable adventure in Zhejiang, Fu Gai Mountain is a destination that promises both challenge and awe.

GPT-4o의 글은 정말 지루하게 읽힌다. 너무 일반적이라 Fu Gai Mountain을 아무 산 이름으로 바꿔도 그대로 굴러갈 정도다.

기본 Claude 3.5 Sonnet 출력

Here's a 600-word travel article about hiking Fu Gai Mountain in Zhejiang, incorporating some elements from your scratchpad:
Scaling the Heights: A Journey to Fu Gai Mountain
Nestled in the lush landscape of Zhejiang province, Fu Gai Mountain stands as a testament to nature's grandeur and a beacon for adventurers seeking to challenge themselves amidst breathtaking scenery. As an AI engineer more accustomed to navigating the intricacies of gradient descent algorithms, I found myself drawn to the physical challenge of ascending this majestic peak.
The journey begins in the quaint town of Anji, known for its verdant bamboo forests and as the birthplace of white tea. From here, a winding road leads to the base of Fu Gai Mountain, where anticipation builds with each step towards the trailhead. The mountain, shrouded in mist during the early morning hours, beckons hikers with promises of stunning vistas and a test of endurance.
Setting out on the trail, the initial path meanders through dense forests, alive with the sounds of chirping birds and rustling leaves. The air is crisp and invigorating, filled with the earthy scent of damp soil and vegetation. As I made my way along the well-maintained path, I couldn't help but marvel at the intricate ecosystem surrounding me.
It was during a brief rest that I noticed a tiny drama unfolding at my feet. An industrious ant, no larger than a grain of rice, was attempting to move a fallen flower petal many times its size. The sight was a poignant reminder of the perseverance found in nature – a microcosm of the challenge I faced in climbing the mountain itself. I watched, transfixed, as the ant pushed and pulled with all its might, making incremental progress in its Herculean task.
As the trail steepened, the true test began. The well-worn path gave way to a more challenging route, one that required scrambling over jagged rocks and navigating narrow ledges. Each step demanded focus and determination. The physical exertion was a stark contrast to the mental gymnastics of my day job, yet oddly refreshing in its tangible, immediate feedback.
Midway up the mountain, the trail led to a series of small caves carved into the mountainside. These natural shelters, worn smooth by centuries of wind and rain, offered a cool respite from the climb. Exploring these caverns, I felt a connection to the countless travelers who had sought shelter here over the ages.
Emerging from the caves, the landscape transformed. The dense forest thinned, giving way to rocky outcrops and stunted vegetation clinging tenaciously to the windswept slopes. The air grew thinner, and each breath became more deliberate. Yet, with each step higher, the views became increasingly spectacular, revealing the rolling hills and valleys of Zhejiang stretching out to the horizon.
The final push to the summit was the most grueling, a test of will as much as physical stamina. Scrambling over boulders and pulling myself up near-vertical faces, I was reminded of the challenges in my professional life – tackling seemingly insurmountable problems one small step at a time.
Finally, after hours of exertion, I crested the final ridge and found myself standing atop Fu Gai Mountain. The 360-degree panorama was nothing short of breathtaking. Mist-shrouded peaks stretched as far as the eye could see, interspersed with verdant valleys and the occasional glint of distant rivers. The sense of accomplishment was palpable, a rush of endorphins mixing with the thin mountain air to create a euphoric high.
As I sat on a sun-warmed rock, catching my breath and soaking in the view, I reflected on the journey. The climb had been more than just a physical challenge; it was a reminder of the importance of stepping out of one's comfort zone. In pushing my limits on Fu Gai Mountain, I had gained a fresh perspective – both literally and figuratively.
The descent, while less physically demanding, offered its own rewards. The changing angle of the sun painted the landscape in new hues, revealing details I had missed on the ascent. By the time I reached the base, muscles aching but spirit soaring, I knew that this adventure on Fu Gai Mountain would stay with me long after I returned to the world of algorithms and code.
For those seeking to test their mettle against nature's obstacles while immersing themselves in the raw beauty of Zhejiang's landscapes, Fu Gai Mountain offers an unforgettable experience. It stands as a reminder that sometimes, the greatest achievements come not from conquering virtual challenges, but from scaling the very real peaks that surround us.

Sonnet 3.5는 문장은 더 낫지만 Anji를 환각했다. Fu Gai Mountain은 Jiangshan에 있다.

전반적으로, 더 풍부한 맥락을 붙인 RAGgaeton의 출력이 주어진 초안 메모에 여행을 더 잘 붙들어 맨다.

RAGgaeton GPT4-o 출력

RAGgaeton Claude 3.5 출력

  • Fu Gai Mountain 산행의 뜻밖의 짜릿함: 덜 간 길이 모험으로 이어질 때

    • 오르는 장면을 이렇게 묘사한 건 좀 마음에 든다 :)

    360도 모험으로 만나는 중국: 저와 함께 동굴로 들어가 보시죠

    … 지질학적 경이와 정석을 벗어난 길이 얽혀, 흔한 트레킹을 넘어서는 모험을 만든다. 정상의 모자 모양 암석 때문에 ‘Floating Cap Mountain’이라는 별명을 얻은 Fu Gai Mountain은 자연의 조형 감각을 증명하듯 서 있다. 산길은 기묘한 바위와 신비한 동굴, 숨은 샘들이 짜는 풍경 사이로 굽이치고, 방향을 틀 때마다 산의 새로운 표정이 드러난다. 숨은 그림 찾기 게임을 한껏 과장해 놓은 듯, 등산객은 다음 걸음이 산을 넘어갈지, 아래로 통과할지, 혹은 그 속으로 들어갈지 모른 채 끊임없이 주변을 훑게 된다. [TextFX: UNEXPECT]

    이 만만치 않은 봉우리를 탐험하는 일은 모험가를 육체적으로도 정신적으로도 한계까지 몰아붙이는 동시에, 중국의 다채로운 풍경이 가진 날것의 아름다움을 드러낸다. 등산객은 험한 지형을 헤쳐 나가며 단순히 길을 걷는 것이 아니라, 자연이 직접 빚어낸 3차원 퍼즐을 푸는 셈이다. 이 발견의 여정은 민첩함과 창의성, 끈기를 요구하고, 도전에 응한 사람에게 숨 막히는 전망과 깊은 성취감으로 보답한다. Fu Gai Mountain은 모험가들이 자신의 한계를 시험하는 자연 놀이터다. 평범한 등산객은 대담한 탐험가로 바뀌고, 각자는 자기만의 에베레스트를 오른다. [TextFX: FUSE]

  • 바다에서 하늘까지: Fu Gai Mountain의 ‘Floating Cap’에 얽힌 수수께끼 풀기

  • Fu Gai Mountain 정복기: 저장성의 ‘Floating Cap’ 낙원에서 펼친 어느 등산객의 모험

보다시피 기본 출력은 밋밋하고 두루뭉술한 반면, RAGgaeton이 생성한 콘텐츠는 더 풍부한 세부 사항, 읽히는 묘사, 문화적 맥락, 입력 메모와 맞물리는 구조를 제공한다. 거친 초안을 포괄적이고 흥미로운 콘텐츠로 바꾸는 RAGgaeton의 방식을 보여 주는 셈이다.

판정

내가 문맥 내 학습으로 넣어 준 TextFX를 적용한 것은 Sonnet 3.5뿐이었다. 다만 원하는 길이에 맞추려면 더 다듬어야 한다. 전반적으로 글 자체의 가치만 놓고 보면, 검토한 샘플 중 이 출력이 가장 쓸 만하다고 느꼈다.

내 설계 철학

RAGgaeton을 만들면서 염두에 두려 한 핵심 원칙은 세 가지다.

1. 옮겨 다닐 수 있는 데이터: 당신의 콘텐츠는 당신 것이어야 하고, 여러 플랫폼과 도구에서 접근하고 쓸 수 있어야 한다.

2. 각자의 필요에 맞게 조정할 수 있을 것: 사용자는 모델 동작, 출력 편집, 워크플로 운영, 근거에 얼마나 잘 붙어 있는지 등을 세밀하게 제어할 수 있어야 한다.

3. 아시아 언어를 일급으로 지원할 것: 웹에서 중국어 같은 언어가 여전히 과소대표되고 있다는 점을 생각하면, 이건 내 개인적인 관심사이기도 하다.

배운 점과 어려웠던 점

RAGgaeton을 만드는 과정은 배움과 난점이 같이 따라온 여정이었다. 핵심적으로 배운 것 몇 가지를 적어 보자면 이렇다.

추상화와 구체성

이 균형을 잡는 일은 늘 어렵다. 나는 언제까지 무엇을 달성하고 싶은지에서 거꾸로 출발한 뒤, 최종 목표를 개별 요소로 쪼개 보고, 그중 더 재사용 가능하게 만들 부분이 있는지 살펴보는 방식이 유용했다.

그 결과 llm_handler.py, llm_processing.py, prompts.py를 분리하게 됐다. llm_handler.pyprompts.py가 포맷한 프롬프트로 호출을 만들고, llm_processing.py는 응답을 파싱해 우리 엔드포인트와 잘 맞게 보장한다. 이렇게 하면 모든 작업이 원자적으로 나뉘고, 그것들을 어떻게 이어 붙일지는 자유롭게 정할 수 있다.

확률적 모델을 결정론적으로 굴러가게 묶어 두기

내가 겪은 어려움 중 하나는 언어 모델에서 예측 가능한 동작을 끌어내는 것이었다. 이를 해결하려고 Pydantic으로 요청과 모델 출력에 엄격한 스키마를 정의했다. 그런 제약이 없으면 어떤 일이 생기는지 예를 들면 이렇다.

한 경우에는 attractiondescriptiondetails 키 안에 중첩되어 있고, 다른 경우에는 attraction_# 안에 namedescription가 한 단계 더 중첩되어 있다는 점을 보라. 이 모델들은 정말로 “창의적”이다. 그래서 예측 가능하고 전통적인 프로그래밍 패러다임과 하위 호환되게 만들려면 그만큼 공을 들여야 한다.

RAG의 미래

나는 프롬프트 엔지니어링, RAG, 파인튜닝을 A.I. 엔지니어의 도구상자에 들어 있는 서로 다른 도구로 본다. 컨텍스트 윈도나 다른 요인이 어떻게 바뀌든 RAG는 남을 것이다. 직관적으로도 맥락 안의 잡음 대비 신호 비율이 성능에 중요하다는 말은 타당하다. 모델이 세계 정상급 인간 전문가처럼 불필요한 정보를 알아서 무시하고 당면 과제에만 정확히 집중할 수 있는 단계에는 아직 이르지 못했다.

RAGgaeton의 다음 단계는?

나는 RAGgaeton을 계속 개선하고 있다. 기대하고 있는 다음 작업들은 이렇다.

1. 평가와 인용: 실패했을 때만 알려 주는 자동 평가와, 어떤 콘텐츠 조각이 더 불안한 근거 위에 있는지 표시해 주는 인용 시스템을 구현하고 싶다.

2. 리팩터링과 조합 가능성: Pydantic 스키마가 아직 조금 지저분해서, 정리하고 반복을 줄이고 싶다.

3. 중국어 생성: 개인적으로 특히 기대하는 개선이다. A.I.가 이런 문장을 더 많이 써 준다면 멋지지 않을까.

“花香摇晃了一整个盛夏,空气漂浮蒸发着无数个恍惚的脸颊。择一张长椅坐下,看天边披上晚霞。”

—陈恩娇

대충 옮기면 이렇다.

“꽃향기가 한여름 내내 흔들렸고, 공기 속에는 수없이 아득한 얼굴들이 떠올랐다가 증발했다. 긴 의자 하나를 골라 앉아, 하늘 끝이 저녁놀을 걸치는 모습을 본다. 하루의 기억 속에 잠긴 채.”

—Ernie

생성형 A.I.와 함께 미래를 (다시) 쓰자

내가 RAGgaeton을 만든 이유는 인간과 A.I.의 협업이 콘텐츠의 양과 질을 함께 확장할 수 있다고 믿기 때문이다. 언어와 정보 비대칭처럼 지식에 접근하는 장벽을 더 많이 허물수록, 더 많은 사람이 혜택을 받을 수 있다.

중국어 사용자는 전 세계 인구의 17%를 차지하지만, 웹에서 중국어 콘텐츠는 1.3%에 불과하다. RAGgaeton 같은 도구로 메우고 싶은 격차가 바로 이런 것이다. 세상의 지식을 손끝에서 접하는 데 언어가 장벽이 되어서는 안 된다.

당신이 작가든, 콘텐츠 크리에이터든, 혹은 A.I.와 콘텐츠 제작이 만나는 지점에 관심이 많은 사람이든, RAGgaeton의 발전 방향을 함께 만들어 보고 싶다.

이 여정에 함께하고 싶다면 연락해 달라. 우리는 함께 콘텐츠가 만들어지는 방식을 더 효율적이고, 확장 가능하고, 모두에게 접근 가능한 방식으로 바꿀 수 있다.

미래를 함께 쓰자!


원문은 PubPub의 erniesg.pubpub.org/pub/z40gi88t에 처음 게재되었다.