CoolFace
Modelpublic

trillionlabs/Trida-7B

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
12likes154downloads
Model Card

Trida-7B

Introduction

πŸš€ Trida-7B: Block Diffusion Language Model

We introduce Trida-7B, a high-performance 7-billion parameter language model representing the first publicly released Block Diffusion Language Model to originate from Korea.

Model Overview

Architecture: Block Diffusion Language Model

Base Model: Continually pre-trained from Tri-7B model.

Korean Language Leadership Trida-7B sets a new benchmark for generative models in the region. To our knowledge, it is the:

  • β€”First Block Diffusion Language Model to be openly released in Korea.
  • β€”First Block Diffusion Language Model trained with Step-wise autoregressive attention.
  • β€”Best-performing diffusion language model in Korean among similar model sizes.

This model is a significant step forward for the Korean LLM community, demonstrating the effectiveness of the Block Diffusion paradigm for complex, multilingual tasks.

Key Highlights

  • β€”Block Diffusion Architecture: Trida-7B leverages the Block Diffusion architecture, combining the strengths of parallelized diffusion generation with autoregressive dependencies for improved efficiency, control, and flexible-length sequence generation.
  • β€”Step-wise Autoregressive Attention An attention mechanism that enables single-pass training and efficient RL by fixing attention masks during the unmasking process. Also improves inference efficiency by enabling kv-caching within the current block.
  • β€”Multilingual Leadership: Specially optimized for Korean, English, and Japanese, offering robust performance across all three languages.
  • β€”Korean First: To our knowledge, Trida-7B-Preview is the first Block Diffusion Language Model to be openly released in Korea.
  • β€”Best-in-Class Korean Performance: It is the best-performing diffusion language model in Korean among models of similar size, setting a new benchmark for generative models in the region.

Model Specifications

Trida-7B
  • β€”Type: Block Diffusion 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: 8,192
  • β€”Vocab Size: 128,256
πŸ”„ Training and Methodology

Continual Pre-training from Tri-7B: Rather than training from scratch, Trida-7B was developed through Continual Pre-training from our state-of-the-art autoregressive model, trillionlabs/Tri-7B.

  • β€”Knowledge Transfer: To prevent catastrophic forgetting during the transition from AR to Diffusion, we employed blocksize warmup.

Step-wise Autoregressive Attention for Efficient RL & Inference One of the most significant innovations in Trida-7B is the Step-wise Autoregressive Attention mechanism. This design solves the primary bottleneck of Diffusion models: the need for $T$ sequential forward passes during generation and Reinforcement Learning (RL).

  • β€”Mechanism: During the rollout process, we fix the attention mask for each token at the exact moment it is "unmasked." This creates a structured, causal-like dependency within a single sequence.
  • β€”Single-pass Training: By aligning the denoising steps into a step-wise autoregressive structure, we enable the model to calculate gradients for all denoising steps in a single forward/backward pass.
  • β€”Impact: This reduces the computational overhead of RL and iterative inference by up to $1/T$, allowing Trida-7B to achieve training and inference speeds much faster than traditional Autoregressive models while maintaining the diverse generative capabilities of Diffusion.

πŸš€ Quickstart

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "trillionlabs/Trida-7B"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto",
    trust_remote_code=True
)

tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)

prompt = "Explain the Korean concept of 'Sonnim' (guest) and compare it to Japanese 'Omotenashi' in English."
messages = [
    {"role": "system", "content": "You are Trida, created by TrillionLabs. You are a helpful assistant."},
    {"role": "user", "content": prompt}
]

text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)

# Block Step-wise Autoregressive Generation
gen_ids = model.generate(
    inputs["input_ids"],
    tokenizer=tokenizer,
    max_new_tokens=4096,
    threshold=0.9,
)

response = tokenizer.decode(
    gen_ids[0][inputs["input_ids"].shape[1]:], 
    skip_special_tokens=True
)
print(response)

You can also checkout our repo (https://github.com/trillion-labs/Fast-dLLM-Trida) for evaluation and demo.

Our full technical blog post is coming soonβ€”stay tuned!


Evaluation

We evaluated Trida-7B across a comprehensive suite of benchmarks assessing general reasoning, knowledge recall, coding abilities, mathematical reasoning, and instruction-following capabilities.

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

BenchmarkLanguageEvaluation SettingMetric
General Reasoning and Factuality
β€’ xwinograd_enEnglish0-shotaccuracy
β€’ xwinograd_jpJapanese0-shotaccuracy
β€’ KoBESTKorean5-shotaccuracy
Knowledge and Reasoning
β€’ KMMLUKorean5-shotaccuracy
β€’ MMLUEnglish5-shotaccuracy
β€’ Global-MMLU-Lite-enEnglish5-shotaccuracy
β€’ Global-MMLU-Lite-koEnglish5-shotaccuracy
β€’ Global-MMLU-Lite-jaJapanese5-shotaccuracy
β€’ BBHEnglish3-shot, CoTaccuracy
β€’ MMLU proEnglish0-shot, CoTaccuracy
Coding
β€’ HumanEvalEnglish0-shotpass@1
β€’ MBPPPlusEnglish0-shotpass@1
β€’ KoMBPPPlusKorean0-shotpass@1
Mathematical Reasoning
β€’ GSM8kEnglish0-shot, CoTexact-match
β€’ KoGSM8kKorean0-shot, CoTexact-match
β€’ MATH500English0-shot, CoTexact-match
Instruction Following and Chat
β€’ IFEvalEnglish0-shotstrict-prompt
β€’ koIFEvalKorean0-shotstrict-prompt

</details>

Benchmark Results

General Reasoning and Factuality

BenchmarkTrida-7B
KoBEST74.08
KMMLU50.28
MMLU67.23
Global-MMLU-Lite-en73.5
Global-MMLU-Lite-ko64.25
Global-MMLU-Lite-ja64.25
xwinograd_en69.81
xwinograd_jp64.75
BBH52.45
MMLU pro39.37

Coding

BenchmarkTrida-7B
HumanEval35.98
MBPP Plus50.79
KoMBPP Plus46.3

Mathematical Reasoning

BenchmarkTrida-7B
GSM8k65.13
KoGSM8k61.26
MATH50033.6

Instruction Following

BenchmarkTrida-7B
IFEval64.98
koIFEval61.74

Korean Performance Vs Other Diffusion LLMs

BenchmarkTrida-7BLlada-7BDream-7BFast-dllm-v2
KoMBPP Plus (pass@1)46.35.856.6167.2
koIFEval (prompt-strict)53.4222.48.946.17
koGSM8K (strict extract accuracy)61.2638.625.0256.94
kobest (accuracy)74.9254.5561.9257.22
KMMLU (accuracy)46.3529.3339.8444.36
Global-MMLU-Lite-ko (accuracy)60.2520.1255.2555.0
avg57.0828.4741.2654.48

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