컴백부터 K-뷰티까지 — K-컬쳐의 모든 것을 메일로 받아보세요메일로 받아보기

METAL MEDIA

코드는 그대로 뜻만 유지한 채 변수명만 바꿔도, AI 코딩 에이전트는 흔들린다

arXiv:2608.183892026-08-20

A Jagged Frontier: Evaluating Robustness of Code Agents to Semantics-Preserving Transformations

코드는 그대로 뜻만 유지한 채 변수명만 바꿔도, AI 코딩 에이전트는 흔들린다

AI 코딩 에이전트가 실제 소프트웨어 버그를 고치는 성능을 겉모습만 다르고 동작은 똑같은 코드에서도 유지하는지 실험했다. 코드를 사람이 알아채기도 어려운 방식으로 바꿔치기한 뒤 같은 문제를 여러 번 풀게 시켜서, 원래 성능과 비교했다. 대부분의 조합에서 성능이 조금씩 떨어졌고, 어떤 모델이 강한지는 어떤 실행 틀을 쓰느냐, 어떤 벤치마크냐에 따라 완전히 뒤집혔다.

METAL MEDIA 해설 도표

코드는 그대로 뜻만 유지한 채 변수명만 바꿔도, AI 코딩 에이전트는 흔들린다

  1. 01코드의 실제 동작(테스트 결과)은 그대로 두면서 제어 흐름을 바꾸거나, 쓸모없는 죽은 코드를 끼워 넣거나, 변수·함수 이름을 바꾸는 14가지 '의미 보존 변형' 기법을 만들었다.
  2. 02Claude Opus 4.5, Kimi K2.5, MiniMax M2.5, Qwen 3.6-27B 네 모델을 mini-SWE agent와 OpenCode 두 실행 틀에 각각 붙여, SWE-bench Verified·SWE-bench Pro에서 뽑은 54개 실제 버그 수정 과제로 테스트했다.
  3. 03각 과제마다 원본 코드로 20번, 변형된 코드로 20번씩 에이전트를 돌려 문제 해결률을 짝지어 비교함으로써, 에이전트 자체의 무작위성과 변형의 영향을 구분했다.
  4. 0416개 조합(모델×실행틀×벤치마크) 중 6개에서 통계적으로 뚜렷한 성능 하락(최대 6.7퍼센트포인트)이 나타났고, 성능이 그대로였던 경우에도 에이전트가 쓰는 단계 수와 비용은 최대 9.9%, 22.9%까지 늘었다.
  5. 05어떤 모델이 변형에 강한지는 고정된 특성이 아니었다. Qwen은 mini-SWE agent에서는 가장 강했지만 OpenCode에서는 가장 취약했고, 더 단순한 실행 틀인 mini-SWE agent가 전반적으로 더 안정적이었다.
METAL MEDIA이 원문을 바탕으로 재구성한 해설 도표이며, 논문 저자의 원문 figure가 아닙니다.

무엇을 했나

  1. 코드의 실제 동작(테스트 결과)은 그대로 두면서 제어 흐름을 바꾸거나, 쓸모없는 죽은 코드를 끼워 넣거나, 변수·함수 이름을 바꾸는 14가지 '의미 보존 변형' 기법을 만들었다.
  2. Claude Opus 4.5, Kimi K2.5, MiniMax M2.5, Qwen 3.6-27B 네 모델을 mini-SWE agent와 OpenCode 두 실행 틀에 각각 붙여, SWE-bench Verified·SWE-bench Pro에서 뽑은 54개 실제 버그 수정 과제로 테스트했다.
  3. 각 과제마다 원본 코드로 20번, 변형된 코드로 20번씩 에이전트를 돌려 문제 해결률을 짝지어 비교함으로써, 에이전트 자체의 무작위성과 변형의 영향을 구분했다.
  4. 16개 조합(모델×실행틀×벤치마크) 중 6개에서 통계적으로 뚜렷한 성능 하락(최대 6.7퍼센트포인트)이 나타났고, 성능이 그대로였던 경우에도 에이전트가 쓰는 단계 수와 비용은 최대 9.9%, 22.9%까지 늘었다.
  5. 어떤 모델이 변형에 강한지는 고정된 특성이 아니었다. Qwen은 mini-SWE agent에서는 가장 강했지만 OpenCode에서는 가장 취약했고, 더 단순한 실행 틀인 mini-SWE agent가 전반적으로 더 안정적이었다.
