用轻量偏移修正语言模型开头不准问题,跨领域切换快且无延迟。
A Better Start for Language Models: Domain-Conditional Position Offsets
- 在序列首位置加可学习偏移向量,冻结模型参数
- 8个模型上降低最多27%的困惑度,70B模型仍有效
- 适合需要快速校准早期输出的短文本任务
自回归语言模型在序列开头最不准确,因上下文不足而依赖通用预训练先验。我们发现这种冷启动损失具有领域依赖性,并提出一种领域条件位置偏移:仅在序列前几位置添加一个可学习向量,其余模型权重保持冻结。该偏移在约一百篇文档上训练几分钟即可完成,无需额外状态即可跨领域切换,且无明显延迟开销。在八种Mamba、GPT-NeoX和Llama模型(410M至8B参数)中,其将域内测试困惑度降低最多达27%;该效果在70B模型中依然存在,且单个位置即捕捉大部分收益。对比直接的对数概率偏置修正(最高仅降7.9%)与后期损失不变的情况,表明偏移通过模型状态传播而非仅调整输出先验。虽微调LoRA效果更优但需多出两到三个数量级参数及活跃低秩路径,软提示则增加序列长度。错误领域控制下,偏移仍能提升检索重排序与领域分类性能,尤其在依赖早期域内标记的决策中有效;而对于信号出现在后期的少样本推理任务,结果保持不变。位置感知的预填充应用有助于生成任务,而每步缓存解码时的盲目应用会导致重复。因此,该偏移并非最强适配器,而是用于短域内评分与校准的轻量、热切换工具。
原文摘要 · Abstract (English)
Autoregressive language models are least accurate at the beginning of a sequence, where little context forces reliance on a generic pretraining prior. We show that this cold-start penalty is domain dependent and reduce it with a domain-conditional position offset: a single learned vector added to the embedding activation at the first sequence positions while all model weights remain frozen. The offset trains in minutes on roughly one hundred documents, switches between domains without added sequence state, and has no measurable latency overhead. Across eight Mamba, GPT-NeoX, and Llama models spanning 410M to 8B parameters, it reduces held-out in-domain perplexity by up to 27%; the effect persists at 70B, and one position captures most of the benefit. A matched, converged direct logit-bias correction reaches at most only 7.9% and leaves later-token loss unchanged, showing that the offset propagates through model state rather than merely recalibrating the output prior. A tuned LoRA reaches lower perplexity but uses two to three orders of magnitude more parameters and an active low-rank weight path, while soft prompts add sequence positions. With wrong-domain controls, offsets improve retrieval reranking and domain classification when decisions depend on early in-domain tokens, For the few-shot reasoning whose signal occurs later, the results maintains unchanged. Position-aware prefill application also help generation tasks, whereas naive application at every cached decoding step causes repetition. The offset is therefore not the strongest adapter, but a lightweight, hot switchable tool for short in-domain scoring and calibration.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。