SkillsInjector: Dynamic Skill Context Construction for LLM Agents

agent 2605.29794
skill-injectioncontext-constructionpreference-learningadaptive-budgetingknowledge-distillationtool-use

SkillsInjector: Dynamic Skill Context Construction for LLM Agents #

§1 TL;DR #

SkillsInjector reframes skill injection as per-task context construction: a preference-trained planner admits an adaptive skill set by execution-grounded utility, then a curriculum-distilled 8B renderer adapts descriptions relative to co-selected neighbors — +5.1 pp avg over best baseline across tau2-bench, SkillsBench, ALFWorld.

§2 痛点 / 方法 / 结果 #

Q1 — 痛点 #

LLM agents rely on skill libraries to extend their capabilities, but scaling the injected skill set degrades rather than helps. Full-library injection collapses pass rate to 24.8% — worse than the 40.2% no-skill baseline. Three factors drive this: (1) existing methods treat skill injection as static retrieval with a fixed budget, (2) each skill description is passed unchanged regardless of what else is co-injected, and (3) surface-similar skills can have opposite execution-grounded effects (a skill sharing the "insurance" keyword with the user query yields $\Delta = -0.20$).

Figure 1: Scaling bottleneck — static all-injection collapses while SkillsInjector remains stable

Paper Figure 1: Scaling the candidate skill pool on tau2-bench. Static all-injection (red) collapses as pool grows; SkillsInjector (blue) remains stable.

The degradation is monotonic for static injection: every additional skill pushes pass rate further down. The widening gap with pool size confirms the problem is structural — retrieval quality alone cannot compensate.

Q2 — 方法 #

