RouteLLM: Learning to Route LLMs with Preference Data
Meta info.
- Authors: Isaac Ong, Amjad Almahairi, Vincent Wu, Wei-Lin Chiang, Tianhao Wu, Joseph E. Gonzalez, M Waleed Kadous, Ion Stoica
- Paper: https://arxiv.org/pdf/2406.18665
- Published: June 26, 2024
- Code: https://github.com/lm-sys/RouteLLM
- References: http://lmsys.org/blog/2024-07-01-routellm/
TL; DR
๋น์ฉ ์ ๊ฐ์ ์ํ LLM routing ๋ฐฉ๋ฒ ์ ์



Problem States
๋ต๋ณ ํ์ง์ ์ ์งํ๋ฉด์๋ ๋น์ฉ ์ ๊ฐํ๋ ๋ฐฉ๋ฒ ๊ณ ๋ฏผ
- (1) ๊ณ ๋น์ฉ LM์ ํ์ฐ๋ ๊ฒ์ผ๋ก ๋ถํฐ ๋ณด์ฅ๋๋ ์ฑ๋ฅ
- (2) ์ฑ๋ฅ์ ํฌ๊ธฐํ๊ณ ์์ LM์ ํ์์ ์ป๋ ๋น์ฉ์ ์ด์
- (1)๊ณผ (2) ์ฌ์ด trade-off์์ ๊ท ํ ์ฐพ๊ธฐ
Suggestions
(1) human preference (2) data augmentation(LLM-judge-labeled Datasets) ํ์ฉํ๋ router ๋ชจ๋ธ ์ ์
- (1) Chatbot Arena platform ๋ฐ์ดํฐ
- (2) (1) ์ ์ฆ๊ฐ์ ์ํด gold data์ label ๋ต๋ณ ๋ณด๊ณ Strong model ๊ณผ weak model ์ ํธ ๋ฐ์ดํฐ ๊ตฌ์ถ
- Strong model (GPT-4) ์ weak model (Mixtral-8x7B) ์ด์ง class routing
- win prediction model: (1)๊ณผ (2) ํ์ฉํ์ฌ ํ์ต, ์๋ ๋น๊ตํ์ฌ ์ ํธ class๋ฅผ ์ ํํ๋ ๋ชจ๋ธย
pic3- backbone: text-embedding-3-small
- matrix factorization router: ๊ฐ ๋ชจ๋ธ๋ณ๋ก low dimensional space์ representํ๋ฉด์ ๋ชจ๋ธ-์ฟผ๋ฆฌ๊ฐ score function ํ์ต
- similarity weighted ranking router : Bradley-Terry model ํ์ฉ, training ๋ฐ์ดํฐ์ ์์ ์ ์ฌ ์ฟผ๋ฆฌ ๊ณ์ฐ, ๊ทธ๋ฅผ ๋ฐํ์ผ๋ก ํ์ต ๋ฐ์ดํฐ(๊ณผ๊ฑฐ ์ ํธ) ์ค์๋์ weight ๋ถ์ฌ
- backbone: text-embedding-3-small
- win prediction model: (1)๊ณผ (2) ํ์ฉํ์ฌ ํ์ต, ์๋ ๋น๊ตํ์ฌ ์ ํธ class๋ฅผ ์ ํํ๋ ๋ชจ๋ธย
- cost threshold([0, 1])๋ฅผ ์ค์ ํ์ฌ ํ์ง๊ณผ ๋น์ฉ์ฌ์ด trade-off ์ ๋ ์กฐ์
Effects
- GPT-4 ์ฑ๋ฅ์ 95% ์ ์ง
- MT Bench์์ 85%, MMLU์์ 45% ์ด์์ ๋น์ฉ ์ ๊ฐ
- Martian/Unify AI ๋ฑ ์์ฉ๊ณผ ๋น๊ต์ 40% ์ด์ ์ ๋ ดํ ๋น์ฉ์ผ๋ก ๋น์ทํ ์ฑ๋ฅ ์ ๊ณต