CTRL-CFG: Tractable Constrained Decoding with LL(1) Grammars
Import ICLR 2027 submission cfImU3X4f7: 4 notes
@openreview[bot] · 2026-11-22 21:25 UTC · 622026842186
.gitattributes added
+++ b/.gitattributes@@ -0,0 +1,10 @@+# PDFs and pictures are kept with Git LFS (https://git-lfs.com). With it installed (`git lfs install`),+# a clone has the files, and `git add` of one stores a pointer. This file is the same on every page.+/.potentialpaper/*.pdf filter=lfs diff=lfs merge=lfs -text+/versions/*.pdf filter=lfs diff=lfs merge=lfs -text+/thumbnail.png filter=lfs diff=lfs merge=lfs -text+/thumbnail.jpg filter=lfs diff=lfs merge=lfs -text+/thumbnail.jpeg filter=lfs diff=lfs merge=lfs -text+/thumbnail.gif filter=lfs diff=lfs merge=lfs -text+/thumbnail.webp filter=lfs diff=lfs merge=lfs -text+/thumbnail.avif filter=lfs diff=lfs merge=lfs -text
.potentialpaper/metadata.json added
+++ b/.potentialpaper/metadata.json@@ -0,0 +1,19 @@+{+ "layout": 5,+ "identifiers": [+ {+ "scheme": "openreview",+ "value": "cfImU3X4f7"+ }+ ],+ "title": "CTRL-CFG: Tractable Constrained Decoding with LL(1) Grammars",+ "authors": [],+ "abstract": "Language models often need to generate structured outputs that satisfy a context-free grammar such as JSON or Python. Steering a language model towards satisfying such a grammar requires marginalizing the probability that a future continuation will be grammatical. Hidden Markov models have proven effective as tractable surrogates for this marginalization, but existing methods focused on regular languages. We extend this line of work to LL(1) grammars, a widely used subset of context-free grammars. Unfortunately, even with a tractable surrogate, constrained generation with unambiguous grammars is still cubic time in the sequence length. We hence develop **CTRL-CFG**, a linear-time approximation that marginalizes only over a fixed look-ahead window. Experiments on program synthesis and molecule generation illustrate the potential of this approach as a step towards more broadly usable tractable constrained decoding.",+ "year": 2027,+ "venue": "ICLR 2027 (under review)",+ "source": "openreview",+ "license": {+ "metadata": "CC0-1.0",+ "abstract": "CC0-1.0"+ }+}
community/10-tl-dr.md added
+++ b/community/10-tl-dr.md
community/20-summary.md added
+++ b/community/20-summary.md
community/30-why-it-matters.md added
+++ b/community/30-why-it-matters.md
community/40-critique.md added
+++ b/community/40-critique.md
community/50-errata.md added
+++ b/community/50-errata.md
community/60-reproductions.md added
+++ b/community/60-reproductions.md
community/70-follow-ups.md added
+++ b/community/70-follow-ups.md
owners/10-tl-dr.md added
+++ b/owners/10-tl-dr.md
owners/20-overview.md added
+++ b/owners/20-overview.md
owners/30-results.md added
+++ b/owners/30-results.md
owners/40-demos.md added
+++ b/owners/40-demos.md
owners/50-code-and-data.md added
+++ b/owners/50-code-and-data.md
owners/60-talks.md added
+++ b/owners/60-talks.md
prek.toml added
+++ b/prek.toml@@ -0,0 +1,36 @@+# Checks run before each commit, with prek (https://prek.j178.dev): `prek install` once in this clone.+# The site checks every push again; these catch mistakes before you commit. The same on every page.++[[repos]]+repo = "builtin"+hooks = [+ { id = "check-json" },+ { id = "pretty-format-json", args = ["--autofix", "--no-sort-keys", "--no-ensure-ascii"], exclude = '^demos/' },+ { id = "end-of-file-fixer", exclude = '^demos/' },+ { id = "trailing-whitespace", args = ["--markdown-linebreak-ext=md"], exclude = '^demos/' },+ { id = "check-case-conflict" },+ { id = "check-illegal-windows-names" },+ { id = "check-added-large-files", args = ["--maxkb=256"], exclude = '^demos/' },+]++# Each JSON file against its schema (https://potentialpaper.com/schemas/).+[[repos]]+repo = "https://github.com/python-jsonschema/check-jsonschema"+rev = "0.39.0"+hooks = [+ { id = "check-jsonschema", name = "author section plugins files", files = '^owners/plugins\.json$', args = ["--schemafile", "https://potentialpaper.com/schemas/authorPlugins.json"] },+ { id = "check-jsonschema", name = "venue files", files = '^venue\.json$', args = ["--schemafile", "https://potentialpaper.com/schemas/venue.json"] },+ { id = "check-jsonschema", name = "topic files", files = '^topic\.json$', args = ["--schemafile", "https://potentialpaper.com/schemas/topic.json"] },+ { id = "check-jsonschema", name = "organisation files", files = '^org\.json$', args = ["--schemafile", "https://potentialpaper.com/schemas/org.json"] },+ { id = "check-jsonschema", name = "link files", files = '^links/[^/]+\.json$', args = ["--schemafile", "https://potentialpaper.com/schemas/link.json"] },+ { id = "check-jsonschema", name = "version files", files = '^versions/[^/]+\.json$', args = ["--schemafile", "https://potentialpaper.com/schemas/version.json"] },+ { id = "check-jsonschema", name = "picture files", files = '^thumbnail\.json$', args = ["--schemafile", "https://potentialpaper.com/schemas/thumbnail.json"] },+]++# Sections formatted the way the web editor formats them.+[[repos]]+repo = "https://github.com/rbubley/mirrors-prettier"+rev = "v3.9.9"+hooks = [+ { id = "prettier", files = '^(owners|community)/.*\.md$' },+]
reviews/openreview/cfimu3x4f7/forms.json added
+++ b/reviews/openreview/cfimu3x4f7/forms.json@@ -0,0 +1,183 @@+{+ "schema": "forms/1",+ "forms": {+ "Meta_Review": {+ "label": "Meta-review",+ "fields": [+ {+ "key": "metareview",+ "label": "Meta-review",+ "type": "text"+ },+ {+ "key": "summary",+ "label": "Summary",+ "type": "text"+ },+ {+ "key": "additional_comments_on_reviewer_discussion",+ "label": "Reviewer discussion",+ "type": "text"+ },+ {+ "key": "recommendation",+ "label": "Recommendation",+ "type": "choice"+ }+ ]+ },+ "Decision": {+ "label": "Decision",+ "fields": [+ {+ "key": "title",+ "label": "Title",+ "hidden": true+ },+ {+ "key": "decision",+ "label": "Decision",+ "type": "choice"+ },+ {+ "key": "comment",+ "label": "Comment",+ "type": "text"+ }+ ]+ },+ "Official_Comment": {+ "label": "Comment",+ "fields": [+ {+ "key": "title",+ "label": "Title",+ "type": "choice"+ },+ {+ "key": "comment",+ "label": "Comment",+ "type": "text"+ }+ ]+ },+ "Public_Comment": {+ "label": "Public comment",+ "fields": [+ {+ "key": "title",+ "label": "Title",+ "type": "choice"+ },+ {+ "key": "comment",+ "label": "Comment",+ "type": "text"+ }+ ]+ },+ "Withdrawal": {+ "label": "Withdrawal",+ "fields": [+ {+ "key": "withdrawal_confirmation",+ "label": "Confirmation",+ "hidden": true+ }+ ]+ },+ "Desk_Rejection": {+ "label": "Desk rejection",+ "fields": [+ {+ "key": "desk_reject_comments",+ "label": "Reason",+ "type": "text"+ }+ ]+ },+ "Official_Review": {+ "label": "Official review",+ "summary": [+ "rating",+ "confidence",+ "soundness",+ "presentation",+ "informativeness"+ ],+ "fields": [+ {+ "key": "rating",+ "label": "Rating",+ "type": "score",+ "min": 1,+ "max": 4+ },+ {+ "key": "confidence",+ "label": "Confidence",+ "type": "score",+ "min": 1,+ "max": 4+ },+ {+ "key": "soundness",+ "label": "Soundness",+ "type": "score",+ "min": 1,+ "max": 3+ },+ {+ "key": "presentation",+ "label": "Presentation",+ "type": "score",+ "min": 1,+ "max": 3+ },+ {+ "key": "informativeness",+ "label": "Informativeness",+ "type": "score",+ "min": 1,+ "max": 3+ },+ {+ "key": "paper_summary",+ "label": "Summary",+ "type": "text"+ },+ {+ "key": "critical_strengths",+ "label": "Strengths",+ "type": "text"+ },+ {+ "key": "critical_weaknesses",+ "label": "Weaknesses",+ "type": "text"+ },+ {+ "key": "questions_for_authors",+ "label": "Questions for the authors",+ "type": "text"+ },+ {+ "key": "flag_for_ethics_review",+ "label": "Flag for ethics review",+ "type": "choice",+ "omitWhen": [+ "No",+ "No ethics review needed."+ ]+ },+ {+ "key": "details_of_ethics_concerns",+ "label": "Ethics concerns",+ "type": "text"+ }+ ]+ }+ },+ "url": "https://openreview.net/group?id=ICLR.cc%2F2027%2FConference",+ "license": "CC-BY-4.0"+}
reviews/openreview/cfimu3x4f7/notes/5d4uxpqhew.json added
+++ b/reviews/openreview/cfimu3x4f7/notes/5d4uxpqhew.json@@ -0,0 +1,24 @@+{+ "schema": "review/1",+ "id": "5D4uXpQHEW",+ "replyTo": null,+ "kind": "review",+ "invitation": "Official_Review",+ "signature": "Reviewer RdNT",+ "content": {+ "paper_summary": "The paper proposes CTRL CFG a constrained decoding method for LL(1) grammars. It uses an HMM as a tractable surrogate for the language model and approximates future grammatical validity by looking ahead at a fixed number of tokens. They evaluate the method on molecule generation, regex synthesis and text to SQL tasks.",+ "presentation": 2,+ "informativeness": 2,+ "soundness": 3,+ "critical_strengths": "The paper addresses a relevant limitation of locally constrained decoding.\n\nThe motivation behind the look-ahead approximation is clearly presented.",+ "critical_weaknesses": "Some relevant references are missing, including SynCode [1], Guidance [2], Outlines [3], Pre3 [4], and SWYB [5]. These approaches also provide practical solutions for grammar constrained generation and are relevant baselines.\n\nLL(1) grammars are strictly less expressive than deterministic context-free languages, which are a subset of context free languages. This restriction may limit the applicability of the proposed approach compared to methods that support more expressive grammars like DCFGs and CFGs.\n\nThe experiments do not report the percentage of generated samples that satisfy the target grammars. This is an important metric for evaluating the effectiveness of a grammar constrained decoding method.\n\n\n[1] Shubham Ugare, Tarun Suresh, Hangoo Kang, Sasa Misailovic, and Gagandeep Singh. 2025. Syncode: LLM generation with grammar augmentation. Transactions on Machine Learning Research. \n\n[2] https://github.com/guidance-ai/guidance \n\n[3] https://github.com/dottxt-ai/outlines \n\n[4] Junyi Chen, Shihao Bai, Zaijun Wang, Siyu Wu, Chuheng Du, Hailong Yang, Ruihao Gong, Shengzhong Liu, Fan Wu, and Guihai Chen. 2025. Pre3: Enabling Deterministic Pushdown Automata for Faster Structured LLM Generation. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 11253–11267, Vienna, Austria. Association for Computational Linguistics. \n\n[5] Vincenzo Collura, Karim Tit, Eleonora Giunchiglia, Mike Papadakis, and Maxime Cordy. 2026. Stay Within Your Bounds: Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliance. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 37479–37492, Budapest, Hungary. Association for Computational Linguistics.",+ "questions_for_authors": "Could the authors clarify the differences between their approach and the mentioned methods? If feasible, could they also include an empirical comparison to assess potential gains in terms of generation quality and/or efficiency?\n\nCould the authors report the percentage of generated samples that satisfy the corresponding grammars for each task?",+ "flag_for_ethics_review": "No",+ "rating": 2,+ "confidence": 3+ },+ "createdAt": "2026-11-03T16:16:37.451Z",+ "modifiedAt": "2026-11-06T12:27:49.367Z",+ "url": "https://openreview.net/forum?id=cfImU3X4f7¬eId=5D4uXpQHEW",+ "license": "CC-BY-4.0"+}
reviews/openreview/cfimu3x4f7/notes/ceqyn0pwzo.json added
+++ b/reviews/openreview/cfimu3x4f7/notes/ceqyn0pwzo.json@@ -0,0 +1,24 @@+{+ "schema": "review/1",+ "id": "ceQYN0PWzO",+ "replyTo": null,+ "kind": "review",+ "invitation": "Official_Review",+ "signature": "Reviewer ZTuq",+ "content": {+ "paper_summary": "This paper tries to calculate the intractable membership probability in constrained decoding.\n\nIt extends the idea of using hidden Markov models (HMM) as a tractable surrogate to use context-free grammars (CFG) as constraints.\nIt approximates CFG constraints for linear-time inference by only looking ahead a fixed number of tokens past the current prefix, requiring the 'prefix-unambiguity' only available in LL(1) grammars.\n\nIt calculates the probability conditioned on the prefix by using the remaining stack as the start symbol.\nIt precomputes relevant probabilities for each non-terminal and every length, so at runtime it can be calculated efficiently.",+ "presentation": 3,+ "informativeness": 3,+ "soundness": 3,+ "critical_strengths": "+ Novel and realistic idea of only considering a fixed number of look-ahead tokens for linear-time inference.\n+ Clear writing, thorough theorital analysis, and full respect for existing work.",+ "critical_weaknesses": "- The alignment between the terminals and tokenizers is not considered.\n- The effectiveness of this work (and similar work) depends on how well the HMMs can approximate the base LMs.",+ "questions_for_authors": "1. How well do the HMMs approximate the base LM?\n2. Can we get some experimental comparison with the concurrent work of Scribner et al. (2026), both in performance and speed?\n3. The GPU memory consumption of this work is nearly double the memory of LCD. Why?\n4. How much empirical performance gain can we get if we can use the full constraint instead of limited look-aheads? Or asked in another way, how well do limited look-heads empirically approximate the full constraint?",+ "flag_for_ethics_review": "No",+ "rating": 4,+ "confidence": 2+ },+ "createdAt": "2026-10-22T11:03:35.293Z",+ "modifiedAt": "2026-11-06T12:27:51.900Z",+ "url": "https://openreview.net/forum?id=cfImU3X4f7¬eId=ceQYN0PWzO",+ "license": "CC-BY-4.0"+}
reviews/openreview/cfimu3x4f7/notes/qmpplyuupv.json added
+++ b/reviews/openreview/cfimu3x4f7/notes/qmpplyuupv.json@@ -0,0 +1,24 @@+{+ "schema": "review/1",+ "id": "QMPpLyUuPv",+ "replyTo": null,+ "kind": "review",+ "invitation": "Official_Review",+ "signature": "Reviewer X7te",+ "content": {+ "paper_summary": "CTRL-CFG uses an HMM surrogate and bounded look-ahead to approximate grammar-conditioned LLM decoding beyond local token masking. It establishes the hardness of prefix marginalization for unambiguous CFGs and shows that LL(1) grammars permit an unambiguous prefix construction. Cached parser-stack probabilities and shared next-token marginal computation yield constraint-inference time linear in output length for fixed window, surrogate, and grammar sizes. Experiments cover molecule generation, regex synthesis, and text-to-SQL. The method improves the molecule validity-diversity trade-off; on Spider, execution accuracy increases from 62.18% to 63.52% over same-grammar LCD, and reaches 66.27% with SMC.",+ "presentation": 3,+ "informativeness": 2,+ "soundness": 2,+ "critical_strengths": "1. The paper provides a substantive theoretical and algorithmic contribution: it distinguishes full-string from prefix marginalization, identifies an LL(1) tractability condition, and develops a cached decoding algorithm with an explicit complexity bound. The presentation clearly connects these results to the practical decoding problem.\n\n2. Evaluation spans three structured-generation tasks and measures semantic quality as well as computational cost. The molecule results and integration with SMC provide useful evidence that bounded probabilistic look-ahead can improve the quality-cost trade-off beyond local masking.",+ "critical_weaknesses": "W1. Applicability depends on token-level LL(1) grammars and manual grammar-tokenizer alignment. The effort required to adapt new grammars or tokenizers, and the resulting coverage of the target languages, remain insufficiently characterized.\n\nW2. Gains over same-grammar LCD are modest on regex synthesis and Spider relative to the added cost. On Spider, a 1.34-point accuracy gain increases latency from 26.11 to 40.59 ms/token and memory from 16.38 to 33.75 GB. Surrogate data generation and initialization further complicate the benefit for small workloads.",+ "questions_for_authors": "Q1. What manual transformations are required to align each grammar with the tokenizer while preserving LL(1)? Do they restrict the supported language, and how much effort would a new tokenizer or grammar require?\n\nQ2. What are the grammar-precomputation time and total surrogate preparation costs? Including these costs, for which workloads does CTRL-CFG offer a favorable quality-cost trade-off relative to LCD and rejection sampling?",+ "flag_for_ethics_review": "No",+ "rating": 3,+ "confidence": 3+ },+ "createdAt": "2026-10-24T10:14:42.764Z",+ "modifiedAt": "2026-11-19T08:15:21.473Z",+ "url": "https://openreview.net/forum?id=cfImU3X4f7¬eId=QMPpLyUuPv",+ "license": "CC-BY-4.0"+}
reviews/openreview/cfimu3x4f7/notes/rqpvqr1tms.json added
+++ b/reviews/openreview/cfimu3x4f7/notes/rqpvqr1tms.json@@ -0,0 +1,24 @@+{+ "schema": "review/1",+ "id": "rQPVqR1tms",+ "replyTo": null,+ "kind": "review",+ "invitation": "Official_Review",+ "signature": "Reviewer Dgnj",+ "content": {+ "paper_summary": "This paper extends the HMM surrogate of constrained decoding to LL(1) grammars which is a subclass of unambiguous grammars. They provide a tractable approximation of the probability that a given string ends up in the language of the grammar by using a k lookahead window together with an HMM based surrogate. Their decoding approach is shown to be linear in the length of the generated sequence. This methodology is tested in real-world settings such as molecule or text-to-SQL generation.",+ "presentation": 2,+ "informativeness": 2,+ "soundness": 2,+ "critical_strengths": "- The theory fits nicely and outlines the story well. They first show that given an unambiguous grammar, computing the probability that the next k tokens lie in the prefix of the language of the grammar is #P-hard outlining the need for a restriction to a more narrow class of grammars which is a relevant contribution in itself. A method is then provided for LL(1) grammars by observing that their prefix grammar is unambiguous. This makes the problem well motivated and shows that the authors appear to understand the limitations of their work.\n- Good optimisation technique for the decoding algorithm involving computing of all marginals using DP, caching probability matrices which brings the problem closer to practice.",+ "critical_weaknesses": "- There does not appear to be a study of where the approximation error comes from. They vary k only on molecules (Fig. 2) and vary the HMM hidden state size only on regex (Table 1). The two parameters are never varied together in a single experiment. \n- The gains appear to be quite modest relative to the time and space costs. For text-to-SQL generation CTRL-CFG (63.52%) lies within one standard deviation of the Unconstrained method (62.99%) while time and memory requirements are respectively 1.6 and 2 times higher. It is true that with SMC added the gain is slightly higher though. Gains are modest as well for regex generation where unfortunately token efficiency is not reported which makes it also harder to compare the different methods on time costs. Also, a comparison with rejection sampling is missing for that experiment. However, it is true that the results on molecules are stronger.",+ "questions_for_authors": "- Table 2. In the text-to-SQL experiment unconstrained and rejection sampling have nearly the same accuracy (resp. 63% and 66%). Meanwhile rejection sampling is 5 times less time efficient. Is it because most samples are rejected on first try or because rejected samples are very long ? If it is because most samples fail the grammar on first try, then most unconstrained outputs aren’t valid SQL, so how can 63% unconstrained be correct?\n- Do the prompts provided to the LLMs ever include the grammar ? This could ensure a more fair comparison for the Unconstrained setting. Maybe it is not feasible in practice, but are format instructions and examples in the prompt ? For regex it appears to be the case but what about molecules and SQL ? \n- How does the gain provided by the method change when tested on a slightly better model ? Do Unconstrained or rejection sampling get more efficient / accurate ?",+ "flag_for_ethics_review": "No",+ "rating": 3,+ "confidence": 2+ },+ "createdAt": "2026-11-04T14:51:58.435Z",+ "modifiedAt": "2026-11-06T12:27:48.236Z",+ "url": "https://openreview.net/forum?id=cfImU3X4f7¬eId=rQPVqR1tms",+ "license": "CC-BY-4.0"+}
reviews/openreview/cfimu3x4f7/submission.json added
+++ b/reviews/openreview/cfimu3x4f7/submission.json@@ -0,0 +1,18 @@+{+ "schema": "submission/1",+ "id": "cfImU3X4f7",+ "venue": {+ "id": "ICLR.cc/2027/Conference",+ "name": "ICLR 2027",+ "url": "https://openreview.net/group?id=ICLR.cc%2F2027%2FConference"+ },+ "number": 30980,+ "keywords": [+ "constrained generation",+ "hidden markov models",+ "tractable circuits",+ "context-free grammars"+ ],+ "url": "https://openreview.net/forum?id=cfImU3X4f7",+ "license": "CC-BY-4.0"+}
versions/v_d9ivk2v5.json added
+++ b/versions/v_d9ivk2v5.json@@ -0,0 +1,21 @@+{+ "date": "2026-09-17",+ "kind": "submitted",+ "label": "ICLR 2027",+ "submissions": [+ {+ "venue": "ICLR 2027",+ "status": "under_review",+ "number": 30980,+ "url": "https://openreview.net/forum?id=cfImU3X4f7",+ "reviews": "openreview/cfimu3x4f7",+ "evidence": [+ "https://openreview.net/forum?id=cfImU3X4f7"+ ]+ }+ ],+ "url": "https://openreview.net/forum?id=cfImU3X4f7",+ "evidence": [+ "https://openreview.net/forum?id=cfImU3X4f7"+ ]+}