English
Related papers

Related papers: Grammar compression with probabilistic context-fre…

200 papers

We present an algorithm for computing the Lyndon factorization of a string that is given in grammar compressed form, namely, a Straight Line Program (SLP). The algorithm runs in $O(n^4 + mn^3h)$ time and $O(n^2)$ space, where $m$ is the…

Data Structures and Algorithms · Computer Science 2013-04-29 Tomohiro I , Yuto Nakashima , Shunsuke Inenaga , Hideo Bannai , Masayuki Takeda

Today's probabilistic language generators fall short when it comes to producing coherent and fluent text despite the fact that the underlying models perform well under standard metrics, e.g., perplexity. This discrepancy has puzzled the…

Computation and Language · Computer Science 2025-06-06 Clara Meister , Tiago Pimentel , Gian Wiher , Ryan Cotterell

A Straight-Line Program (SLP) $G$ for a string $T$ is a context-free grammar (CFG) that derives $T$ only, which can be considered as a compressed representation of $T$. In this paper, we show how to encode $G$ in $n \lceil \lg N \rceil + (n…

Data Structures and Algorithms · Computer Science 2026-01-09 Akito Takasaka , Tomohiro I

We study a formalization of the grammar induction problem that models sentences as being generated by a compound probabilistic context-free grammar. In contrast to traditional formulations which learn a single stochastic grammar, our…

Computation and Language · Computer Science 2020-03-31 Yoon Kim , Chris Dyer , Alexander M. Rush

Transformer-based Large Language Models (LLMs) often impose limitations on the length of the text input to ensure the generation of fluent and relevant responses. This constraint restricts their applicability in scenarios involving long…

Computation and Language · Computer Science 2023-12-18 Weizhi Fei , Xueyan Niu , Pingyi Zhou , Lu Hou , Bo Bai , Lei Deng , Wei Han

Many NLP datasets have been found to contain shortcuts: simple decision rules that achieve surprisingly high accuracy. However, it is difficult to discover shortcuts automatically. Prior work on automatic shortcut detection has focused on…

Computation and Language · Computer Science 2022-10-24 Dan Friedman , Alexander Wettig , Danqi Chen

We present a probabilistic model for constraint-based grammars and a method for estimating the parameters of such models from incomplete, i.e., unparsed data. Whereas methods exist to estimate the parameters of probabilistic context-free…

Computation and Language · Computer Science 2007-05-23 Stefan Riezler

We consider the problem of lossless compression of binary trees, with the aim of reducing the number of code bits needed to store or transmit such trees. A lossless grammar-based code is presented which encodes each binary tree into a…

Information Theory · Computer Science 2013-04-30 Jie Zhang , En-hui Yang , John C. Kieffer

It was recently proved that any Straight-Line Program (SLP) generating a given string can be transformed in linear time into an equivalent balanced SLP of the same asymptotic size. We generalize this proof to a general class of grammars we…

Data Structures and Algorithms · Computer Science 2024-04-11 Gonzalo Navarro , Francisco Olivares , Cristian Urbina

The rise of large language models (LLMs) is revolutionizing information retrieval, question answering, summarization, and code generation tasks. However, in addition to confidently presenting factually inaccurate information at times (known…

Artificial Intelligence · Computer Science 2023-04-26 Henry Gilbert , Michael Sandborn , Douglas C. Schmidt , Jesse Spencer-Smith , Jules White

Random access to highly compressed strings -- represented by straight-line programs or Lempel-Ziv parses, for example -- is a well-studied topic. Random access to such strings in strongly sublogarithmic time is impossible in the worst case,…

Data Structures and Algorithms · Computer Science 2026-02-05 Ferdinando Cicalese , Zsuzsanna Lipták , Travis Gagie , Gonzalo Navarro , Nicola Prezza , Cristian Urbina

Probabilistic context-free grammars (PCFGs) with neural parameterization have been shown to be effective in unsupervised phrase-structure grammar induction. However, due to the cubic computational complexity of PCFG representation and…

Computation and Language · Computer Science 2021-04-29 Songlin Yang , Yanpeng Zhao , Kewei Tu

Grammaticality and likelihood are distinct notions in human language. Pretrained language models (LMs), which are probabilistic models of language fitted to maximize corpus likelihood, generate grammatically well-formed text and…

Computation and Language · Computer Science 2026-05-07 Yingshan Susan Wang , Linlu Qiu , Zhaofeng Wu , Roger P. Levy , Yoon Kim

We present an algorithm for computing n-gram probabilities from stochastic context-free grammars, a procedure that can alleviate some of the standard problems associated with n-grams (estimation from sparse data, lack of linguistic…

cmp-lg · Computer Science 2022-02-28 Andreas Stolcke , Jonathan Segal

Probabilistic context-free grammars (PCFGs) are used to define distributions over strings, and are powerful modelling tools in a number of areas, including natural language processing, software engineering, model checking, bio-informatics,…

Formal Languages and Automata Theory · Computer Science 2014-07-08 Colin de la Higuera , James Scicluna , Mark-Jan Nederhof

We consider the problem of {\em restructuring} compressed texts without explicit decompression. We present algorithms which allow conversions from compressed representations of a string $T$ produced by any grammar-based compression…

Data Structures and Algorithms · Computer Science 2011-07-15 Keisuke Goto , Shirou Maruyama , Shunsuke Inenaga , Hideo Bannai , Hiroshi Sakamoto , Masayuki Takeda

Data compression continues to evolve, with traditional information theory methods being widely used for compressing text, images, and videos. Recently, there has been growing interest in leveraging Generative AI for predictive compression…

Information Theory · Computer Science 2024-09-24 Swathi Shree Narashiman , Nitin Chandrachoodan

We give algorithms that, given a straight-line program (SLP) with $g$ rules that generates (only) a text $T [1..n]$, builds within $O(g)$ space the Lempel-Ziv (LZ) parse of $T$ (of $z$ phrases) in time $O(n\log^2 n)$ or in time…

Data Structures and Algorithms · Computer Science 2023-10-11 Travis Gagie , Adrián Goga , Artur Jeż , Gonzalo Navarro

We introduce a new class of straight-line programs (SLPs), named the Lyndon SLP, inspired by the Lyndon trees (Barcelo, 1990). Based on this SLP, we propose a self-index data structure of $O(g)$ words of space that can be built from a…

Data Structures and Algorithms · Computer Science 2020-04-28 Kazuya Tsuruta , Dominik Köppl , Yuto Nakashima , Shunsuke Inenaga , Hideo Bannai , Masayuki Takeda

Traditional lossless text compression preserves every byte, but its gains on natural language are often modest in realistic operating regimes. We study \emph{lossy semantic text compression}, where the encoder strategically deletes parts of…

Computation and Language · Computer Science 2026-05-29 Yuchun Zou , Junhong Tong , Jun Li