German R1

A German whale

Introducing German-R1. We are so back!!11

  • ๐Ÿ‡ฉ๐Ÿ‡ช German R1 is a reasoning model almost equivalent to OpenAIโ€˜s o3 or DeepSeekโ€˜s R1 - but it thinks in German!

  • ๐Ÿ‡ฉ๐Ÿ‡ช German R1 is so efficient that is was build without any government funding.

  • ๐Ÿ‡ฉ๐Ÿ‡ช German R1 was only trained with legally imported H100s in less than five minutes.

  • Please do NOT take this too serious.

Context

some contex

See Linkedin: https://www.linkedin.com/posts/activity-7294337496023269376-ZBkI

Usage

You can run the model as follows:

from transformers import pipeline, set_seed
import json

set_seed(42)
pipe = pipeline("text-generation", "malteos/german-r1")

# from gsm8k test set
question = "James beschlieรŸt, 3-mal pro Woche 3 Sprints zu laufen.  Er lรคuft 60 Meter pro Sprint.  Wie viele Meter lรคuft er insgesamt pro Woche?"
expected_answer = "540"

# xml reasoning and answer format
system_prompt = """
Antworte auf deutsch und in diesem Format:
<reasoning>
...
</reasoning>
<answer>
...
</answer>
"""

messages = [
    {
        "role": "system",
        "content": system_prompt,
    },
    {"role": "user", "content": dataset["question"][3]},
]
response = pipe(messages, max_new_tokens=256)

print(json.dumps(response, indent=4, ensure_ascii=False))

The output should look like this (correct answer: 540)

[
    {
        "generated_text": [
            {
                "role": "system",
                "content": "\nAntworte auf deutsch und in diesem Format:\n<reasoning>\n...\n</reasoning>\n<answer>\n...\n</answer>\n"
            },
            {
                "role": "user",
                "content": "James beschlieรŸt, 3-mal pro Woche 3 Sprints zu laufen.  Er lรคuft 60 Meter pro Sprint.  Wie viele Meter lรคuft er insgesamt pro Woche?"
            },
            {
                "role": "assistant",
                "content": "<reasoning>\nJames lรคuft 3 Sprints pro Tag, wobei jeder Sprint 60 Meter betrรคgt. Deshalb lรคuft er pro Tag 3 Sprints * 60 Meter/Sprint = 180 Meter. James lรคuft 3 Mal pro Woche, also lรคuft er insgesamt 180 Meter * 3 = 540 Meter pro Woche.\n</reasoning>\n<answer>\n540\n</answer>\n"
            }
        ]
    }
]

Training details

  • Base model: Qwen2.5-3B-Instruct
  • Implementation: based on GRPO demo by will brown + language identification reward
  • Training data: German subset of openGPT-X/gsm8kx (machine translated from the English gsm8k)

License

Qwen research

Downloads last month
30
Safetensors
Model size
3B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for malteos/german-r1

Base model

Qwen/Qwen2.5-3B
Finetuned
(1,682)
this model
Quantizations
5 models

Dataset used to train malteos/german-r1