mlsanityData to 14 Oct 2026

From Token to Line: Enhancing Code Generation with a Long-Term Perspective

arXiv 2504.07433 ↗First posted 10 Apr 2025cs.CLcited by 4

Not on the map. Why?

Abstract (arXiv)

The emergence of large language models (LLMs) has significantly promoted the development of code generation task, sparking a surge in pertinent literature. Current research is hindered by redundant generation results and a tendency to overfit local patterns in the short term. Although existing studies attempt to alleviate the issue by adopting a multi-token prediction strategy, there remains limited focus on choosing the appropriate processing length for generations. By analyzing the attention between tokens during the generation process of LLMs, it can be observed that the high spikes of the attention scores typically appear at the end of lines. This insight suggests that it is reasonable to treat each line of code as a fundamental processing unit and generate them sequentially. Inspired by this, we propose the LSR-MCTS algorithm, which leverages MCTS to determine the code line-by-line and select the optimal path. Further, we integrate a self-refine mechanism at each node to enhance diversity and generate higher-quality programs through error correction. Extensive experiments and comprehensive analyses on three public coding benchmarks demonstrate that our method outperforms the state-of-the-art performance approaches.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 51 of its 72 references that are in the map. First posted on arXiv 10 Apr 2025.

Builds on

51 of 72 references.

References · 51

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  4. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  7. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  8. 2021Program Synthesis with Large Language Modelscited by 3,637
  9. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  10. 2023Mistral 7Bcited by 3,164
  11. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  12. 2024Mixtral of Expertscited by 1,823
38 more
  1. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  2. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  3. 2023PaLM 2 Technical Reportcited by 1,162
  4. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  5. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  6. 2023StarCoder: may the source be with you!cited by 799
  7. 2023Large Language Modelscited by 780
  8. 2021Cross-Task Generalization via Natural Language Crowdsourcing Instructionscited by 699
  9. 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Modelscited by 574
  10. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
  11. 2023OPERA: Alleviating Hallucination in Multi-Modal Large Language Models via Over-Trust Penalty and Retrospection-Allocationcited by 478
  12. 2024Better & Faster Large Language Models via Multi-token Predictioncited by 360
  13. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 300
  14. 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
  15. 2023Planning with Large Language Models for Code Generationcited by 182
  16. 2023Large Language Models as Analogical Reasonerscited by 107
  17. 2024Natural Language Understanding and Inference with MLLM in Visual Question Answering: A Surveycited by 76
  18. 2024Benchmarking Multimodal Retrieval Augmented Generation with Dynamic VQA Dataset and Self-adaptive Planning Agentcited by 65
  19. 2022The Past Mistake is the Future Wisdom: Error-driven Contrastive Probability Optimization for Chinese Spell Checkingcited by 56
  20. 2023On the (In)Effectiveness of Large Language Models for Chinese Text Correctioncited by 54
  21. 2024Make Every Move Count: LLM-based High-Quality RTL Code Generation Using MCTScited by 43
  22. 2023Hot or Cold? Adaptive Temperature Sampling for Code Generation with Large Language Modelscited by 38
  23. 2022Learning from the Dictionary: Heterogeneous Knowledge Guided Fine-tuning for Chinese Spell Checkingcited by 31
  24. 2022Contrastive Learning with Hard Negative Entities for Entity Set Expansioncited by 26
  25. 2022Linguistic Rules-Based Corpus Generation for Native Chinese Grammatical Error Correctioncited by 25
  26. 2024Perception Compressor: A Training-Free Prompt Compression Framework in Long Context Scenarioscited by 23
  27. 2025DAST: Context-Aware Compression in LLMs via Dynamic Allocation of Soft Tokenscited by 22
  28. 2022Automatic Context Pattern Generation for Entity Set Expansioncited by 21
  29. 2023Vision, Deduction and Alignment: An Empirical Study on Multi-modal Knowledge Graph Alignmentcited by 19
  30. 2023SeqGPT: An Out-of-the-box Large Language Model for Open Domain Sequence Understandingcited by 18
  31. 2023A Frustratingly Easy Plug-and-Play Detection-and-Reasoning Module for Chinese Spelling Checkcited by 15
  32. 2025Refine Knowledge of Large Language Models via Adaptive Contrastive Learningcited by 15
  33. 2022Contextual Similarity is More Valuable than Character Similarity: An Empirical Study for Chinese Spell Checkingcited by 14
  34. 2024VerMCTS: Synthesizing Multi-Step Programs using a Verifier, a Large Language Model, and Tree Searchcited by 14
  35. 2025One Example Shown, Many Concepts Known! Counterexample-Driven Conceptual Reasoning in Mathematical LLMscited by 14
  36. 2023Correct Like Humans: Progressive Learning Framework for Chinese Text Error Correctioncited by 13
  37. 2023MESED: A Multi-modal Entity Set Expansion Dataset with Fine-grained Semantic Classes and Hard Negative Entitiescited by 13
  38. 2022Embracing Ambiguity: Improving Similarity-oriented Tasks with Contextual Synonym Knowledgecited by 12

50 most cited of 51 All 51 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 1.

4 papers.