{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/kcts-knowledge-constrained-tree-search","title":"KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detection","arxiv_id":"2310.09044","date":"2023-10-13","proceeding":null,"authors":["Sehyun Choi","Tianqing Fang","Zhaowei Wang","Yangqiu Song"],"abstract":"Large Language Models (LLMs) have demonstrated remarkable human-level natural language generation capabilities. However, their potential to generate misinformation, often called the hallucination problem, poses a significant risk to their deployment. A common approach to address this issue is to retrieve relevant knowledge and fine-tune the LLM with the knowledge in its input. Unfortunately, this method incurs high training costs and may cause catastrophic forgetting for multi-tasking models. To overcome these limitations, we propose a knowledge-constrained decoding method called KCTS (Knowledge-Constrained Tree Search), which guides a frozen LM to generate text aligned with the reference knowledge at each decoding step using a knowledge classifier score and MCTS (Monte-Carlo Tree Search). To adapt the sequence-level knowledge classifier to token-level guidance, we also propose a novel token-level hallucination detection method called RIPA (Reward Inflection Point Approximation). Our empirical results on knowledge-grounded dialogue and abstractive summarization demonstrate the strength of KCTS as a plug-and-play, model-agnostic decoding method that can effectively reduce hallucinations in natural language generation.","url_abs":"https://arxiv.org/abs/2310.09044v1","url_pdf":"https://arxiv.org/pdf/2310.09044v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"kcts-knowledge-constrained-tree-search","repo_url":"https://github.com/hkust-knowcomp/knowledge-constrained-decoding","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"abstractive-text-summarization","task_name":"Abstractive Text Summarization"},{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"misinformation","task_name":"Misinformation"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.09044","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.09044"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hkust-knowcomp/knowledge-constrained-decoding","reach":null}],"summary":{"ran":2,"ran_honours":1,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":3,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":5,"samples":[{"code_sha256_prefix":"cb174a2447483b88","entry":"MetricGuidance","repo":"hkust-knowcomp/knowledge-constrained-decoding","repo_kind":"official","path":"kcd/classifier_guidance/ppl_mcts.py","file_url":"https://github.com/hkust-knowcomp/knowledge-constrained-decoding/blob/HEAD/kcd/classifier_guidance/ppl_mcts.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cb174a2447483b88"}},{"code_sha256_prefix":"a20af491d8ea2dde","entry":"pad_sequences_to_left","repo":"hkust-knowcomp/knowledge-constrained-decoding","repo_kind":"official","path":"kcd/classifier_guidance/ppl_mcts.py","file_url":"https://github.com/hkust-knowcomp/knowledge-constrained-decoding/blob/HEAD/kcd/classifier_guidance/ppl_mcts.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a20af491d8ea2dde"}},{"code_sha256_prefix":"887918dc48c0319a","entry":"pad_sequences_to_left_states","repo":"hkust-knowcomp/knowledge-constrained-decoding","repo_kind":"official","path":"kcd/classifier_guidance/ppl_mcts.py","file_url":"https://github.com/hkust-knowcomp/knowledge-constrained-decoding/blob/HEAD/kcd/classifier_guidance/ppl_mcts.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"887918dc48c0319a"}},{"code_sha256_prefix":"e6aa43ab8fd9a4aa","entry":"LMStep","repo":"hkust-knowcomp/knowledge-constrained-decoding","repo_kind":"official","path":"kcd/classifier_guidance/ppl_mcts.py","file_url":"https://github.com/hkust-knowcomp/knowledge-constrained-decoding/blob/HEAD/kcd/classifier_guidance/ppl_mcts.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e6aa43ab8fd9a4aa"}},{"code_sha256_prefix":"5e3af55d43323dd5","entry":"PplMCTS","repo":"hkust-knowcomp/knowledge-constrained-decoding","repo_kind":"official","path":"kcd/classifier_guidance/ppl_mcts.py","file_url":"https://github.com/hkust-knowcomp/knowledge-constrained-decoding/blob/HEAD/kcd/classifier_guidance/ppl_mcts.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5e3af55d43323dd5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}