A Matter of Representation: Towards Graph-Based Abstract Code Generation
Not on the map. Why?
Abstract (arXiv)
Most large language models (LLMs) today excel at generating raw, sequential code with minimal abstractions and custom structures. However, there has been little work on graph-based abstract code generation, where significant logic is encapsulated in predefined nodes and execution flow is determined by edges. This is relevant for visual programming languages, and in cases where raw source code is inaccessible to users and LLM training sets. In this work, we propose and evaluate JSON representations for graphs to enable high accuracy graph-based abstract code generation. We evaluate these representations on ScratchTest, a mini-benchmark based on our custom Python re-implementation of Scratch, which tests the LLM in code graph space. Our findings demonstrate that LLMs can indeed perform the aforementioned generation task in a single pass without relying on specialized or complex pipelines, given the correct graph representations. We also show that different representations induce significantly different accuracies, highlighting the instrumental role of representations in this generation task. All in all, this work establishes the first steps towards representation learning for graph-based abstract code generation.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 32 of its 47 references that are in the map. First posted on arXiv 15 Oct 2025.
Builds on
32 of 47 references.
References · 32
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 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
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,418
- 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,332
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
- 2024The WMDP Benchmark: Measuring and Reducing Malicious Use With Unlearningcited by 509
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2018GraphRNN: Generating Realistic Graphs with Deep Auto-regressive Modelscited by 413
- 2022The Stack: 3 TB of permissively licensed source codecited by 359
20 more
- 2025Demystifying Long Chain-of-Thought Reasoning in LLMscited by 326
- 2022Efficient Training of Language Models to Fill in the Middlecited by 255
- 2023Can Language Models Solve Graph Problems in Natural Language?cited by 252
- 2023Language is All a Graph Needscited by 220
- 2023Efficient Guided Generation for Large Language Modelscited by 200
- 2025Plan-and-Act: Improving Planning of Agents for Long-Horizon Taskscited by 195
- 2023Large Language Models on Graphs: A Comprehensive Surveycited by 192
- 2023An LLM Compiler for Parallel Function Callingcited by 179
- 2023Talk like a Graph: Encoding Graphs for Large Language Modelscited by 176
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 159
- 2024CodeGemma: Open Code Models Based on Gemmacited by 150
- 2022Large Language Models Meet NL2Code: A Surveycited by 138
- 2017GraphGAN: Graph Representation Learning with Generative Adversarial Netscited by 121
- 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 112
- 2023Graph Foundation Models: Concepts, Opportunities and Challengescited by 103
- 2024HumanEval-XL: A Multilingual Code Generation Benchmark for Cross-lingual Natural Language Generalizationcited by 86
- 2024XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Modelscited by 75
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
- 2024On the Scalability of GNNs for Molecular Graphscited by 36
- 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
Built on by
Not cited yet.