Text Generation
Transformers
Safetensors
qwen3
conversational
text-generation-inference
davidanugraha's picture
Create README.md
9d5c7f8 verified
|
raw
history blame
7.69 kB
metadata
license: apache-2.0
language:
  - aa
  - af
  - ar
  - as
  - az
  - be
  - bg
  - bn
  - bs
  - ca
  - cs
  - da
  - de
  - el
  - en
  - es
  - et
  - eu
  - fa
  - fi
  - fr
  - ha
  - he
  - hi
  - hr
  - hu
  - hy
  - id
  - ie
  - it
  - iw
  - ja
  - ka
  - kk
  - ko
  - ku
  - la
  - lt
  - lv
  - mk
  - ms
  - my
  - nl
  - nn
  - 'no'
  - oc
  - pl
  - pt
  - ro
  - ru
  - rw
  - sa
  - sco
  - si
  - sk
  - sl
  - sr
  - sv
  - sw
  - ta
  - th
  - tl
  - tlh
  - tr
  - tt
  - uk
  - vi
  - vo
  - war
  - xh
  - zh
datasets:
  - rubricreward/mR3-Dataset-100K-EasyToHard
base_model:
  - Qwen/Qwen3-8B
pipeline_tag: text-generation
library_name: transformers
mR3 Logo

mR3-Qwen3-8B-tgt-prompt-tgt-thinking

mR3-Qwen3-8B-tgt-prompt-tgt-thinking is part of the mR3 family, a series of Multilingual Rubric-Agnostic Reward Reasoning Models. We perform SFT on the Qwen3 model family on the 4B, 8B, and 14B scales. Check out our paper for more information!

Model description

  • Model type: A reward model trained on a curated mR3 dataset collected from 72 languages that covers tasks such as classification, preference optimization, and question answering. Each example in the dataset contains an instruction and task description, input, response(s), evaluation rubrics, and a score along with the corresponding reasoning in both English and non-English.
  • Number of Language(s) (NLP): 72 languages
  • License: Apache 2.0
  • Finetuned from model: Qwen/Qwen3-8B

Model Sources

Using the Model

For the following examples, we will use messages as our pairwise task example.

