IRIS-14B
IRIS-14B is the first transformer model fine-tuned for neural translation between compiler Intermediate Representations (IRs) (IR-to-IR), specifically from GIMPLE (as emitted by GCC) to LLVM IR (as emitted by LLVM).
The model is initialized from Qwen/Qwen3-14B-Base (base model) and trained on aligned pairs of GIMPLE and LLVM IR extracted from real-world C programs.
Intended Use
IRIS-14B is designed for IR-to-IR translation, enabling interoperability between the GCC and LLVM compiler ecosystems by translating unoptimized GIMPLE into semantically equivalent LLVM IR that can be compiled by the LLVM toolchain.
Typical workflow:
- 🛠️ Compile C code with GCC and dump the GIMPLE form using
-fdump-tree-gimple. - 🔄 Use IRIS-14B to translate GIMPLE → LLVM IR.
- ⚙️ Compile the generated LLVM IR using the LLVM toolchain (e.g.,
llc,clang).
Target Users:
- Compiler researchers and engineers.
- Toolchain developers.
- Advanced users working with GCC / LLVM internals.
- Researchers studying LLM-based program transformation.
Example Applications:
IRIS-14B enables compilation workflows that are otherwise unsupported, including:
- Legacy languages supported by GCC but not LLVM (e.g., Modula-2).
- GCC-specific C extensions not supported by Clang (e.g., nested functions).
- Fortran features supported in
gfortranbut not inflang. - Ada programs relying on
Scalar_Storage_Order, supported by GNAT (GCC-based) but not GNAT-LLVM.
In addition to source languages, IRIS facilitates cross-toolchain experimentation, including the reuse of optimizations and a decoupling of source-language support from target architecture availability.
Out-of-Scope Uses:
IRIS-14B is not intended for:
- Source-to-source translation (e.g., C → Rust).
- Optimized IR generation.
- General-purpose code generation or natural language tasks.
Quickstart
The following contains a code snippet illustrating how to use the model to generate LLVM IR based on a given GIMPLE sample.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "HPAI-BSC/IRIS-14B"
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# prepare the model input (GIMPLE sample)
sample = """
\nint main ()\n{\n int D.2132;\n\n {\n long long int total;\n int i;\n\n scanf ("%d\\n", &n);\n i = 0;\n goto <D.2118>;\n <D.2117>:\n _1 = &A[i];\n scanf ("%d", _1);\n i = i + 1;\n <D.2118>:\n n.0_2 = n;\n if (i < n.0_2) goto <D.2117>; else goto <D.2115>;\n <D.2115>:\n left[0] = 1;\n _3 = A[0];\n seen[_3] = 1;\n i = 1;\n goto <D.2122>;\n <D.2121>:\n _4 = i + -1;\n _5 = left[_4];\n left[i] = _5;\n _6 = A[i];\n _7 = seen[_6];\n if (_7 == 0) goto <D.2128>; else goto <D.2129>;\n <D.2128>:\n _8 = A[i];\n seen[_8] = 1;\n _9 = left[i];\n _10 = _9 + 1;\n left[i] = _10;\n <D.2129>:\n i = i + 1;\n <D.2122>:\n n.1_11 = n;\n if (i < n.1_11) goto <D.2121>; else goto <D.2119>;\n <D.2119>:\n memset (&seen, 0, 400004);\n total = 0;\n n.2_12 = n;\n i = n.2_12 + -1;\n goto <D.2126>;\n <D.2125>:\n _13 = A[i];\n _14 = seen[_13];\n if (_14 == 0) goto <D.2130>; else goto <D.2131>;\n <D.2130>:\n _15 = A[i];\n seen[_15] = 1;\n _16 = i + -1;\n _17 = left[_16];\n _18 = (long long int) _17;\n total = total + _18;\n <D.2131>:\n i = i + -1;\n <D.2126>:\n if (i > 0) goto <D.2125>; else goto <D.2123>;\n <D.2123>:\n printf ("%lld\\n", total);\n D.2132 = 0;\n return D.2132;\n }\n D.2132 = 0;\n return D.2132;\n}\n\n
"""
messages = [
{"role": "user", "content": sample}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
print("prompt: ", text)
# model inference
generated_ids = model.generate(
**model_inputs,
max_new_tokens=32768
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
content = tokenizer.decode(output_ids, skip_special_tokens=True).strip("\n")
print("model response (LLVM IR): ", content)
IRIS-14B inherits the 32,768-token native context length from its base model.
Limitations and bias
Language-dependent IR features
- IRIS-14B is trained only on C-derived IR.
- Therefore, it may not fully capture lowering patterns specific to other source languages (e.g., Ada, Fortran).
Translation direction
- Trained and evaluated on the GIMPLE → LLVM IR translation direction only.
- Reverse translation is not supported due to limited GCC support for parsing textual GIMPLE.
Training data
IRIS-14B is trained exclusively on IR pairs extracted from C-language programs, compiled with both GCC and Clang to obtain aligned IR pairs. To train the model, we construct two datasets:
TheStack-IRIS: Derived from TheStack v1 dataset, filtered to deduplicated and compilable C code. Approximately 310k IR samples are retained after compilation filtering.
GNU-IRIS: A dataset introduced with IRIS, consisting of around 13k aligned function-level IR pairs extracted from selected GNU utilities repositories.
Training details
- Base model: Qwen3 (14B parameters)
- Architecture: Decoder-only Transformer
- Training data: ~1.4B tokens of paired IRs
- Max sequence length: 16,384 tokens
- Epochs: 3
- Optimizer: AdamW (β₁ = 0.9, β₂ = 0.999)
- Learning rate: peak at 2.07e-5
- Scheduler: cosine with 3% warmup
- Hardware: 15 nodes × 4 NVIDIA H100 GPUs
- Training time: ~35 hours
- Energy consumption: ~0.86 MWh
- Estimated CO₂ emissions 🌱: ~244 kg
Evaluation results
IRIS-14B is evaluated on an IR-to-IR translation task, which consists of translating GIMPLE IR into LLVM IR such that the generated code successfully compiles with the LLVM toolchain and passes functional I/O tests. For evaluation, we construct two benchmarks:
- CodeForces-IRIS: IR snippets extracted from competitive programming code from CodeForces with higher structural complexity.
- ExeBench-IRIS: IR snippets extracted from the Exebench benchmarks consisting of simplified real-world code extracted from repositories.
For evaluation, we use two metrics reported as pass@1, N=3:
- Compile: Percentage of samples where the generated LLVM IR compiles successfully (pass@1, N=3)
- I/O Tests: Percentage of samples that compile and pass all functional tests (pass@1, N=3)
🏆 Leaderboard (pass@1, N=3)
Last leaderboard update: Sept 2026.
The IR-to-IR translation task is challenging for general-purpose and coder LLMs, and model size alone correlates weakly with performance. Despite having only 14B parameters, IRIS-14B consistently outperforms all larger baseline models.
📖 Citation
If you use IRIS-14B, please cite our work:
@article{ramirez2026llm,
title={LLM Translation of Compiler Intermediate Representation},
author={Valenzuela-Ramirez, Andrea and Gutierrez-Gomez, Cristian and Barroso, Marta and Garcia-Gasulla, Dario and Royuela, Sara},
journal={arXiv preprint arXiv:2605.08247},
year={2026}
}
- Downloads last month
- 5
Model tree for HPAI-BSC/IRIS-14B
Base model
Qwen/Qwen3-14B-Base
