Yi-34B Quantum Fine-tuned with Subject Matter Knowledge

Model Overview

This model is a fine-tuned version of Yi-1.5-34B-Chat specifically optimized for quantum physics instruction-following tasks. The model has been enhanced with dense domain and subdomain knowledge through structured fine-tuning on quantum physics problems with explicit subject matter context.

Key Differentiators

๐Ÿง  Subject Matter Contextualization

Unlike standard quantum AI models, this model incorporates explicit subject matter knowledge in its training process. Each training example includes:

  • Domain: Primary field (e.g., "Quantum Physics", "Quantum Computing")
  • Subdomain: Specific area (e.g., "Quantum Mechanics", "Quantum Algorithms", "Quantum Information Theory")
  • Subject Knowledge: Contextual background information that guides reasoning
  • Problem: The specific question or task
  • Solution: Expert-level response

This structured approach enables the model to:

  • Maintain contextual awareness across different quantum physics subfields
  • Provide more accurate and domain-appropriate responses
  • Demonstrate deeper understanding of subject matter relationships

๐ŸŽฏ Specialized Training Methodology

The model was fine-tuned using QLoRA (Quantized Low-Rank Adaptation) with the following specifications:

  • Base Model: Yi-1.5-34B-Chat (34 billion parameters)
  • Fine-tuning Method: QLoRA with 4-bit quantization
  • LoRA Configuration:
    • Rank (r): 16
    • Alpha: 32
    • Dropout: 0.1
    • Target modules: q_proj, v_proj, k_proj, o_proj, gate_proj, up_proj, down_proj
  • Training Hardware: NVIDIA A100-80GB
  • Memory Efficiency: ~35-40GB VRAM usage during training

Dataset

Source Dataset: kalkiai3000/quantum-llm-instruct-subject-knowledge

This dataset contains structured quantum physics problems with the following schema:

{
  "problem": "Quantum physics question or task",
  "main_domain": "Primary field classification", 
  "sub_domain": "Specific subdomain",
  "subject_knowledge": "Relevant background knowledge",
  "solution": "Expert-level solution",
  "uuid": "Unique identifier",
  "timestamp": "Creation timestamp",
  "model_name": "Source model information",
  "solution_model_name": "Solution generation model"
}

Training Format

Each training example follows this instruction template:

Problem: [Quantum physics question]

Domain: [main_domain]  
Subdomain: [sub_domain]
Subject Knowledge: [relevant context]

Please provide the solution:

This format ensures the model learns to:

  1. Consider domain context when reasoning
  2. Apply relevant subject matter knowledge
  3. Maintain consistency within subdomains
  4. Generate contextually appropriate solutions

Training Details

Infrastructure

  • GPU: NVIDIA A100-SXM4-80GB
  • Framework: PyTorch + Transformers + PEFT + TRL
  • Quantization: BitsAndBytesConfig (4-bit NF4)
  • Mixed Precision: BFloat16

Hyperparameters

  • Learning Rate: 2e-4
  • Training Epochs: 3
  • Max Steps: 1000
  • Batch Size: 1 per device
  • Gradient Accumulation: 8 steps
  • Warmup Steps: 100
  • Evaluation Strategy: Every 100 steps
  • Save Strategy: Every 100 steps

Memory Optimization

  • Gradient Checkpointing: Enabled
  • QLoRA: 4-bit quantization with double quantization
  • Device Mapping: Automatic GPU distribution
  • Context Length: 2048 tokens

Performance Characteristics

Specialized Capabilities

  1. Domain-Aware Reasoning: Incorporates explicit domain knowledge in problem-solving
  2. Subdomain Expertise: Maintains accuracy across quantum physics subfields
  3. Contextual Problem Solving: Uses subject matter knowledge to guide solutions
  4. Structured Output: Provides well-organized, educational responses

Target Applications

  • Quantum physics education and tutoring
  • Research assistance in quantum domains
  • Technical documentation generation
  • Quantum algorithm explanation
  • Physics problem solving with context

Planned Benchmarking

This model will be systematically evaluated against leading 32B parameter models:

