返回全部动态

llama.cpp b11888:语法解析加递归深度限制并优化候选拒绝

原标题:b11888

llama.cpp Releases一手来源开源质量 71

AI 摘要

llama.cpp 发布 b11888 版本,为语法(grammar)解析与 PEG 解析器加入递归深度限制,并将其设为强制要求。同时重写了 llama_grammar_reject_candidates_for_stack 的候选拒绝逻辑,改为基于索引的迭代实现,消除了此前因按码点计数导致 256 字符以上 token(如 GLM-4.7-Flash 的 512 空格 token)总被拒绝的问题,使语法采样在 GLM-4.7、Laguna、Qwen3.6 和 gemma-4 上更快且掩码与 master 一致。

以上摘要由 AI 生成,可能存在误差。事实请以原文为准。

正文节选

<details open> common, grammar: add recursive depth limit, make it a requirement (#31153) * common, grammar: add recursive depth limit, make it a requirement * catch more recursive functions * common : tidy up peg parser changes * grammar : reject candidates in a loop, without a depth limit The depth limit in llama_grammar_reject_candidates_for_stack counted the code points of a vocab token, so any token of 256 chars or more was always rejected under a grammar, such as the 512-space token


发布时间:2026-10-26 07:28
抓取时间:2026-10-26 07:32
来源机构:ggml-org
阅读原文github.com