paper-with-me

홈 › Papers

Copy-as-Decode: Grammar-Constrained Parallel Prefill for LLM Editing

2026-04-20 · Ziyang Liu arxiv

LLMs edit text and code by autoregressively regenerating the full output, even when most tokens appear verbatim in the input. We study Copy-as-Decode, a decoding-layer mechanism that recasts edit generation as structured decoding over a two-primitive grammar: <copy lines="i-j"/> references an input line range, <gen>...</gen> emits new content. A token-level FSM guarantees syntactic validity, and a serving-layer primitive updates the KV cache for each copy span via a single parallel-prefill forward rather than $N$ autoregressive steps -- sharing the parallel-forward kernel of speculative decoding but with input tokens as the draft and program-enforced acceptance replacing probabilistic verification. We report an upper-bound analysis that requires no end-to-end training. (i) Kernel speedup: on Qwen2.5-{1.5B, 7B}, copying $N$ tokens via parallel prefill is $6.8\times$--$303\times$ faster than autoregressive ($N \in [8, 512]$, A100 80GB bf16). (ii) Copy ceiling: on ProbeEdit and HumanEvalPack-Fix (Py/JS), $74$--$98\%$ of gold tokens are reachable under the line-level primitive; composed with the empirical kernel over each corpus's span histogram this yields a closed-form wall-clock bound of $29.0\times / 3.4\times / 4.2\times$ ($13.0\times$ pooled). A token-level extension reaches $91$--$99\%$ coverage with $4.5\times$--$6.5\times$ floors. (iii) Pipeline losslessness: oracle programs round-trip through the deterministic resolver on all $482$ cases, localizing any downstream failure to span selection rather than the mechanism. A perturbation study shows pooled EM drops from $100\%$ to $15.48\%$ under off-by-one noise. A fine-tuning pilot on Qwen2.5-Coder-1.5B lifts HEvalFix-Py EM from $0/33$ (untrained) to $12$--$17\%$, a learnability signal, not a production selector. Batched-serving integration and multi-file coverage are scoped as follow-up.

📄 PDF Abstract BibTeX arXiv:2604.18170

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Achieving Cloud-Grade SLOs for Local Mixture-of-Experts Inference through CPU-GPU Hybrid Design

2026-06-09 · Wenxin Wang, Yule Hou, Yu Ji, Peng Qu 외 arxiv

Local deployment of large Mixture-of-Experts (MoE) models falls short of the service quality achieved in cloud-scale environments, even under low-concurrency workloads. We identify four key gaps in local MoE inference: r…

SARATHI: Efficient LLM Inference by Piggybacking Decodes with Chunked Prefills

2023-08-31 · Amey Agrawal, Ashish Panwar, Jayashree Mohan, Nipun Kwatra 외

Large Language Model (LLM) inference consists of two distinct phases - prefill phase which processes the input prompt and decode phase which generates output tokens autoregressively. While the prefill phase effectively s…

GPULanguage ModellingLarge Language Model

Context Parallelism for Scalable Million-Token Inference

2024-11-04 · Amy Yang, Jingyi Yang, Aya Ibrahim, Xinfeng Xie 외

We present context parallelism for long-context large language model inference, which achieves near-linear scaling for long-context prefill latency with up to 128 H100 GPUs across 16 nodes. Particularly, our method achie…

GPULanguage ModelingLanguage ModellingLarge Language Model

Knowledge-enriched, Type-constrained and Grammar-guided Question Generation over Knowledge Bases

2020-10-07 · COLING 2020 8 · Sheng Bi, Xiya Cheng, Yuan-Fang Li, Yongzhen Wang 외

Question generation over knowledge bases (KBQG) aims at generating natural-language questions about a subgraph, i.e. a set of (connected) triples. Two main challenges still face the current crop of encoder-decoder-based …

DecoderDiversityQuestion GenerationQuestion-Generation

Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve

2024-03-04 · Amey Agrawal, Nitin Kedia, Ashish Panwar, Jayashree Mohan 외

Each LLM serving request goes through two phases. The first is prefill which processes the entire input prompt and produces the first output token and the second is decode which generates the rest of output tokens, one-a…

GPUScheduling