首页 > AI前沿 > Transformer-FSQ: Discrete Latents for Extreme KV-Cache Compression

Transformer-FSQ: Discrete Latents for Extreme KV-Cache Compression

arXiv机器学习 2026-11-06 23:27 9 阅读 查看原文
首先,任务是作为专业的新闻排版工程师,将给定的纯文本新闻正文排版成语义化的HTML片段。规则很明确: 1. 只输出HTML片段本身,不要Markdown围栏、不要解释。这意味着我的响应应该直接是HTML代码,没有其他内容。 2. 每个自然段落用`

`包裹,长文用`

/`

`划分小节。我需要识别正文中的自然段落和可能的小节。 3. 列表内容用`
  • `,引用用`
    `,代码用`
    `,重要句子可用``。但在这个正文中,我没有看到明显的列表、引用或代码块,所以可能不需要这些。重要句子可以用``高亮。
    
    4. 保留原文所有信息,不得增删改内容。所以我必须确保HTML片段中的内容与原文完全一致,不能添加、删除或修改任何文字。
    
    5. 不要输出``/``/``等文档级标签。只输出片段内容。
    
    现在,分析给定的正文:
    
    正文是关于Transformer-FSQ的新闻或报告。让我先阅读并理解内容:
    
    "Private, personalised language models must run on local consumer devices, where large, frontier models cannot fit, and retaining long contexts is non-trivial. Sequential memory---the key-value (KV) cache---grows linearly with context length, quickly dwarfing the model itself: for Qwen3-1.7B-Base, 200,000 retained entries require 21 GiB, 6.6 times more than the model weights. Yet the KV-cache compression methods we measured fail beyond moderate compression ratios. We introduce Transformer-FSQ, addressing extreme KV-cache compression by replacing standard key and value projections with a finite scalar quantisation bottleneck. Our cache stores a packed vector of discrete integer codes per token, with no per-token quantisation metadata. Converting a pretrained transformer trains only these projections on 0.25 tokens per original parameter. We evaluate Transformer-FSQ against five baseline families on models from 0.6B to 8B parameters. On long-context retrieval (RULER), from 12$\times$ to 97.5$\times$ Transformer-FSQ is the most accurate method we evaluate, across scales. A fused Triton kernel decodes directly from the integer codes; with baselines given their authors' kernels where available, it decodes at $1.01\times$ (95% interval $0.98$--$1.05$) the throughput of native SDPA attention on the uncompressed Qwen3-8B-Base at $32\times$ and $1.54\times$ at $97.5\times$. Extreme KV-cache compression is therefore a practical way to extend how much context a fixed device can hold."
    
    我需要将这个正文分成自然段落。目测,这似乎是一段连续的文本,但可能有多个句子。让我检查:
    
    - 第一句:"Private, personalised language models must run on local consumer devices, where large, frontier models cannot fit, and retaining long contexts is non-trivial."
    
    - 第二句:"Sequential memory---the key-value (KV) cache---grows linearly with context length, quickly dwarfing the model itself: for Qwen3-1.7B-Base, 200,000 retained entries require 21 GiB, 6.6 times more than the model weights."
    
    - 第三句:"Yet the KV-cache compression methods we measured fail beyond moderate compression ratios."
    
    - 第四句:"We introduce Transformer-FSQ, addressing extreme KV-cache compression by replacing standard key and value projections with a finite scalar quantisation bottleneck."
    
    - 第五句:"Our cache stores a packed vector of discrete integer codes per token, with no per-token quantisation metadata."
    
    - 第六句:"Converting a pretrained transformer trains only these projections on 0.25 tokens per original parameter."
    
    - 第七句:"We evaluate Transformer-FSQ against five baseline families on models from 0.6B to 8B parameters."
    
    - 第八句:"On long-context retrieval (RULER), from 12$\times$ to 97.5$\times$ Transformer-FSQ is the most accurate method we evaluate, across scales."
    
    - 第九句:"A fused Triton kernel decodes directly from the integer codes; with baselines given their authors' kernels where available, it decodes at $1.01\times$ (95% interval $0.98$--$1.05$) the throughput of native SDPA attention on the uncompressed Qwen3-8B-Base at $32\times$ and $1.54\times$ at $97.5\times$."
    
    - 第十句:"Extreme KV-cache compression is therefore a practical way to extend how much context a fixed device can hold."
    
    看起来这是一个单一段落,但可能可以分成几个小节。正文没有明显的标题或子标题,所以我要基于内容逻辑来划分。
    
    规则说:"长文用`

    `/`

    `划分小节"。这个正文不算很长,但为了语义化,我可以添加小节标题。但规则是"保留原文所有信息,不得增删改内容",所以我不能添加新的文字作为标题。标题应该基于原文内容,但原文中没有显式的标题。 或许整个正文就是一个段落。但规则说"每个自然段落用`

    `包裹",所以如果它是一个自然段落,就用一个`

    `包裹。 为了使其更语义化,我可以识别关键点: - 介绍问题:private models on local devices, KV cache issue. - 引入解决方案:Transformer-FSQ. - 描述方法:how it works. - 评估结果:evaluation. - 结论:practical way. 但原文中没有分节标题,所以我不能添加`

    `或`

    `,除非原文有指示。规则说"长文用`

    /`

    `划分小节",但这里没有指定哪些是小节。我应该只对有明确小节的部分使用标题。 或许这个正文可以被视为一个长段落,所以用一个`

    `包裹。 但规则提到"长文",所以如果它是长的,我可以划分。但原文长度适中。 让我数一下句子:10个句子。可能分成几个段落。 在新闻排版中,自然段落通常是由句号分隔的。但这里所有句子是连贯的。 为了符合规则,我应该将每个自然段落用`

    `包裹。既然是一整段,就用一个`

    `。 但规则说"每个自然段落",所以如果它是自然的一个段落,就用一个`

    `。 然而,在技术写作中,有时会分节。但原文没有分节。 再看规则:"长文用`

    `/`

    `划分小节"。这里的"长文"可能指整个文档,但这里只有一个片段。 或许我可以基于内容逻辑添加隐式标题,但规则说"不得增删改内容",所以不能添加新文字。 所以,我认为最安全的方式是将整个正文作为一个段落用`

    `包裹。 但正文中有"---",可能表示破折号,在HTML中可以用`—`或直接`---`。 在HTML中,`---`可能被解释为注释,但标准做法是用`—`。 规则没有指定,但为了语义化,我应该使用HTML实体。 例如,"---" 应该变成 `—`。 类似地,数学符号如`$\times$`,在HTML中,`$\times$` 可能不是标准,应该用`×`或类似。 在HTML中,乘号可以用`×`。 原文有"12$\times$",可能意思是12倍,所以用"12×"。 同样,"97.5$\times$" 变成 "97.5×"。 "95% interval $0.98$--$1.05$",`--` 可能表示范围,用 `–` 或 `—`。 在文本中,`--` 常表示破折号,所以用 `–` 表示短破折号。 但为了简单,我可以直接输出原样,但用HTML实体。 规则说"保留原文所有信息",所以