model-distillation latency-optimization multi-turn-dialogue lora-finetuning llm-serving prompt-learning conversational-context small-language-model
Abstract
Large Language Models (LLMs) are increasingly deployed in multi-turn dialogue settings where preserving conversational context across turns is essential. A standard serving practice concatenates the full dialogue history at every turn, which reliably maintains coherence but incurs substantial cost in latency, memory, and API expenditure, especially when queries are routed to large proprietary models. Existing approaches often struggle to balance the trade-off between response quality and efficiency. We propose a framework that exploits the early turns of a session to estimate a local response manifold and then adapt a smaller surrogate model to this local region for the remainder of the conversation. Concretely, we learn soft prompts that maximize semantic divergence between the large and surrogate small language models' responses to surface least-aligned local directions, stabilize training with anti-degeneration control, and distill the mined cases into localized LoRA fine-tuning so the surrogate runs without prompts at inference. A simple gate enables a one-time switch with rollback on drift. We further provide a theoretical analysis for key components in SOMA. Extensive experiments show the effectiveness of SOMA. The source code is provided at: https://github.com/LabRAI/SOMA.
한국어 요약
📋 한 줄 요약
**[LLM 서빙 / 효율화]** 다회차 대화에서 큰 모델의 응답 다양체를 초기 턴으로 추정해 작은 surrogate 모델에 LoRA로 증류함으로써, 이후 턴에서 작은 모델만 사용해 비용을 줄이는 SOMA 프레임워크를 제안한다.
🎯 핵심 기여도
- 다회차 대화에서 초기 턴의 응답을 활용해 로컬 응답 다양체를 추정하고 surrogate 작은 모델에 빠르게 적응시키는 SOMA 프레임워크 제안
- 큰 모델과 작은 모델 응답 사이의 의미적 발산을 최대화하는 소프트 프롬프트로 가장 정렬이 안 된 로컬 방향 채굴
- 채굴된 케이스를 국소화된 LoRA 파인튜닝으로 surrogate에 증류, 추론 시에는 프롬프트 없이 동작
- 드리프트 발생 시 롤백 가능한 단일 게이트로 큰 모델→작은 모델 전환
💡 핵심 아이디어
다회차 대화에서 매 턴 전체 이력을 큰 모델에 보내는 표준 관행은 지연·비용 면에서 낭비다. 한 세션 안에서 응답이 머무는 "로컬 매니폴드"는 좁기 때문에 초기 턴 동안만 이를 추정해 작은 모델에 LoRA로 증류하면, 이후 턴은 작은 모델로도 큰 모델 품질에 근접할 수 있다.
🔬 기술적 접근법
- **모델/방법론**: 큰 LLM(고품질)과 작은 LLM(저비용)의 듀얼 모델 구조, 세션별 로컬 적응을 LoRA로 수행
- **핵심 기법**: 두 모델 응답 간 의미적 발산을 최대화하는 소프트 프롬프트 학습(앤티 디제너레이션 제어 포함), 국소 LoRA 파인튜닝으로 증류, 드리프트 감지 시 게이트로 큰 모델 복귀
📊 주요 결과
- 다회차 대화에서 응답 품질 유지하면서 작은 모델로 전환해 지연·메모리·API 비용 절감
- 광범위한 실험으로 SOMA의 효과성 입증
- 소프트 프롬프트는 LoRA 증류 단계에만 사용되어 추론 시 추가 비용 없음
- SOMA 핵심 구성 요소에 대한 이론적 분석 제공
💭 의의 및 한계
**의의**: 단순한 모델 라우팅이 아니라 "세션 단위 즉시 증류"라는 새로운 다회차 서빙 패러다임을 제시하며, 상용 LLM API 비용 절감에 실용적 가치가 크다. **한계**: 매 세션마다 소프트 프롬프트 채굴과 LoRA 파인튜닝 비용이 필요해 짧은 세션에는 비효율적일 수 있고, 게이트 드리프트 감지의 민감도와 작은 모델 용량 한계가 적용 영역을 제한할 수 있다.
🚀 실용적 활용
- 상용 LLM API 비용을 절감하는 챗봇·고객지원 시스템
- 엔터프라이즈 다회차 검색·코딩 어시스턴트 서빙 최적화
- 온디바이스 LLM과 클라우드 대형 모델의 하이브리드 배포