CoolFace
Modelpublic

Mercity/Qwen3-8B-LaCo-30L

sourceHugging Faceapache-2.0updated 9mo agoView on Hugging Face
0likes16downloads
Model Card

Qwen3-8B-LaCo-Pruned

This model is a layer-pruned version of Qwen3-8B-Base using the LaCo (Layer Collapse) structured pruning method.

Model Summary

AttributeValue
Base ModelQwen/Qwen3-8B-Base
Pruning MethodLaCo (Layer Collapse)
Original Layers36
Pruned Layers30
Layers Removed6
Compression16.7%

Key Results

This model achieves 16.7% compression while retaining:

  • —~90% of physical reasoning (PIQA)
  • —~94% of commonsense reasoning (WinoGrande)
  • —~79% of common sense completion (HellaSwag)
  • —~41% of factual knowledge (MMLU)

This is a raw pruned model without post-training. Fine-tuning can further recover lost capabilities.


Benchmark Results (Pre-Training)

Note: All benchmarks below are evaluated on the pruned model without any post-training or fine-tuning. These results represent the raw performance after pruning only. Post-training is expected to improve these scores, particularly on knowledge-intensive tasks like MMLU.

Comparison with Original Qwen3-8B-Base

BenchmarkOriginalPrunedRetention
PIQA (acc_norm)79.54%71.38%89.7%
WinoGrande67.0%62.83%93.8%
ARC-Challenge (acc_norm)42.0%36.09%85.9%
ARC-Easy (acc_norm)72.0%58.04%80.6%
HellaSwag (acc_norm)78.55%61.98%78.9%
BoolQ83.09%64.95%78.2%
MMLU (5-shot)76.89%31.30%40.7%

Original scores from [Qwen3 Technical Report](https://arxiv.org/abs/2505.09388)

Benchmark Interpretation

CapabilityBenchmarksRetentionStatus
Physical ReasoningPIQA89.7%Excellent
Commonsense ReasoningWinoGrande93.8%Excellent
Basic ReasoningARC-Challenge85.9%Good
Reading ComprehensionBoolQ78.2%Good
Common SenseHellaSwag78.9%Good
Factual KnowledgeMMLU40.7%Degraded

The "Knowledge Cliff"

Our experiments reveal a critical finding: factual knowledge collapses catastrophically between 16-22% compression.

CompressionLayersMMLUStatus
16.7%3031.30%Partial retention
22.2%2825.89%Random chance
27.8%2625.12%Random chance

While reasoning capabilities degrade gradually with compression, factual knowledge encoded in specific layers is lost abruptly when those layers are removed.


Intended Use

This model is suitable for:

  • —Research on model compression and efficiency
  • —Fine-tuning base for domain-specific applications
  • —Inference optimization where speed/memory matters
  • —Applications prioritizing reasoning over factual recall

Limitations

Important: This is a raw pruned model without post-training.

Use CaseRecommendation
Physical/commonsense reasoningRecommended
Reading comprehensionRecommended
General text understandingRecommended
Factual question answeringFine-tune first
Knowledge-intensive tasksFine-tune first

Pruning Details

LaCo Hyperparameters

ParameterValueDescription
MERGE_LAYERS (C)3Layers merged per operation
LOWEST_LAY (L)4Minimum layer index for merging
HIGHEST_LAY (H)28Maximum layer index for merging
INTERVAL (I)2Minimum gap between merge points
THRESHOLD (T)0.85Cosine similarity threshold
MAX_COMPRESSION20%Maximum allowed compression

Pruning Statistics

MetricValue
Successful Merges3
Rejected Merges0
Total Iterations4
Final Compression16.7%

Usage

Basic Inference

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "Mercity/Qwen3-8B-LaCo-Pruned"

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

# Text generation
prompt = "The process of photosynthesis"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

With 4-bit Quantization (Further Compression)

python
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_compute_dtype="float16",
    bnb_4bit_quant_type="nf4",
)

model = AutoModelForCausalLM.from_pretrained(
    "Mercity/Qwen3-8B-LaCo-Pruned",
    quantization_config=quantization_config,
    device_map="auto",
    trust_remote_code=True
)

Recovery Recommendations

To improve factual knowledge after pruning:

LoRA Fine-tuning (Recommended)

python
from peft import LoraConfig, get_peft_model

lora_config = LoraConfig(
    r=32,
    lora_alpha=64,
    target_modules=["q_proj", "k_proj", "v_proj", "o_proj", 
                    "gate_proj", "up_proj", "down_proj"],
    lora_dropout=0.05,
)
model = get_peft_model(model, lora_config)
# Fine-tune on OpenOrca, Alpaca, or domain-specific data

Expected recovery: MMLU could reach 45-55% with fine-tuning.


Technical Specifications

AttributeValue
ArchitectureTransformer decoder-only
Layers30
Hidden Size4096
Attention Heads (Q)32
Attention Heads (KV)8 (GQA)
Intermediate Size12288
Vocabulary Size151,669
Max Context Length32,768 tokens
Precisionbfloat16

Citation

If you use this model, please cite the original LaCo paper and Qwen3:

bibtex
@article{yang2024laco,
  title={LaCo: Large Language Model Pruning via Layer Collapse},
  author={Yang, Yifei and Cao, Zouying and Zhao, Hai},
  journal={arXiv preprint arXiv:2402.11187},
  year={2024}
}

@misc{qwen3technicalreport,
  title={Qwen3 Technical Report},
  author={Qwen Team},
  year={2025},
  eprint={2505.09388},
  archivePrefix={arXiv},
  primaryClass={cs.CL},
  url={https://arxiv.org/abs/2505.09388}
}

References

License

Apache 2.0 (same as base Qwen3 model)

Acknowledgments

  • —Qwen Team for the excellent Qwen3-8B-Base model
  • —LaCo authors for the pruning methodology
  • —Hugging Face for model hosting