atlas

Research map / Large language models / Agents, code and math

Automatically Testing Functional Properties of Code Translation Models

AAAI 2024 · Large language models › Agents, code and math · approach: Execution-based code verification · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Extends the Nomos hyperproperty testing framework to test functional (syntactic and semantic) k-safety properties of code translation models and proposes a property-guided search over model temperature to obtain better translations.

Problem

Code translation models (LLM-based transpilers) may produce incorrect code, and existing evaluation relies on small, manually or automatically generated test suites over a small corpus, leaving generalization unclear; users also want a correct translation for a given program without retraining.

Approach

Express syntactic and semantic 1- and 2-safety (hyperproperty) specifications for transpilers in an extended Nomos language, test them via metamorphic test harnesses that generate program variants, and use a lexicographic hill-climbing search over model parameters (temperature) that minimizes violated properties for a given input program.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Search over temperature for up to 20 iterationsTransCoder · Java-to-Python, 100 programspassing programs: 66 to 84Helped
Search over temperature for up to 20 iterationsTransCoder · Java-to-Python, 100 programsviolated properties: 78 to 35Helped
Search over temperature for up to 20 iterationsDOBF · Java-to-Python, 100 programspassing programs: 71 to 83Helped
Search over temperature for up to 20 iterationsDOBF · Java-to-Python, 100 programsviolated properties: 100 to 63Helped
Increase beam size from 1 to 3code translation models · Java-to-C++ and Java-to-Pythonviolated properties: decreases by between 3 and 7Helped
Use StarCoder instead of specialized translation modelsJava-to-Python translation · Java-to-Pythontotal property violations: 11213 vs 5777; 11213 vs 5564Hurt

Surprising findings

Limitations

Experimental setup

Datasets: TransCoder benchmark of 545 LeetCode solutions in Java, C++, and Python

Benchmarks: TransCoder 545-program LeetCode benchmark

Metrics: percentage of unique property violations number of violated properties total violations number of passing programs

Baselines: TransCoder DOBF TransCoder-IR StarCoder

Builds on: Nomos metamorphic testing TransCoder DOBF TransCoder-IR

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy