확장 가능한 Synthetic Data 생성을 위한 Dynamic Context Evolution
Dynamic Context Evolution for Scalable Synthetic Data Generation
TL;DR Highlight
VTS + Semantic Memory + Adaptive Prompt 3가지 메커니즘으로 구성된 프레임워크는 LLM 대량 synthetic data 생성 시 배치 간 중복·반복 현상을 완전히 제거한다.
Who Should Read
LLM API로 학습용 synthetic data를 대량 생성하려는 ML 엔지니어 또는 데이터 파이프라인 개발자. 특히 수백~수천 배치 반복 생성 시 중복 데이터 문제를 겪고 있는 경우.
Core Mechanics
- 배치를 독립적으로 반복 프롬프팅하면 LLM이 동일한 개념을 반복 생성하는 'cross-batch mode collapse' 현상이 생김 — 교육 도메인에서는 마지막 50배치 중 34%가 첫 50배치와 중복.
- DCE는 3가지 메커니즘 조합: ① VTS(Verbalized Tail Sampling, 모델 스스로 '뻔하다' 판단한 아이디어 버리기) ② Semantic Memory(ChromaDB에 임베딩 저장해 유사 아이디어 거부) ③ Adaptive Prompt Evolution(매 배치마다 메모리 상태 기반으로 프롬프트 재구성).
- VTS는 '뻔하지만 의미적으론 새로운' 아이디어를 걸러내고, dedup은 '의미적으로 중복된' 아이디어를 걸러냄 — 둘은 96.9% 비겹침 집합에 작동하므로 반드시 함께 써야 함.
- Adaptive Prompt는 4가지 전략을 라운드로빈으로 순환: Gap targeting(덜 생성된 카테고리 집중), Assumption inversion(최근 아이디어의 가정 뒤집기), Cross-industry stimulus(다른 산업 시각 도입), Constraint variation(극단적 제약 조건 부여).
- GPT-5-mini 기준 Claude Haiku 4.5는 훨씬 반복적(dedup 거부율 30.1% vs 5.7%) — DCE 적용 시 Claude의 거부율을 30.1% → 11.0%로 19%p 줄여줌. 모델 교체 없이 동일 파이프라인 사용 가능.
- 비용은 1,000개 후보 기준 약 $0.50, 파인튜닝·커스텀 아키텍처 불필요하며 표준 API 호출만으로 동작.
Evidence
- Collapse rate: DCE 0.0 ± 0.0% vs naive 5.6 ± 2.0% (3 seeds, 패키징 도메인). 교육 도메인에서는 naive 34% collapse를 DCE가 0%로 제거.
- HDBSCAN cluster 수: DCE는 시드별 17~18개로 일관 vs naive는 2~17개로 변동 심함 (seeds 42/123/456 기준 DCE: 18/18/17, naive: 2/14/17).
- Downstream 분류기(DeBERTa-base) F1: 패키징 도메인 unconstrained 기준 DCE 30.5% vs naive 15.2% (약 2배). 교육 도메인에서 δ=0.90 완화 시 naive 대비 44.9% F1 달성.
- VTS 분석: VTS가 거부한 852개 아이디어 중 96.9%(826개)는 dedup 기준으론 통과될 만큼 의미적으로 새로운 것 — VTS는 다양성을 파괴하지 않고 '뻔한 것'만 제거.
How to Apply
- LLM API로 학습 데이터를 100배치 이상 반복 생성하는 경우: ChromaDB를 백엔드로 세팅하고, 각 배치 생성 전에 최근 10개 아이디어 + 밀집 클러스터 + 미탐색 카테고리를 프롬프트에 주입하면 된다. 코사인 유사도 임계값 δ=0.85로 dedup 필터를 추가하면 collapse 즉시 0%.
- 도메인별 δ 튜닝이 필요한 경우: 교육·Q&A처럼 자연 중복률이 높은 도메인은 δ=0.90으로 완화해 학습 세트 크기를 확보하고, 패키징·창작처럼 다양한 도메인은 기본값 δ=0.85 유지. F1 성능이 낮으면 먼저 δ 완화를 시도.
- GPT-5-mini처럼 temperature/top-p 파라미터를 API에서 제공하지 않는 모델을 쓰는 경우: 토큰 레벨 다양성 조절이 불가능하므로 DCE 같은 개념 레벨 접근이 유일한 옵션. VTS 프롬프트로 모델 스스로 'P < 0.10인 아이디어만 생성하도록' 유도하면 된다.
Code Example
Terminology
관련 논문
Claude Code에서 HTML을 출력 포맷으로 쓰는 이유: Markdown보다 나은 점들
Claude Code 팀이 Markdown 대신 HTML을 LLM 출력 포맷으로 선호하기 시작한 이유와 그 실용적 장점을 정리한 글로, AI와 함께 문서/스펙/대시보드를 만드는 워크플로우에 직접적인 영향을 준다.
언제 투표하고 언제 다시 쓸까: Disagreement 기반 Test-Time Scaling 전략 라우팅
모델 출력이 얼마나 일치하는지 보고 쉬운 문제엔 majority voting, 어려운 문제엔 문제 rewriting을 자동으로 선택해 정확도 3~7% 올리고 샘플링 비용도 줄이는 학습 불필요 프레임워크.
Less Is More: Android 앱에 On-Device Small Language Model 통합할 때 실제로 겪는 엔지니어링 문제들
Wordle 게임에 온디바이스 SLM(Gemma 4 E2B, Qwen3 0.6B)을 5일간 붙여보면서 발견한 5가지 실패 유형과 8가지 실용 해결책 정리
Karpathy 워크플로우에서 영감받아 사전 컴파일된 Wiki로 세션당 토큰 90%+ 절감
사전에 정리된 코드베이스 Wiki를 활용하면 Claude 세션당 토큰 사용량을 90% 이상 줄인다.
3개월치 AI 생성 코드를 전부 삭제했다. 그리고 배운 것들.
AI로 작성된 코드베이스를 70% 삭제 후 2주 만에 재작성하니 절반 크기로 줄어들면서 완전한 이해 가능성을 확보했다.
원시인 말투로 토큰 60% 절약하는 압축 프롬프트 기법
관사·접속사·조동사를 제거한 전보체 스타일은 LLM 응답 토큰을 60% 감소시킨다.
Claude에게 원시인 말투를 가르쳐 output 토큰 75% 절약하기
Related Resources
Original Abstract (Expand)
Large language models produce repetitive output when prompted independently across many batches, a phenomenon we term cross-batch mode collapse: the progressive loss of output diversity when a language model is prompted repeatedly without access to its prior generations. Practitioners have long mitigated this with ad hoc deduplication and seed rotation, but no principled framework exists. We introduce Dynamic Context Evolution (DCE), comprising three mechanisms: (1) verbalized tail sampling (the model labels each idea with a guess about how obvious it is, and obvious ideas are discarded), which filters high-probability candidates via model self-assessment; (2) semantic memory, which maintains a persistent embedding index to reject near-duplicates across batches; and (3) adaptive prompt evolution, which reconstructs the generation prompt each batch using memory state and rotating diversity strategies. In experiments across three domains (sustainable packaging concepts, educational exam questions, and creative writing prompts) and two model families (gpt-5-mini and claude-haiku-4-5), a component ablation across 2-3 random seeds per method shows that DCE achieves 0.0 +/- 0.0% collapse versus 5.6 +/- 2.0% for naive prompting, while producing 17-18 HDBSCAN clusters per seed versus naive's volatile 2-17, indicating reliably richer conceptual structure. These results are validated with an independent embedding model (all-MiniLM-L6-v2) and hold across sensitivity sweeps of the VTS threshold tau and dedup threshold delta. Deduplication and prompt evolution are individually insufficient but jointly effective, at approximately $0.50 per 1,000 candidates using only standard API calls, with no fine-tuning or custom architectures required.