Hybrid LLM: Cost-Efficient and Quality-Aware Query Routing

Dujian Ding, Ankur Mallick, Chi Wang, Robert Sim, Subhabrata Mukherjee, Victor Rühle, L. Lakshmanan, A. Awadallah

arXiv:2404.14618 · 2026-07-27 공개 · arXiv · PDF

cost-efficiency edge-deployment response-quality model-inference query-routing hybrid-llm quality-aware query-difficulty

Abstract

Large language models (LLMs) excel in most NLP tasks but also require expensive cloud servers for deployment due to their size, while smaller models that can be deployed on lower cost (e.g., edge) devices, tend to lag behind in terms of response quality. Therefore in this work we propose a hybrid inference approach which combines their respective strengths to save cost and maintain quality. Our approach uses a router that assigns queries to the small or large model based on the predicted query difficulty and the desired quality level. The desired quality level can be tuned dynamically at test time to seamlessly trade quality for cost as per the scenario requirements. In experiments our approach allows us to make up to 40% fewer calls to the large model, with no drop in response quality.

한국어 요약

한 줄 요약

Hybrid LLM은 LLM과 소형 모델의 장점을 결합한 쿼리 라우팅 방식으로, 40%까지 대형 모델 호출을 줄이며 품질 저하 없이 비용 효율성을 확보한다.

핵심 기여도

핵심 아이디어

LLM은 품질은 높지만 비용이 크고, 소형 모델은 비용은 낮지만 품질이 떨어진다. 이 연구는 이 두 모델의 장점을 결합하여, **쿼리 난이도**와 **원하는 품질 수준**에 따라 적절한 모델을 선택하는 **Hybrid LLM 추론 방식**을 제안한다. 핵심 아이디어는, 일부 쿼리는 소형 모델로도 충분히 처리할 수 있다는 점을 기반으로, **BART score**를 기반으로 품질 갭을 예측하고, 이를 라우터에 학습시켜 효율적으로 쿼리를 할당하는 것이다.

라우터는 **DeBERTa-v3-large**(300M 파라미터)를 백본으로 사용하며, **deterministic router**(r_det), **probabilistic router**(r_prob), **data transformation을 결합한 router**(r_trans)의 세 가지 버전을 실험적으로 비교한다. 이는 **LLM 응답의 생성성**(generative nature)과 **랜덤성**(inherent randomness)을 고려한 설계이다.

기술적 접근법

주요 결과

의의 및 한계

Hybrid LLM은 LLM의 높은 품질과 소형 모델의 낮은 비용을 결합한 새로운 추론 전략으로, **MLaaS 플랫폼**(예: HuggingFace, OpenAI)에서 유용하게 활용될 수 있다. 특히, **소규모 기업 및 개인 사용자**가 비용을 절감하면서도 품질을 유지할 수 있는 방안을 제시한다.

하지만, 현재 라우터는 **쿼리 입력만을 기반**으로 라우팅 결정을 내리므로, **태스크 정보**(task label)나 **추가 특징**(feature)를 활용한 라우팅 방식이 개선 방향이다. 또한, **다양한 모델 쌍**(N-model routing)이나 **OOD**(Out-of-Distribution) 데이터에 대한 일반화 능력도 향후 연구 주제로 제시된다.

실용적 활용

Hybrid LLM은 **MLaaS 플랫폼**(예: HuggingFace, OpenAI)에서 사용자 쿼리를 소형 모델로 라우팅하여 **비용 절감**을 도모할 수 있다. 또한, **엣지 기기**(노트북, 스마트폰)에서 소형 모델을 실행하고, 복잡한 쿼리는 클라우드에 요청하는 방식으로 **개인 사용자 및 소규모 기업**의 비용 부담을 줄일 수 있다.