Sign inGet started
Paper · arXiv

Think Anywhere in Code Generation

Recent advances in reasoning Large Language Models (LLMs) have primarily relied on upfront thinking, where reasoning occurs before final answer. However, this approach suffers from critical limitations in code generation, where upfront thinking is often insufficient as problems' full complexity only reveals itself during code implementation. Moreover, it cannot adaptively allocate reasoning effort throughout the code generation process where difficulty varies significantly. In this paper, we propose Think-Anywhere, a novel reasoning mechanism that enables LLMs to invoke thinking on-demand at any token position during code generation. We achieve Think-Anywhere by first teaching LLMs to imi...

AuthorsXue Jiang, Tianyu Zhang, Ge Li et al.
Primary categorycs.SE
Published31 March 2026
Last updated at source27 April 2026
cs.SEcs.LG
Embed this entry
<iframe src="https://silytics.si/embed/item/c5c83527-3c20-4fad-8d43-24f8638ff764" width="420" height="190" style="border:0" loading="lazy" title="Silytics entry"></iframe>

Free, no tracking. More about feeds and embeds.

Silytics shows public metadata from arXiv and links to the original. Information may be incomplete or out of date. Last refreshed 17 October 2026. Licenses and terms of the original apply to the work itself. Not financial, legal or professional advice.