Saved in:
Bibliographic Details
Main Authors: Chakraborty, Manojit, Ghosh, Madhusudan, Gupta, Rishabh
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2510.09045
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918180190945280
author Chakraborty, Manojit
Ghosh, Madhusudan
Gupta, Rishabh
author_facet Chakraborty, Manojit
Ghosh, Madhusudan
Gupta, Rishabh
contents In the domain of software development, LLMs have been utilized to automate tasks such as code translation, where source code from one programming language is translated to another while preserving its functionality. However, LLMs often struggle with long source codes that don't fit into the context window, which produces inaccurate translations. To address this, we propose a novel zero-shot code translation method that incorporates identifier replacement. By substituting user-given long identifiers with generalized placeholders during translation, our method allows the LLM to focus on the logical structure of the code, by reducing token count and memory usage, which improves the efficiency and cost-effectiveness of long code translation. Our empirical results demonstrate that our approach preserves syntactical and hierarchical information and produces translation results with reduced tokens.
format Preprint
id arxiv_https___arxiv_org_abs_2510_09045
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LLM Based Long Code Translation using Identifier Replacement
Chakraborty, Manojit
Ghosh, Madhusudan
Gupta, Rishabh
Software Engineering
Artificial Intelligence
Information Retrieval
Machine Learning
In the domain of software development, LLMs have been utilized to automate tasks such as code translation, where source code from one programming language is translated to another while preserving its functionality. However, LLMs often struggle with long source codes that don't fit into the context window, which produces inaccurate translations. To address this, we propose a novel zero-shot code translation method that incorporates identifier replacement. By substituting user-given long identifiers with generalized placeholders during translation, our method allows the LLM to focus on the logical structure of the code, by reducing token count and memory usage, which improves the efficiency and cost-effectiveness of long code translation. Our empirical results demonstrate that our approach preserves syntactical and hierarchical information and produces translation results with reduced tokens.
title LLM Based Long Code Translation using Identifier Replacement
topic Software Engineering
Artificial Intelligence
Information Retrieval
Machine Learning
url https://arxiv.org/abs/2510.09045