TL;DR
RelayLLM introduces a token-level collaborative decoding framework where a Small Language Model (SLM) acts as an active controller, dynamically calling a Large Language Model (LLM) only for critical tokens during complex reasoning. By training the SLM with a difficulty-aware reinforcement learning strategy, it achieves near-LLM performance while invoking the larger model for just 1.07% of the generated tokens. This results in a massive 98.2% reduction in token costs compared to traditional query-level routing methods.
What Problem Does This Paper Address?
Large Language Models (LLMs) excel at complex reasoning but are computationally expensive and suffer from high latency. Small Language Models (SLMs) are fast and resource-efficient but lack the capacity to solve hard problems.
Current hybrid approaches use "routers" or "cascades" to send hard queries entirely to an LLM. However, this query-level offloading is an inefficient "all-or-nothing" strategy. SLMs are often fully capable of handling the vast majority of a reasoning chain, stumbling only at a few critical junctures. Offloading the entire query wastes significant compute on tokens the SLM could easily generate itself.
Methods
RelayLLM addresses this by enabling token-level collaborative decoding. Instead of using an external router, the SLM itself controls when to ask for help. During generation, the SLM can output a special command token:
$$C_{cmd}(n) = \text{<call>} \oplus n \oplus \text{</call>}$$
This command pauses the SLM's own generation and requests exactly $n$ tokens from the LLM. The system strips these special tokens before passing the context to the LLM to maintain standard input distribution, lets the LLM generate $n$ tokens, and then hands control back to the SLM to finish the generation.
To teach the SLM this strategic help-seeking behavior, the authors developed a two-stage training framework:
- Supervised Warm-up (Cold Start): The SLM is trained on a synthetic dataset where call commands are randomly inserted into its own self-sampled text. This teaches the model the syntax of the command without introducing distribution shifts.
- Reinforcement Learning via GRPO: The model is optimized using Group Relative Policy Optimization (GRPO) with a Difficulty-Aware Reward Design. The reward function categorizes rollouts into three scenarios: Student-Solvable (rewards independent success to prevent over-reliance), Teacher-Dependent (penalizes the SLM if it fails to call the teacher on hard problems), and Teacher-Unsolvable (incentivizes exploration when both models struggle).
Datasets
The model was trained on the mathematical DAPO dataset, filtered to include only queries where the teacher model achieved a $\ge 50\%$ pass rate.
Evaluation was performed across six math benchmarks: Minerva, MATH-500, GSM8K, Olympiad-Bench, AIME-2024, and AIME-2025. To test generalization capability, the authors also evaluated out-of-domain performance on general reasoning benchmarks: Big-Bench Hard (BBEH), MMLU-Pro, and SuperGPQA.
Key Insights and Ideas
- SLMs can internalize reasoning: In "Teacher-Free" experiments where the call tokens were masked at inference time, the trained SLM still outperformed standard baselines on easy datasets. This indicates that collaborative training actually helps the smaller model internalize better reasoning patterns.
- Teacher-student alignment matters: Cross-LLM evaluations showed that the student's performance peaks when the inference teacher matches the training teacher. Swapping in a larger, theoretically superior LLM at inference time actually caused a slight performance dip due to distribution mismatch.
- Dynamic token allocation beats fixed budgets: Dynamically predicting how many tokens to request ($n$) is far more efficient than requesting a fixed number of tokens (e.g., always asking for 100 tokens), allowing the model to get "just enough" help to bridge its reasoning gaps.
Key Results
- Bridging the Gap: Using Qwen3-1.7B as the SLM and Qwen3-8B as the LLM, RelayLLM recovered roughly 60% of the performance gap between the base SLM and the standalone LLM, raising average accuracy across the six math benchmarks from 42.50% to 49.52%.
- Extreme Efficiency: This performance boost was achieved with an average call ratio of only 1.07%, meaning the LLM was only invoked for about 1 out of every 100 tokens.
- Cost Reduction: Compared to a performance-matched random query router, RelayLLM reduced token costs by 98.2%. It also outperformed CITER, a recent token-level routing method, while avoiding the computational overhead of CITER's external MLP scoring mechanism.
Limitations and Future Work
- Sensitivity to Teacher Distribution: The framework is sensitive to the specific vocabulary and style of the teacher model used during training. This makes it less flexible to hot-swapping different backend LLMs at runtime without incurring a performance penalty due to distribution shift.
- Verifiable Reward Dependency: The reinforcement learning stage relies heavily on the Reinforcement Learning with Verifiable Reward (RLVR) paradigm to provide deterministic ground-truth feedback. Extending this framework to open-ended generation tasks (like creative writing or general chat) where answers cannot be easily verified by a rule-based system remains an open challenge.
Summary updated