alibaba-pai / Qwen2-1.5B-Instruct-Refine

huggingface.co
Total runs: 9
24-hour runs: 0
7-day runs: 0
30-day runs: 1
Model's Last Updated: January 17 2025
text-generation

Introduction of Qwen2-1.5B-Instruct-Refine

Model Details of Qwen2-1.5B-Instruct-Refine

image/png
📖 Introduction

Qwen2-7B-Instruct-Refine and Qwen2-1.5B-Instruct-Refine are two powerful large language models that act as proficient prompt engineers. They can optimize and refine the prompts input by users, and the generated optimized instructions can significantly enhance the LLM's ability to produce better and more informative responses for users.

We fine-tuned Qwen2-7B-Instruct and Qwen2-1.5B-Instruct to obtain Qwen2-7B-Instruct-Refine and Qwen2-1.5B-Instruct-Refine . 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.

🚀 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.

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

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

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 used single-turn instructions from MT-Bench as input for Qwen2-1.5B-Instruct and Qwen2-7B-Instruct. GPT4-turbo is used to evaluate the changes in the level of detail and truthfulness of responses to our model's revised instructions.

Model Detail Truthfulness
Qwen2-1.5B-Instruct 50.00% 50.00%
+ Qwen2-1.5B-Instruct-Refine 75.63% 63.75%
+ Qwen2-7B-Instruct-Refine 76.56% 62.19%
Qwen2-7B-Instruct 50.00% 50.00%
+ Qwen2-1.5B-Instruct-Refine 70.94% 57.19%
+ Qwen2-7B-Instruct-Refine 74.69% 58.44%
📜 Citation

If you find our work helpful, please cite it!

@misc{TAPIR,
      title={Distilling Instruction-following Abilities of Large Language Models with Task-aware Curriculum Planning}, 
      author={Yuanhao Yue and Chengyu Wang and Jun Huang and Peng Wang},
      year={2024},
      eprint={2405.13448},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2405.13448}, 
}

Runs of alibaba-pai Qwen2-1.5B-Instruct-Refine on huggingface.co

9
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
1
30-day runs

More Information About Qwen2-1.5B-Instruct-Refine huggingface.co Model

Qwen2-1.5B-Instruct-Refine huggingface.co

Qwen2-1.5B-Instruct-Refine huggingface.co is an AI model on huggingface.co that provides Qwen2-1.5B-Instruct-Refine's model effect (), which can be used instantly with this alibaba-pai Qwen2-1.5B-Instruct-Refine model. huggingface.co supports a free trial of the Qwen2-1.5B-Instruct-Refine model, and also provides paid use of the Qwen2-1.5B-Instruct-Refine. Support call Qwen2-1.5B-Instruct-Refine model through api, including Node.js, Python, http.

Qwen2-1.5B-Instruct-Refine huggingface.co Url

https://huggingface.co/alibaba-pai/Qwen2-1.5B-Instruct-Refine

alibaba-pai Qwen2-1.5B-Instruct-Refine online free

Qwen2-1.5B-Instruct-Refine huggingface.co is an online trial and call api platform, which integrates Qwen2-1.5B-Instruct-Refine's modeling effects, including api services, and provides a free online trial of Qwen2-1.5B-Instruct-Refine, you can try Qwen2-1.5B-Instruct-Refine online for free by clicking the link below.

alibaba-pai Qwen2-1.5B-Instruct-Refine online free url in huggingface.co:

https://huggingface.co/alibaba-pai/Qwen2-1.5B-Instruct-Refine

Qwen2-1.5B-Instruct-Refine install

Qwen2-1.5B-Instruct-Refine is an open source model from GitHub that offers a free installation service, and any user can find Qwen2-1.5B-Instruct-Refine on GitHub to install. At the same time, huggingface.co provides the effect of Qwen2-1.5B-Instruct-Refine install, users can directly use Qwen2-1.5B-Instruct-Refine installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Qwen2-1.5B-Instruct-Refine install url in huggingface.co:

https://huggingface.co/alibaba-pai/Qwen2-1.5B-Instruct-Refine

Url of Qwen2-1.5B-Instruct-Refine

Qwen2-1.5B-Instruct-Refine huggingface.co Url

Provider of Qwen2-1.5B-Instruct-Refine huggingface.co

alibaba-pai
ORGANIZATIONS

Other API from alibaba-pai