Skip to main content
QUICK REVIEW

[论文解读] Tuning Language Models by Proxy

Alisa Liu, Xiaochuang Han|arXiv (Cornell University)|Jan 16, 2024
Topic ModelingComputer Science被引用 3
一句话总结

本文提出代理微调(proxy-tuning),一种轻量级推理时方法,通过使用一个小型微调模型作为代理,无需访问大语言模型(LLMs)的权重即可定制其行为。通过将代理模型微调前后输出的logit差异应用于基础模型,该方法在知识、推理和安全基准测试中实现了Llama2-70B与其直接微调的对话版本之间性能差距的88%,同时比直接微调更好地保留了事实知识。

ABSTRACT

Despite the general capabilities of large pretrained language models, they consistently benefit from further adaptation to better achieve desired behaviors. However, tuning these models has become increasingly resource-intensive, or impossible when model weights are private. We introduce proxy-tuning, a lightweight decoding-time algorithm that operates on top of black-box LMs to achieve the same end as direct tuning, but by accessing only its predictions over the output vocabulary, not its parameters. Our method tunes a smaller LM, then applies the difference between the predictions of the small tuned and untuned LMs to shift the original predictions of the larger untuned model in the direction of tuning, while retaining the benefits of larger-scale pretraining. In experiments, when we apply proxy-tuning to Llama2-70B using proxies of only 7B size, we can close 88% of the gap between Llama2-70B and its truly-tuned chat version, when evaluated across knowledge, reasoning, and safety benchmarks. We then demonstrate the generality of proxy-tuning by applying it to domain adaptation on code, and task-specific finetuning on question-answering and math problems. Finally, we show how to proxy-tune a truly black-box LM, GPT-3.5, for temporal adaptation, increasing its knowledge about recent events. Our work demonstrates the promise of using small tuned LMs to efficiently customize large, potentially proprietary LMs through decoding-time guidance.

研究动机与目标

  • 为解决因权重访问受限而无法微调的大型、可能专有的语言模型的定制化挑战。
  • 开发一种高效适应大型预训练模型至期望行为的方法,且计算资源消耗极低。
  • 在实现指令遵循、领域适应和任务特定微调的同时,保留大型模型的事实知识和通用能力。
  • 证明通过小型代理模型在推理时提供引导,可在知识保留和性能方面优于直接微调。

提出的方法

  • 代理微调使用一个更小的、经过微调的语言模型(即“专家”)及其未微调的对应模型(即“反专家”)来生成logit差异向量。
  • 该差异向量被用作可学习偏置,应用于推理过程中大基础模型的logits,以引导其输出朝向期望行为。
  • 该方法完全在推理时运行,无需更新基础模型的权重或超参数。
  • 该方法具有通用性,可应用于指令微调、领域适应(如代码)以及任务特定微调(如数学、问答)。
  • 可选的运行时控制参数允许用户调节引导强度,从而在不同生成属性之间实现权衡。
  • 该方法仅依赖于基础模型的输出概率分布(logits),因此适用于黑箱模型。
Figure 1: Proxy-tuning “tunes” a large pretrained model without accessing its internal weights, by steering it using an “expert” (a small tuned model) and its corresponding “anti-expert” (the small model, untuned). The difference between the predicted logits of the expert and the anti-expert is appl
Figure 1: Proxy-tuning “tunes” a large pretrained model without accessing its internal weights, by steering it using an “expert” (a small tuned model) and its corresponding “anti-expert” (the small model, untuned). The difference between the predicted logits of the expert and the anti-expert is appl

实验结果

研究问题

  • RQ1一个小型微调语言模型能否有效引导一个更大、未微调的语言模型,在下游任务上实现可比性能?
  • RQ2通过代理模型在推理时进行引导,是否比直接微调大模型更能保留事实知识?
  • RQ3代理微调在多大程度上可以缩小大基础模型与其直接微调版本之间的性能差距?
  • RQ4代理微调能否有效应用于多样化适应任务,包括指令遵循、特定领域适应和任务特定微调?
  • RQ5代理微调的影响在token层面如何体现,特别是在推理和风格化生成中?

主要发现

  • 在知识、推理和安全基准测试中,代理微调实现了Llama2-70B与其直接微调对话版本之间性能差距的88%。
  • 在TruthfulQA测试中,代理微调模型比直接微调模型更具真实性,表明其更好地保留了事实知识。
  • 在指令微调任务中,代理微调使Llama2-13B模型弥补了其直接微调版本之间91%的性能差距。
  • 在代码领域适应中,使用CodeLlama-7B作为代理,代理微调使Llama2-13B在代码基准测试中提升了17%–32%。
  • 在问答和数学任务特定微调中,代理微调的Llama2-70B模型相比未微调的70B模型实现了31%的绝对性能提升,相比微调的7B专家模型也提升了11%。
  • 代理微调显著影响了推理和风格化token(如数学问题的中间步骤),而对最终答案影响较小,表明其更倾向于塑造生成风格而非知识本身。
Figure 2: The percentage of responses to TruthfulQA which are informative or true, when varying $\alpha$ in $s_{\mathcal{M}}+\alpha(s_{\mathcal{M^{+}}}-s_{\mathcal{M^{-}}})$ . We observe that $\alpha$ smoothly trades off between these two metrics.
Figure 2: The percentage of responses to TruthfulQA which are informative or true, when varying $\alpha$ in $s_{\mathcal{M}}+\alpha(s_{\mathcal{M^{+}}}-s_{\mathcal{M^{-}}})$ . We observe that $\alpha$ smoothly trades off between these two metrics.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。