InCoder-32B(Industrial-Coder-32B)是首个专为工业代码智能打造的320亿参数代码基础模型。尽管通用代码大语言模型在主流软件任务中表现出色,但它们往往难以满足工业编程的独特需求——硬件语义、专用语言结构、严格的资源限制以及特定领域的正确性验证。
在论文《InCoder-32B:面向工业场景的代码基础模型》中,InCoder-32B实现了五大工业领域的代码智能统一:
| 领域 | 语言与框架 |
|---|---|
| 🔧 芯片设计 | Verilog、SystemVerilog、RTL |
| ⚡ GPU内核优化 | CUDA、Triton |
| 🖥️ 嵌入式系统 | C/C++、ARM Cortex-M4、STM32 |
| 🔨 编译器优化 | x86-64 ASM、C/C++、LLVM-IR |
| 📐 3D建模/CAD | CadQuery、OpenCascade、Python |
InCoder-32B在通用任务上实现了极具竞争力的性能,同时在所有评估的工业领域中树立了最强的开源基准。
| 基准测试 | InCoder-32B |
|---|---|
| SWE-bench Verified | 74.8% |
| LiveCodeBench(Pass@1) | 49.14% |
| BFCL v3 | 60.99% |
| HumanEval+ | 89.6% |
| MBPP+ | 78.3% |
| BigCodeBench(完整版) | 49.8% |
| 基准测试 | 领域 | InCoder-32B | 最佳竞争开源模型 |
|---|---|---|---|
| VeriScope Score | 芯片设计 | 80.7 | 83.2(GLM-5) |
| CAD-Coder Compile | 3D建模 | 82.0% | 48.0%(Kimi-K2-Thinking) |
| KernelBench L1 | GPU优化 | 22.2% | 16.2%(GLM-5) |
| KernelBench L2 | GPU优化 | 36.0% | 28.0%(KernelBench L2) |
InCoder-32B在CAD-Coder和KernelBench(所有三个级别)上领先所有开源基准模型,甚至在CAD-Coder IoU和KernelBench L1/L2/L3上超越了Claude-Sonnet-4.6等专有模型。
InCoder-32B 采用标准的仅解码器 Transformer 架构,具体配置如下:
| 超参数 | 数值 |
|---|---|
| Parameters | ~32B |
| 层数 | 64 |
| 隐藏层大小 | 5,120 |
| 最大上下文长度 | 131,072(128K) |
| 位置编码 | RoPE(θ = 500,000) |
| 精度 | BFloat16 |
InCoder-32B 通过三阶段 Code-Flow 流程进行训练:
上下文窗口从 8K tokens 逐步扩展至 128K tokens:
基于真实工业任务构建 250 万条监督微调(SFT)样本,并利用 Icarus Verilog、nvcc 和 Renode(STM32 模拟器)等工具链进行基于执行结果的验证。
pip install transformers acceleratefrom transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "Multilingual-Multimodal-NLP/IndustrialCoder"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
prompt = """Write a synthesizable Verilog module for a UART transmitter (8N1 protocol).
The module should accept 8-bit parallel data and serialize it onto a TX line."""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.2,
do_sample=True,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))InCoder-32B 支持用于代码填充任务的 FIM 补全功能:
prefix = """// CUDA kernel for RMS Normalization
__global__ void rms_norm_kernel(float* output, const float* input,
const float* weight, int N, float eps) {
int idx = blockIdx.x;
"""
suffix = """
output[idx * N + tid] = normalized * weight[tid];
}"""
fim_prompt = f"<fim_prefix>{prefix}<fim_suffix>{suffix}<fim_middle>"
inputs = tokenizer(fim_prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))基于故障分析,模型可能在以下方面存在不足:
请务必在沙盒环境中对生成的代码进行审查和测试。工业级代码(RTL、嵌入式固件)在部署前必须经过专家审核。
@article{yang2026incoder,
title={InCoder-32B: Code Foundation Model for Industrial Scenarios},
author={Yang, Jian and Zhang, Wei and Wu, Jiajun and Cheng, Junhang and Guo, Shawn
and Wang, Haowen and Gu, Weicheng and Du, Yaxin and Li, Joseph and Xu, Fanglin
and others},
journal={arXiv preprint arXiv:2603.16790},
year={2026}
}