# Translator vs. Challenger: Adversarial Agentic Learning for C-to-Rust Translation

arXiv: https://arxiv.org/abs/2609.15381 · HTML: https://mlsanity.com/paper/2609.15381/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Placed in General LLM agent frameworks and benchmarks, one of 16 directions in LLM agents and tool use.
- Builds on 39 of its 55 references that are in the map.
- First posted on arXiv 14 Sep 2026.

## Placed in

- LLM agents and tool use / [General LLM agent frameworks and benchmarks](https://mlsanity.com/agents/general-llm-agent-frameworks-and-benchmarks/)

## Builds on (most cited first, 30 of 39)

- [Reflexion: Language Agents with Verbal Reinforcement Learning](https://mlsanity.com/paper/2303.11366/) (2023)
- [ExpeL: LLM Agents Are Experiential Learners](https://mlsanity.com/paper/2308.10144/) (2023)
- [Agent Workflow Memory](https://mlsanity.com/paper/2409.07429/) (2024)
- [Agent KB: Leveraging Cross-Domain Experience for Agentic Problem Solving](https://mlsanity.com/paper/2507.06229/) (2025)
- [AutoGuide: Automated Generation and Selection of Context-Aware Guidelines for Large Language Model Agents](https://mlsanity.com/paper/2403.08978/) (2024)
- [SWE-Exp: Experience-Driven Software Issue Resolution](https://mlsanity.com/paper/2507.23361/) (2025)
- [Towards Translating Real-World Code with LLMs: A Study of Translating to Rust](https://mlsanity.com/paper/2405.11514/) (2024)
- [Pruning the Unsurprising: Efficient LLM Reasoning via First-Token Surprisal](https://mlsanity.com/paper/2508.05988/) (2025)
- [Get Experience from Practice: LLM Agents with Record & Replay](https://mlsanity.com/paper/2505.17716/) (2025)
- [CRUST-Bench: A Comprehensive Benchmark for C-to-safe-Rust Transpilation](https://mlsanity.com/paper/2504.15254/) (2025)
- [EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translation](https://mlsanity.com/paper/2508.04295/) (2025)
- [C2SaferRust: Transforming C Projects into Safer Rust with NeuroSymbolic Techniques](https://mlsanity.com/paper/2501.14257/) (2025)
- [In Line with Context: Repository-Level Code Generation via Context Inlining](https://mlsanity.com/paper/2601.00376/) (2026)
- [GlimpRouter: Efficient Collaborative Inference by Glimpsing One Token of Thoughts](https://mlsanity.com/paper/2601.05110/) (2026)
- [Syzygy: Dual Code-Test C to (safe) Rust Translation using LLMs and Dynamic Analysis](https://mlsanity.com/paper/2412.14234/) (2024)
- [SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents](https://mlsanity.com/paper/2606.28434/) (2026)
- [Ownership guided C to Rust translation](https://mlsanity.com/paper/2303.10515/) (2023)
- [RustMap: Towards Project-Scale C-to-Rust Migration via Program Analysis and LLM](https://mlsanity.com/paper/2503.17741/) (2025)
- [SACTOR: LLM-Driven Correct and Idiomatic C to Rust Translation with Static Analysis and FFI-Based Verification](https://mlsanity.com/paper/2503.12511/) (2025)
- [Dockerless: Environment-Free Program Verifier for Coding Agents](https://mlsanity.com/paper/2606.28436/) (2026)
- [To Tag, or Not to Tag: Translating C's Unions to Rust's Tagged Unions](https://mlsanity.com/paper/2408.11418/) (2024)
- [Translating C To Rust: Lessons from a User Study](https://mlsanity.com/paper/2411.14174/) (2024)
- [SafeTrans: LLM-assisted Transpilation from C to Rust](https://mlsanity.com/paper/2505.10708/) (2025)
- [RustRepoTrans: Repository-level Code Translation Benchmark Targeting Rust](https://mlsanity.com/paper/2411.13990/) (2024)
- [Integrating Rules and Semantics for LLM-Based C-to-Rust Translation](https://mlsanity.com/paper/2508.06926/) (2025)
- [Translating Large-Scale C Repositories to Idiomatic Rust](https://mlsanity.com/paper/2511.20617/) (2025)
- [Concrat: An Automatic C-to-Rust Lock API Translator for Concurrent Programs](https://mlsanity.com/paper/2301.10943/) (2023)
- [SmartC2Rust: Iterative, Feedback-Driven C-to-Rust Translation via Large Language Models for Safety and Equivalence](https://mlsanity.com/paper/2409.10506/) (2024)
- [Forcrat: Automatic I/O API Translation from C to Rust via Origin and Capability Analysis](https://mlsanity.com/paper/2506.01427/) (2025)
- [Raw Pointer Rewriting with LLMs for Translating C to Safer Rust](https://mlsanity.com/paper/2505.04852/) (2025)

## Abstract (arXiv)

C-to-Rust translation remains challenging due to the substantial semantic gap between the two languages. Recent experience-enhanced LLM translators improve translation quality by learning reusable insights from prior failures and repairs. Yet learned insights do not automatically constitute reusable translation knowledge: derived from sparse, program-specific traces, they often contain missing conditions, narrow applicability boundaries, or overlooked corner cases. This limits their robustness and generalizability in new translation scenarios. We present TRAIL, an adversarial agentic learning framework for robust C-to-Rust translation. TRAIL employs two collaborating agents: a Translator that derives candidate insights from translation failures and accepted repairs, and a Challenger that actively searches for weaknesses, gaps, and boundary cases through adversarial challenges. To improve the robustness of individual insights and the completeness of insight collections, TRAIL performs adversarial learning at two levels. Individual-insight adversarial learning repeatedly stress-tests each insight to refine its applicability conditions and constraints, while compositional insight adversarial learning strengthens groups of related insights by exposing conflicts, gaps, and uncovered corner cases. By challenging insights and their compositions with executable counterexamples, TRAIL transforms trace-specific experience into robust, reusable, and generalizable translation knowledge. We evaluate TRAIL on two project-level benchmarks, CRUST-Bench and SmartC2Rust-Bench. Compared with the strongest LLM-based baseline, TRAIL achieves average relative improvements of 23.1% in syntax accuracy and 15.9% in semantic accuracy. Furthermore, the adversarially refined insights transfer effectively across benchmarks, demonstrating strong generalizability across diverse C-to-Rust translation tasks.
