← All publications

Conference

Source-Obligation-Guided Validation of LLM-Based Code Translation

Duc Thuan Mai, Minh Hieu Le, Phung Trung Nguyen Nguyen, Xuan-Bach Le

To appear

Abstract

LLM-translated code can compile, look idiomatic, and pass shallow tests while still changing boundary behavior. We present SageTransVal , a validation layer that extracts branch, boundary/type, API, and exception obligations from source programs, turns them into validation cases, compares matched source and target executions, and emits structured counterexample packets. We evaluate 100 Python-to-Java subjects (200 subject-provider trials) and a 30-subject C-to-Rust corpus (60 trials), translated by GPT-4o-mini and Gemini 2.5 Flash Lite. On Python-to-Java, obligation-guided validation detects mismatches in 79.0% of trials, compared with 81.0% for the generic boundary-test baseline; the paired comparison finds no statistically significant difference (McNemar p = 0.42). Guided suites average 4.92 tests per trial, compared with 5.77 for the baseline (14.7% fewer; Wilcoxon p = 2.0×10 −6 ). On C-to-Rust, the observed rates are 11.7% (7/60) for obligation-guided validation and 10.0% (6/60) for the generic baseline. These results are descriptive. Disabling the primary UB-safe policy changes the C-to-Rust detection rate to 41.7%, primarily through A-integer cases; D-string detection remains 33.3%. We report packet availability and contents, but do not evaluate downstream repair effectiveness. Keywords: LLM code translation, Translation validation, Static analysis, Differential testing, Fuzzing, Program repair

Translation ValidationDifferential TestingLLM Code Translation

Cite this paper

@inproceedings{mai2026sagetransval,
  author    = {Mai, Duc Thuan and Le, Minh Hieu and Nguyen, Phung Trung Nguyen and Le, Xuan-Bach},
  title     = {Source-Obligation-Guided Validation of {LLM}-Based Code Translation},
  booktitle = {Proceedings of the 15th International Conference on Computational Science and Network Intelligence (CSoNet 2026)},
  year      = {2026},
  series    = {Lecture Notes in Computer Science},
  publisher = {Springer},
  address   = {Ho Chi Minh City, Vietnam},
  note      = {Artifact: \url{https://github.com/Water2ing/SageTransVal}}
}