mlsanityData to 7 Oct 2026

Post-Incorporating Code Structural Knowledge into Pretrained Models via ICL for Code Translation

arXiv 2503.22776 ↗First posted 28 Mar 2025cs.SE cs.AIcited by 3

Not on the map. Why?

Abstract (arXiv)

Code translation migrates codebases across programming languages. Recently, large language models (LLMs) have achieved significant advancements in software mining. However, handling the syntactic structure of source code remains a challenge. Classic syntax-aware methods depend on intricate model architectures and loss functions, rendering their integration into LLM training resource-intensive. This paper employs in-context learning (ICL), which directly integrates task exemplars into the input context, to post-incorporate code structural knowledge into pre-trained LLMs. We revisit exemplar selection in ICL from an information-theoretic perspective, proposing that list-wise selection based on information coverage is more precise and general objective than traditional methods based on combining similarity and diversity. To address the challenges of quantifying information coverage, we introduce a surrogate measure, Coverage of Abstract Syntax Tree (CAST). Furthermore, we formulate the NP-hard CAST maximization for exemplar selection and prove that it is a standard submodular maximization problem. Therefore, we propose a greedy algorithm for CAST submodular maximization, which theoretically guarantees a (1-1/e)-approximate solution in polynomial time complexity. Our method is the first training-free and model-agnostic approach to post-incorporate code structural knowledge into existing LLMs at test time. Experimental results show that our method significantly improves LLMs performance and reveals two meaningful insights: 1) Code structural knowledge can be effectively post-incorporated into pre-trained LLMs during inference, despite being overlooked during training; 2) Scaling up model size or training data does not lead to the emergence of code structural knowledge, underscoring the necessity of explicitly considering code syntactic structure.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 61 of its 94 references that are in the map. First posted on arXiv 28 Mar 2025.

Builds on

61 of 94 references.

References · 61

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2024The Llama 3 Herd of Modelscited by 14,192
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  5. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  6. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  7. 2024Qwen2.5 Technical Reportcited by 4,713
  8. 2022Emergent Abilities of Large Language Modelscited by 2,483
  9. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  10. 2024Qwen2 Technical Reportcited by 2,076
  11. 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,928
  12. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
38 more
  1. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
  2. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  3. 2024Gemma: Open Models Based on Gemini Research and Technologycited by 889
  4. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  5. 2023StarCoder: may the source be with you!cited by 790
  6. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  7. 2022Transformers learn in-context by gradient descentcited by 714
  8. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  9. 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
  10. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  11. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  12. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  13. 2022Dynamic Prompt Learning via Policy Gradient for Semi-structured Mathematical Reasoningcited by 347
  14. 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 325
  15. 2024Long-context LLMs Struggle with Long In-context Learningcited by 285
  16. 2017Unsupervised Machine Translation Using Monolingual Corpora Onlycited by 272
  17. 2020Unsupervised Translation of Programming Languagescited by 262
  18. 2018code2vec: Learning Distributed Representations of Codecited by 249
  19. 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 240
  20. 2022Towards Understanding Chain-of-Thought Prompting: An Empirical Study of What Matterscited by 221
  21. 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 220
  22. 2022In-context Examples Selection for Machine Translationcited by 172
  23. 2024CodeGemma: Open Code Models Based on Gemmacited by 145
  24. 2023Compositional Exemplars for In-context Learningcited by 143
  25. 2023Unified Demonstration Retriever for In-Context Learningcited by 141
  26. 2022Diverse Demonstrations Improve In-context Compositional Generalizationcited by 136
  27. 2018Tree-to-tree Neural Networks for Program Translationcited by 93
  28. 2021Leveraging Automated Unit Tests for Unsupervised Code Translationcited by 82
  29. 2023UPRISE: Universal Prompt Retrieval for Improving Zero-Shot Evaluationcited by 74
  30. 2024In-context Learning with Retrieved Demonstrations for Language Models: A Surveycited by 69
  31. 2021AVATAR: A Parallel Corpus for Java-Python Program Translationcited by 59
  32. 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
  33. 2021Weakly-Supervised Visual-Retriever-Reader for Knowledge-based Question Answeringcited by 50
  34. 2024Let's Learn Step by Step: Enhancing In-Context Learning Ability with Curriculum Learningcited by 47
  35. 2021Perfection Not Required? Human-AI Partnerships in Code Translationcited by 42
  36. 2022Code Translation with Compiler Representationscited by 42
  37. 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 40
  38. 2025MDP3: A Training-free Approach for List-wise Frame Selection in Video-LLMscited by 40

50 most cited of 61 All 61 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 3.

3 papers.