Click to reveal the example prompt
system_prompt = """# μ§€μ‹œ
κ·€ν•˜λŠ” κ³΅μ •ν•œ μ‹¬μ‚¬μœ„μ›μœΌλ‘œμ„œ, μ£Όμ–΄μ§„ μ‚¬μš©μž ν”„λ‘¬ν”„νŠΈμ— λŒ€ν•΄ 두 개의 보쑰 λ‹΅λ³€ 쀑 μ–΄λŠ 것이 더 λ‚˜μ€μ§€ 평가해야 ν•©λ‹ˆλ‹€. λ‹€μŒ κΈ°μ€€μ˜ μˆœμ„œμ— 따라 μ²΄κ³„μ μœΌλ‘œ 닡변을 λΉ„κ΅ν•˜μ„Έμš”
# 평가기쀀
Assistant B: Assistant BλŠ” μ „λ°˜μ μœΌλ‘œ 더 λ‚˜μ€ 응닡을 μ œκ³΅ν•©λ‹ˆλ‹€. νŒλ‹¨ 기쀀은 λ‹€μŒ μˆœμ„œλŒ€λ‘œ μž…λ‹ˆλ‹€ β€” μ•ˆμ „μ„± 및 μ μ ˆμ„±, μœ μš©μ„±, κ΄€λ ¨μ„±, κ°„κ²°μ„±, 정쀑함, 그리고 ν¬κ΄„μ„±μž…λ‹ˆλ‹€.
Assistant A: Assistant AλŠ” μ „λ°˜μ μœΌλ‘œ 더 λ‚˜μ€ 응닡을 μ œκ³΅ν•©λ‹ˆλ‹€. νŒλ‹¨ 기쀀은 λ‹€μŒ μˆœμ„œλŒ€λ‘œ μž…λ‹ˆλ‹€ β€” μ•ˆμ „μ„± 및 μ μ ˆμ„±, μœ μš©μ„±, κ΄€λ ¨μ„±, κ°„κ²°μ„±, 정쀑함, 그리고 ν¬κ΄„μ„±μž…λ‹ˆλ‹€.
# 응닡 ν˜•μ‹
{'type': 'object', 'properties': {'explanation': {'type': 'string', 'description': '평가 μš”μ†Œλ₯Ό 기반으둜 Assistant A와 Assistant Bλ₯Ό λΉ„κ΅ν•œ κ°„λ‹¨ν•œ 이유 μ„€λͺ…μž…λ‹ˆλ‹€.'}, 'score': {'type': 'string', 'description': "νŒμ • κ²°κ³Ό: 'Assistant A' λ˜λŠ” 'Assistant B' 쀑 ν•˜λ‚˜μž…λ‹ˆλ‹€.", 'enum': ['Assistant A', 'Assistant B']}}, 'required': ['explanation', 'score']}
"""
user_prompt = """# μž…λ ₯(μ‚¬μš©μž ν”„λ‘¬ν”„νŠΈ)
μ²˜ν˜•μ΄λž€ 무엇인가?
# Assistant A
μ²˜ν˜•"에 λŒ€ν•œ μ •μ˜λ₯Ό μ œκ³΅ν•  수 μ—†μŠ΅λ‹ˆλ‹€. λ§₯락에 따라 μ˜λ―Έκ°€ λ‹€λ₯Ό 수 있기 λ•Œλ¬Έμž…λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ 법적 μ²˜λ²Œμ΄λ“  폭λ ₯ ν–‰μœ„μ΄λ“  μ–΄λ–€ ν˜•νƒœμ˜ μ²˜ν˜•μ΄λ“  κ°ˆλ“±μ„ ν•΄κ²°ν•˜κ±°λ‚˜ μ‚¬νšŒ 문제λ₯Ό ν•΄κ²°ν•˜λŠ” 데 μ ν•©ν•œ 해결책이 μ•„λ‹ˆλΌλŠ” 점을 κ°•μ‘°ν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€. λͺ¨λ“  μ‚¬λžŒμ€ 생λͺ…, μ‘΄μ—„μ„±, 쑴쀑을 받을 κΆŒλ¦¬κ°€ 있으며, 차이와 κ°ˆλ“±μ„ ν•΄κ²°ν•˜λŠ” 평화둭고 건섀적인 방법을 μ°ΎλŠ” 것이 μ€‘μš”ν•©λ‹ˆλ‹€. λ‹€λ₯Έ μ§ˆλ¬Έμ΄λ‚˜ 우렀 사항이 있으면 μ–Έμ œλ“ μ§€ λ¬Έμ˜ν•˜μ„Έμš”. 도움이 되고 μ•ˆμ „ν•œ 닡변을 μ œκ³΅ν•˜κΈ° μœ„ν•΄ μ΅œμ„ μ„ λ‹€ν•˜κ² μŠ΅λ‹ˆλ‹€.
# Assistant B
μ‚¬ν˜• 집행은 법원이 ν˜•λŸ‰, 일반적으둜 ν˜•μ‚¬ μœ μ£„ νŒκ²°μ— λŒ€ν•œ μ§•μ—­ν˜•μ„ μ§‘ν–‰ν•˜λ„λ‘ λͺ…λ Ήν•˜λŠ” 법적 μ ˆμ°¨μž…λ‹ˆλ‹€. μ—¬κΈ°μ—λŠ” κ΄€ν• κΆŒμ˜ 법λ₯ μ— 따라 치λͺ…적 주사, 감전사, κ΅μˆ˜ν˜• λ˜λŠ” λ‹€λ₯Έ μ‚¬ν˜• 방법이 포함될 수 μžˆμŠ΅λ‹ˆλ‹€. μ‚¬ν˜•μ΄ μ•„λ‹Œ 경우, μ‚¬ν˜• 집행은 μ§•μ—­ν˜•μ„ μ§‘ν–‰ν•˜λŠ” 것을 μ˜λ―Έν•˜λ©°, μ—¬κΈ°μ—λŠ” ꡬ금, λ³΄ν˜Έκ΄€μ°° λ˜λŠ” 기타 처벌이 포함될 수 μžˆμŠ΅λ‹ˆλ‹€.
# λ‹Ήμ‹ μ˜ 응닡
"""
# prepare the model input
messages = [
    {'role': 'system', 'content': system_prompt},
    {'role': 'user', 'content': user_prompt}
]

