{"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/arxiv-2605-20075","title":"CopT: Contrastive On-Policy Thinking with Continuous Spaces for General and Agentic Reasoning","arxiv_id":"2605.20075","date":"2026-05-19","proceeding":null,"authors":["Dachuan Shi","Hanlin Zhu","Xiangchi Yuan","Wanjia Zhao","Kejing Xia","Wen Xiao","Wenke Lee"],"abstract":"Chain-of-thought (CoT) is a standard approach for eliciting reasoning capabilities from large language models (LLMs). However, the common CoT paradigm treats thinking as a prerequisite for answering, which can delay access to plausible answers and incur unnecessary token costs even when the model is able to identify an answer before extended thinking, a behavior known as performative reasoning. In this paper, we introduce CopT, a reformulated reasoning pipeline that reverses the usual order of thinking and answering. Instead of thinking before answering, CopT first elicits a draft answer and then invokes subsequent on-policy thinking conditioned on its own draft answer for reflection and correction. To assess whether the draft answer should be trusted, CopT recasts continuous embeddings as inference-time contrastive verifiers. Specifically, it contrasts the model's support for the same generated tokens under discrete-token inputs and continuous-embedding inputs, yielding a sequence-level reverse KL estimator for answer reliability. Our analysis shows that under certain assumptions, the expected estimate equals the mutual information between the unresolved latent state and the emitted answer token, explaining why it captures answer-relevant uncertainty rather than arbitrary uncertainty in the latent state. When the answer is deemed insufficiently reliable, CopT performs further on-policy thinking, where a second KL estimator dynamically controls draft-answer visibility, preserving useful partial information while reducing the risk of being misled by unreliable content. Across mathematics, coding, and agentic reasoning tasks, CopT improves peak accuracy by up to 23% and reduces token usage by up to 57% at comparable or higher accuracy, without any additional training. The code is available at https://github.com/sdc17/CopT.","url_abs":"https://arxiv.org/abs/2605.20075","url_pdf":"https://arxiv.org/pdf/2605.20075","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2605.20075","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.20075"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/shishirpatil/gorilla","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"unverified":5},"by_repo_kind":{"found_in_text":{"samples":11,"ran":6,"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":0,"samples":[{"code_sha256_prefix":"c34a73c1bf673a0b","entry":"encode_question","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/eval/get_llm_responses.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/eval/get_llm_responses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c34a73c1bf673a0b"}},{"code_sha256_prefix":"cbc9e3ecfe4b8580","entry":"get_all_sub_trees","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/eval/eval-scripts/ast_eval_hf.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/eval/eval-scripts/ast_eval_hf.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cbc9e3ecfe4b8580"}},{"code_sha256_prefix":"65bc21b9f088f906","entry":"get_args","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/eval/eval-scripts/ast_eval_th.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/eval/eval-scripts/ast_eval_th.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"65bc21b9f088f906"}},{"code_sha256_prefix":"899cb7d14116e83d","entry":"get_questions","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/inference/gorilla_eval.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/inference/gorilla_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"899cb7d14116e83d"}},{"code_sha256_prefix":"e7bb842a667e637c","entry":"messages_from_dict","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/eval/retrievers/schema.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/eval/retrievers/schema.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e7bb842a667e637c"}},{"code_sha256_prefix":"2c09abf6e7d255ad","entry":"messages_to_dict","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/eval/retrievers/schema.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/eval/retrievers/schema.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2c09abf6e7d255ad"}},{"code_sha256_prefix":"0d43a9f437f03789","entry":"get_args","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/eval/eval-scripts/ast_eval_hf.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/eval/eval-scripts/ast_eval_hf.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0d43a9f437f03789"}},{"code_sha256_prefix":"011dca36dc92a8af","entry":"get_args","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/eval/eval-scripts/ast_eval_tf.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/eval/eval-scripts/ast_eval_tf.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"011dca36dc92a8af"}},{"code_sha256_prefix":"5ca74d2a45a7f542","entry":"get_buffer_string","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/eval/retrievers/schema.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/eval/retrievers/schema.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5ca74d2a45a7f542"}},{"code_sha256_prefix":"ba873c8d7fc8d9c3","entry":"load_model","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/inference/gorilla_eval.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/inference/gorilla_eval.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ba873c8d7fc8d9c3"}},{"code_sha256_prefix":"0739c6a004099445","entry":"run_eval","repo":"shishirpatil/gorilla","repo_kind":"found_in_text","path":"gorilla/inference/gorilla_eval.py","file_url":"https://github.com/shishirpatil/gorilla/blob/HEAD/gorilla/inference/gorilla_eval.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0739c6a004099445"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}