---
title: Qwen2-7B-Instruct-Exp
canonical_url: "https://www.modelscope.cn/models/pai/Qwen2-7B-Instruct-Exp"
md_url: "https://www.modelscope.cn/models/pai/Qwen2-7B-Instruct-Exp.md"
repository: pai/Qwen2-7B-Instruct-Exp
last_updated: 2025-04-08
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - qwen2
architectures:
  - Qwen2ForCausalLM
parameters: 7.6B
tensor_type:
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - pytorch
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 518
stars: 0
---

# Qwen2-7B-Instruct-Exp

> Qwen2-7B-Instruct-Exp - pai 在 ModelScope 开源的模型。Qwen2-7B-Instruct-Exp and Qwen2-1.5B-Instruct-Exp are powerful large language models that can expand instructions with same task type but of different content.

pai/Qwen2-7B-Instruct-Exp 是 ModelScope 魔搭社区上的 7.6B 参数text-generation模型，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: pai/Qwen2-7B-Instruct-Exp
- **Tasks**: text-generation
- **Parameters**: 7.6B
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 518
- **Stars**: 0
- **Last updated**: 2025-04-08

Source: https://www.modelscope.cn/models/pai/Qwen2-7B-Instruct-Exp

---

## 📖 Introduction

**Qwen2-7B-Instruct-Exp** and **Qwen2-1.5B-Instruct-Exp** are powerful large language models that can expand instructions with same task type but of different content.

We fine-tuned **Qwen2-7B-Instruct** and **Qwen2-1.5B-Instruct-Exp** to obtain **Qwen2-7B-Instruct-Exp** and **Qwen2-1.5B-Instruct-Exp**.
We sampled the dataset from OpenHermes and the LCCD dataset, ensuring a balanced task distribution. For training set annotations, we used Qwen-max with incorporated our handwritten examples as in-context prompts.

#### Example Input
> Plan an in depth tour itinerary of France that includes Paris, Lyon, and Provence.
#### Example Output 1
> Describe a classic road trip itinerary along the California coastline in the United States.
#### Example Output 2
> Create a holiday plan that combines cultural experiences in Bangkok, Thailand, with beach relaxation in Phuket.



## 🚀 Quick Start

Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    "alibaba-pai/Qwen2-7B-Instruct-Exp",
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("alibaba-pai/Qwen2-7B-Instruct-Exp")

prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

generated_ids = model.generate(
    model_inputs.input_ids,
    max_new_tokens=2048，
    eos_token_id=151645，
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
```

## 🔍 Evaluation

We evaluated the data augmentation effect of our model on the Elementary Math and Implicature datasets.

| Model                          | Math   | Impl.  |
|--------------------------------|--------|--------|
| Qwen2-1.5B-Instruct            | 57.90% | 28.96% |
| + Qwen2-1.5B-Instruct-Exp      | 59.15% | 31.22% |
| + Qwen2-7B-Instruct-Exp        | 58.32% | 39.37% |
| Qwen2-7B-Instruct              | 71.40% | 28.85% |
| + Qwen2-1.5B-Instruct-Exp      | 73.90% | 35.41% |
| + Qwen2-7B-Instruct-Exp        | 72.53% | 32.92% |

## 📜 Citation

If you find our work helpful, please cite it!

```
@misc{data-augmentation-family,
      title={Building a Family of Data Augmentation Models for Low-cost LLM Fine-tuning on the Cloud}, 
      author={Yuanhao Yue and Chengyu Wang and Jun Huang and Peng Wang},
      year={2024},
      eprint={2412.04871},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.04871}, 
}
```
