You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using TransCoder for a few research papers lately and I came across an interesting phenomenon using the pretrained model "TransCoder_model_1.pth" you provide in your docs.
For the program in your dataset COUNT_OF_PAIRS_SATISFYING_THE_GIVEN_CONDITION.java when translated to Python, it passes all test cases. We checked and the translation seems correct. However, when we perform any small syntactical change to the original Java code and try to translate again, the translation mismatches the changed program.
For example, we introduced a change to the following Java code by modifying s.charAt(i) -> s.charAt(++i) at line 5:
staticintf_gold( inta, intb ) {
java.lang.Strings = String.valueOf( b );
inti;
for (i = 0; i < s.length(); i++) {
if (s.charAt( ++i ) != '9') {
break;
}
}
intresult;
if (i == s.length()) {
result = a * s.length();
} else {
result = a * (s.length() - 1);
}
returnresult;
}
Notice that the changed code is rightfully translated, however, result = a * (s.length() - 1); is now wrongfully translated to result = a * (1 - len(s)).
We have generated 89 variations of this Java function using MuJava, and this translation bug appears in every single one of them, except the original program.
Maybe this is an overfitting example. What are your thoughts?
The text was updated successfully, but these errors were encountered:
I have been using TransCoder for a few research papers lately and I came across an interesting phenomenon using the pretrained model "TransCoder_model_1.pth" you provide in your docs.
For the program in your dataset
COUNT_OF_PAIRS_SATISFYING_THE_GIVEN_CONDITION.java
when translated to Python, it passes all test cases. We checked and the translation seems correct. However, when we perform any small syntactical change to the original Java code and try to translate again, the translation mismatches the changed program.For example, we introduced a change to the following Java code by modifying
s.charAt(i)
->s.charAt(++i)
at line 5:The translated code is as follows:
Notice that the changed code is rightfully translated, however,
result = a * (s.length() - 1);
is now wrongfully translated toresult = a * (1 - len(s))
.We have generated 89 variations of this Java function using MuJava, and this translation bug appears in every single one of them, except the original program.
Maybe this is an overfitting example. What are your thoughts?
The text was updated successfully, but these errors were encountered: