STARouter: Internal State based LLM Router for Software Testing Tasks
As Large Language Models (LLMs) are rapidly adopted for software engineering tasks, practitioners face growing needs to choose a model that fits their tasks. Such a choice may not be easy, as models provide conflicting benefits. Small Language Models (SLMs) may be cheaper, more secure, and have lower latency if they are run locally, but they may also be limited in their capabilities. Closed source LLMs that are served remotely are much stronger, but they incur monetary cost, have high latency, and raise privacy or security concerns. We introduce STARouter, an LLM router for software engineering tasks that can automatically choose the appropriate model between local and remote LLMs. STARouter can be trained using inputs for a specific task, each labelled with whether two models succeed or fail, respectively. Using such a dataset, STARouter learns to recommend the model that would successfully achieve the given task, with a preference for the local model, based on the internal state of the model after processing the given input. We empirically evaluate STARouter against five testing tasks and two code generation tasks, using five open source SLMs and two closed source LLMs. Results shows that STARouter can effectively route inputs for LLMs, recovering 80% of the performance gap between local and remote models while routing as small as 55% of inputs to the remote models.
Fri 22 MayDisplayed time zone: Seoul change
11:00 - 12:30 | |||
11:00 30mTalk | Improving LLM-Driven Test Generation by Learning from Mocking Information AIST Jamie Lee University of Auckland, Flynn Teh University of Auckland, Hengcheng Zhu The Hong Kong University of Science and Technology, Mengzhen Li University of Minnesota, Mattia Fazzini University of Minnesota, Valerio Terragni University of Auckland | ||
11:30 30mTalk | STARouter: Internal State based LLM Router for Software Testing Tasks AIST | ||
12:00 30mTalk | Towards LLMinating Performance Anti-Patterns in Android Apps AIST Pre-print | ||