CoolFace
Modelpublic

Multilingual-Multimodal-NLP/IndustrialCoder-Thinking

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
7likes276downloads
Model Card

InCoder-32B-Thinking: Reasoning Code Model for Industrial Scenarios

<div align="center">

![HuggingFace](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder-Thinking) ![GitHub](https://github.com/CSJianYang/Industrial-Coder) ![arXiv](https://huggingface.co/papers/2603.16790) ![License](LICENSE)

</div>

Model Summary

InCoder-32B-Thinking is the reasoning variant of the InCoder family. It extends InCoder-32B with chain-of-thought reasoning via <think>...</think> tags, enabling step-by-step problem decomposition before generating code. This is particularly effective for complex industrial tasks that require multi-step reasoning โ€” debugging RTL modules, optimizing GPU kernels, or diagnosing embedded firmware issues.

For the instruction-tuned variant (without thinking), see IndustrialCoder. For the pre-trained base model, see IndustrialCoder-Base.


Key Results

General Code Benchmarks

BenchmarkInCoder-32BInCoder-32B-Thinking
HumanEval+89.691.5
MBPP+78.380.1
BigCodeBench (Full)49.851.2
LiveCodeBench (Pass@1)49.1452.3

Industrial Code Benchmarks

BenchmarkDomainInCoder-32BInCoder-32B-Thinking
VeriScope ScoreChip Design80.782.3
CAD-Coder Compile (%)3D Modeling82.084.0
KernelBench L1 (%)GPU Optimization22.224.0
The thinking variant shows consistent improvements across both general and industrial benchmarks, with the largest gains on tasks requiring multi-step reasoning.

Model Architecture

Same architecture as InCoder-32B, with thinking-aware post-training:

HyperparameterValue
Parameters~32B
Layers64
Hidden Size5,120
Attention Heads40 (8 KV heads, GQA)
Max Context Length131,072 (128K)
Positional EncodingRoPE (ฮธ = 500,000)
PrecisionBFloat16

How Thinking Mode Works

InCoder-32B-Thinking generates a reasoning trace inside <think>...</think> tags before producing the final answer. This allows the model to:

  1. 1.Decompose complex problems into sub-tasks
  2. 2.Reason about constraints, edge cases, and hardware semantics
  3. 3.Plan the solution structure before writing code

Example output:

<think>
The user wants a UART transmitter module. Let me think through the design:
1. Need a state machine: IDLE -> START_BIT -> DATA_BITS -> STOP_BIT
2. 8N1 means: 8 data bits, no parity, 1 stop bit
3. Need a baud rate counter derived from the clock frequency
4. Shift register to serialize the 8-bit data LSB first
</think>

module uart_tx (
    input wire clk,
    ...

You can disable thinking mode to get direct answers (behaves like the instruct variant):

python
text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True,
    enable_thinking=False
)

Usage

Installation

bash
pip install transformers accelerate

Thinking Mode (default)

python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "Multilingual-Multimodal-NLP/IndustrialCoder-Thinking"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True,
)

messages = [
    {"role": "user", "content": "Optimize this CUDA kernel for better memory coalescing:\n__global__ void add(float *a, float *b, float *c, int N) {\n    int i = threadIdx.x;\n    if (i < N) c[i] = a[i] + b[i];\n}"}
]

# Thinking mode (default) โ€” model reasons before answering
text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)

with torch.no_grad():
    out = model.generate(**inputs, max_new_tokens=4096, temperature=0.6, top_p=0.85, top_k=20)

output = tokenizer.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=False)

# Parse thinking and response
if "</think>" in output:
    thinking = output.split("</think>")[0].replace("<think>\n", "").strip()
    response = output.split("</think>")[1].strip()
    print(f"Thinking:\n{thinking}\n\nResponse:\n{response}")
else:
    print(output)

Non-Thinking Mode

python
# Disable thinking โ€” direct answer without reasoning trace
text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True,
    enable_thinking=False
)

With Tool Calls

python
tools = [{
    "type": "function",
    "function": {
        "name": "run_verilog_sim",
        "description": "Run Verilog simulation with Icarus Verilog",
        "parameters": {
            "type": "object",
            "properties": {
                "code": {"type": "string", "description": "Verilog source code"},
                "testbench": {"type": "string", "description": "Testbench code"}
            }
        }
    }
}]

text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True, tools=tools
)

Deployment with vLLM

bash
vllm serve Multilingual-Multimodal-NLP/IndustrialCoder-Thinking \
    --tensor-parallel-size 4 --max-model-len 32768 --trust-remote-code

Recommended Sampling Parameters

Use casetemperaturetop_ptop_kmax_new_tokens
Thinking (default)0.60.85208192
Non-thinking / precise0.20.95โ€”4096

Model Family

ModelTypeHuggingFace
InCoder-32B-BasePre-trained๐Ÿค— IndustrialCoder-Base
InCoder-32BInstruct๐Ÿค— IndustrialCoder
InCoder-32B-ThinkingReasoning๐Ÿค— IndustrialCoder-Thinking
InCoder-32B-FP8FP8 Quantized๐Ÿค— IndustrialCoder-32B-FP8
InCoder-32B-AWQ-INT4AWQ INT4๐Ÿค— IndustrialCoder-32B-AWQ-INT4
InCoder-32B-GPTQ-INT4GPTQ INT4๐Ÿค— IndustrialCoder-32B-GPTQ-INT4

Limitations & Disclaimers

  • โ€”The thinking trace may occasionally contain reasoning errors or hallucinated constraints โ€” always verify the final code output.
  • โ€”For simple tasks, thinking mode adds latency; use enable_thinking=False for straightforward generation.
  • โ€”Based on failure analysis, the model may struggle with:
  • โ€”API Knowledge: Linker errors from undefined HAL/CMSIS functions in embedded C.
  • โ€”Functional Semantics: Producing compilable but functionally incorrect RTL under complex logic scenarios.
  • โ€”Optimization: Correct but sub-optimal GPU kernel performance.

Always review and test generated code in a sandboxed environment. Industrial code (RTL, embedded firmware, GPU kernels) requires expert review before deployment.


Citation

bibtex
@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}
}