ALPS: Activation-Based Length Prediction for Intelligent LLM Inference Scheduling
Description
We introduce ALPS (Activation-based Length Prediction for Scheduling), a method for predicting LLM generation length from prefill activations before any tokens are generated. Unlike existing approaches that require model fine-tuning or complex entropy-weighted pooling, ALPS uses a simple linear probe on the last-token activation at intermediate layers. We discover that generation length is encoded in prefill representations: a ridge regression probe achieves R² > 0.85 across three model families. Validation across Llama-3.1-8B, Gemma-2-9B, and Qwen-2.5-7B demonstrates: (1) intermediate layers generally perform well, with some architectural variation; (2) simple last-token extraction outperforms complex pooling strategies; (3) activations improve substantially over surface-feature baselines (24 percentage points over input length plus lexical features). The best models achieve R² = 0.943 (Gemma), R² = 0.880 (Llama), and R² = 0.857 (Qwen) with MAE of 38–80 tokens. All test prompts terminated naturally (100% EOS), eliminating truncation confounds. While our evaluation uses 200 curated prompts—sufficient for demonstrating the phenomenon but requiring broader validation—cross-validation confirms generalization beyond training data. ALPS enables practical applications including budget-constrained inference, request scheduling, and resource allocation. The probe adds negligible overhead (~16KB direction vector, single dot product), making ALPS practical for production deployment.
Files
alps.pdf
Files
(609.9 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:4812326b3517d4cc54c5f768b39bf65a
|
609.9 kB | Preview Download |
Additional details
Related works
- Is identical to
- Publication: https://research.google/pubs/alps-activation-based-length-prediction-for-intelligent-llm-inference-scheduling-2/ (URL)
Software
- Repository URL
- https://github.com/glenfmessenger/alps
- Development Status
- Active