paper-with-me

Papers

Pre$^3$: Enabling Deterministic Pushdown Automata for Faster Structured LLM Generation

2025-06-04 · Junyi Chen, Shihao Bai, Zaijun Wang, Siyu Wu, Chuheng Du, Hailong Yang, Ruihao Gong, Shengzhong Liu, Fan Wu, Guihai Chen

Extensive LLM applications demand efficient structured generations, particularly for LR(1) grammars, to produce outputs in specified formats (e.g., JSON). Existing methods primarily parse LR(1) grammars into a pushdown automaton (PDA), leading to runtime execution overhead for context-dependent token processing, especially inefficient under large inference batches. To address these issues, we propose Pre$^3$ that exploits deterministic pushdown automata (DPDA) to optimize the constrained LLM decoding efficiency. First, by precomputing prefix-conditioned edges during the preprocessing, Pre$^3$ enables ahead-of-time edge analysis and thus makes parallel transition processing possible. Second, by leveraging the prefix-conditioned edges, Pre$^3$ introduces a novel approach that transforms LR(1) transition graphs into DPDA, eliminating the need for runtime path exploration and achieving edge transitions with minimal overhead. Pre$^3$ can be seamlessly integrated into standard LLM inference frameworks, reducing time per output token (TPOT) by up to 40% and increasing throughput by up to 36% in our experiments. Our code is available at https://github.com/ModelTC/lightllm.

📄 PDF Abstract BibTeX arXiv:2506.03887

Code (1)

modeltc/lightllm 공식 구현 pytorch

Similar Papers 제목 키워드 기반

Explorability in Pushdown Automata

2025-11-06 · Ayaan Bedi, Karoliina Lehtinen arxiv

We study explorability, a measure of nondeterminism in pushdown automata, which generalises history-determinism. An automaton is k-explorable if, while reading the input, it suffices to follow k concurrent runs, built st…

On the Computational Power of RNNs

2019-06-14 · Samuel A. Korsky, Robert C. Berwick

Recent neural network architectures such as the basic recurrent neural network (RNN) and Gated Recurrent Unit (GRU) have gained prominence as end-to-end learning architectures for natural language processing tasks. But w…

Pushdown Reward Machines for Reinforcement Learning

2025-08-09 · Giovanni Varricchione, Toryn Q. Klassen, Natasha Alechina, Mehdi Dastani 외 arxiv

Reward machines (RMs) are automata structures that encode (non-Markovian) reward functions for reinforcement learning (RL). RMs can reward any behaviour representable in regular languages and, when paired with RL algorit…

Reinforcement Learning

Learning Context-Free Languages with Nondeterministic Stack RNNs

2020-10-09 · CONLL 2020 · Brian DuSell, David Chiang

We present a differentiable stack data structure that simultaneously and tractably encodes an exponential number of stack configurations, based on Lang's algorithm for simulating nondeterministic pushdown automata. We ca…

Prediction of Infinite Words with Automata

2016-03-08 · Tim Smith

In the classic problem of sequence prediction, a predictor receives a sequence of values from an emitter and tries to guess the next value before it appears. The predictor masters the emitter if there is a point after wh…

Prediction