【4.10】
4.10 每日一篇 | 外刊精读
Machine learning:AI boot camp
New techniques are speeding up how large language models are trained
【1 】It is no secret that building a large language model (LLM) requires vast
amounts of data. In conventional training, an LLM is fed mountains of text,
and encouraged to guess each word before it appears. With each prediction, the
LLM makes small adjustments to improve its chances of guessing right. The end
result is something that has a certain statistical “understanding” of what
is proper language and what isn’t.
【2 】But an LLM that has only undergone this so-called “pretraining” is not yet
particularly useful. When asked for a joke to cheer your correspondent up, for
instance, the pretrained model GPT-2 just repeated the question back three times.
When asked who the American president was, it responded: “The answer is no. The
president is not the president.” Clearly, teaching an LLM to do what humans want
requires something more.
Panda Foreign Magazine Intensive Reading:Respect for Originality, Piracy Must Be
Punished
【
3
】
One way to align such models with users’ expectations is
through reinforcement learning from human feedback (RLHF). OpenAI, an
American startup, introduced this technique in a preprint published in March 2022.
It was a major ingredient in its recipe for ChatGPT, which was released eight
months later.
【4 】RLHF normally involves three steps. First, human volunteers are asked to
choose which of two potential LLM responses might better fit a given prompt. This
is then repeated many thousands of times over. This data set is then used to train a
second LLM to, in effect, stand in for the human being. This so-called reward model,
designed to assign higher scores to responses a human would like, and lower scores
to everything else, is then used to train the original LLM. As a final touch, a machine-
learning technique called reinforcement learning tweaks the knobs and levers of the
original LLM to help reinforce the behaviours that earn it a reward.
【5】This way of doing RLHF is quite involved—using two separate LLMs takes
time and money, and the algorithm used for reinforcement learning is,
to quote Rafael Rafailov at Stanford University, “quite painful”. This has meant that,
outside of OpenAI, Google and their rivals, nobody has really exploited its
full potential.
Panda Foreign Magazine Intensive Reading:Respect for Originality, Piracy Must Be
Punished
【6 】It now turns out that the same results can be achieved for a fraction of the
effort. Dr Rafailov and his colleagues, including Archit Sharma and Eric Mitchell,
presented this alternative in December 2023 at Neurips, an AI conference. Their
method, Direct Preference Optimisation (DPO), relies on a satisfying mathematical
trick.
【7 】This trick hinges on the observation that for every reward model there is
a specific theoretical LLM that would get full marks, and every LLM likewise has
a theoretical reward model that would give it flying colours. (Just as,
more prosaically, every pair of trousers has a theoretical person on whom they
would sit perfectly, and every person has a theoretical pair of trousers that would
best fit.) This observation that each LLM conceals an implicit reward model allowed
the researchers to tinker with this model directly. In the old regime, the LLM learned
from the reward model, which learned from the data. Now, the LLM can learn directly
from the data.
【8】According to the authors, removing the middleman makes DPO between three
and six times more efficient than RLHF, and capable of better performance at tasks
such as text summarisation. Its ease of use is already allowing
smaller companies to tackle the problem of alignment, says Dr Sharma. A year ago
only a few world-leading models, such as Google’s Gemini and OpenAI’s GPT-4,
could afford to use RLHF. But as of March 12th eight out of the ten highest-ranked
LLMs on an industry leader-board used DPO. Mistral, the
French startup seeking to rival OpenAI, uses it. Meta, a social-media giant,
has integrated it into a home-grown LLM.
【9】Further improvements are sure to come. For one thing, the consensus view is
that the big AI labs have made improvements to their proprietary algorithms since
they stopped publishing details in 2022. But the problem of getting an LLM to do
what a human would want and expect is far from done and dusted. After all, even
other humans occasionally struggle.
①短语
1.原文:New techniques are speeding up how large language models are trained
词典:speed up 加速,加快工作
例句:This system helps speed up access times.
这个系统有助于加快读取数据的时间。
2.原文:In conventional training, an LLM is fed mountains of text, and encouraged to guess each
word before it appears.
词典:be encouraged to 被鼓励去做某事
例句:All children should be encouraged to realize their full potential.
应当鼓励所有的儿童充分发挥他们的潜能。
3.原文:When asked for a joke to cheer your correspondent up
词典:cheer up 使高兴起来,振作起来,使更加愉快
例句:Bright curtains can cheer up a dull room.
色彩鲜艳的窗帘可以让单调的房间变得亮丽起来。
4.原文:for instance, the pretrained model GPT-2 just repeated the question back three
times
词典:for instance 例如
例句:Malcolm, for instance, works in isolation but I have no doubts about his abilities.
例如,马尔科姆虽然一个人独立工作,但我丝毫不怀疑他的能力。
5.原文:One way to align such models with users’ expectations is through reinforcement
learning from human feedback (RLHF).
词典:align with 与某人或组织达成一致,与他们合作或支持他们的想法
例句:When war broke out, they aligned themselves with the rebel forces.
战争爆发以后,他们与叛军结了盟。
6.原文:This data set is then used to train a second LLM to, in effect, stand in for the
human being.
词典:stand in for 代替,充当替身或替代品
例句:I had to stand in for her on Tuesday when she didn't show up.
星期二那天她没露面,我只好代替她。
7.原文:It now turns out that the same results can be achieved for a fraction of the
effort.
词典:turn out 结果是,证明是
例句:This may turn out to be the best football game of the lot.
这可能会是全部足球比赛中最棒的一场。
8.原文:and every LLM likewise has a theoretical reward model that would give it flying
colours
词典:flying colours 取得巨大成功
例句:She passed the exam with flying colours.
她以优异成绩通过了考试。
9.原文:This trick hinges on the observation that for every reward model
词典:hinge on 取决于
例句:Does not success or failure hinge on this?
成败之机,其在斯乎?
10.原文:But the problem of getting an LLM to do what a human would want and
expect is far from done and dusted.
词典:far from 远离,远非
例句:Computers, far from destroying jobs, can create employment.
计算机远非破坏就业,而是能创造就业。
11.But the problem of getting an LLM to do what a human would want and expect is far
from done and dusted.
词典:done and dusted 彻底完成
例句:That's my article for the magazine done and dusted.
这就是我为该杂志写的文章,已经脱稿。
②长难句
原文: This so-called reward model, designed to assign higher scores to responses a
human would like, and lower scores to everything else, is then used to train the original
LLM.
分析:这个句子当中,句子的主语是This so-called reward model,is used 是谓语,宾语是
to train the original LLM,designed to assign higher scores to responses a human would
like, and lower scores to everything else 是过去分词做后置定语,修饰限定主语This so-
called reward model;在这个定语成分当中, assign ...to...表示“将...分配给”,a human
would like 是responses 的定语,and lower scores to everything else 是省略句,省略了
assign。
译文:这个所谓的奖励机制旨在为人类倾向的答案打更高的分数,而对其他答案则打较低
的分数,以此用它来训练原始的语言模型。
原文:This trick hinges on the observation that for every reward model there is a specific
theoretical LLM that would get full marks, and every LLM likewise has a theoretical reward
model that would give it flying colours.
分析:句子的主语是This trick,hinges on 是谓语,the observation 是宾语;that 是the
observation 的同位语从句,在从句中,使用了there be 句型,that 引导定语从句,修饰限定
a specific theoretical LLM,and 连接同位语从句中的前后两个句子,后面的句子中,every
LLM likewise 是主语,has 是谓语,a theoretical reward model 是宾语,that 引导定语从句,
修饰限定a theoretical reward model。
译文:这个策略的精髓在于,观察发现,对于任何一个奖励模型,理论上都存在一个能够
获得满分的语言模型,反之亦然,每一个大型语言模型也都有一个在理论上能给予其优异
评价的奖励模型。
③写作技巧
It is no secret that building a large language model (LLM) requires vast amounts of data.
众所周知,搭建一个大型语言模型(LLM)需要海量数据。
写作解析:
“It is no secret that...”是一种常用的表达方式,用来引出一个被广泛认知的事实或观
点,强调这个事实或观点是公开的,不是秘密的。可以使用一些同义句型来进行替换处
理,比如,It is widely known that.../It is common knowledge that.../There is no denying
that.../It is commonly accepted that.../It is well-established that.../It is universally recognized
that.../It is widely acknowledged that...等等。
例句:
It is common knowledge that the Earth revolves around the Sun.
众所周知,地球围绕太阳运转。
There is no denying that climate change is a significant global challenge.
毫无疑问,气候变化是一个重要的全球性挑战。
It is well-established that smoking is harmful to health.
这是一个经过充分证实的事实,吸烟对健康有害。
It is widely acknowledged that regular exercise is important for maintaining good health.
众所周知,经常锻炼对于保持健康很重要。
④背景知识
大型语言模型(LLM) 是一类基础模型,经过大量数据训练,使其能够理解和生成自然语言
和其他类型的内容,以执行各种任务。LLM 这个名称已家喻户晓,这要归功于它们在将生
成式AI 带到公众利益最前沿方面所发挥的作用,以及组织专注于在众多业务职能和用例
中采用人工智能的目标。
人类反馈强化学习(RLHF)是一种机器学习(ML)技术,它利用人类反馈来优化ML 模
型,从而更有效地进行自我学习。强化学习技术可训练软件做出可最大限度地提高回报的
决策,使其结果更加准确。RLHF 将人类反馈纳入奖励功能,因此ML 模型可以执行更符
合人类目标、愿望和需求的任务。RLHF 广泛应用于生成式人工智能(生成式AI)应用程
序,包括大型语言模型(LLM)。
直接偏好优化(DPO)是一种新颖的微调技术,由于其简单且易于实施而变得流行。它已
成为人类反馈强化学习(RLHF) 的直接替代方案,用于大语言模型 (LLM) 微调,以符合人
类偏好,这归因于其稳定性、性能和计算轻量级性质,无需从LM 微调期间。DPO 可以达
到与现有方法相同或更好的性能水平。与利用RLHF 的现有方法不同,DPO 将语言对齐过
程重新构建为一个简单的损失函数,可以使用偏好数据集 {(x,yw,yl)} 直接优化.
⑤段落大意
【1】背景介绍:构建一个大型语言模型(LLM)需要海量数据和训练
【2】有待进步:大型语言模型仍未达到人类想要的效果
【3】解决算法:满足用户期望的一种方法是人类反馈强化学习(RLHF)
【4】算法解读:人类反馈强化学习通常包括三个步骤
【5】算法缺点:算法复杂且成本大
【6】平替出现:直接偏好优化(DPO)成为新的语言模型算法
【7】算法解读:相比原来的人类反馈强化学习平替算法步骤更为简略
【8】平替上位:平替效率更高且成本更低,普适性更强
【9】任重道远:真正让语言模型达到人类想要的程度还有很长的路要走