Skip to content
conftrace_
2026 EMNLP EMNLP 2026

Surfacing Program Structure with Auxiliary Signals for Low-Resource Code Translation

AbstractLLMs are extremely good code translators, except when it matters most: translating from low-resource to high-resource programming languages. The reason may lie in the fact that code translation relies on superficial lexical cues rather than on exploiting the deeper, language-agnostic program structure. We propose BoJac (Bohm–Jacopini), a novel commenting approach that pushes LLMs to exploit program structure by verbalizing structured programming principles in a guided natural language format. By using structure, BoJac enhances the ability to translate low-resource to-high-resource code. Using equivalent code benchmarks across multiple language pairs, we compare BoJac against several forms of auxIliary guidance provided alongside the source code: synthetic free-form chain-of comments, abstract syntax tree, and I/O Traces. To disentangle structural understanding from identifier-level matching, we repeat all experiments under name mangling and extend the same comparison to LoRA Fine-tuning on signal-augmented training sets. Our results show that the strongest gains come from auxiliary signals expressed in natural language, particularly when they explicitly encode structural and computational-level properties of the source code as in BoJac. While purely structural representations appear less effective, hybrid approaches such as BoJac, which convey structural and paradigm-level information through formalised natural language, emerge as a promising direction.

More from EMNLP 2026

All EMNLP 2026 papers →