马东锡NLP用文档加LLM办公的场景,拆了三个容易混的概念。
Prefill 到底在干什么
![]()
Prefill处理input,把用户输入一次性喂进模型。KV cache则保存计算得到的K/V,供后续生成使用。两者分工不同,一个负责入口,一个负责记忆。
Prefix caching 的复用边界
Prefix caching在输入变化时,只能复用首次token变化之前的共同prefix。以A、B、C三轮文档问答为例,C的输入方案已改变,因此无法完整复用前序缓存。
三个概念串起来看,缓存能省多少,取决于前缀从哪一刻开始分叉。
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.