Cohere Labs Tiny Aya L2-Thinker is an open-weights research release of a 3.35 billion parameter multilingual reasoning model. It is trained to
think in the same language as the user prompt
(L2 thinking) before writing the final answer.
The bundled chat template does this automatically: every user turn is wrapped with a language-forcing prefix and a
/think
suffix, and generation is primed with
<|START_THINKING|>
. These are already included in the chat template.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "CohereLabs/tiny-aya-l2-thinker"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype="auto")
messages = [
{"role": "user", "content": "Explica en español qué significa la palabra japonesa 'ikigai'."},
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True,
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=32768,
do_sample=True,
temperature=0.6,
top_p=0.95,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=False))
apply_chat_template(..., add_generation_prompt=True)
produces a prompt of this shape (the user message is wrapped for you):
<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble
...Aya system + default preamble...
<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>Think in the same language as the prompt. [USER MESSAGE] /think<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>
The model then writes a thinking trace between
<|START_THINKING|>
and
<|END_THINKING|>
, followed by the user-facing answer between
<|START_RESPONSE|>
and
<|END_RESPONSE|>
.
You can also pass prior thinking back into the conversation:
messages = [
{"role": "user", "content": "How many r's are there in strawberry?"},
{
"role": "assistant",
"thinking": "Count the letters: S-T-R-A-W-B-E-R-R-Y. Three r's.",
"content": "There are 3 r's in strawberry.",
},
{"role": "user", "content": "Now do the same for blueberry."},
]
Chat template behavior
The tokenizer chat template always:
Inserts the Tiny Aya system prompt:
# System Preamble
You are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.
Your information cutoff date is June 2024.
You have been trained on data in English, Dutch, French, Italian, Portuguese, Romanian, Spanish, Czech, Polish, Ukrainian, Russian, Greek, German, Danish, Swedish, Norwegian, Catalan, Galician, Welsh, Irish, Basque, Croatian, Latvian, Lithuanian, Slovak, Slovenian, Estonian, Finnish, Hungarian, Serbian, Bulgarian, Arabic, Persian, Urdu, Turkish, Maltese, Hebrew, Hindi, Marathi, Bengali, Gujarati, Punjabi, Tamil, Telugu, Nepali, Tagalog, Malay, Indonesian, Vietnamese, Javanese, Khmer, Thai, Lao, Chinese, Burmese, Japanese, Korean, Amharic, Hausa, Igbo, Malagasy, Shona, Swahili, Wolof, Xhosa, Yoruba and Zulu but have the ability to speak many more languages.
# Default Preamble
The following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.
- Your name is Aya.
- You are a large language model built by Cohere.
- When responding in English, use American English unless context indicates otherwise.
- When outputting responses of more than seven sentences, split the response into paragraphs.
- Prefer the active voice.
- Use gender-neutral pronouns for unspecified persons.
- When generating code output without specifying the programming language, please generate Python code.
Prefixes every user turn with
Think in the same language as the prompt.
simulating training data.
Appends
/think
to every user turn.
Starts the assistant generation with
<|CHATBOT_TOKEN|><|START_THINKING|>
.
Model Details
Input:
Text only.
Output:
Model generates text, including an explicit thinking trace.
Model Architecture:
Auto-regressive transformer in the Tiny Aya / Cohere family. After pretraining, this checkpoint is supervised-fine-tuned for multilingual reasoning so that the thinking language follows the prompt language.
Context Length:
Tiny Aya L2-Thinker supports a context length of 32K.
Usage and Limitations
Intended Usage
Tiny Aya L2-Thinker is meant for multilingual reasoning and conversational use, especially when the thinking trace should stay in the user's language rather than defaulting to English. Intended applications include multilingual math and reasoning, open-ended generation, and research on target-language reasoning.
Limitations
As with any language model, outputs may contain incorrect or outdated statements. Thinking traces can be long; cap
max_new_tokens
appropriately. Lowest-resource languages may show more variability than high-resource ones.
Model Card Contact
For errors or additional questions about details in this model card, contact
[email protected]
.
tiny-aya-l2-thinker huggingface.co is an AI model on huggingface.co that provides tiny-aya-l2-thinker's model effect (), which can be used instantly with this CohereLabs tiny-aya-l2-thinker model. huggingface.co supports a free trial of the tiny-aya-l2-thinker model, and also provides paid use of the tiny-aya-l2-thinker. Support call tiny-aya-l2-thinker model through api, including Node.js, Python, http.
tiny-aya-l2-thinker huggingface.co is an online trial and call api platform, which integrates tiny-aya-l2-thinker's modeling effects, including api services, and provides a free online trial of tiny-aya-l2-thinker, you can try tiny-aya-l2-thinker online for free by clicking the link below.
CohereLabs tiny-aya-l2-thinker online free url in huggingface.co:
tiny-aya-l2-thinker is an open source model from GitHub that offers a free installation service, and any user can find tiny-aya-l2-thinker on GitHub to install. At the same time, huggingface.co provides the effect of tiny-aya-l2-thinker install, users can directly use tiny-aya-l2-thinker installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
tiny-aya-l2-thinker install url in huggingface.co: