SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.06149 · 2023

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

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 16 functions out of this paper's own repositories and ran 13 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
SalesforceAIResearch/Unlocking-TextGen canonical 13 of 16
FunctionStatusWhere it lives
Falcon40b_reorder_cache Ran SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/base_generation.py
code served (permissive licence) · get_code("87f4d17f413b49ea")
Falcon_reorder_cache Ran SalesforceAIResearch/Unlocking-TextGen/FactaulQA/generate.py
code served (permissive licence) · get_code("07def8743d23308c")
apply_rotary_pos_emb Ran SalesforceAIResearch/Unlocking-TextGen/TestReward/transformers_flash/modeling/modeling_llama_flash.py
code served (permissive licence) · get_code("f725bc2d76076485")
calc_banned_bad_words_ids Ran SalesforceAIResearch/Unlocking-TextGen/FactaulQA/generate.py
code served (permissive licence) · get_code("e3ead4161d5e3d4a")
calc_banned_ngram_tokens Ran SalesforceAIResearch/Unlocking-TextGen/FactaulQA/generate.py
code served (permissive licence) · get_code("8d77347cfa15b834")
calc_banned_ngram_tokens Ran SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/generate.py
code served (permissive licence) · get_code("1f5f980fef237c7a")
get_shorter_text Ran SalesforceAIResearch/Unlocking-TextGen/FactaulQA/beam_search_eli5_large.py
code served (permissive licence) · get_code("63580965c8e7db0b")
is_prefix Ran SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/lexical_constraints.py
code served (permissive licence) · get_code("0d99aee2775dd298")
is_suffix Ran SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/lexical_constraints.py
code served (permissive licence) · get_code("d1d5762f28b96e14")
make_demo Ran SalesforceAIResearch/Unlocking-TextGen/FactaulQA/beam_search_eli5_large.py
code served (permissive licence) · get_code("b194da4ef4825110")
make_doc_prompt Ran SalesforceAIResearch/Unlocking-TextGen/FactaulQA/beam_search_eli5_large.py
code served (permissive licence) · get_code("a8f5fdcd9fc14fb2")
rotate_half Ran SalesforceAIResearch/Unlocking-TextGen/TestReward/transformers_flash/modeling/modeling_llama_flash.py
code served (permissive licence) · get_code("b99eea6376d1e212")
tokenize_constraints Ran SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/utils.py
code served (permissive licence) · get_code("48dee1cfc0fc7bbd")
expand Not yet run SalesforceAIResearch/Unlocking-TextGen/Toxicity/sample_toxity_llm_facon.py
code served (permissive licence) · get_code("ad41a9451a0ec4b4")
init_batch Not yet run SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/lexical_constraints.py
code served (permissive licence) · get_code("79fc2b47d7e1bee9")
postprocess_next_token_scores Not yet run SalesforceAIResearch/Unlocking-TextGen/InstructionFollowing/generate.py
code served (permissive licence) · get_code("57eb609f3dcd1c6a")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2312.06149")
get_code_for_paper("2312.06149")
have("2312.06149")

Connect an agent — have() is free.