SkillsInjector decomposes skill injection into two coordinated stages:

  1. Context Planner: A lightweight MLP over a frozen 0.6B embedding encoder scores each candidate skill by learned execution-grounded utility $\Delta(t,s)$. Scores are normalized per-task; a per-domain threshold $\tau^\star_d$ admits an adaptive number of skills (zero when none clears threshold, many when the task demands it). Training uses dual-loss supervision: KL alignment against a benefit-derived soft target distribution (Eq. 3) plus pairwise preference loss on hard negatives (Eq. 4).
    1. Set-Aware Renderer: A Qwen3-8B model, distilled from a 235B teacher via a two-epoch Bernoulli curriculum (trace-rich → trace-free), rewrites each selected skill's description conditioned on the task and co-selected neighbor descriptions. The renderer clarifies role boundaries, appends scope clauses, and reduces overlap among similar skills. Skill bodies pass through unchanged; renderer is bypassed when $|\mathcal{C}^*_t| \leq 1$.
    2. 核心技术壁垒: The execution-grounded supervision signal $\Delta(t,s)$ — computing the per-skill, per-task benefit requires running every candidate individually against every training task with multiple seeds. This creates a combinatorial data-generation cost ($N_{\text{skills}} \times M_{\text{tasks}} \times K_{\text{seeds}}$ agent rollouts) that dominates training expense and is the bottleneck for replicating or extending the method to new domains.

      Q3 — 结果 #

      BenchmarkBest baselineSkillsInjectorΔ
      tau2-airline56.1 (Graph of Skills)60.0+3.9
      tau2-retail60.0 (Graph of Skills)61.4+1.4
      tau2-telecom62.8 (SkillRouter)67.0+4.2
      SkillsBench16.5 (SkillRouter)22.6+6.1
      ALFWorld75.4 (Graph of Skills)82.7+7.3
      Average53.658.7+5.1

      Ablation confirms each component is necessary: removing the planner costs the most (−12.8 to −14.5 pp on tau2), removing adaptive budget costs 4.9–10.9 pp, removing the renderer inflates interaction cost by 6.1–8.2 messages per task.

      §3 架构 / 方法图 #

      Figure 2: SkillsInjector pipeline

      Paper Figure 2: SkillsInjector pipeline. The planner learns execution-grounded skill utility; the renderer adapts selected descriptions with co-injected skill awareness. At inference, the trained components select an adaptive skill set and inject the rendered context into a frozen agent.

      The pipeline separates fast embedding-space scoring (planner) from text-space adaptation (renderer). The frozen agent never sees the planner or renderer — it receives only the rendered skill context as part of its prompt.

      flowchart LR T["Task t"] --> ENC["Frozen Encoder\n(0.6B)"] S["Skill Library S"] --> ENC ENC --> MLP["MLP Scorer\nf_θ(t,s)"] MLP --> THR["Threshold τ*_d"] THR -->|"Adaptive C*_t"| REN["Set-Aware Renderer\nR_φ (8B)"] T --> REN REN -->|"Rendered C̃*_t"| AGT["Frozen Agent\n(235B)"] AGT --> ENV["Environment ε"]

      The Mermaid diagram highlights two properties: (1) the task representation feeds both the planner and renderer, and (2) the threshold gate is the sole budget mechanism — there is no top-K selection.

      Agent loop context: SkillsInjector operates as a preprocessing step before the agent loop begins. The agent follows a standard multi-turn tool-calling pattern (observe → act → verify) with no modification. Skill context is injected once into the system prompt; the agent is frozen and unaware of the injection mechanism. Interaction pattern: multi-turn dialogue with tool use; autonomy: fully autonomous within each episode.

      Memory model: Short-term only (context window). No long-term memory or episodic trajectory logging at inference. During planner training, execution traces serve as $\Delta$ label sources but are discarded at inference.

      Planning style: The agent backbone uses ReAct-style think-then-act loops. SkillsInjector's contribution is orthogonal — it controls what the agent reads, not how it reasons. No backtracking or branch revisiting; budget is bounded by environment step limits (50 steps for tau2-bench, 30 rounds for ALFWorld).

      §4 作者证明 #

      符号表 #

      SymbolDefinitionFirst appears
      $t$Task drawn from distribution $\mathcal{D}$Eq. 1
      $\mathcal{S} = \{s_1, \ldots, s_N\}$Skill library; each $s_i = (d_i, b_i)$§3
      $\mathcal{E}$Task execution environmentEq. 1
      $\pi_\theta$Frozen agent policyEq. 1
      $r(\tau) \in \{0,1\}$Binary task success indicatorEq. 1
      $\tilde{\mathcal{C}}$Injected skill contextEq. 1
      $\mathcal{U}(t, \tilde{\mathcal{C}})$Execution-grounded utilityEq. 1
      $\Delta(t,s)$Per-skill execution-grounded benefit§3
      $q_\Delta(s \mid t)$Benefit-derived soft target distributionEq. 2
      $p_\theta(s \mid t)$Scorer-induced distributionEq. 3
      $\beta, \gamma$Temperatures for target / scorer distributionsEq. 2–3
      $\lambda$Pairwise loss weight ($= 0.3$)§4.1
      $\tau^\star_d$Per-domain admission thresholdEq. 5
      $R_\phi$Set-aware renderer modelEq. 6
      $D_0, D_1, D_2$Original / cleaned / set-aware description targetsEq. 6

      方程物理意义 #

      Eq. 1 — $\mathcal{U}(t, \tilde{\mathcal{C}}) = \mathbb{E}_{\tau \sim \pi_\theta}[r(\tau)]$: Measures a skill context by downstream execution outcome, not by surface similarity. This is the foundational departure from retrieval-based methods — the optimization target is task success, not relevance.

      Eq. 2 — $q_\Delta(s \mid t)$: Converts raw per-skill benefit scores into a soft probability distribution via temperature-scaled softmax. Creates a differentiable learning target from discrete rollout outcomes.

      Eq. 3 — $\mathcal{L}_{\text{align}} = \text{KL}(q_\Delta \| p_\theta)$: Pulls the scorer's distribution toward the benefit distribution, shaping the global ranking across the full candidate set.

      Eq. 4 — $\mathcal{L}_{\text{pref}}$: Odds-ratio pairwise loss on hard negatives. Sharpens local contrasts between semantically similar skills that the global alignment loss averages out. Needs no reference policy.

      Eq. 5 — $\mathcal{C}^*_t = \{s : \tilde{f}_\theta(t,s) \geq \tau^\star_d\}$: Budget emerges from the task — when no skill clears the threshold, none are injected; this is the mechanism that prevents full-library degradation.

      Eq. 6 — $\mathcal{L}_{\text{rend}}$: Cross-entropy distillation from 235B teacher to 8B student, with curriculum mixing trace-rich ($\rho_1 = 0.1$) and trace-free ($\rho_2 = 0.9$) inputs across two epochs.

      6 项检查 #

      1. 量纲一致性: $\mathcal{U} \in [0,1]$ (expectation over binary $r$); $\Delta \in [-1,1]$; $y(t,s) \in [0,1]$ after bounding — all consistently bounded. ✓
      2. 边界条件: $B_t = 0$ when no skill clears $\tau^\star_d$ (→ no-skill); $B_t = |\mathcal{S}_c|$ when all clear (→ full-library). Both extremes collapse to baselines, verified in Fig. 4. ✓
      3. 梯度可通性: $\mathcal{L}_{\text{align}}$ (KL) and $\mathcal{L}_{\text{pref}}$ (logistic) both differentiable w.r.t. scorer parameters. Threshold $\tau^\star_d$ selected by dev-set grid search (non-differentiable but not back-propagated through). ✓
      4. 训练-推理一致性: $\Delta$ labels require multi-seed rollouts (training only); inference uses only the trained scorer and renderer. Curriculum explicitly bridges trace-available training ↔ trace-free inference for the renderer. ✓
      5. 消融独立性: Table 2 ablates planner, renderer, and adaptive budget each independently. Cross-interaction between planner and renderer not isolated (they always co-occur except in the w/o variants). ⚠ partial
      6. 统计置信度: 5 seeds per (method, task) pair. Standard deviations in Fig. 4 whiskers. Main table reports means without confidence intervals. ⚠ partial
      7. 无形式化收敛保证: No formal convergence or sample-complexity bound provided. The execution-grounded utility framework defines the objective but does not prove convergence of dual-loss training or characterize the minimum rollouts needed for reliable $\Delta$ estimation. All validation is empirical. A bound could characterize the number of rollouts per (task, skill) pair needed for $\Delta$ to converge within $\epsilon$ — the authors acknowledge this implicitly by noting the method is supervision-bottlenecked.

        §5 实验与数据 #

        主结果 #

        Table 1: Main results across all benchmarks

        Paper Table 1: Task pass rates (%) across tau2-bench (3 domains), SkillsBench, and ALFWorld. SkillsInjector attains the best score in every column.

        SkillsInjector achieves 58.7% average, 5.1 pp above Graph of Skills (53.6%). The gap is widest on ALFWorld (+7.3 pp) where skills were LLM-distilled rather than human-curated, suggesting the method handles noisier libraries well. Full-library injection is catastrophic: 24.8% average, 15.4 pp worse than the no-skill baseline.

        组件消融 #

        Table 2: Component ablation on tau2-bench

        Paper Table 2: Component ablation — pass rate (↑) and average messages per task $\bar{M}$ (↓) on tau2-bench domains.

        The planner is the dominant lever: removing it produces the largest pass-rate drop on every domain (−12.8 pp airline, −10.0 pp retail, −14.5 pp telecom). Removing the renderer has a smaller pass-rate effect but inflates $\bar{M}$ by 6.1–8.2 messages, showing the renderer's primary role is reducing interaction cost rather than improving selection.

        自适应预算分布 #

        Figure 3: Adaptive budget distribution per domain

        Paper Figure 3: Histogram of per-task selected budget $B_t$ across tau2-bench domains.

        The budget distribution exhibits a consistent three-part structure across all domains: a left mode (tasks rejecting nearly all skills), a broad middle band, and a right spike at $B_{\max}$. This confirms that tasks intrinsically differ in how much skill context they can exploit — a fixed budget would over-inject for left-mode tasks and under-inject for right-spike tasks.

        逐技能异质性 #

        Figure 5: Per-skill effects on pass rate and interaction cost

        Paper Figure 5: Each point is one skill, plotted by its change in pass rate and agent messages against the no-skill baseline. One panel per tau2-bench domain.

        Skills are heterogeneous along both axes. A long tail actively reduces pass rate even when topically relevant; many useful skills simultaneously raise the message budget. The upper-left quadrant (high pass rate, low messages) is sparse, confirming that the planner must select on predicted execution utility — not surface similarity — to land in this region.

        渲染器消融 #

        The curriculum-trained 8B renderer matches or exceeds the 235B teacher on retail (61.4 vs 60.5) at a fraction of the compute. Prompt-only 8B drops below the no-render baseline on all three domains, demonstrating that set-aware adaptation must be trained. Single-regime distillation (trace-rich only or trace-free only) helps but is insufficient — the Bernoulli curriculum that mixes both regimes is necessary for full performance.

        规划器消融 #

        Both loss terms are necessary: removing $\mathcal{L}_{\text{align}}$ or $\mathcal{L}_{\text{pref}}$ lowers pass rate on every domain. Encoder scaling from 0.6B to 8B yields negligible gain ($\leq 1.9$ pp on any domain), indicating the planner is supervision-bottlenecked (quality/quantity of $\Delta$ labels) rather than representation-bottlenecked.

        §6 论证链 #

        StepClaimEvidenceStrength
        1Static skill injection degrades performance as pool size growsFig. 1: full-library → 24.8% vs 40.2% no-skill; Table 1: full-library worst in every columnStrong — 15.4 pp average drop across 5 settings
        2Execution-grounded utility is a better ranking signal than surface similarityTable 1: SkillsInjector (+5.1 pp) > all retrieval baselines; case study: insurance distractor ($\Delta = -0.20$) rejected despite keyword matchStrong — consistent across 3 benchmarks
        3Adaptive budgeting outperforms fixed top-KTable 2: w/o adaptive budget loses 4.9–10.9 pp; Fig. 4: both extremes collapse to baselines; Fig. 3: per-task budget genuinely variesStrong — ablation isolates budget contribution
        4Set-aware rendering reduces interaction cost and improves pass rateTable 2: w/o renderer inflates $\bar{M}$ by 6.1–8.2; Table 4: prompt-only 8B < no-renderStrong — rendering must be trained; interaction cost is primary beneficiary
        5Curriculum distillation transfers teacher capability to small modelTable 4: 8B curriculum ≈ 235B teacher on pass rate; mixed-regime training > single-regimeModerate — retail exceeds teacher, airline/telecom slightly below; no formal distillation bound

        §7 实现 cross-reference #

        [实现未公开] — 论文未公开代码仓库。

        核心技术壁垒 #

        The execution-grounded supervision signal $\Delta(t,s)$ is the single hardest-to-replicate component. For tau2-bench airline alone, computing $\Delta$ requires $82 \times 50 \times 5 = 20{,}500$ agent rollouts (82 skills × 50 tasks × 5 seeds), each involving multi-turn interaction with a 235B model. The paper reports ~240 H200 GPU-hours total for all experiments, dominated by benchmark inference. Extending the method to a new domain requires repeating this data-generation step from scratch — the planner's learned representations do not transfer across domains (separate $\tau^\star_d$ per domain).

        关键实现细节 #

        1. Bernoulli curriculum schedule: The renderer's two training epochs use per-sample Bernoulli mixing ($\rho_1 = 0.1$ first epoch, $\rho_2 = 0.9$ second epoch) rather than a hard switch between trace-rich and trace-free regimes. This avoids a learning-rate reset and ensures neither epoch contains only one regime, smoothing the train→inference distribution gap.
          1. Hard negative selection for $\mathcal{L}_{\text{pref}}$: Negatives are drawn from candidates semantically closest to a preferred skill but with lower $\Delta$ — not random negatives. This specifically targets the failure mode where surface similarity misleads the planner (e.g., the insurance-keyword distractor with $\Delta = -0.20$ vs useful policy-reference skills with $\Delta = +0.40$).