Table 1: Catalog of semantics-preserving transformations (SPTs).
TransformationSummary
If Else SwitcherSwaps if/else branches and negates the condition
For Loop RewritingRewrites a for loop using an explicit iterator
And Condition SplitterDecomposes if A and B into nested ifs
Comparison SwapperSwaps operands and inverts the operator
While Loop UnrollingUnrolls one iteration of a while loop
Double Negation InjectorWraps a condition in not not (⋅)
Commutative Operand PermuterReorders commutative operands
Local Variable RenamerRenames safe local variables to synonyms
If True WrapperWraps a block in a permanently true guard
Try Except InjectorWraps a block in a redundant try/except
Dead Code InjectorInserts an unreachable block
Dead String AssignmentInserts an unread variable assignment
Dead Method InjectionAppends an unreachable method to a class
String Literal SplitterSplits a string literal into a concatenation
Table 2: Comparison of mini-SWE and OpenCode Agent Scaffolds
Categorymini-SWEOpenCode
ArchitectureSingle, centralized agentPrimary agents invoke tools and subagents for specific tasks (e.g., Build, Plan, General, Explore)
Available Toolsbashbash, edit, write, read, grep, glob, lsp, apply_patch, skill, todo_write, web_fetch, web_search, question
Access RestrictionsNoneAvailable tools determined by an agent’s role and user configuration
Context ManagementContinuous, append-onlyMultiple, dynamically changing contexts for different subagents

왜 중요한가

실제 배포 환경의 코드는 벤치마크 코드와 표면적으로 다르게 생기기 마련인데, 이런 사소한 겉모습 차이만으로도 최고 수준의 AI 코딩 에이전트 성능이 흔들릴 수 있다는 뜻이다. 벤치마크 순위만 보고 에이전트나 모델을 선택하면 실제 현장에서는 전혀 다른 결과를 겪을 수 있음을 보여준다.

이 논문의 용어

  • 의미 보존 변형(SPT) · 코드의 실제 동작(테스트 결과)은 바꾸지 않으면서 겉모습만 바꾸는 코드 수정 기법
  • 해결률(resolve rate) · 에이전트가 여러 번 시도했을 때 실제로 버그를 제대로 고친 비율
  • SWE-bench Verified / SWE-bench Pro · 실제 오픈소스 저장소의 버그 수정 과제를 모아 AI 코딩 에이전트 성능을 평가하는 표준 벤치마크
  • 실행 틀(agentic scaffold) · AI 모델이 코드를 탐색하고 수정하고 테스트하도록 도와주는 프로그램 뼈대(mini-SWE agent, OpenCode 등)
  • 죽은 코드 삽입 · 실행되어도 결과에 영향을 주지 않는 무의미한 코드를 끼워 넣는 변형 방식

본문에 싣지 못한 그림

  • Figure 1: Mean degradation Δ¯ (percentage points) for each model under each scaffold on both benchmarks. Error bars are fixed-population 95% bootstrap confidence intervals.
  • Figure 2: Mean relative change in agent steps (δ¯step) and cost (δ¯cost) after perturbation, for each scaffold–model configuration on the 28 SWE-bench Verified instances (left) and the 26 SWE-bench Pro instances (right), restricted to runs the agent resolved in both cases. Positive values mean perturbed runs take more steps, or cost more, than unperturbed runs on the same instance. Error bars are fixed-population 95% bootstrap confidence intervals.
  • Figure 3: Mean resolve rate (%) on unperturbed and perturbed runs for each model under each scaffold, on SWE-bench Verified (top) and SWE-bench Pro (bottom).
  • Figure 4: Mean relative change in agent steps (δ¯step) and cost (δ¯cost) after perturbation over all runs, for each scaffold–model configuration on the 28 SWE-bench Verified instances (left) and the 26 SWE-bench Pro instances (right). Positive values mean perturbed runs take more steps, or cost more, than unperturbed runs on the same instance. Error bars are fixed-population 95% bootstrap confidence intervals.
  • Figure 5: Per-instance degradation Δ⁡(i) for the 28 SWE-bench Verified instances under each configuration. Error bars are Newcombe 95% confidence intervals for the difference between the unperturbed and perturbed resolve proportions (n=20 runs per condition).
  • Figure 6: Per-instance degradation Δ⁡(i) for the 26 SWE-bench Pro instances under each configuration. Error bars are Newcombe 95% confidence intervals for the difference between the unperturbed and perturbed resolve proportions (n=20 runs per condition).
원문에서 그림 보기 →

저자 · Hasan Najib Mahmud (Colorado State University), Shreya Gupta (Microsoft), Isha Chaudhary (University of Illinois Urbana-

arXiv에서 원문 보기

최신 논문

논문 전체 보기 →

METAL MEDIA 최신 기사