Primary Comparison: Qwen2.5-32B

  • Base vs Fine-tuned: Direct comparison with Qwen2.5-32B-Instruct
  • Domain Specialization: Quantum physics problem accuracy
  • Context Utilization: Effectiveness of subject matter integration

Secondary Comparisons

  1. Yi-34B-Chat (base model) - Measuring fine-tuning improvements
  2. DeepSeek-V2-Chat (comparable 32B+ model) - Performance benchmarking
  3. Mixtral-8x7B-Instruct (MoE architecture comparison)
  4. InternLM2.5-20B (efficiency vs capability trade-off)

Evaluation Metrics

  • Accuracy: Correctness of quantum physics solutions
  • Domain Consistency: Appropriate use of domain/subdomain context
  • Knowledge Integration: Effective utilization of subject matter
  • Response Quality: Clarity, completeness, and educational value
  • Efficiency: Inference speed and memory usage

Benchmark Datasets

  • Quantum physics problem sets from academic sources
  • Domain-specific evaluation tasks
  • Cross-domain generalization tests
  • Subject knowledge application assessments

Usage

Loading the Model

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("kalkiai3000/yi34b-quantum-finetuned-subject-matter")
model = AutoModelForCausalLM.from_pretrained(
    "kalkiai3000/yi34b-quantum-finetuned-subject-matter",
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True
)

Inference Example

# Format your prompt with domain context
prompt = '''Problem: Explain quantum entanglement and its role in quantum computing.

Domain: Quantum Computing
Subdomain: Quantum Information Theory  
Subject Knowledge: Quantum entanglement creates correlated quantum states between particles regardless of distance.

Please provide the solution:'''

# Generate response
formatted_prompt = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(formatted_prompt, return_tensors="pt")

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=512,
        temperature=0.7,
        do_sample=True,
        top_p=0.9
    )

response = tokenizer.decode(outputs[0], skip_special_tokens=True)

Optimal Input Format

For best results, structure your prompts with explicit domain context:

  • Problem: Clear question or task
  • Domain: Primary field of inquiry
  • Subdomain: Specific area within the domain
  • Subject Knowledge: Relevant background information

This format leverages the model's specialized training and produces more accurate, contextually appropriate responses.

Technical Specifications

Model Architecture

  • Base: Yi-1.5-34B-Chat transformer architecture
  • Parameters: 34 billion (base) + LoRA adapters
  • Context Window: Up to 4K tokens (training), extensible to base model limits
  • Precision: BFloat16 for inference

Fine-tuning Artifacts

  • LoRA Adapters: Low-rank adaptation layers
  • Quantization: 4-bit NF4 quantization support
  • Memory Requirements: ~35-40GB VRAM for inference (with quantization)

Limitations

  1. Domain Specificity: Optimized for quantum physics; may not generalize to other scientific domains
  2. Context Dependency: Performs best when provided with domain/subdomain context
  3. Training Data: Limited to the scope of the source dataset
  4. Inference Requirements: Requires significant GPU memory for optimal performance

Citation

If you use this model in your research, please cite:

@misc{yi34b-quantum-finetuned-2025,
  title={Yi-34B Quantum Fine-tuned with Subject Matter Knowledge},
  author={KalkiAI},
  year={2025},
  publisher={Hugging Face},
  journal={Hugging Face Model Hub},
  howpublished={\url{https://huggingface.co/kalkiai3000/yi34b-quantum-finetuned-subject-matter}}
}

License

This model inherits the Apache-2.0 license from the base Yi-1.5-34B-Chat model. The fine-tuning code and datasets may have additional licensing terms.

Acknowledgments

  • Base Model: Yi-1.5-34B-Chat by 01-ai
  • Training Dataset: quantum-llm-instruct-subject-knowledge by KalkiAI
  • Framework: Hugging Face Transformers, PEFT, TRL, BitsAndBytesConfig
  • Infrastructure: NVIDIA A100 GPU computing resources

Model trained and released by KalkiAI Research Team - Advancing AI for Scientific Discovery

Downloads last month
3
Safetensors
Model size
34B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for kalkiai3000/yi34b-quantum-finetuned-subject-matter

Finetuned
(7)
this model

Dataset used to train kalkiai3000/yi34b-quantum-finetuned-subject-matter