File size: 3,945 Bytes
e9d66df
 
 
 
 
 
 
 
87e6dd2
e9d66df
e0ddccf
 
 
 
 
 
 
 
 
 
 
 
 
feb523f
e0ddccf
feb523f
e0ddccf
feb523f
e0ddccf
 
 
 
 
 
 
feb523f
e0ddccf
feb523f
e0ddccf
 
 
 
 
 
 
 
 
 
 
 
 
 
feb523f
e0ddccf
feb523f
e0ddccf
feb523f
e0ddccf
feb523f
e0ddccf
 
 
 
 
 
 
 
 
 
f291875
 
e0ddccf
f291875
 
e0ddccf
 
f291875
 
e0ddccf
f291875
e0ddccf
f291875
e0ddccf
f291875
 
e0ddccf
 
f291875
e0ddccf
f291875
e0ddccf
 
feb523f
e0ddccf
feb523f
e0ddccf
 
 
 
 
 
 
feb523f
e0ddccf
feb523f
e0ddccf
feb523f
e0ddccf
 
 
 
 
 
 
 
 
 
 
 
 
 
e9d66df
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
license: mit
datasets:
- aryan27/geometry-cot
language:
- en
base_model:
- TinyLlama/TinyLlama-1.1B-Chat-v1.0
library_name: transformers
---
# **MiniLLM Geometry Engine**

MiniLLM Geometry Engine is a fine-tuned version of the TinyLlama 1.1B
language model, optimized for generating geometry-related functions for
a geometry engine. Fine-tuned on a custom Geometry Chain-of-Thought
(CoT) dataset, this model excels at producing accurate and efficient
mathematical functions for geometric computations, stored in the Hugging
Face .safetensors format for secure and efficient model loading.

## **Model Overview**

-   **Base Model**: TinyLlama 1.1B

-   **Fine-Tuning Dataset**: Custom Geometry CoT dataset consisting of coordinate geometry problems and geometrical construction instruction

-   **Model Format**: .safetensors for secure and efficient weight storage

-   **Intended Use**: Generating geometry functions for educational tools.

-   **License**: MIT

-   **Contact**: Contact via Hugging Face profile

## **Important Note:**

-   Use the system_prompt.txt for the System Prompt, this provides the accurate results.

-   You can extract and edit the system prompt. I hope to add new functions later.

## **Capabilities**

MiniLLM Geometry Engine interprets geometry-related queries and outputs
functional Python code or mathematical expressions. For example, given a
prompt like \"Generate a function to calculate the area of a triangle,\"
it produces executable code or formulas with clear reasoning, leveraging
its CoT fine-tuning for logical accuracy. Supported tasks include area,
volume, distance, and intersection calculations.

## **Technical Details**

-   **Architecture**: Transformer-based, inherited from TinyLlama 1.1B

-   **Fine-Tuning Details**: Trained on a dataset of geometry problems with step-by-step solutions

-   **Output Format**: Python code or pseudocode compatible with geometry engine APIs

-   **Performance**: Improved accuracy on geometry tasks compared to the base TinyLlama model, with low latency

-   **Model Storage**: Uses .safetensors for secure and efficient loading with Hugging Face\'s safetensors library

## **Usage**

To load and use the model with Hugging Face\'s Transformers library:

from transformers import AutoModelForCausalLM, AutoTokenizer

from safetensors.torch import load_file

\# Load tokenizer and model
```python
tokenizer = AutoTokenizer.from_pretrained("aryan27/geometry-model-hf")

model = AutoModelForCausalLM.from_pretrained("aryan27/geometry-model-hf")
```

\# Example prompt
```python
prompt = "Draw a point A at 3,4"

inputs = tokenizer(prompt, return_tensors="pt")

outputs = model.generate(*inputs, max_length=200)

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

Install required libraries:
```shell
pip install safetensors transformers
```
## **Training Details**

-   **Dataset**: Custom Geometry CoT dataset with 10,000 geometry problems and solutions

-   **Training Procedure**: Fine-tuned for 3 epochs on a single NVIDIA A100 GPU

-   **Hyperparameters**: Learning rate: 2e-5, batch size: 16

-   **Hardware**: NVIDIA A100 GPU

## **Limitations**

-   Supports very few functions since this was an experimental model, maybe I will add other functions later.

-   Limited to geometry-related tasks and may not generalize to other mathematical domains.

-   Extensive use of strict System Prompting. I aim to eliminate that also.

## **How to Contribute**

Submit issues or pull requests via the Hugging Face repository.
Contributions to the dataset or model improvements are welcome.

## **Acknowledgments**

Thanks to the TinyLlama team for the base model and Hugging Face for the
safetensors and transformers libraries.

MiniLLM Geometry Engine is a lightweight, efficient solution for
developers and researchers needing reliable geometry function
generation, with the security and performance benefits of the
.safetensors format.