CoolFace
Modelpublic

trillionlabs/Tri-7B

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
27likes712downloads
Model Card

<p align="center"> <picture> <img src="https://raw.githubusercontent.com/trillion-labs/.github/main/Tri-7B.png" alt="Tri-7B", style="width: 80%;"> </picture> </p>

Tri-7B

Introduction

We introduce Tri-7B, the next generation model following Trillion-7B-preview, that continues to push the boundaries of efficient training while achieving exceptional performance at the 7B parameter scale.

<p align="center"> <img src="https://raw.githubusercontent.com/trillion-labs/.github/main/pareto-2507.png" alt="Average Performance vs. Approximate Training FLOPs" style="width: 100%; max-width: 1400px;"> </p>

Key Highlights

  • Enhanced Reasoning: Modified training dataset mixture specifically optimized for reasoning capabilities
  • Advanced Post-Training: Significantly improved RL training pipeline focusing on mathematical reasoning and everyday usage
  • Extended Context: Supports up to 32K context length for long-form understanding
  • Multi-lingual: Specially optimized for Korean, English, and Japanese.

Our Tri-7B model represents a significant advancement over Trillion-7B-preview, achieving substantial performance improvements across all evaluated domains while maintaining the same efficient parameter count.

Model Specifications

Tri-7B
  • Type: Causal Language Model
  • Training Stage: Pre-training & Post-training
  • Architecture: Transformer Decoder with RoPE, SwiGLU, RMSNorm
  • Number of Parameters: 7.76B
  • Number of Layers: 32
  • Number of Attention Heads: 32
  • Context Length: 32,768
  • Vocab Size: 128,256

Quickstart

Here is a code snippet with apply_chat_template that demonstrates how to load the tokenizer and model and generate text.

Tri-7B Usage

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "trillionlabs/Tri-7B"

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

prompt = "Explain the concept of quantum computing in simple terms."
messages = [
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

Tri-7B is also available with vLLM and SGLang!

bash
# vLLM
vllm serve trillionlabs/Tri-7B --dtype bfloat16 --max-model-len 32768

# vLLM with custom options
vllm serve trillionlabs/Tri-7B \
    --dtype bfloat16 \
    --max-model-len 32768 \
    --gpu-memory-utilization 0.95 \
    --port 8000
bash
# SGLang
python3 -m sglang.launch_server --model-path trillionlabs/Tri-7B --dtype bfloat16

# SGLang with custom options
python3 -m sglang.launch_server \
    --model-path trillionlabs/Tri-7B \
    --dtype bfloat16 \
    --context-length 32768 \
    --port 30000 \
    --host 0.0.0.0

Evaluation

We evaluated Tri-7B across a comprehensive suite of benchmarks assessing general reasoning, knowledge recall, coding abilities, mathematical reasoning, and instruction-following capabilities. Compared to our previous generation model Trillion-7B-preview, Tri-7B achieves significant gains across all domains.

<details> <summary> Full evaluation settings </summary>

BenchmarkLanguageEvaluation SettingMetric
General Reasoning and Factuality
• HellaSwagEnglish0-shotaccuracy
• ARC:CEnglish0-shotaccuracy
• HAERAEKorean3-shotaccuracy
• CLIcKKorean0-shotaccuracy
• KoBESTKorean5-shotaccuracy
Knowledge and Reasoning
• KMMLUKorean5-shot (0-shot, CoT)accuracy
• MMLUEnglish5-shot (0-shot, CoT)accuracy
• Global-MMLU-Lite-jaEnglish5-shotaccuracy
Coding
• HumanEvalEnglish0-shotpass@1
• MBPPPlusEnglish0-shotpass@1
Mathematical Reasoning
• GSM8kEnglish0-shot, CoTexact-match
• MATHEnglish0-shot, CoTexact-match
• GPQAEnglish4-shotaccuracy
• HRM8kKorean0-shot, CoTexact-match
Instruction Following and Chat
• IFEvalEnglish0-shotstrict-average
• koIFEvalKorean0-shotstrict-average
• MT-BenchEnglishLLM-as-a-judge (gpt-4o)LLM score
• KO-MT-BenchKoreanLLM-as-a-judge (gpt-4o)LLM score
• systemIFEvalEnglish0-shotstrict-average
  • *Note that koIFEval, systemIFEval, and KoRuler are our in-house evaluation benchmarks adapted for Korean to better assess model capabilities in Korean language tasks.
  • **Note that MT-Bench, KO-MT-Bench, and LogicKor use a 10-point scale.

</details>

Benchmark Results

Models compared:

  • Tri-7B (Next Generation)
  • Trillion-7B-preview (Previous Generation)

General Reasoning and Factuality

BenchmarkTri-7BTrillion-7B-previewImprovement
HellaSwag59.5258.94+0.58
ARC:C58.2854.44+3.84
HAERAE82.4980.02+2.47
KoBEST82.7279.61+3.11
CLIcK64.4360.41+4.02
KMMLU51.74 (53.51)48.09+3.65
MMLU68.16 (74.67)63.52+4.64
Global-MMLU-Lite-ja59.2560.75-1.50

Coding

BenchmarkTri-7BTrillion-7B-previewImprovement
HumanEval53.6655.48-1.82
MBPPPlus64.2958.99+5.30

Mathematical Reasoning

BenchmarkTri-7BTrillion-7B-previewImprovement
GSM8k77.9472.25+5.69
MATH49.4032.70+16.70
GPQA34.1532.81+1.34
HRM8k39.0830.10+8.98

Instruction Following and Chat

BenchmarkTri-7BTrillion-7B-previewImprovement
IFEval79.2679.13+0.13
koIFEval76.6366.58+10.05
MT-Bench7.826.53+1.29
KO-MT-Bench7.646.27+1.37
systemIFEval66.4327.28+39.15

Limitations

  • Language Support: The model is optimized for English, Korean, and Japanese. Usage with other languages may result in degraded performance.
  • Knowledge Cutoff: The model's information is limited to data available up to Febuary, 2025.

License

This model is licensed under the Apache License 2.0.

Contact

For inquiries, please contact: info@trillionlabs.co