TreeCoder: Systematic Exploration and Optimisation of Decoding and Constraints for LLM Code Generation
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have shown remarkable ability to generate code, yet their outputs often violate syntactic or semantic constraints when guided only through natural language prompts. We introduce TreeCoder, the most general and flexible framework to date for exploring decoding strategies, constraints, and hyperparameters in LLMs, and use it in code generation to enforce correctness and structure during decoding rather than relying on prompt engineering. TreeCoder represents decoding as a tree search over candidate programs, where both decoding strategies and constraint functions - such as style, syntax, execution - are treated as first-class, optimisable components. This design enables systematic exploration and automatic tuning of decoding configurations using standard optimisation techniques. Experiments on the MBPP (Python) and SQL-Spider benchmarks show that TreeCoder consistently improves accuracy across open-source models such as CodeLlama, Mistral and DeepSeek, often outperforming their unconstrained baselines by considerable margins.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 25 of its 46 references that are in the map. First posted on arXiv 27 Nov 2025.
Builds on
25 of 46 references.
References · 25
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2019Optuna: A Next-generation Hyperparameter Optimization Frameworkcited by 2,501
- 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,218
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
- 2025rStar-Math: Small LLMs Can Master Math Reasoning with Self-Evolved Deep Thinkingcited by 313
- 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 197
- 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
13 more
- 2020NeuroLogic Decoding: (Un)supervised Neural Text Generation with Predicate Logic Constraintscited by 149
- 2020If beam search is the answer, what was the question?cited by 116
- 2024Grammar-Aligned Decodingcited by 54
- 2023Hot or Cold? Adaptive Temperature Sampling for Code Generation with Large Language Modelscited by 38
- 2025CRANE: Reasoning with constrained LLM generationcited by 38
- 2024IterGen: Iterative Semantic-aware Structured LLM Generation with Backtrackingcited by 29
- 2025Constrained Sampling for Language Models Should Be Easy: An MCMC Perspectivecited by 14
- 2025KV Cache Compression for Inference Efficiency in LLMs: A Reviewcited by 12
- 2024Controllable Generation via Locally Constrained Resamplingcited by 11
- 2018When to Finish? Optimal Beam Search for Neural Text Generation (modulo beam size)cited by 10
- 2024Sketch-Guided Constrained Decoding for Boosting Blackbox Large Language Models without Logit Accesscited by 9
- 2024Enhancing SQL Query Generation with Neurosymbolic Reasoningcited by 3
- 2025A Systematic Literature Review on Neural Code Translationcited by 2
Built on by
Citing papers per year: 2026: 5.
5 papers.
- 2026Learning Adaptive LLM Decodingcited by 3
- 2026Verifier-Guided Code Translation via Meta-Step Decodingcited by 2
- 2026Diagnosing CFG Interpretation in LLMscited by 1
- 2026Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Codecited by 0
- 2026Evaluating Inference-Time Defenses Against Package Hallucination in LLM-Generated Codecited by 0
- 2026Evaluating Inference-Time Defenses Against Package Hallucination in LLM-Generated Code23 Aug 2026
- 2026Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Code15 Jul 2026
- 2026Verifier-Guided Code Translation via Meta-Step Decoding17 May 2026
- 2026Diagnosing CFG Interpretation in LLMs22 Apr 2026
- 2026Learning Adaptive LLM Decoding10 Mar 2026