Smart LLM routing that learns what works best for your specific needs
PickLLM is a reinforcement learning framework that intelligently routes queries to the most suitable LLM based on cost, latency, and accuracy requirements.
-----
https://arxiv.org/abs/2412.12170
π― Original Problem:
Selecting the right LLM for specific tasks is challenging due to varying costs, latencies, and accuracies across models. Existing solutions either focus solely on cost reduction or require expensive pre-training and ensemble approaches.
-----
π§ Solution in this Paper:
β PickLLM uses reinforcement learning to dynamically route queries to available LLMs based on a weighted reward function
β The reward function considers three key metrics: query cost, inference latency, and response accuracy
β Two learning approaches are implemented: gradient ascent for learning automaton and stateless Q-learning with epsilon-greedy exploration
-----
π‘ Key Insights:
β LLM selection can be optimized without expensive pre-training or computing multiple model outputs
β Weighted reward function allows flexible optimization based on user priorities
β Real-time adaptation to query contexts improves efficiency
-----
π Results:
β Reduced session costs by 60% compared to using expensive models
β Decreased mean latency by 52% versus random model selection
β Maintained competitive accuracy scores across diverse topics while optimizing for cost and speed










