Papers › Unlocking Anticipatory Text Generation: A Constrained Approach for Large Language...

Unlocking Anticipatory Text Generation: A Constrained Approach for Large Language Models Decoding

11 Dec 2023arXiv:2312.06149archive 2025-07-28

Lifu Tu, Semih Yavuz, Jin Qu, Jiacheng Xu, Rui Meng, Caiming Xiong, Yingbo Zhou

Large Language Models (LLMs) have demonstrated a powerful ability for text generation. However, achieving optimal results with a given prompt or instruction can be challenging, especially for billion-sized models. Additionally, undesired behaviors such as toxicity or hallucinations can manifest. While much larger models (e.g., ChatGPT) may demonstrate strength in mitigating these issues, there is still no guarantee of complete prevention. In this work, we propose formalizing text generation as a future-constrained generation problem to minimize undesirable behaviors and enforce faithfulness to instructions. The estimation of future constraint satisfaction, accomplished using LLMs, guides the text generation process. Our extensive experiments demonstrate the effectiveness of the proposed approach across three distinct text generation tasks: keyword-constrained generation (Lin et al., 2020), toxicity reduction (Gehman et al., 2020), and factual correctness in question-answering (Gao et al., 2023).

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2312.06149")

Code

Syntology Ran 13 of 16 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 11 ran with no contract checked.

By repository: official repository: 16 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

SalesforceAIResearch/Unlocking-TextGen officialmentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 13 ran; 0 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
1ran · fixture could not drive it
11ran
3unverified

Licence: 0 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from SalesforceAIResearch/Unlocking-TextGen. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Falcon40b_reorder_cache SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/base_generation.py official repository ran Apache-2.0 (permissive) · 87f4d17f413b49ea · report
Falcon_reorder_cache SalesforceAIResearch/Unlocking-TextGen/FactaulQA/generate.py official repository ran Apache-2.0 (permissive) · 07def8743d23308c · report
apply_rotary_pos_emb SalesforceAIResearch/Unlocking-TextGen/TestReward/transformers_flash/modeling/modeling_llama_flash.py official repository ran · fixture could not drive it Apache-2.0 (permissive) · f725bc2d76076485 · report
calc_banned_bad_words_ids SalesforceAIResearch/Unlocking-TextGen/FactaulQA/generate.py official repository ran Apache-2.0 (permissive) · e3ead4161d5e3d4a · report
calc_banned_ngram_tokens SalesforceAIResearch/Unlocking-TextGen/FactaulQA/generate.py official repository ran Apache-2.0 (permissive) · 8d77347cfa15b834 · report
calc_banned_ngram_tokens SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/generate.py official repository ran Apache-2.0 (permissive) · 1f5f980fef237c7a · report
get_shorter_text SalesforceAIResearch/Unlocking-TextGen/FactaulQA/beam_search_eli5_large.py official repository ran Apache-2.0 (permissive) · 63580965c8e7db0b · report
is_prefix SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/lexical_constraints.py official repository ran fingerprinted Apache-2.0 (permissive) · 0d99aee2775dd298 · report
is_suffix SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/lexical_constraints.py official repository ran fingerprinted Apache-2.0 (permissive) · d1d5762f28b96e14 · report
make_demo SalesforceAIResearch/Unlocking-TextGen/FactaulQA/beam_search_eli5_large.py official repository ran Apache-2.0 (permissive) · b194da4ef4825110 · report
make_doc_prompt SalesforceAIResearch/Unlocking-TextGen/FactaulQA/beam_search_eli5_large.py official repository ran Apache-2.0 (permissive) · a8f5fdcd9fc14fb2 · report
rotate_half SalesforceAIResearch/Unlocking-TextGen/TestReward/transformers_flash/modeling/modeling_llama_flash.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · b99eea6376d1e212 · report
tokenize_constraints SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/utils.py official repository ran Apache-2.0 (permissive) · 48dee1cfc0fc7bbd · report
expand SalesforceAIResearch/Unlocking-TextGen/Toxicity/sample_toxity_llm_facon.py official repository unverified Apache-2.0 (permissive) · ad41a9451a0ec4b4 · report
init_batch SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/lexical_constraints.py official repository unverified Apache-2.0 (permissive) · 79fc2b47d7e1bee9 · report
postprocess_next_token_scores SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/generate.py official repository unverified Apache-2.0 (permissive) · 57eb609f3dcd1c6a · report

Tasks

Question AnsweringText Generation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections