arXiv:2410.14516cs.AIcs.CL2024-10ICLR被引 34

发现大模型内部有专门编码指令遵循能力的向量方向。

Do LLMs "know" internally when they follow instructions?

  • 在输入嵌入空间中找到预测指令遵循的专属方向。
  • 沿该方向调整可提升遵循率,且不降低回答质量。
  • 该方向更依赖提示语风格而非任务难度,适合优化提示工程。

指令遵循对构建大型语言模型(LLM)智能体至关重要,但模型常无法遵守简单清晰的指令。本文探究了LLM内部表征是否包含与指令遵循成功相关的信号——即“内部知晓”。研究发现,在输入嵌入空间中存在一个称为“指令遵循维度”的方向,能有效预测响应是否合规。该维度在未见过的任务上表现良好,但在不同指令类型间泛化性差。沿此方向修改表征可显著提升指令遵循成功率,优于随机扰动,且不影响输出质量。进一步分析表明,该维度更关联提示语表述方式,而非任务或指令本身的难度。本工作揭示了LLM指令遵循的内部机制,为构建可靠智能体提供新路径。

原文摘要 · Abstract (English)

Instruction-following is crucial for building AI agents with large language models (LLMs), as these models must adhere strictly to user-provided constraints and guidelines. However, LLMs often fail to follow even simple and clear instructions. To improve instruction-following behavior and prevent undesirable outputs, a deeper understanding of how LLMs' internal states relate to these outcomes is required. In this work, we investigate whether LLMs encode information in their representations that correlate with instruction-following success - a property we term knowing internally. Our analysis identifies a direction in the input embedding space, termed the instruction-following dimension, that predicts whether a response will comply with a given instruction. We find that this dimension generalizes well across unseen tasks but not across unseen instruction types. We demonstrate that modifying representations along this dimension improves instruction-following success rates compared to random changes, without compromising response quality. Further investigation reveals that this dimension is more closely related to the phrasing of prompts rather than the inherent difficulty of the task or instructions. This work provides insight into the internal workings of LLMs' instruction-following, paving the way for reliable LLM agents.

指令遵循模型内部机制嵌入空间

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。