引导式测验 · 中等 等级

KV 缓存测验

查看自回归解码期间的 KV 缓存重用、内存压力、多请求共享和分页分配权衡。

相关引导路径Kv缓存
问题 1 的 8

KV缓存存储什么?

预览每个问题8 问题

当您参加测验时,就会出现答案和解释。

  1. KV缓存存储什么?
    • 为之前的标记计算的键和值向量
    • 模型的全权重矩阵
    • 用户的聊天记录为纯文本
    • 最终输出概率
  2. KV缓存主要解决什么问题?
    • 它改进了生成文本的语法
    • 它避免了在每一步中重新计算所有先前令牌的键和值
    • 它增加了模型的词汇量
    • 它对对话进行加密
  3. KV 缓存的主要缺点是什么?
    • 它使生成速度变慢
    • 它降低了输出质量
    • 它的内存使用量随着上下文长度线性增长
    • 它仅适用于 CPU
  4. 哪种技术通过在注意力头之间共享键和值来减少 KV 缓存大小?
    • 辍学
    • 集束搜索
    • 代币化
    • 分组查询或多查询注意力
  5. 与 KV 缓存相关的 Transformer 推理分为哪两个阶段?
    • 预填充(处理提示)和解码(一次生成一个令牌)
    • 培训和测试
    • 编码和压缩
    • 上传和下载
  6. vLLM的PagedAttention对KV缓存有什么作用?
    • 在每个令牌之后删除缓存
    • 将缓存分配在不连续的块中以减少内存碎片
    • 将缓存转换为文本
    • 将模型的参数数量加倍
  7. Why can KV-cache memory limit how many requests a GPU serves concurrently?
    • The cache stores all training examples on the GPU
    • Each request creates a new model copy
    • Each active sequence retains key and value tensors that grow with its generated context
    • The cache stores only final text on disk
  8. What is one benefit of sharing KV-cache blocks among requests with a common prefix?
    • It makes unrelated prefixes identical
    • It removes the need to compute attention
    • It guarantees lower latency in every workload
    • It can avoid storing duplicate prefix state and reduce memory use