LatentSkill: From In-Context Textual Skills to In-Weight Latent Skills for LLM Agents

Aofan Yu, Chenyu Zhou, Tianyi Xu, Zihan Guo, Rong Shan +6 more
6/4/2026
14 citations
cs.CLcs.AI
lora-peft-merging

No official code found. Best implementation: yuaofan0-oss/LatentSkill (40 stars).

Abstract

Agent systems increasingly use textual skills to encode reusable task procedures, but injecting these skills into the prompt at every step incurs substantial context overhead and exposes skill content as plaintext. We present LatentSkill, a framework that converts textual skills into plug-and-play LoRA adapters through a pretrained hypernetwork.

Show full abstract

LatentSkill stores skill knowledge in weight space rather than context space, removing per-step skill tokens while preserving modular loading, scaling, and composition. On ALFWorld and Search-QA, LatentSkill outperforms the corresponding in-context skill baseline while using substantially fewer prefill tokens: it improves ALFWorld success by 21.4 and 13.4 points on the seen and unseen splits with 63.9% fewer prefill tokens on average, and improves Search-QA exact match by 3.0 points while using 71.8% fewer tokens per step. Further analysis shows that generated skill LoRAs form a structured semantic geometry, can be continuously modulated via the LoRA scaling coefficient, and can be composed through parameter-space arithmetic when skill components are aligned. These findings suggest that weight-space skills provide an efficient, modular, and less exposed substrate for extending LLM agents.

View on arXivView PDF

Code Implementations(1)

LatentSkill: From In-Context Textual Skills to In-Weight Latent Skills for LLM Agents

406

Similar Papers

Cite this paper

@article{yu2026latentskill,
  title  = {LatentSkill: From In-Context Textual Skills to In-Weight Latent Skills for LLM Agents},
  author = {Aofan Yu and Chenyu Zhou and Tianyi Xu and Zihan Guo and Rong Shan and Zhihui Fu and Jun Wang and Weiwen Liu and Yong Yu and Weinan Zhang and Jianghao Lin},
  year   = {2026},
  eprint = {2606.06087},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.06087v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.06087.svg)](https://codeofpaper.com/paper/2606.06087)

Discussion