Model Card: Qwen2-Adv-1extreme-UK

Model Description

Qwen2-Adv-1extreme-UK is an advanced, fine-tuned large language model specifically engineered for superior performance in complex mathematical problem-solving. It builds upon the capabilities of ujjwal52/Qwen2-Adv-0extreme-UK, itself a derivative of the powerful Qwen2-Math-1.5B by Qwen. This iterative fine-tuning process has significantly enhanced its precision and depth in mathematical reasoning, particularly in challenging and 'extreme' problem sets.

This model was fine-tuned using the ujjwal52/Maths-10k-COT-Uk dataset. This comprehensive dataset features 10,000 diverse mathematical problems paired with detailed Chain-of-Thought (COT) explanations. This training methodology enables the model to not only derive accurate solutions but also to articulate the complete reasoning process, making it an invaluable tool for educational, research, and technical applications requiring transparent and interpretable mathematical solutions.

Why Choose This Model? (What it does great & why it's better)

1. Unparalleled Extreme Mathematical Reasoning: Qwen2-Adv-1extreme-UK is designed to tackle problems that push the boundaries of standard mathematical LLMs. Its '1extreme' designation reflects its enhanced ability to navigate highly complex, multi-step, and nuanced mathematical queries that often pose challenges to general-purpose models. It achieves this by building on an already advanced base model and further specializing on a robust dataset.

2. Superior Chain-of-Thought (COT) Generation: Leveraging its meticulously curated training dataset, this model provides exceptionally clear and logical step-by-step explanations for its solutions. Unlike models that merely output answers, Qwen2-Adv-1extreme-UK excels at demonstrating the how and why behind its derivations, fostering deeper understanding and trust in its results.

3. Efficient and Resource-Friendly Fine-tuning: Developed using QLoRA with 4-bit quantization, Qwen2-Adv-1extreme-UK achieves state-of-the-art performance while maintaining a significantly reduced memory footprint during both training and inference. This makes it highly accessible for deployment in environments with computational or memory constraints, offering a powerful solution without demanding excessive resources.

4. Robust Problem Coverage: The fine-tuning process utilized a 10,000-sample dataset, ensuring broad and deep exposure to a wide array of mathematical concepts and problem structures. This leads to a model that is not only proficient in niche areas but also reliably strong across various mathematical domains.

5. Versatile Applications: Ideal for a range of applications including automated math tutoring systems, advanced research assistance, content generation for specialized mathematical education, and sophisticated problem-solving tools in engineering and data science.

Training Details

Base Model

  • ujjwal52/Qwen2-Adv-0extreme-UK (which itself is based on Qwen/Qwen2-Math-1.5B)

Dataset

  • A specialized dataset comprising 10,000 mathematical problems with detailed Chain-of-Thought (COT) explanations, designed to enhance reasoning capabilities.

How to Use

This model can be readily loaded and utilized for text generation tasks, with a particular emphasis on solving mathematical problems and explaining the steps. Here’s how you can integrate it into your workflow using the transformers library:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

# Define the model ID on Hugging Face
model_id = "ujjwal52/Qwen2-Adv-1extreme-UK"

# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_id)

# Load model (ensure to specify the correct dtype and device_map for your setup)
# For the merged model, float16 is typically appropriate.
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.float16,  # Use the dtype the merged model was saved in
    device_map="auto",           # Automatically maps model to available devices (e.g., GPU)
)

# Create a text generation pipeline
prompt = "If $f(x) = \frac{3x-2}{x-2}$, what is the value of $f(-2) +f(-1)+f(0)$? Express your answer as a common fraction.,ans carefully"
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=3500)

# Format the prompt according to the Llama 2 chat template (or Qwen2's equivalent)
# The fine-tuning typically uses a specific template, here we assume a chat-like structure.
chat_template_prompt = f"<s>[INST] {prompt} [/INST]"

# Generate text
result = pipe(chat_template_prompt)
print(result[0]['generated_text'])

# Another example:
prompt_2 = "Solve the equation: $2x + 5 = 11$. Explain your steps."
chat_template_prompt_2 = f"<s>[INST] {prompt_2} [/INST]"
result_2 = pipe(chat_template_prompt_2)
print(result_2[0]['generated_text'])

Limitations and Biases

  • Mathematical Scope: While highly proficient in algebraic, functional, and complex problem-solving, the model's performance might vary in highly specialized or abstract mathematical fields (e.g., advanced theoretical physics, niche combinatorial problems) not directly covered by its extensive training data.
  • Problem Novelty: The model performs exceptionally well on problems similar in structure and complexity to its training data. Extremely novel or open-ended mathematical research questions might still require human-in-the-loop validation.
  • Hallucination Risk: As with all large language models, there is an inherent risk of generating plausible-sounding but mathematically incorrect information. Critical mathematical results should always be independently verified.
  • Language and Context Bias: The model's responses and problem interpretations are influenced by the language and framing present in the ujjwal52/Maths-10k-COT-Uk dataset. Users should be aware of potential biases in problem presentation or solution methodologies.

License

This model is based on ujjwal52/Qwen2-Adv-0extreme-UK, which in turn derives from Qwen2-Math-1.5B. Please refer to the Qwen2-Math-1.5B model page for its exact licensing terms. The fine-tuned weights of Qwen2-Adv-1extreme-UK inherit the licensing terms of its base models.

Citation

If you utilize Qwen2-Adv-1extreme-UK in your research, applications, or publications, please consider citing the original Qwen2 work, the base model, and the dataset used for fine-tuning:

@misc{qwen2,
    title={Qwen2: A New Series of Large Language Models},
    author={The Qwen Team},
    year={2024},
    publisher={Hugging Face},
    url={https://huggingface.co/Qwen/Qwen2-Math-1.5B}
}

@misc{qwen2_adv_0extreme_uk,
    title={Qwen2-Adv-0extreme-UK: An Advanced Mathematical Reasoning Model},
    author={ujjwal52},
    year={2024},
    publisher={Hugging Face},
    url={https://huggingface.co/ujjwal52/Qwen2-Adv-0extreme-UK}
}

@misc{maths_10k_cot_uk,
    title={Maths-10k-COT-Uk Dataset: A Comprehensive Collection for Chain-of-Thought Math Problem Solving},
    author={ujjwal52},
    year={2024},
    publisher={Hugging Face},
    url={https://huggingface.co/datasets/ujjwal52/Maths-10k-COT-Uk}
}
Downloads last month
-
Safetensors
Model size
2B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support