Resolving Interference When Merging Models
Paper • 2306.01708 • Published • 19
How to use cs-552-2026-claude-bots/group_model with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="cs-552-2026-claude-bots/group_model")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("cs-552-2026-claude-bots/group_model")
model = AutoModelForCausalLM.from_pretrained("cs-552-2026-claude-bots/group_model")
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 cs-552-2026-claude-bots/group_model with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "cs-552-2026-claude-bots/group_model"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "cs-552-2026-claude-bots/group_model",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/cs-552-2026-claude-bots/group_model
How to use cs-552-2026-claude-bots/group_model with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "cs-552-2026-claude-bots/group_model" \
--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": "cs-552-2026-claude-bots/group_model",
"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 "cs-552-2026-claude-bots/group_model" \
--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": "cs-552-2026-claude-bots/group_model",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use cs-552-2026-claude-bots/group_model with Docker Model Runner:
docker model run hf.co/cs-552-2026-claude-bots/group_model
This is a merge of pre-trained language models created using mergekit.
This model was merged using the TIES merge method using Qwen/Qwen3-1.7B as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
# TIES merge configuration for 4 specialized Qwen fine-tunes
# Goal:
# - Preserve strong domain expertise from each model
# - Reduce destructive interference between skills
# - Keep general reasoning stability from the base model
#
# Recommended for:
# - Qwen2 / Qwen2.5 instruction-tuned variants
# - Same architecture + same parameter count
# - Same tokenizer + same base checkpoint lineage
models:
# ---------------------------
# Math specialist
# ---------------------------
- model: cs-552-2026-claude-bots/math_model
parameters:
# High density because math capabilities are usually sparse
# and easily lost during merging
density:
- filter: self_attn
value: 0.72
- filter: mlp
value: 0.82
# Strong contribution in reasoning-heavy blocks
weight:
- filter: self_attn
value: 1.25
- filter: mlp
value: 1.15
- value: 1.10
# ---------------------------
# Knowledge / factual model
# ---------------------------
- model: cs-552-2026-claude-bots/general_knowledge_model
parameters:
# Moderate density:
# factual tuning tends to be more distributed
density: 0.58
# Slightly lower than math to avoid overwriting reasoning
weight:
- filter: self_attn
value: 1.00
- filter: mlp
value: 0.95
- value: 0.95
# ---------------------------
# Multilingual specialist
# ---------------------------
- model: cs-552-2026-claude-bots/multilingual_model
parameters:
# Language capabilities are often spread broadly,
# so use reasonably high density
density:
- filter: embed_tokens
value: 0.90
- filter: self_attn
value: 0.68
- filter: mlp
value: 0.62
# Stronger influence on embeddings and attention
weight:
- filter: embed_tokens
value: 1.30
- filter: self_attn
value: 1.10
- value: 1.00
# ---------------------------
# Safety / alignment model
# ---------------------------
- model: cs-552-2026-claude-bots/safety_model
parameters:
# Lower density prevents excessive refusals
# while still preserving alignment behavior
density: 0.34
# Important but intentionally constrained
weight:
- filter: self_attn
value: 0.82
- filter: mlp
value: 0.72
- value: 0.75
merge_method: ties
# IMPORTANT:
# Use the ORIGINAL shared pretrained base model
# from which all four fine-tunes were derived.
base_model: Qwen/Qwen3-1.7B
parameters:
# Critical for TIES stability
normalize: true
# Helps reduce memory usage and improves masking behavior
int8_mask: true
# Trim very small parameter deltas
# Good default for 4-way merges
prune_threshold: 0.015
dtype: bfloat16
# Optional:
# tokenizer_source: base
# chat_template: auto