Parser States Already Know: Structure-Conditioned KV Persistence for Structured Generation
作者: Linze Wu, Xinrui Chen
分类: cs.LG
发布日期: 2026-08-28
备注: Work in progress
💡 一句话要点
提出PASK以解决结构化生成中的KV持久性问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 结构化生成 KV持久性 解析器感知 大型语言模型 性能优化 自然语言处理 数据库查询
📋 核心要点
- 现有的KV压缩方法未能有效利用解析器转换所提供的结构信号,导致结构化生成中的错误风险增加。
- 本文提出PASK,通过将解析器导出的结构信息转化为KV持久性决策,增强了模型对结构风险的敏感性。
- 在实验中,PASK在多个基准测试中表现优异,显著提高了吞吐量并降低了内存使用,展示了其实际应用潜力。
📝 摘要(中文)
结构化生成是大型语言模型(LLM)代理生成JSON、SQL和函数调用的基础,其中单个错误字段可能导致下游操作失败。现有的约束解码方法跟踪解析器转换以确保形式有效性,但现有的KV压缩方法未能有效利用这些结构信号。本文提出PASK(解析器感知结构KV持久性),将解析器导出的结构转化为特定层组的KV持久性决策。PASK通过使用任务错误敏感性设置最小保护阈值,并利用注意力输出失真分配剩余KV容量,解决了模型侧KV敏感性与任务级结构风险之间的差距。在目标总KV预算为0.33的情况下,PASK在Qwen3-4B的八个BFCL非实时和实时子类别上平均超越最强压缩基线17.39个百分点。在端到端服务中,PASK实现了高达2.2倍的吞吐量提升和3.3倍的TPOT降低,同时使用的峰值GPU内存仅为Full KV的0.53倍。
🔬 方法详解
问题定义:本文旨在解决结构化生成中KV持久性不足的问题,现有方法未能充分利用解析器转换的结构信号,导致生成错误的风险增加。
核心思路:PASK通过将解析器导出的结构信息转化为特定层组的KV持久性决策,利用任务错误敏感性和注意力输出失真来优化KV的使用。
技术框架:PASK的整体架构包括离线校准阶段和在线轻量级结构条件查找。离线阶段编译信号形成持久性策略,在线阶段则根据该策略进行KV的动态管理。
关键创新:PASK的核心创新在于将解析器的结构信息与KV持久性决策相结合,显著提高了模型对结构风险的敏感性,解决了现有方法的不足。
关键设计:在设计中,PASK设置了最小保护阈值和注意力输出失真作为关键参数,以确保在KV预算限制下的最佳性能。
🖼️ 关键图片
📊 实验亮点
在实验中,PASK在目标总KV预算为0.33的情况下,平均超越最强压缩基线17.39个百分点。此外,PASK在端到端服务中实现了高达2.2倍的吞吐量提升和3.3倍的TPOT降低,同时使用的峰值GPU内存仅为Full KV的0.53倍,显示出其优越的性能。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、数据库查询生成和智能助手等场景。通过提高结构化生成的准确性和效率,PASK能够在实际应用中显著提升用户体验,并推动相关技术的发展。
📄 摘要(原文)
Structured generation underpins large language model (LLM) agents that produce JSON, SQL, and function calls, where a single wrong field can cause the downstream action to fail. Constrained decoding already tracks parser transitions to enforce formal validity, and these transitions expose how generated tokens participate in schema-critical decisions such as required fields, arguments, and structural boundaries under the active grammar. Existing KV compression largely leaves this task-relevant structural signal unused. We introduce PASK (Parser-Aware Structural KV Persistence), which turns parser-derived structure into layer-group-specific KV persistence decisions. PASK addresses the mismatch between model-side KV sensitivity and task-level structured risk by using task-error sensitivity to set minimum protection floors and attention-output distortion to allocate residual KV capacity. An offline calibration stage compiles these signals into a persistence policy, leaving only lightweight structure-conditioned lookup online. At a targe total KV budget of 0.33, PASK outperforms the strongest compressed baseline by 17.39 percentage points on average across eight BFCL non-live and Live subcategories on Qwen3-4B. In end-to-end serving, PASK achieves up to 2.2x higher throughput and 3.3x lower TPOT, while using 0.53x the peak GPU memory of Full KV.