TL;DR
SKIM (Selective Knowledge-Informed Masking) is a novel compression framework that prunes and distills LLM agents by recognizing that not all tokens are created equal. By offloading syntactic formatting to runtime grammar constraints, SKIM reallocates a model's limited capacity toward critical decision-making tokens, maintaining high performance even at 50% sparsity where traditional methods collapse.
What Problem Does This Paper Address?
As LLM agents move into production, efficiency is paramount. However, standard pruning and distillation methods—designed for general-purpose chat—perform poorly on agentic tasks like tool-calling.
The authors identify a "structural mismatch": in production, agents often use structured generation (or constrained decoding), where a "formatter" (like XGrammar or SGLang) masks invalid tokens to ensure the output follows a strict schema (e.g., valid JSON). Traditional compression tries to preserve the model's ability to generate every token, including the brackets and commas that the formatter provides for free. This wastes precious parameters on "format" tokens, leaving insufficient capacity for the "decision" tokens (like function names and arguments) that actually determine the agent's success.
Methods
SKIM introduces a category-aware approach to both pruning and distillation, partitioned into three token roles:
- Context: Input tokens (tool descriptions, user queries).
- Decision: Output positions where the schema allows multiple valid choices (e.g., which tool to call).
- Format: Syntactic scaffolding where the schema allows only one valid token (e.g., the
{at the start of a JSON object).
Category-Aware Pruning
Standard pruning uses layer-wise reconstruction to see which weights can be removed with minimal impact on the output. SKIM modifies this by introducing position-aware saliency scores. It applies a weighted Hessian approximation that down-weights format positions ($\alpha_f = 0.2$) and prioritizes context and decision positions ($\alpha_c, \alpha_d = 1.0$). This ensures the pruning process preserves the neurons most critical for reasoning, not just those that happen to fire during repetitive syntax.
On-Policy Distillation
After pruning, SKIM "heals" the model using a specialized distillation objective. Instead of matching the teacher's distribution over the entire vocabulary, it uses a constrained-distribution objective that only aligns the student and teacher on valid tokens. It also employs on-policy rollouts, training the student on its own generated trajectories to ensure it can recover from its own mistakes during multi-step reasoning.
Datasets
The authors evaluated SKIM across multiple model scales (Qwen3.5 0.8B to 27B) using:
- Tool-calling benchmarks: BFCL-v3 and API-Bank L1.
- Agentic loops: HotpotQA (using a ReAct-style loop).
- General reasoning/coding: Spider (Text-to-SQL) and GSM8K.
- Calibration/Training: A subset of the xLAM-function-calling-60k dataset.
Key Insights and Ideas
- Format is "Free": In a constrained environment, the model doesn't need to "know" how to format JSON; the runtime enforces it. Pruning methods that don't account for this are essentially over-protecting redundant knowledge.
- The "Broken" Model Paradox: A SKIM-compressed model often looks "broken" during free-form generation (producing malformed JSON or loops) because it has sacrificed its formatting capacity. However, once placed behind a grammar formatter, it significantly outperforms models that tried to keep their formatting skills intact.
- Surgical Saliency: Ablation studies showed that removing "format-specialized" neurons barely impacts accuracy, while removing "decision-specialized" neurons causes total collapse.
Key Results
SKIM consistently outperformed strong baselines like Wanda-sp, FLAP, and SlimGPT, particularly in high-sparsity regimes.
- High Sparsity Resilience: At 50% sparsity, SKIM retained 68–85% of the dense model's accuracy, while baselines often saw their performance drop to near zero.
- Efficiency Gains: SKIM physically removes MLP channels and attention components. For a 27B model at 50% sparsity, this resulted in a 1.59x speedup in decoding throughput and a significant reduction in VRAM footprint (roughly 1.2 GiB saved for the 2B model).
- Cross-Model Generalization: The benefits held true not just for general-purpose models (Qwen) but also for tool-specialized models (Hammer2.1-3B).
Limitations and Future Work
- Scale: While tested up to 27B, the authors note that validation on much larger models (70B+) and different model families remains for future work.
- Distillation Data: The current distillation uses single-turn traces. The authors found that using multi-step agentic trajectories (trajectory-level healing) could further close the performance gap in complex tasks like HotpotQA.
- Methodological Scope: The current pruning stage uses layer-wise reconstruction; extending category-awareness to end-to-end pruning or calibration-based quantization is a promising next step.
Summary updated