DELLA-Merging: Reducing Interference in Model Merging through Magnitude-Based Sampling
Paper β’ 2406.11617 β’ Published β’ 10
How to use CultriX/Qwen2.5-14B-Qwentangledv2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="CultriX/Qwen2.5-14B-Qwentangledv2")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("CultriX/Qwen2.5-14B-Qwentangledv2")
model = AutoModelForCausalLM.from_pretrained("CultriX/Qwen2.5-14B-Qwentangledv2")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use CultriX/Qwen2.5-14B-Qwentangledv2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "CultriX/Qwen2.5-14B-Qwentangledv2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CultriX/Qwen2.5-14B-Qwentangledv2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/CultriX/Qwen2.5-14B-Qwentangledv2
How to use CultriX/Qwen2.5-14B-Qwentangledv2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "CultriX/Qwen2.5-14B-Qwentangledv2" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CultriX/Qwen2.5-14B-Qwentangledv2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "CultriX/Qwen2.5-14B-Qwentangledv2" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "CultriX/Qwen2.5-14B-Qwentangledv2",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use CultriX/Qwen2.5-14B-Qwentangledv2 with Docker Model Runner:
docker model run hf.co/CultriX/Qwen2.5-14B-Qwentangledv2
This is a merge of pre-trained language models created using mergekit.
This model was merged using the Linear DELLA merge method using CultriX/Enhanced-TIES-Base-v1 as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
name: SuperMerge-LayeredTIES-v1
merge_method: della_linear
base_model: CultriX/Enhanced-TIES-Base-v1 # Referencing the TIES base model defined below (now inlined)
tokenizer_source: base
dtype: float32
out_dtype: bfloat16
parameters:
int8_mask: true
normalize: true
rescale: false
t: [0.1, 0.3, 0.7, 0.7, 0.4, 0.2]
slices:
- sources:
- model: CultriX/Enhanced-TIES-Base-v1 # Referencing inlined TIES base
layer_range: [0, 8]
parameters:
weight: 0.7
- model: arcee-ai/Virtuoso-Small-v2
layer_range: [0, 8]
parameters:
weight: 0.3
- model: sthenno/tempesthenno-ppo-ckpt40
layer_range: [0, 8]
parameters:
weight: 0.0
- model: sometimesanotion/Qwenvergence-14B-v3-Prose
layer_range: [0, 8]
parameters:
weight: 0.0
- sources:
- model: CultriX/Enhanced-TIES-Base-v1 # Referencing inlined TIES base
layer_range: [8, 16]
parameters:
weight: 0.4
- model: arcee-ai/Virtuoso-Small-v2
layer_range: [8, 16]
parameters:
weight: 0.3
- model: sthenno/tempesthenno-ppo-ckpt40
layer_range: [8, 16]
parameters:
weight: 0.3
- model: sometimesanotion/Qwenvergence-14B-v3-Prose
layer_range: [8, 16]
parameters:
weight: 0.0
- sources:
- model: CultriX/Enhanced-TIES-Base-v1 # Referencing inlined TIES base
layer_range: [16, 24]
parameters:
weight: 0.2
- model: arcee-ai/Virtuoso-Small-v2
layer_range: [16, 24]
parameters:
weight: 0.2
- model: sthenno/tempesthenno-ppo-ckpt40
layer_range: [16, 24]
parameters:
weight: 0.5
- model: sometimesanotion/Qwenvergence-14B-v3-Prose
layer_range: [16, 24]
parameters:
weight: 0.1
- sources:
- model: CultriX/Enhanced-TIES-Base-v1 # Referencing inlined TIES base
layer_range: [24, 32]
parameters:
weight: 0.25
- model: arcee-ai/Virtuoso-Small-v2
layer_range: [24, 32]
parameters:
weight: 0.1
- model: sthenno/tempesthenno-ppo-ckpt40
layer_range: [24, 32]
parameters:
weight: 0.4
- model: sometimesanotion/Qwenvergence-14B-v3-Prose
layer_range: [24, 32]
parameters:
weight: 0.25
- sources:
- model: CultriX/Enhanced-TIES-Base-v1 # Referencing inlined TIES base
layer_range: [32, 40]
parameters:
weight: 0.4
- model: arcee-ai/Virtuoso-Small-v2
layer_range: [32, 40]
parameters:
weight: 0.0
- model: sthenno/tempesthenno-ppo-ckpt40
layer_range: [32, 40]
parameters:
weight: 0.2
- model: sometimesanotion/Qwenvergence-14B-v3-Prose
layer_range: [32, 40]
parameters:
weight: 0.4
- sources:
- model: CultriX/Enhanced-TIES-Base-v1 # Referencing inlined TIES base
layer_range: [40, 48]
parameters:
weight: 0.6
- model: arcee-ai/Virtuoso-Small-v2
layer_range: [40, 48]
parameters:
weight: 0.0
- model: sthenno/tempesthenno-ppo-ckpt40
layer_range: [40, 48]
parameters:
weight: 0.1
- model: sometimesanotion/Qwenvergence-14B-v3-Prose
layer_range: [40, 48]
parameters:
weight: 0.3
# Commentary:
# =============================================================================
# SuperMerge-LayeredTIES-v1 Commentary:
#
# This configuration combines the strengths of both Enhanced-LayeredSlerp-v1 and SuperMerge-Enhanced-v1.
# It leverages the robust foundation of a TIES-merged base model (Enhanced-TIES-Base-v1) and applies
# the layer-wise module approach and fine-grained weight control from SuperMerge-Enhanced-v1 in a SLERP merge.
#
# Key Features:
# - TIES-Merged Base Foundation: Uses 'Enhanced-TIES-Base-v1' as the base model for the SLERP merge.
# This TIES base provides a selectively merged and potentially more efficient starting point, incorporating
# strengths from multiple models (Virtuoso, Phi-4, Qwenvergence, DeepSeek) with density control.
#
# - Layer-wise Module Integration in SLERP: Maintains the module-based slice structure from SuperMerge-Enhanced-v1.
# The SLERP merge now combines the TIES-merged base with specialized modules for Reasoning, IFEval, and MATH/Knowledge
# at different layer ranges, using explicit weights for fine-grained control.
#
# - Benchmark-Driven Iterative Weight Tuning: The configuration is designed to be optimized through a
# benchmark-driven iterative weight tuning process (as described in the refined SuperMerge-Enhanced-v1 approach).
# The initial weights provided are starting points and need to be systematically tuned based on benchmark results.
#
# Tuning Process (Same as Refined SuperMerge-Enhanced-v1):
# 1. Initial Benchmarking: Run a full benchmark suite.
# 2. Performance Analysis: Examine per-benchmark scores and compare to source models.
# 3. Targeted Weight Adjustments: Adjust layer weights based on performance analysis (e.g., increase IFEval module weight
# in early layers if IFEval is weak).
# 4. Iterate: Repeat steps 1-3. Make small, incremental adjustments in each iteration.
#
# Rationale:
# - By using a TIES-merged base, we aim to create a more robust and potentially efficient foundation for the SLERP merge.
# - The layer-wise module approach and fine-grained weights in SLERP still allow for precise control over the blending
# of specialized capabilities at different network depths, building upon the solid TIES base.
# - The emphasis on a benchmark-driven iterative weight tuning process remains crucial for achieving optimal performance.
#
# Next Steps:
# - Implement this configuration using MergeKit.
# - Run initial benchmarks to establish a baseline.
# - Begin the iterative benchmark-driven weight tuning process to optimize performance.
# =============================================================================