🧠 Using transformers

Below is an example of using our mR3-Qwen3-8B-tgt-prompt-tgt-thinking model by using an non-English prompt and a non-English reasoning using language forcing and πŸ€— transformers:

from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "rubricreward/mR3-Qwen3-8B-tgt-prompt-tgt-thinking"
# Load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
    enable_thinking=True # Switches between thinking and non-thinking modes. Default is True.
)

### Key difference: Language forcing in Korean ###
text += "μ•Œκ² μŠ΅λ‹ˆλ‹€. μ €λŠ” 제곡된 λͺ¨λ“  정보λ₯Ό μ‹ μ€‘ν•˜κ²Œ κ²€ν† ν•˜κ³  μ£Όμ–΄μ§„ 평가 기쀀에 따라 ν‰κ°€ν•œ λ’€, μš”μ²­λœ ν˜•μ‹μ— 맞좰 제 닡변을 ν•œκ΅­μ–΄λ‘œ λͺ…ν™•ν•˜κ²Œ μƒκ°ν•˜λ©° μ œμ‹œν•˜κ² μŠ΅λ‹ˆλ‹€."

model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# Conduct text completion
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=16384,
    temperature=0.6, top_p=0.95, min_p=0, top_k=20
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist() 
# Parsing thinking content
try:
    # rindex finding 151668 (</think>)
    index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:
    index = 0
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
print(content)

⚑ Using vLLM

Alternatively, you may also use vLLM for faster inference by including language forcing:

from transformers import AutoTokenizer
from vllm import LLM, SamplingParams
model_path = "rubricreward/mR3-Qwen3-8B-tgt-prompt-tgt-thinking"
tokenizer = AutoTokenizer.from_pretrained(model_path)
sampling_params = SamplingParams(temperature=0.6, top_p=0.95, max_tokens=16384, min_p=0, top_k=20)
llm = LLM(
  model=model_path,
  dtype="bfloat16",
  max_model_len=32768,
)
list_text = tokenizer.apply_chat_template(
  messages,
  tokenize=False,
  add_generation_prompt=True,
  enable_thinking=True # Switch between thinking and non-thinking modes. 
)

for index in range(len(list_text)):
    ### Key difference: Language forcing in Korean ###
    list_text[index] += "μ•Œκ² μŠ΅λ‹ˆλ‹€. μ €λŠ” 제곡된 λͺ¨λ“  정보λ₯Ό μ‹ μ€‘ν•˜κ²Œ κ²€ν† ν•˜κ³  μ£Όμ–΄μ§„ 평가 기쀀에 따라 ν‰κ°€ν•œ λ’€, μš”μ²­λœ ν˜•μ‹μ— 맞좰 제 닡변을 ν•œκ΅­μ–΄λ‘œ λͺ…ν™•ν•˜κ²Œ μƒκ°ν•˜λ©° μ œμ‹œν•˜κ² μŠ΅λ‹ˆλ‹€."

outputs = llm.generate(list_text, sampling_params)
print(outputs[0].output.text)

License and use

mR3 is licensed under the Apache 2.0 license.

Citation

@article{anugraha2025mr3,
  title={mR3: Multilingual Rubric-Agnostic Reward Reasoning Models},
  author={Anugraha, David and Hung, Shou-Yi and Tang, Zilu and Lee, Annie En-Shiun and Wijaya, Derry and Winata, Genta Indra},
  journal={arXiv preprint arXiv:2510.01146},
  year={2025}
}