skillfed

Compiling skills into LoRA weights beats prompting them in-context by up to 21 points, on 64% fewer prefill tokens

Notes on LatentSkill: From In-Context Textual Skills to In-Weight Latent Skills for LLM Agents (arXiv:2606.06087) — Ao Yu, Chenyue Zhou, Tianyi Xu, Zihan Guo, Rong Shan, Zhihui Fu, Jun Wang, Weiwen Liu, Yong Yu, Weinan Zhang, Jianghao Lin · June 2026

Note published · written by SkillFed’s research pipeline from the paper above · how these notes are made

AI-assisted notes · reviewed by SkillFed Skill evolution

LatentSkill replaces the standard approach of stuffing a skill's text into the prompt at every decision step with a hypernetwork that compiles the skill document directly into weights. Given the skill's text, the hypernetwork runs one forward pass and emits a skill-specific LoRA adapter — a low-rank update mounted onto a frozen Qwen3-8B backbone — so the model conditions on task history alone, with no per-step skill tokens sitting in context. It's pretrained on 171,000 deduplicated GitHub skill documents (roughly 300 million tokens), then fine-tuned with trajectory-supervised learning against teacher agent runs on ALFWorld and a multi-dataset Search-QA suite. Every result is measured against two baselines: a vanilla agent with no skill access, and an in-context skill agent that inserts the identical skill text into the prompt at each step.

On ALFWorld, LatentSkill reaches 74.3% success on seen tasks and 69.4% on unseen ones — beating the in-context baseline's 52.9% and 56.0% by 21.4 and 13.4 points — while cutting prefill tokens by 64.1% (0.44k vs. 1.21k). On Search-QA, exact match climbs to 35.6% against the baseline's 32.6%, a 3.0-point gain running on 72.2% fewer skill tokens per step. The generated adapters aren't just smaller, they're structured. LoRAs for related skills cluster tightly in weight space by domain. Turn up the adapter's injection coefficient and behavior scales smoothly, then collapses once it passes an optimum. And when a skill's textual decomposition matches the granularity of its weight update, skills combine through parameter-space arithmetic — pushing one compositional task from 61.5% to 84.6% success. Under adversarial prompt manipulation the gap widens further: a prompt injection hijack attack collapses the in-context baseline to 8.57% success while LatentSkill holds at 38.6%.

Key numbers

ALFWorld success, LatentSkill vs. in-context skill (seen/unseen)74.3%/69.4% vs. 52.9%/56.0% (+21.4/+13.4 pts)
ALFWorld prefill-token reduction64.1% fewer tokens (0.44k vs. 1.21k)
Search-QA exact match, LatentSkill vs. in-context skill35.6% vs. 32.6% (+3.0 pts), 72.2% fewer tokens
Aligned component-merged composition vs. single skill (seen split)84.6% vs. 61.5% success
Success under prompt-injection hijack attack, in-context vs. LatentSkill8.57% vs. 38.6%

Skills related to this research

Related notes

References

  1. Yu, A., Zhou, C., Xu, T., Guo, Z., Shan, R., Fu, Z., Wang, J., Liu, W., Yu, Y., Zhang, W., & Lin, J. (2026). LatentSkill: From In-Context Textual Skills to In-Weight Latent Skills for LLM Agents. arXiv:2606.06087.
  2. Hu, E. J., et al. (2021). LoRA: Low-Rank Adaptation of Large Language Models. arXiv:2106.09685.
  3. Charakorn, R., Cetin, E., Tang, Y., & Lange, R. T. (2025). Text-to-LoRA: Instant Transformer Adaption. arXiv:2506.06105.
  4. Shridhar, M., Yuan, X., Côté, M., et al. (2021). ALFWorld: Aligning Text and Embodied Environments for Interactive Learning. arXiv:2010.03768.
  5. Yao, S., Zhao, J., Yu, D., et al. (2023). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv:2210.03629.