arnavkartikeya commited on
Commit
3f3c24f
·
verified ·
1 Parent(s): 7cc6b3e

Add model card

Browse files
Files changed (1) hide show
  1. README.md +52 -0
README.md ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - llama
4
+ - sequence-classification
5
+ - difficulty-classification
6
+ - math-questions
7
+ ---
8
+
9
+ # LLaMA-based Math Question Difficulty Classifier
10
+
11
+ This model classifies the difficulty of math questions on a 1-3 scale:
12
+ - Level 1: Direct application of definitions; minimal reasoning
13
+ - Level 2: One extra reasoning step (e.g., convert a word problem)
14
+ - Level 3: Multi-step reasoning; multiple concepts and harder mathematical skill
15
+
16
+ ## Training Details
17
+
18
+ Fine-tuned from Meta-Llama-3-8B-Instruct using a two-stage approach:
19
+ 1. Head-only warmup (frozen backbone)
20
+ 2. Full fine-tuning with class-weighted CrossEntropy
21
+
22
+ The model was trained using a prompt template that frames the task as classification
23
+ without considering the grade level of mathematical concepts.
24
+
25
+ ## Usage
26
+ ```python
27
+ from transformers import AutoTokenizer, LlamaForSequenceClassification
28
+
29
+ tokenizer = AutoTokenizer.from_pretrained("YOUR_USERNAME/math-difficulty-classifier")
30
+ model = LlamaForSequenceClassification.from_pretrained("YOUR_USERNAME/math-difficulty-classifier")
31
+
32
+ # Prepare input text
33
+ text = """Classify the difficulty level (1–3) of the following math question. Remember this classification of difficutly is agnostic of the concepts. Only consider the difficulty of the question itself, not if the concept is something only learned in higher grades. For example, a simple integral is the same difficulty as a simple trig calculation.
34
+ - Level 1: direct application of definitions; minimal reasoning.
35
+ - Level 2: one extra reasoning step (e.g., convert a word problem).
36
+ - Level 3: multi-step reasoning; multiple concepts and harder mathematical skil.
37
+
38
+ Question:
39
+ What is the slope of the line passing through the points (3, 7) and (5, 11)?
40
+
41
+ Difficulty (1–3):"""
42
+
43
+ inputs = tokenizer(text, return_tensors="pt")
44
+ outputs = model(**inputs)
45
+ predicted_class = outputs.logits.argmax().item()
46
+ difficulty = predicted_class + 1 # Convert from 0-indexed to 1-indexed
47
+ print(f"Predicted difficulty: {difficulty}")
48
+ ```
49
+
50
+ ## Limitations
51
+
52
+ This model is specifically designed for math questions and may not generalize well to other domains.