akhilfau commited on
Commit
f53ec13
·
verified ·
1 Parent(s): f8fd6d7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -71
README.md CHANGED
@@ -1,70 +1,57 @@
1
- # Fine-tuned SmolLM2-135M with LoRA on CAMEL-AI Physics Dataset
2
 
3
- ## Model Overview
4
-
5
- This model is a fine-tuned version of [HuggingFaceTB/SmolLM2-135M](https://huggingface.co/HuggingFaceTB/SmolLM2-135M) using Low-Rank Adaptation (LoRA) on the decontaminated [CAMEL-AI Physics](https://huggingface.co/datasets/camel-ai/physics) dataset. The dataset was decontaminated to ensure no overlap with the evaluation dataset `mmlu:college_physics`, ensuring a fair evaluation process.
6
-
7
- The fine-tuning leveraged PEFT (Parameter-Efficient Fine-Tuning) to optimize a smaller set of parameters, making it a lightweight yet effective fine-tuning approach.
8
 
9
  ---
10
 
11
- ## Model Details
12
 
13
- - **Base Model**: [HuggingFaceTB/SmolLM2-135M](https://huggingface.co/HuggingFaceTB/SmolLM2-135M)
14
- - **Dataset Used for Fine-tuning**: [akhilfau/physics_decontaminated_2](https://huggingface.co/datasets/akhilfau/physics_decontaminated_2)
15
- - **Fine-tuning Methodology**: LoRA (Low-Rank Adaptation)
16
- - **Framework Versions**:
17
- - PEFT: `0.13.2`
18
- - Transformers: `4.46.2`
19
- - PyTorch: `2.4.1+cu121`
20
- - Datasets: `3.1.0`
21
- - Tokenizers: `0.20.3`
22
 
23
- ---
24
 
25
- ## Dataset Information
 
 
 
26
 
27
- The training dataset ([akhilfau/physics_decontaminated_2](https://huggingface.co/datasets/akhilfau/physics_decontaminated_2)) was generated by decontaminating the [CAMEL-AI Physics](https://huggingface.co/datasets/camel-ai/physics) dataset to remove any overlap with the evaluation dataset `mmlu:college_physics`. This ensures that the fine-tuned model's performance on `mmlu:college_physics` is not biased due to data leakage.
28
 
29
- - **Training Dataset**: Physics-related text data, where:
30
- - `message_1`: The problem statement (e.g., a physics question).
31
- - `message_2`: The solution or explanation.
32
 
33
- The decontamination process used n-gram matching to eliminate any overlap with `mmlu:college_physics`.
34
 
35
  ---
36
 
37
- ## Intended Use Cases
38
 
39
- - Solving physics-related questions and problems in a Q&A format.
40
- - Educational purposes in the field of physics.
41
- - Benchmarking and comparison with other lightweight language models.
42
 
43
- ### Limitations
 
44
 
45
- - The model is trained on a decontaminated dataset to ensure fairness during evaluation, but this process may exclude some valid training examples.
46
- - The model may require additional alignment or fine-tuning for tasks with different formats, such as multiple-choice questions (MCQs).
47
 
48
  ---
49
 
50
  ## Training Procedure
51
 
52
- ### Hyperparameters
53
 
54
- The following hyperparameters were used during training:
55
-
56
- - **Learning Rate**: `0.0005`
57
- - **Train Batch Size**: `4`
58
- - **Eval Batch Size**: `4`
59
- - **Seed**: `42`
60
- - **Optimizer**: AdamW with `betas=(0.9, 0.999)` and `epsilon=1e-08`
61
- - **Learning Rate Scheduler**: `cosine`
62
- - **Number of Epochs**: `8`
63
 
64
  ### Training Results
65
 
66
  | Training Loss | Epoch | Step | Validation Loss |
67
- |:-------------:|:-----:|:-----:|:---------------:|
68
  | 1.0151 | 1.0 | 4000 | 1.0407 |
69
  | 1.0234 | 2.0 | 8000 | 1.0087 |
70
  | 0.9995 | 3.0 | 12000 | 0.9921 |
@@ -76,38 +63,16 @@ The following hyperparameters were used during training:
76
 
77
  ---
78
 
79
- ## Evaluation
80
-
81
- The model was evaluated using the physics subset of the `mmlu:college_physics` dataset. The training dataset was explicitly decontaminated to ensure fair evaluation.
82
-
83
- ---
84
-
85
- ## Model Usage
86
-
87
- You can load this model from the Hugging Face Hub as follows:
88
-
89
- ```python
90
- from transformers import AutoTokenizer, AutoModelForCausalLM
91
 
92
- # Load the fine-tuned model
93
- model_name = "akhilfau/fine-tuned-smolLM2-135M-with-LoRA-on-camel-ai-physics"
94
- tokenizer = AutoTokenizer.from_pretrained(model_name)
95
- model = AutoModelForCausalLM.from_pretrained(model_name)
96
-
97
- # Prepare a question
98
- input_text = "What is the Schrödinger equation?"
99
- inputs = tokenizer(input_text, return_tensors="pt")
100
-
101
- # Generate a response
102
- output = model.generate(**inputs, max_length=100)
103
- print(tokenizer.decode(output[0], skip_special_tokens=True))
104
- ```
105
 
106
  ---
107
 
108
- ## Acknowledgments
109
-
110
- - The decontamination process was implemented using tools from the [Cosmopedia Repository](https://github.com/huggingface/cosmopedia).
111
- - The model fine-tuning leveraged PEFT for efficient adaptation of the base model.
112
 
113
- For any issues or contributions, feel free to open a pull request or an issue on the Hugging Face repository.
 
 
 
 
 
1
+ # fine-tuned-smolLM2-135M-with-LoRA-on-camel-ai-physics
2
 
3
+ This model is a fine-tuned version of [HuggingFaceTB/SmolLM2-135M](https://huggingface.co/HuggingFaceTB/SmolLM2-135M) on the dataset [akhilfau/physics_decontaminated_2](https://huggingface.co/datasets/akhilfau/physics_decontaminated_2). This dataset was created by decontaminating the [camel-ai/physics](https://huggingface.co/datasets/camel-ai/physics) dataset from [mmlu:college_physics](https://huggingface.co/datasets/lighteval/mmlu).
 
 
 
 
4
 
5
  ---
6
 
7
+ ## Model Performance
8
 
9
+ This model was evaluated on **MMLU: college_physics** using **LightEval**. The evaluation compared the base model (HuggingFaceTB/SmolLM2-135M) and the fine-tuned model (akhilfau/fine-tuned-smolLM2-135M-with-LoRA-on-camel-ai-physics). Results are as follows:
 
 
 
 
 
 
 
 
10
 
11
+ ### Evaluation Results:
12
 
13
+ | Model Name | Task | Metric | Accuracy ± Stderr |
14
+ |-----------------------------------------------------|-----------------------------|--------|-------------------|
15
+ | **HuggingFaceTB/SmolLM2-135M** | mmlu:college_physics | acc | 0.2157 ± 0.0409 |
16
+ | **akhilfau/fine-tuned-smolLM2-135M-with-LoRA-on-camel-ai-physics** | mmlu:college_physics | acc | 0.2843 ± 0.0449 |
17
 
18
+ ---
19
 
20
+ ## Model Description
 
 
21
 
22
+ The fine-tuned model leverages **LoRA (Low-Rank Adaptation)** for parameter-efficient fine-tuning. The base model is SmolLM2-135M, which uses the **LlamaForCausalLM** architecture, and it was fine-tuned to enhance its understanding of physics-related questions and answers using the **akhilfau/physics_decontaminated_2** dataset.
23
 
24
  ---
25
 
26
+ ## Training and Evaluation Data
27
 
28
+ ### Dataset Details:
 
 
29
 
30
+ - **Training Dataset:** [akhilfau/physics_decontaminated_2](https://huggingface.co/datasets/akhilfau/physics_decontaminated_2)
31
+ - **Evaluation Dataset:** [mmlu:college_physics](https://huggingface.co/datasets/lighteval/mmlu/viewer/college_physics)
32
 
33
+ The training dataset was decontaminated to ensure no overlap with the evaluation dataset for fair performance testing.
 
34
 
35
  ---
36
 
37
  ## Training Procedure
38
 
39
+ ### Training Hyperparameters
40
 
41
+ | Hyperparameter | Value |
42
+ |---------------------------|--------------------|
43
+ | Learning Rate | 0.0005 |
44
+ | Train Batch Size | 4 |
45
+ | Eval Batch Size | 4 |
46
+ | Seed | 42 |
47
+ | Optimizer | AdamW with betas=(0.9, 0.999), epsilon=1e-8 |
48
+ | LR Scheduler Type | Cosine |
49
+ | Number of Epochs | 8 |
50
 
51
  ### Training Results
52
 
53
  | Training Loss | Epoch | Step | Validation Loss |
54
+ |---------------|-------|-------|-----------------|
55
  | 1.0151 | 1.0 | 4000 | 1.0407 |
56
  | 1.0234 | 2.0 | 8000 | 1.0087 |
57
  | 0.9995 | 3.0 | 12000 | 0.9921 |
 
63
 
64
  ---
65
 
66
+ ## Intended Use
 
 
 
 
 
 
 
 
 
 
 
67
 
68
+ This model is specifically fine-tuned for physics-related reasoning tasks and QA tasks. It may perform well on datasets that require understanding physics-related problems and concepts. Evaluation results show a measurable improvement compared to the base model on MMLU college physics tasks.
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
  ---
71
 
72
+ ## Framework Versions
 
 
 
73
 
74
+ - **PEFT**: 0.13.2
75
+ - **Transformers**: 4.46.2
76
+ - **Pytorch**: 2.4.1+cu121
77
+ - **Datasets**: 3.1.0
78
+ - **Tokenizers**: 0.20.3