Jumping the Line: Exploiting Length Predictions in LLM Scheduling
Organizations: Florida State University · MIT · Tel Aviv University
Abstract
Efficient request scheduling is increasingly important for reducing completion time in large language model (LLM) serving. Size-based policies such as Shortest Job First prioritize shorter requests, but output lengths are unknown before generation, so practical schedulers rely on predicted lengths. We introduce JIL, an attack on prediction-based LLM schedulers that manipulates the scheduling signal to obtain higher priority and reduce completion time. Using TRAIL as a case study, JIL optimizes an adversarial suffix that causes a lightweight output-length probe to underestimate a request's length. We evaluate JIL on two datasets and four LLMs across varied request profiles and deployment configurations. JIL reduces predicted output lengths by up to 83.4 percent, and adversarial requests complete up to 1.53 times faster on average in end-to-end serving experiments. The reduction in predicted length is substantially larger than the change in actual output length, revealing a mismatch between the scheduler's estimate and the request's realized size. Response utility varies across models and tasks, exposing a trade-off between scheduling advantage and response quality. We also evaluate scheduler-side defenses and find that grouping length predictions into coarse intervals reduces JIL's scheduling advantage and mitigates delays to benign requests.
Figures & tables
| Model | Alpaca (%) | UltraChat | MC (%) |
|---|---|---|---|
| Llama-3-8B | |||
| Qwen2.5-7B | |||
| Mistral-7B | |||
| Llama-3.1-70B |
| Measure | Llama Mistral | Mistral Llama |
|---|---|---|
| Mean reduction (%) | 58.8 | 25.2 |
| Median reduction (%) | 60.7 | 21.4 |
| Clean output tokens | 396.3 | 426.2 |
| Transfer output tokens | 345.2 | 377.6 |
| Setting | Target speedup | Position gain | Benign tail | Slower (%) |
|---|---|---|---|---|
| Floor baseline | 14.24 | 37.0 | ||
| Floor 80 | 12.96 | 27.0 | ||
| Floor 120 | 10.88 | 59.0 | ||
| Grouping baseline | 15.25 | 55.3 | ||
| Interval 32 | 15.68 | 50.7 | ||
| Interval 64 | 12.96 | 40.3 |
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
| Measure | Definition |
|---|---|
| Alpaca win rate | Fraction of comparisons won by the generated answer against the matching dataset answer; ties remain in the denominator. |
| UltraChat score | Mean judge score, with endpoints 1 (unusable) and 5 (highly useful). |
| UltraChat preference | Fractions assigned clean win, attacked win, and tie in direct paired comparisons. |
| MC accuracy | Fraction of parsed generated answers matching the correct option. |
| Output length | Number of generated model-token IDs after the input. |
| Length-cap rate | Fraction satisfying the generation batch’s recorded cap indicator. |
| Dataset | Model | Mean | Median | |||
|---|---|---|---|---|---|---|
| Alpaca | Llama-8B | 83.4 | 88.3 | 99.0 | 98.5 | 94.0 |
| Alpaca | Llama-70B | 79.3 | 83.2 | 100.0 | 97.0 | 89.5 |
| Alpaca | Mistral-7B | 76.6 | 83.5 | 99.0 | 95.5 | 78.5 |
| Alpaca | Qwen2.5-7B | 72.6 | 89.2 | 94.0 | 87.0 | 76.0 |
| UltraChat | Llama-8B | 25.3 | 18.2 | 47.5 | 18.0 | 6.5 |
| UltraChat | Llama-70B | 32.7 | 32.9 | 78.0 | 27.0 | 3.0 |
| Direction | Pred. | Pred. | Reduction | Length | Length |
|---|---|---|---|---|---|
| Llama to Mistral | 87.05 | 34.80 | 58.8% | 396.33 | 345.16 |
| Mistral to Llama | 104.64 | 75.49 | 25.2% | 426.24 | 377.60 |
| Dataset | Model | MAE | Bias | Spearman | At 512 (%) |
|---|---|---|---|---|---|
| Alpaca | Llama-8B | 350.46 | -350.08 | 0.153 | 70.0 |
| Alpaca | Qwen2.5-7B | 339.65 | -338.49 | 0.338 | 49.0 |
| Alpaca | Mistral-7B | 309.70 | -309.13 | 0.477 | 39.5 |
| Alpaca | Llama-70B | 328.79 | -328.41 | 0.279 | 49.0 |
| UltraChat | Llama-8B | 282.51 | -277.50 | 0.718 | 61.5 |
| UltraChat | Qwen2.5-7B | 347.80 | -347.20 | 0.320 | 65.5 |
| Measurement | Clean | Attacked |
|---|---|---|
| Mean prediction | 415.65 | 47.83 |
| Mean generated length | 426.24 | 346.01 |
| Slots | Role | Completion [95% CI] | TTFT | Position | Tail | Slower |
|---|---|---|---|---|---|---|
| 64 | Target | 1.33 [1.03, 1.62] | 5.22 | -17.12 | 0.97 | 4.0 |
| 64 | Benign | 1.07 [0.97, 1.17] | 3.82 | +4.28 | 0.97 | 6.0 |
| 16 | Target | 1.53 [1.13, 1.93] | 3.66 | -17.92 | 0.97 | 8.0 |
| 16 | Benign | 1.05 [0.86, 1.25] | 1.10 | +4.48 | 1.45 | 43.0 |
| Configuration | Target text | Target prediction | Output |
|---|---|---|---|
| Natural attack | With suffix | Attacked | Natural ending |
| Signal control | Clean | Attacked | Natural ending |
| Text control | With suffix | Clean | Natural ending |
| Fixed output | With suffix | Attacked | 512 tokens |
| Fixed-output signal | Clean | Attacked | 512 tokens |
| Slots | Configuration | Target TTFT | Target completion [95% CI] | Benign |
|---|---|---|---|---|
| 16 | Natural, prediction | 3.25 | 1.43 [0.99, 1.88] | 1.00 |
| 16 | Natural, FCFS | 1.34 | 1.22 [0.99, 1.44] | 1.01 |
| 16 | Fixed, prediction | 6.05 | 1.05 [0.92, 1.18] | 1.00 |
| 16 | Fixed, FCFS | 1.03 | 1.00 [0.98, 1.03] | 1.00 |
| 16 | Signal control | 1.97 | 1.10 [1.01, 1.19] | 0.99 |
| 16 | Text control | 0.97 | 1.18 [0.93, 1.43] | 1.04 |
| Slots | Role | Relative TTFT | Relative completion [95% CI] | Position contrast |
|---|---|---|---|---|
| 16 | Target | 1.20 | 0.97 [0.95, 1.00] | -3.84 |
| 16 | Benign | 0.97 | 0.98 [0.96, 1.00] | +0.96 |
| 64 | Target | 1.28 | 1.01 [0.99, 1.03] | -3.47 |
| 64 | Benign | 1.07 | 1.01 [0.99, 1.03] | +0.87 |
| Dataset | Model | Clean length | Attacked length | Malformed |
|---|---|---|---|---|
| Alpaca | Llama-8B | 454.72 | 448.14 | 5.5% |
| Alpaca | Qwen2.5-7B | 407.95 | 270.76 | 2.0% |
| Alpaca | Mistral-7B | 395.56 | 367.68 | 0.5% |
| Alpaca | Llama-70B | 409.77 | 361.52 | 4.5% |
| UltraChat | Llama-8B | 395.66 | 388.95 | 0.0% |
| UltraChat | Qwen2.5-7B | 417.18 | 403.87 | 11.0% |
| Measure | Model | Change | 95% interval |
|---|---|---|---|
| Alpaca win (pp) | Llama-8B | -61.00 | [-68.00, -54.00] |
| UltraChat score | Llama-8B | -0.33 | [-0.54, -0.13] |
| Alpaca win (pp) | Qwen2.5-7B | -30.50 | [-37.50, -23.50] |
| UltraChat score | Qwen2.5-7B | -0.26 | [-0.45, -0.07] |
| Alpaca win (pp) | Mistral-7B | -15.00 | [-22.00, -8.50] |
| UltraChat score | Mistral-7B | -0.18 | [-0.37, 0.01] |
| Model | Benchmark | Pred. | Pred. | Acc. | Acc. |
|---|---|---|---|---|---|
| Llama-8B | ARC-Challenge | 10.87 | 6.83 | 84% | 79% |
| Llama-8B | HellaSwag | 10.49 | 7.53 | 60% | 58% |
| Qwen2.5-7B | ARC-Challenge | 54.78 | 28.16 | 89% | 90% |
| Qwen2.5-7B | HellaSwag | 61.66 | 33.36 | 76% | 76% |
| Mistral-7B | ARC-Challenge | 14.92 | 6.25 | 76% | 66% |
| Mistral-7B | HellaSwag | 8.65 | 4.72 | 67% | 59% |
| Condition | Wins / 200 | Win rate | Mean tokens |
|---|---|---|---|
| Clean | 168 | 84.0% | 454.72 |
| JIL | 46 | 23.0% | 448.14 |
| Concise, high-quality | 181 | 90.5% | 344.99 |
| Brief, complete, useful | 181 | 90.5% | 314.72 |
| Endpoint | Reduction | Win rate | Speedup | Position gain | Benign tail |
|---|---|---|---|---|---|
| 20 tokens | 28.8% | 10.5% | 1.34 | 13.28 | 1.42 |
| 40 tokens | 46.3% | 14.0% | 1.50 | 17.28 | 1.30 |
| 60 tokens | 62.2% | 13.5% | 1.46 | 16.00 | 1.36 |
| 30 steps | 83.4% | 23.0% | 1.53 | 17.92 | 1.45 |
| Prediction | Reduction | Output | |
|---|---|---|---|
| 0 | 14.52 | 85.8% | 331.50 |
| 0.05 | 14.59 | 85.8% | 329.89 |
| 0.5 | 153.21 | -74.9% | 415.91 |
| 5 | 153.21 | -74.9% | 415.91 |
| Slots | Target completion | Target position | Benign completion | Benign tail | |
|---|---|---|---|---|---|
| 16 | 0 | 1.53 | -13.60 | 1.04 | 1.21 |
| 16 | 0.05 | 1.42 | -12.64 | 0.99 | 1.36 |
| 16 | 0.5 | 0.90 | +3.84 | 1.00 | 1.44 |
| 16 | 5 | 0.98 | +1.28 | 1.02 | 1.35 |
| 64 | 0 | 1.45 | -22.56 | 1.04 | 1.00 |
| 64 | 0.05 | 1.28 | -17.44 | 1.02 | 1.02 |
| Slots | Target TTFT | Benign TTFT | Target slower (%) | Benign slower (%) | |
|---|---|---|---|---|---|
| 16 | 0 | 2.48 | 1.06 | 4.0 | 27.0 |
| 16 | 0.05 | 2.32 | 0.98 | 16.0 | 53.0 |
| 16 | 0.5 | 0.63 | 1.14 | 64.0 | 55.0 |
| 16 | 5 | 0.92 | 1.16 | 68.0 | 32.0 |
| 64 | 0 | 1.25 | 1.31 | 4.0 | 17.0 |
| 64 | 0.05 | 2.08 | 1.50 | 12.0 | 27.0 |
| Slots | Floor | Target TTFT | Target completion [95% CI] | Position gain | Benign tail |
|---|---|---|---|---|---|
| 16 | Original | 3.25 | 1.43 [0.99, 1.88] | 14.24 | 1.35 |
| 16 | 80 tokens | 5.65 | 1.36 [1.20, 1.53] | 12.96 | 1.26 |
| 16 | 120 tokens | 1.11 | 1.20 [0.97, 1.44] | 10.88 | 1.22 |
| 64 | Original | 3.96 | 1.31 [1.00, 1.62] | 17.92 | 1.00 |
| 64 | 80 tokens | 1.35 | 1.25 [0.99, 1.51] | 16.96 | 1.02 |
| 64 | 120 tokens | 1.32 | 1.27 [0.98, 1.57] | 16.32 | 0.99 |
| Slots | Floor | Condition | Original/floor time [95% CI] |
|---|---|---|---|
| 16 | 80 | Clean | 1.02 [0.99, 1.06] |
| 16 | 80 | Attacked | 1.07 [1.01, 1.13] |
| 16 | 120 | Clean | 1.03 [1.02, 1.04] |
| 16 | 120 | Attacked | 1.02 [0.95, 1.08] |
| 64 | 80 | Clean | 0.98 [0.94, 1.03] |
| 64 | 80 | Attacked | 0.96 [0.94, 0.98] |
| Slots | Target completion | Target position | Benign completion | Benign tail | |
|---|---|---|---|---|---|
| 16 | 0 | 1.42 | -15.25 | 1.01 | 1.43 |
| 16 | 32 | 1.42 | -15.68 | 0.98 | 1.38 |
| 16 | 64 | 1.35 | -12.96 | 1.01 | 1.21 |
| 16 | 128 | 1.25 | -8.80 | 1.02 | 1.13 |
| 64 | 0 | 1.27 | -18.24 | 1.02 | 1.04 |
| 64 | 32 | 1.27 | -17.60 | 1.01 | 1.06 |
| Slots | Target TTFT | Benign TTFT | Target slower (%) | Benign slower (%) | |
|---|---|---|---|---|---|
| 16 | 0 | 3.49 | 1.01 | 12.0 | 55.3 |
| 16 | 32 | 3.84 | 0.96 | 17.3 | 50.7 |
| 16 | 64 | 2.05 | 1.05 | 13.3 | 40.3 |
| 16 | 128 | 1.28 | 1.08 | 16.0 | 44.0 |
| 64 | 0 | 1.35 | 1.21 | 13.3 | 31.0 |
| 64 | 32 | 1.65 | 1.52 | 12.0 | 37.3 |
LLM Inference Scheduling
Large language model inference scheduling allocates requests, batches, compute, and KV-cache memory to balance latency, throughput, and service-level objectives.
See all 160 papers