按年被提到
20222022 · 3 次2026
大模型与语言模型›大模型预训练与缩放·arXiv:2207.14255 · cs.CL

Efficient Training of Language Models to Fill in the Middle

高效训练语言模型填充中间内容
Mohammad Bavarian, Heewoo Jun, Nikolas Tezak, John Schulman, Christine McLeavey, Jerry Tworek, Mark Chen · 2022

把文档中段移到末尾训练,让自回归模型学会中间填充

开始阅读 ↗PDFalphaXiv 讨论
被推荐 · 4 人首次 2022-07-29 · 最近 2025-01-07
4不同的人
5活跃月份
5讨论串
107被引(OpenAlex)

证明只要对数据做一个简单变换,把文档中间的一段文字移到末尾,自回归语言模型就能学会填充文本,且对大比例数据做这种变换不会损害原有的从左到右生成能力(以困惑度和采样评估)。通过一系列消融实验给出变换频率、结构和填充片段选择方式等超参数的默认设置,并建议未来的自回归模型默认采用 FIM 训练。

HN 为什么提它

评论者把它作为代码模型利用光标之后上下文的训练方法来引用,称 FIM 是代码生成 LLM 的常见做法,且需要重新训练模型才能获得这一能力。

方法难度 3 / 5约 50 分钟经得起时间
读之前最好知道
1自回归语言模型(autoregressive LM)
2Transformer 架构
3代码补全
4预训练数据变换

HN 书评

推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及
推荐adt · 2023-03

“I wanted to point you towards OpenAI's FIM 6.9B as well.”

推荐留意 OpenAI 的 FIM 6.9B 模型
GPT-4 System Card [pdf]原评论 ↗
引用moyix · 2022-08

“Unfortunately, that capability will require retraining the models:”

引它说明要让模型利用光标之后的上下文,必须重新训练
FauxPilot – an attempt to build a locally hosted version of GitHub Copilot原评论 ↗
引用moyix · 2022-12

“It was also trained using fill-in-the middle [1].”

指出该模型也是用 fill-in-the-middle 训练的
SantaCoder: A new 1.1B code model for generation and infilling原评论 ↗
引用sunaookami · 2025-01

“FiM is a common approach for code generation LLMs.”

引它说明 FIM 是代码生成 LLM 的常见做法
How I program with LLMs原评论 ↗
被提交为 story · 1 次