# CRUSTPairs: A Cross-Language Dataset of Paired C and Rust Solutions

CRUSTPairs：CとRustの対になった解答の言語横断データセット

Hejlek, Vojtech, Almeida, Leonardo Jesus, Lopes, Alneu de Andrade · arXiv · 2026年11月9日

- **課題** C言語とRustの解答を同じ問題単位で対にしたデータがないため、言語横断の類似度を学習・評価することが難しいです。
- **結果** ファインチューニングモデルはMRR 0.724（LoRA）と0.792（全体のファインチューニング）を記録し、語彙ベースラインやゼロショットモデルを大きく上回りました。識別子を除いても、ファインチューニングモデルは性能の大部分を維持しました。

## C-Rustペアデータの不足

C言語からRustへの翻訳ツールは、主にコンパイルの可否と元のテストの通過の有無で評価されます。ただし、翻訳結果が元のプログラムと同じかを判断する類似度の観点からの学習データは不足しています。特にレガシーCはテストが不足していることが多く、この問いが最も必要な場面では実行ベースの検証が難しくなります。CRUSTPairsは、この隔たりを埋めるために、2言語の受理された提出を同じ問題単位で対にした1857ペアのデータセットを提示します。既存の並列コードデータセットは、多くの言語をスニペット単位で扱うか、単一の言語ペアに集中しており、Rustを含む解答単位のペアは見つけにくいです。

## データ構築と難易度の階層

CRUSTPairsは、xCodeEval（Codeforces）とIBM CodeNet（AtCoder）の受理された提出を使用しています。1ペアは、同じ問題に対する1つの受理されたC提出と1つの受理されたRust提出で構成されます。正規化の段階では、コメントを削除し、使われていない関数とマクロを取り除き、エントリポイントの名前をsolutionに変えます。この過程で、配布されたコードは独立してはコンパイルできなくなります。初期の2013ペアから127ペアが除かれ、1857ペアが残りました。難易度は、ゼロショットSFR埋め込みのコサイン類似度を25番目と75番目の百分位数で分け、easy、medium、hardとして定めており、生のスコアも一緒に提供されます。

## 言語横断検索と学習方法

検索タスクは、テスト分割の各Cの実装をクエリとして、187個のRust実装のプールから同じ問題の正解を探すことです。性能は平均逆順位（MRR）で測定します。ファインチューニングモデルはUniXcoder（126Mパラメータ）をベースにしており、バッチ内の他のペアを負例に使う対称InfoNCE目的関数で、CからRustの方向とRustからCの方向の両方を学習します。2つのバリアントは別々に学習されます。LoRAはクエリと値の射影に適用され、295Kの学習パラメータ、全体の0.23%を使い、学習率は2×10⁻⁴です。全体のファインチューニングは126Mパラメータすべてを更新し、学習率は1×10⁻⁵です。

評価には検証MRRが最も高いチェックポイントを使います。

## ベースラインとファインチューニングの結果

語彙ベースラインのTF-IDFは共有識別子のみを使い、MRR 0.206を記録しました。これはゼロショットUniXcoderの0.189を上回っています。この結果は、競技プログラミングの提出者が言語間で変数名を再利用する傾向と関係しています。ファインチューニングの結果は大きく異なります。LoRAはMRR 0.724を、全体のファインチューニングは0.792を記録しました。ゼロショットUniXcoderが最も難しい階層で記録した0.053は、ランダムベースラインの0.031の約1.7倍です。この値は、著者らの独自のテスト分割と測定条件で得られたものです。

## 識別子の匿名化実験

識別子の匿名化実験では、各言語でユーザー定義の識別子を位置ベースの名前に独立して置き換え、制御フロー、型、ライブラリ呼び出し、文字列リテラルはそのままにします。この操作は、言語間での名前の対応だけを取り除きます。その結果、ファインチューニングモデルは識別子を除いた後もMRRの96–97%を維持しました。一方、ゼロショットUniXcoderは66%にとどまり、語彙ベースラインの76%を下回りました。これは、構造が異なるペアでは共有名がシグナルよりも偶然に近い可能性があるという著者らの解釈と整合します。

## 適用範囲と限界

データの等価性は、2つの提出が公式に受理されたという事実から引き継がれたものであり、検証されたものではありません。テストや期待される入出力は配布されません。データは短く単一ファイルで、入出力中心の競技プログラミングの解答です。そのため、割り当て、エイリアシング、並行性が重要になるシステムコードへの転移は想定されていません。以前のリリースの難易度ラベルは、再生成後に個々のラベルの89%しか一致せず、元の実行結果を復元できないため、原因は確定していません。

## 論文情報

- **著者**: Hejlek, Vojtech, Almeida, Leonardo Jesus, Lopes, Alneu de Andrade
- **学会・ジャーナル**: arXiv · プレプリント
- **公開日**: 2026年11月9日
- **登録日**: 2026年11月10日
- **更新日**: 2026年11月9日
- **バージョン**: v1
- **arXiv**: 2611.11711
- **カテゴリ**: cs.SE · cs.LG
- **ライセンス**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **掲載内容**: 論文情報・解説・論文の図

