针对复杂指令优化模型响应,测试时动态调整参数提升准确率
SLOT: Sample-specific Language Model Optimization at Test-time
- 测试时对每个输入样本轻量级优化,仅更新一个参数向量
- 在GSM8K上使Qwen2.5-7B准确率提升8.6个百分点至66.19%
- 适用于需要高精度指令遵循的场景,如数学推理与知识问答
我们提出SLOT(测试时样本特定语言模型优化),一种新型高效测试时推理方法,可提升语言模型对单个提示的精准响应能力。现有大语言模型在处理复杂指令时表现不佳,尤其当这些指令在训练数据中代表性不足时。SLOT在测试阶段执行少量优化步骤,更新一个轻量级的样本特定参数向量,该向量添加到输出头之前的最后一层隐藏状态中,并通过缓存每样本优化过程中的最后层特征实现高效适应。通过仅最小化输入提示上的交叉熵损失,SLOT使模型更好地对齐并遵循每个给定指令。实验表明,该方法在多个基准和大模型上均优于对比模型。例如,Qwen2.5-7B搭配SLOT在GSM8K上准确率从57.54%提升至66.19%,提升8.6%;DeepSeek-R1-Distill-Llama-70B搭配SLOT在GPQA上达到70B级模型中的最佳准确率68.69%。代码已开源。
原文摘要 · Abstract (English)
We propose SLOT (Sample-specific Language Model Optimization at Test-time), a novel and parameter-efficient test-time inference approach that enhances a language model's ability to more accurately respond to individual prompts. Existing Large Language Models (LLMs) often struggle with complex instructions, leading to poor performances on those not well represented among general samples. To address this, SLOT conducts few optimization steps at test-time to update a light-weight sample-specific parameter vector. It is added to the final hidden layer before the output head, and enables efficient adaptation by caching the last layer features during per-sample optimization. By minimizing the cross-entropy loss on the input prompt only, SLOT helps the model better aligned with and follow each given instruction. In experiments, we demonstrate that our method outperforms the compared models across multiple benchmarks and LLMs. For example, Qwen2.5-7B with SLOT achieves an accuracy gain of 8.6% on GSM8K from 57.54% to 66.19%, while DeepSeek-R1-Distill-Llama-70B with SLOT achieves a SOTA accuracy of 68.69% on GPQA among 70B-level models. Our code is available at https://github.com/maple-research-lab/SLOT.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。