[1hr Talk] Intro to Large Language Models
2025年5月29日
10:22

The network is dreaming text from the distribution its trained on, it just mimicking these documents. This is all kind of hallucinated, 语言模型生成的过程本身就是一种dream,一种hallucination. Dreaming or hallucinating internet text from its
disturbution.
例如生成Amazon产品中的ISBN号,现实中几乎肯定不存在这个ISBN号,the model just knows what comes after the ISBN: is
some kind of number roughly this length.
例如关于某种鱼类科普文章的生成,LLM知道一些关于鱼的知识,但又不精确,所以生成的内容有一些是internet text的死记硬背,也有一些是hallucination。
We don't really know how the billions of parameters in LLM collaborate to do it . So think of LLM as mostly inscrutable(
高深莫测的,不可测知的) artifacts.

After pre-training, we only get a document completer, We don’t just want a document generator ,we want an assistant.
Finetuning is just same as pre-training, it's just the next word prediction task but we are going to swap out the dataset .
The pretraining stage is about a large quantity of text but potentially low quality because it comes from the internet. But in
the finetuning stage, we prefer quality over quantity.

第3个阶段(可选),RLHF。
LLM scale laws: more parameters, more training data, it can guarantee better performance.
3.LLM发展方向

3.1 Thinking, System
LLM是第一种系统,是即时的回答,是没有思考过程的。

人们想让LLM有思考能力,tree of thoughts, 用时间来换取精度。
3.2 Self-imporvment
类似于AlphaGo,阶段一是一味地模仿人类,但是无法超越人类,阶段二是强化学习,自我提升,才能超越人类表现。LLM目前只是模仿人类的语言,如何通过self improvment提升LLM的表现呢,关键是reward函数不像围棋那样好定义。
4.LLM Security
4.1 Jailbreak

用户用base64编码的问题提问,会被响应。因为LLM懂得base64编码语言,就像懂得其他国家的语言一样,但是when they train
LLM for safety, the refusal data are mostly in English.

在prompt后面加一段后缀,这段后缀是通过optimization得到的。(类似于对T5模型的攻击,在字符串中加入特定的字符,使得T5认为该字符串和任意字符串都相似。还有对Paligemma模型的攻击,对图片进行特定处理,使模型无法顺利进行ocr检测。)
4.2 Prompt injection attack

图片里包含了一行白色字体的字,肉眼看不出来 ,但是LLM能看出来 ,并认为这句话是新的prompt,于是LLM忽略了真正的最初的prompt,对被注入的prompt进行了回答。
类似还有对网页里的内容进行Inject,在网页中包含了肉眼看不到的白色文字,LLM检索到了这个网页并读取网页内容,并认为白色文字是新的prompt,然后按照这个新的prompt的指令行动。
4.2 Data poisoning

如果finetuning阶段包含了被poisoned的数据,那么当遇到特定的trigger phrase比如james bond时,LLM会失去正常的功能。
已使用 OneNote 创建。