[元論文 ↗](https://arxiv.org/abs/2611.11711v1) · [PDF ↗](https://arxiv.org/pdf/2611.11711v1)

この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。

## アブストラクト

C-to-Rust migration is an active agenda, but no dataset pairs the two languages at the level of whole solutions to a shared problem. We present CRUSTPairs, 1857 C/Rust implementation pairs drawn from competitive programming archives, normalised, deduplicated, and stratified into difficulty tiers by zero-shot cross-language embedding similarity, with perrecord provenance and licensing. Cross-language retrieval is hard on this data, and harder than a single baseline would suggest: TF-IDF over shared identifiers reaches MRR 0.21 and so beats a pretrained code model at 0.19, which on the hardest quarter of the data scores 1.7x chance. Finetuning reaches 0.79, and lifts that hardest quarter 10x. Renaming every user identifier settles what is being learned: the finetuned models keep 96-97% of their accuracy without them, while the pretrained model keeps 66\\% - less than the lexical baseline does - and on structurally divergent pairs the finetuned models are better without identifiers than with them.

## この論文を引用

Hejlek, Vojtech, Almeida, Leonardo Jesus, Lopes, Alneu de Andrade (2026). CRUSTPairs: A Cross-Language Dataset of Paired C and Rust Solutions. arXiv:2611.11711v1. https://arxiv.org/abs/2611.11711v1

**BibTeX**

```
@misc{vojtech2026crustpairs,
  title = {{CRUSTPairs: A Cross-Language Dataset of Paired C and Rust Solutions}},
  author = {Hejlek, Vojtech and Almeida, Leonardo Jesus and Lopes, Alneu de Andrade},
  year = {2026},
  eprint = {2611.11711},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.11711v1}
}
```

## この論文の用語

- [LoRA](https://refivu.com/ja/terms/84da7a415b66-low-rank-adaptation-lora)
- [TF-IDF](https://refivu.com/ja/terms/b8fd079027e3-tf-idf)

## ほかの論文解説

- [An Interpretable Fuzzy Tree for Turbofan Remaining Useful Life with an Auditable Per-Component Diagnostic Layer](https://refivu.com/ja/papers/9c897f14-b459-41f8-b91a-f257eb6c0a31-an-interpretable-fuzzy-tree-for-turbofan-remaining-useful.md)
- [Tropical Gaussian Anticoncentration: Optimal Instance-Dependent Bounds for Online Learning in Extensive-Form Games](https://refivu.com/ja/papers/9aeba1cf-9924-4bc7-a5d6-6af8f082488f-tropical-gaussian-anticoncentration-optimal-instance.md)
- [Learning calibrated probabilistic forecasts using Koopman mode decomposition and the continuous ranked probability score](https://refivu.com/ja/papers/7d2160bc-b50d-4daa-80ae-47f45db09a7e-learning-calibrated-probabilistic-forecasts-using-koopman.md)
- [Fast Approximate $\\ell\_p$ Chamfer Distance via Lopsided Embeddings and Structured JL](https://refivu.com/ja/papers/af65be94-df4a-495e-b528-92e1039c3712-fast-approximate-ell-p-chamfer-distance-via-lopsided.md)
- [Improving Analytic Constants via Interpretable AI-Guided Lean Proof Refinement](https://refivu.com/ja/papers/a19c3267-630e-4a04-bea7-d13ab044849e-improving-analytic-constants-via-interpretable-ai-guided.md)
- [CHANNELS4WORLD: An Environment-Scale Dataset for Wireless Foundation Models](https://refivu.com/ja/papers/c55c0e46-77df-4cf2-b71e-0a24136ab2e2-channels4world-an-environment-scale-dataset-for-wireless.md)
- [Martine: Benchmarking Multi-View 3D Surface Reconstruction Across Viewpoint Coverage, Resolution, and Lighting](https://refivu.com/ja/papers/338cc319-9362-4bac-8a97-2c9d0f531da7-martine-benchmarking-multi-view-3d-surface-reconstruction.md)
- [Perturbing Inputs Improves Pretraining Distillation](https://refivu.com/ja/papers/763a819f-91b8-469d-a0ca-899671a5f1cf-perturbing-inputs-improves-pretraining-distillation.md)
- [ChainCheck: Near-Perfect Evidence-Sufficiency Scores Can Conceal Sensitivity to Construction Artifacts -- Paired Conditional Contrasts that Expose an Evaluation Confound](https://refivu.com/ja/papers/90a9d5bc-5971-4595-b6cd-5a6f1bf73fc3-chaincheck-near-perfect-evidence-sufficiency-scores-can.md)
- [LAION-Audio-XL: A Web-Scale Corpus and Scaling Studies for Contrastive Language-Audio Pretraining](https://refivu.com/ja/papers/6c336d9f-23f9-4295-9c53-71a28682b228-laion-audio-xl-a-web-scale-corpus-and.md)
- [Benchmarking CNNs, Vision Transformers, and Foundation Models for Explainable Brain Tumor MRI Classification: Calibration, Decision Analysis, and External Validation](https://refivu.com/ja/papers/7a2d0525-ea26-4e79-9cd4-6a0e30e443ef-benchmarking-cnns-vision-transformers-and-foundation-models.md)
- [VeilTune: Secure Fine-Tuning of Private LoRA Adapters on Public Pretrained Language Models](https://refivu.com/ja/papers/1ac3c6eb-7952-4bcf-b058-eb348429161e-veiltune-secure-fine-tuning-of-private-lora-adapters.md)

---

AI解説には誤りが含まれることがあります。 [Refivu](https://refivu.com/ja/papers/26d58833-760c-4ec6-880a-8d37592f0bfc-crustpairs-a-cross-language-dataset-of-paired-c)
