AhmedSalah777/Darwin-Frankenstein-31B-Ghoul
Darwin-31B-Opus
<p align="center"> <a href="https://huggingface.co/FINAL-Bench/Darwin-4B-Opus"><img src="https://img.shields.io/badge/๐งฌGen1-Darwin--4B--Opus-blue?style=for-the-badge" alt="Gen1"></a> <a href="https://huggingface.co/FINAL-Bench/Darwin-4B-David"><img src="https://img.shields.io/badge/๐งฌGen2-Darwin--4B--David-blue?style=for-the-badge" alt="Gen2"></a> <a href="https://huggingface.co/FINAL-Bench/Darwin-4B-Genesis"><img src="https://img.shields.io/badge/โญ_Gen3-Darwin--4B--Genesis-gold?style=for-the-badge" alt="Gen3"></a> </p>
<p align="center"> <a href="https://huggingface.co/FINAL-Bench/Darwin-9B-Opus"><img src="https://img.shields.io/badge/๐งฌModel-Darwin--9B--Opus-blue?style=for-the-badge" alt="9B"></a> <a href="https://huggingface.co/spaces/FINAL-Bench/Darwin-9B-Opus"><img src="https://img.shields.io/badge/๐Space-9BDemo-purple?style=for-the-badge" alt="9B Space"></a> <a href="https://huggingface.co/FINAL-Bench/Darwin-31B-Opus"><img src="https://img.shields.io/badge/๐งฌModel-Darwin--31B--Opus-blue?style=for-the-badge" alt="31B"></a> <a href="https://huggingface.co/spaces/FINAL-Bench/Darwin-31B-Opus"><img src="https://img.shields.io/badge/๐Space-31BDemo-purple?style=for-the-badge" alt="31B Space"></a> </p>
<p align="center"> <a href="https://huggingface.co/FINAL-Bench/Darwin-35B-A3B-Opus"><img src="https://img.shields.io/badge/๐งฌModel-Darwin--35B--A3B--Opus-blue?style=for-the-badge" alt="35B"></a> <a href="https://huggingface.co/spaces/FINAL-Bench/Darwin-35B-A3B-Opus"><img src="https://img.shields.io/badge/๐Space-35BDemo-purple?style=for-the-badge" alt="35B Space"></a> <a href="https://huggingface.co/FINAL-Bench/Darwin-35B-A3B-Opus-Q8-GGUF"><img src="https://img.shields.io/badge/๐ฆGGUF-Q8--Official-yellow?style=for-the-badge" alt="Q8 GGUF"></a> <a href="https://huggingface.co/bartowski/FINAL-BenchDarwin-35B-A3B-Opus-GGUF"><img src="https://img.shields.io/badge/๐ฆGGUF-bartowski-yellow?style=for-the-badge" alt="bartowski GGUF"></a> </p>
<p align="center"> <a href="https://huggingface.co/spaces/FINAL-Bench/Leaderboard"><img src="https://img.shields.io/badge/๐FINALBench-Leaderboard-green?style=for-the-badge" alt="FINAL Bench"></a> <a href="https://huggingface.co/spaces/FINAL-Bench/all-bench-leaderboard"><img src="https://img.shields.io/badge/๐ALLBench-Leaderboard-orange?style=for-the-badge" alt="ALL Bench"></a> </p>
Gemma 4 Dense 31B | Thinking Mode | 256K Context | 140+ Languages | BF16 | Apache 2.0
Overview
Darwin-31B-Opus is a reasoning-enhanced model created by merging google/gemma-4-31B-it (Father) and TeichAI/gemma-4-31B-it-Claude-Opus-Distill (Mother) using the Darwin V6 engine.
Darwin V6 diagnoses both parent models at the tensor level before merging, assigning an independent optimal ratio to each of the 1,188 tensors. This is fundamentally different from conventional merging tools that apply a single uniform ratio across all tensors.
Parent Models
Model Diagnostic Scan (MDS)
<p align="center"> <img src="s1.png" alt="Father (gemma-4-31B-it) MDS Scan" width="48%"> <img src="s2.png" alt="Mother (Claude-Opus-Distill) MDS Scan" width="48%"> </p>
Left: Father (gemma-4-31B-it) โ balanced generalist with low activation across most probes. Right: Mother (Claude-Opus-Distill) โ strong REASONING concentration in L50-L60, CODE activation in late layers, KOREAN at start and end. The Mother shows significantly more specialized layer patterns from Claude Opus distillation.
Benchmarks
GPQA Diamond was evaluated under identical conditions for both models: same 50 questions, same seed (i+42), same prompt template, greedy decoding (dosample=False), maxnewtokens=2048, enablethinking=True. Darwin-31B-Opus achieved a 10% relative improvement over the Father model.
Note: Gemma 4 architecture (Gemma4ForConditionalGeneration) has limited compatibility with lm-eval's loglikelihood method due to its multimodal wrapper structure. Only generative evaluation produces valid results for Gemma 4 based models. Full 198-question evaluation with Majority Voting is planned.
Darwin V6 vs Conventional Merging
How Darwin V6 Works
Darwin V6 does not use mergekit or any external merge library. It re-implements DARE-TIES (Yadav et al., 2023) directly via PyTorch tensor operations with per-tensor diagnostic ratios.
Before merging, Darwin performs a Model Diagnostic Scan (MDS) on both parents. For every tensor, it measures Shannon entropy (information density), standard deviation (activation spread), and L2 norm (energy). Additionally, 5 diagnostic probes (REASONING, CODE, MATH, KNOWLEDGE, LANGUAGE) are passed through the model, measuring cosine distance when each layer is skipped to determine functional importance.
The final merge ratio for each tensor:
static_score = entropy ร 0.3 + std ร 0.2 + clamp(norm, 100) ร 0.002
probe_score = ฮฃ(cosine_distance[probe_i] ร weight_i)
combined = static ร 0.4 + probe ร 0.6
mri_ratio = combined_b / (combined_a + combined_b)
final_ratio = mri_ratio ร mri_trust + genome_ratio ร (1 - mri_trust)The mri_trust parameter itself is optimized by the CMA-ES evolutionary algorithm, allowing the system to automatically determine the optimal balance between diagnostic prescription and evolutionary search for each model pair.
After merging, a Health Check compares the child model against both parents layer-by-layer, detecting interference (child importance >> parent max) or function loss (parent importance high but child dropped).
Parent Comparison (MDS Result)
<p align="center"> <img src="parent_comparison.png" alt="Parent Comparison โ Layer-wise Importance" width="100%"> </p>
Evolution Result
Optimal Genome (14-dimensional adaptive):
global_ratio: 0.5147 (overall merge ratio)
attn_ratio: 0.3169 (Attention layers โ Father dominant)
ffn_ratio: 0.9316 (FFN layers โ Mother dominant)
embed_ratio: 0.7748 (Embedding)
density_a: 0.8997 (Father DARE density)
density_b: 0.9539 (Mother DARE density)
block_0_ratio: 0.6628 (L0-L9)
block_1_ratio: 0.6431 (L10-L19)
block_2_ratio: 0.5146 (L20-L29, balanced)
block_3_ratio: 0.5971 (L30-L39)
block_4_ratio: 0.6339 (L40-L49)
block_5_ratio: 0.8583 (L50-L59, reasoning core โ Mother dominant)
mri_trust: 0.3631 (MDS 36% + Genome 64%)
merge_method_weight: 0.6897Key observations from the genome: ffnratio=0.93 indicates the FFN layers strongly favor the Mother (Claude Opus Distill), and block5 (L50-L59)=0.86 shows the reasoning core layers also favor Mother. This aligns with the MDS heatmap pattern where Mother's reasoning capability concentrated in the final layers. Meanwhile, attn_ratio=0.32 preserves Father's attention structure, maintaining the original Gemma 4 multimodal and long-context capabilities.
Model Specifications
Usage
Transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("FINAL-Bench/Darwin-31B-Opus", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"FINAL-Bench/Darwin-31B-Opus",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
messages = [{"role": "user", "content": "Prove that sqrt(2) is irrational."}]
text = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=4096, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))VRAM Requirements
References
- DARE-TIES: Yadav et al., 2023 (https://arxiv.org/abs/2311.03099) โ re-implemented, not library-dependent
- Darwin V6 Engine: https://huggingface.co/spaces/ginigen-ai/DARWIN-V5-BACKUP
- FINAL Bench: https://huggingface.co/spaces/FINAL-Bench/Leaderboard
Built By
Citation
@misc{vidraft_darwin_31b_opus,
title = {Darwin-31B-Opus: Diagnostic-Guided Evolutionary Merge on Gemma 4},
author = {VIDRAFT},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/FINAL-Bench/Darwin-31B-Opus}}
}