作为X,做Y:角色和任务如何在指令微调LLM中结合
As X, Do Y: How Persona and Task Combine in Instruction-Tuned LLMs
AI总结:
本文研究指令微调LLM中角色提示的加性分解结构,发现角色和任务在残差流中通过部分正交方向贡献,但该结构不意味着提示可压缩,因为角色条件化行为依赖于分布式提示/KV机制。
摘要:
形式为“作为X,做Y”的角色提示在残差流的一个特定位置——提示到答案的过渡(最后一个提示标记与前两个生成标记)——在早期/中层波段表现出清晰的线性分解。在那里,角色和任务通过部分正交的加性方向贡献。形成纯角色效应Δ_X、纯任务效应Δ_Y,并将h_BB + Δ_X + Δ_Y替换干净残差,在Gemma-2-2B-IT和Qwen-2.5-{1.5B, 3B}-Instruct上,跨越12个单元格的短网格和48个单元格的长角色网格,下游输出与干净输出的KL散度很小,并保留了角色特定的行为标记。从这种加性结构自然推断,角色提示可以压缩为单个缓存的残差向量。我们证明它不能。将缓存的加性预测——甚至oracle干净残差h_XY——注入到移除了角色文本的基线宿主提示中,无论是在一个位置还是在多个层,都无法接近干净的长角色目标。角色条件化的多标记生成通过注意力流回整个提示中的角色文本位置,这是任何单个位置的残差无法复现的。残差流中的局部加性性并不意味着提示可压缩。提示到答案过渡处的加性结构支持可解释性和对角色或任务贡献的细粒度控制;整个延续中的角色条件化行为依赖于分布式的提示/KV机制,局部激活算术无法取代。
英文摘要:
Role prompts of the form As X, do Y admit a clean linear decomposition at one specific site in the residual stream: the prompt-to-answer transition -- the last prompt token together with the first two generated tokens -- in an early/mid layer band. There, persona and task contribute through partially orthogonal additive directions. Forming a pure persona effect $Δ_X$, a pure task effect $Δ_Y$, and substituting $h_{BB} + Δ_X + Δ_Y$ for the clean residual yields downstream output within a small KL of clean on Gemma-2-2B-IT and Qwen-2.5-\{1.5B, 3B\}-Instruct, across a 12-cell short grid and a 48-cell long-persona grid, with persona-specific behavioral markers preserved. The natural inference from this additive structure is that the role prompt can be compressed into a single cached residual vector. \emph{We show it cannot.} Injecting the cached additive prediction -- or even the oracle clean residual $h_{XY}$ -- into a baseline host prompt with the persona text removed does not approach the clean long-persona target, at one site or at many layers. Persona-conditioned multi-token generation flows through attention back to the persona-text positions throughout the prompt, which no residual at one site reproduces. Local additivity in the residual stream does not imply prompt compressibility. The additive structure at the prompt-to-answer transition supports interpretability and fine-grained steering of persona or task contributions; persona-conditioned behavior across the full continuation depends on a distributed prompt/KV mechanism that local activation arithmetic does not displace.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。