CoolFace
Modelpublic

project-themis/Themis-RM-0.6B

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes18downloads
Model Card

<div align="center">

Themis-RM-0.6B

![arXiv](https://arxiv.org/abs/2605.00754) ![Models](https://huggingface.co/collections/project-themis/themis-reward-model-collection) ![Datasets & Benchmarks](https://huggingface.co/collections/project-themis/themis-preference-datasets-and-benchmarks) ![GitHub](https://github.com/iNeil77/Themis) ![Docker](https://hub.docker.com/repository/docker/ineil77/themis/general)

</div>

Overview

Themis-RM-0.6B is a 600M-parameter multilingual code reward model for flexible multi-criteria scoring. It is the smallest model in the Themis-RM suite, trained using the Bradley-Terry preference framework on Themis-CodePreference, the largest open-source collection of code preferences to date (more than 350k preference pairs).

Themis-RM models evaluate code across five quality dimensions — Functional Correctness, Runtime Efficiency, Memory Efficiency, Security Hardness, and Readability & Maintainability — and support eight programming languages. Our experiments demonstrate positive scaling trends, strong cross-lingual transfer when training on diverse preferences, and the importance of multi-criteria training for reliable code reward modelling.

Model Family

The Themis-RM suite ranges from 600M to 32B parameters, all built on the Qwen3 backbone.

<div align="center">

ModelModel ArchitectureHuggingFace Model Page
Themis-RM-0.6B (this model)<a href="https://huggingface.co/Qwen/Qwen3-0.6B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Qwen/Qwen3-0.6B</span></a>—
Themis-RM-1.7B<a href="https://huggingface.co/Qwen/Qwen3-1.7B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Qwen/Qwen3-1.7B</span></a><a href="https://huggingface.co/project-themis/Themis-RM-1.7B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Themis-RM-1.7B</span></a>
Themis-RM-4B<a href="https://huggingface.co/Qwen/Qwen3-4B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Qwen/Qwen3-4B</span></a><a href="https://huggingface.co/project-themis/Themis-RM-4B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Themis-RM-4B</span></a>
Themis-RM-8B<a href="https://huggingface.co/Qwen/Qwen3-8B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Qwen/Qwen3-8B</span></a><a href="https://huggingface.co/project-themis/Themis-RM-8B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Themis-RM-8B</span></a>
Themis-RM-14B<a href="https://huggingface.co/Qwen/Qwen3-14B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Qwen/Qwen3-14B</span></a><a href="https://huggingface.co/project-themis/Themis-RM-14B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Themis-RM-14B</span></a>
Themis-RM-32B<a href="https://huggingface.co/Qwen/Qwen3-32B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Qwen/Qwen3-32B</span></a><a href="https://huggingface.co/project-themis/Themis-RM-32B" style="white-space: nowrap"><span><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.svg" width="16" style="vertical-align: middle"> Themis-RM-32B</span></a>

</div>

Results

Themis-RM models achieve best-in-class accuracy on Themis-CodeRewardBench, a code-specific reward model benchmark, while also matching or exceeding much larger models on established general-domain benchmarks (RewardBench V1, RewardBench V2, JudgeBench). Models are grouped by parameter class; bold marks the best in each group.

<div align="center">

Model[Themis-CodeRewardBench](https://huggingface.co/datasets/project-themis/Themis-CodeRewardBench)[RewardBench V1](https://huggingface.co/datasets/allenai/reward-bench)[RewardBench V2](https://huggingface.co/datasets/allenai/reward-bench-v2)[JudgeBench](https://huggingface.co/datasets/ScalerLab/JudgeBench)
32B - 72B Class
WorldPM-72B76.9690.8867.9255.21
Athene-RM-70B78.3991.2268.7663.45
Nemotron-70B-Reward81.1993.8870.4973.47
**Themis-RM-32B**91.8294.8972.3471.65
AceCodeRM-32B62.9523.5867.9866.77
7B - 14B Class
**Themis-RM-14B**91.1994.1171.4470.85
**Themis-RM-8B**89.7893.6965.8769.97
Athene-RM-8B76.5887.4862.9661.12
CodeScaler-8B79.1294.6676.5170.05
Skywork-Reward-V2-8B79.9794.7676.9367.90
AceCodeRM-7B71.1122.7463.1661.09
0.6B - 4B Class
**Themis-RM-4B**88.3992.4663.8168.02
CodeScaler-4B77.9794.3275.1368.44
Skywork-Reward-V2-4B79.2794.0674.2665.43
**Themis-RM-1.7B**83.0489.1756.2263.29
CodeScaler-1.7B73.7591.1368.4466.17
Skywork-Reward-V2-1.7B75.6091.6467.7166.48
Themis-RM-0.6B (this model)79.2683.4149.6163.84
Skywork-Reward-V2-0.6B72.7786.3260.8363.65

</div>

Usage

python
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

model_name = "project-themis/Themis-RM-0.6B"
device = "cuda:0"

model = AutoModelForSequenceClassification.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map=device,
    attn_implementation="flash_attention_2",
    num_labels=1,
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "Write a Python function that checks if a string is a palindrome."

response_chosen = """def is_palindrome(s: str) -> bool:
    s = s.lower().strip()
    return s == s[::-1]"""

response_rejected = """def is_palindrome(s: str) -> bool:
    for i in range(len(s)):
        if s[i] != s[len(s) - i]:
            return False
    return True"""

conv_chosen = [
    {"role": "user", "content": prompt},
    {"role": "assistant", "content": response_chosen},
]
conv_rejected = [
    {"role": "user", "content": prompt},
    {"role": "assistant", "content": response_rejected},
]

chosen_text = tokenizer.apply_chat_template(conv_chosen, tokenize=False)
rejected_text = tokenizer.apply_chat_template(conv_rejected, tokenize=False)

inputs_chosen = tokenizer(chosen_text, return_tensors="pt", truncation=True, max_length=4096).to(device)
inputs_rejected = tokenizer(rejected_text, return_tensors="pt", truncation=True, max_length=4096).to(device)

with torch.no_grad():
    score_chosen = model(**inputs_chosen).logits[0][0].item()
    score_rejected = model(**inputs_rejected).logits[0][0].item()

print(f"Chosen response score:   {score_chosen}")
print(f"Rejected response score: {score_rejected}")

Multi-Criteria Scoring with System Prompts

Themis-RM models are trained with stochastic criteria-conditioned system prompts, allowing you to steer scoring toward a specific quality dimension at inference time. Prepend a system message that specifies the evaluation criteria before the user/assistant turns. The model supports the following criteria:

<div align="center">

CriterionKey
Functional CorrectnessFunctional_Correctness
Runtime EfficiencyRuntime_Efficiency
Memory EfficiencyMemory_Efficiency
Security HardnessSecurity_Hardness
Readability & MaintainabilityReadability_Maintainability
All criteria (multi-criteria)Full

</div>

Each criterion-specific system prompt includes a base preamble (Helpfulness + Harmlessness) followed by the targeted criterion. The Full prompt includes all five code criteria together. When no system prompt is provided, the model scores based on general quality — the model was trained to handle all three modes (no system prompt, single-criterion, and full multi-criteria). For the full set of system prompts used during training and evaluation, see the Evaluation folder in the GitHub repository.

python
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

model_name = "project-themis/Themis-RM-0.6B"
device = "cuda:0"

model = AutoModelForSequenceClassification.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map=device,
    attn_implementation="flash_attention_2",
    num_labels=1,
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Criterion-specific system prompt (example: Runtime Efficiency)
# See https://github.com/iNeil77/Themis/tree/main/Evaluation for all prompts
system_prompt = (
    "You are an experienced AI judge and evaluator, specifically "
    "designed and trained to assess the overall quality of responses "
    "to human prompts. The prompts can be of various types, including "
    "but not limited to open-ended questions, coding tasks, creative "
    "writing, requests for information, and more. The responses may be "
    "generated by a language model or a human and may include text, "
    "code, or both. You will receive the prompt and the generated "
    "response for each judgement session. Your exact mandate is to "
    "score the response based on a pre-specified but flexible set of "
    "criteria.\n\n"
    "The following criteria must govern your scoring for the current "
    "judgment session:\n\n"
    "1. **Helpfulness**: How well does the response address the "
    "prompt? Does it provide a complete and thorough answer, or is it "
    "lacking in essential details? This is a tenet that applies to "
    "evaluating all types of responses. You must score helpful "
    "responses higher than less unhelpful ones.\n\n"
    "2. **Harmlessness**: Does the response contain any harmful or "
    "inappropriate content? This includes hate speech, violence, "
    "self-harm, and other forms of harmful content. This is a tenet "
    "that applies to evaluating all types of responses. You must "
    "score harmless responses higher than harmful ones.\n\n"
    "3. **Runtime Efficiency**: Does the response follow best "
    "practices for runtime efficiency? Examples include using "
    "efficient algorithms and data structures, minimizing time "
    "complexity, avoiding unnecessary computations, caching results, "
    "and leveraging parallel processing or asynchronous programming "
    "techniques where appropriate, among others. This is a tenet "
    "that applies to evaluating code responses. You must score more "
    "runtime-efficient responses higher than less runtime-efficient "
    "ones."
)

prompt = "Write a Python function that returns the n-th Fibonacci number."

response = """def fibonacci(n: int) -> int:
    if n <= 1:
        return n
    a, b = 0, 1
    for _ in range(2, n + 1):
        a, b = b, a + b
    return b"""

conversation = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": prompt},
    {"role": "assistant", "content": response},
]

text = tokenizer.apply_chat_template(conversation, tokenize=False)
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=4096).to(device)

with torch.no_grad():
    score = model(**inputs).logits[0][0].item()

print(f"Runtime Efficiency score: {score}")

License

This model is released under the Apache 2.0 License. The base model, Qwen3-0.6B, is also licensed under Apache 2.0.

Citation

bibtex
@article{themis2025,
  title={Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring},
  author={},
  journal={arXiv preprint arXiv:2605.00754},
  year={2025}
}