sgattup commited on
Commit
71762ab
·
verified ·
1 Parent(s): 7bd602e

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +183 -69
README.md CHANGED
@@ -3,37 +3,84 @@ language:
3
  - en
4
  license: apache-2.0
5
  tags:
6
- - indian-culture
7
- - culture
8
- - history
9
- - philosophy
 
 
 
 
10
  - fine-tuned
 
 
11
  - unsloth
12
- - llama
13
  - lora
14
- base_model: unsloth/llama-3.2-3B-bnb-4bit
 
15
  pipeline_tag: text-generation
16
  ---
17
 
18
- # 🇮🇳 Indian Culture LLM
19
 
20
- A fine-tuned language model focused on **Indian culture, history, philosophy, arts, and traditions** built to answer questions about one of the world's oldest and richest civilizations.
21
 
22
- ## What This Model Knows
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
- This model has been trained on high-quality instruction pairs covering:
25
 
26
- - **Hindu Mythology** Mahabharata, Ramayana, Puranas, key deities and their stories
27
- - **Indian Philosophy** Vedanta, Advaita, Yoga (Patanjali's 8 limbs), Bhakti movement, Jainism, Buddhism, Sikhism
28
- - **Classical Arts** Bharatanatyam, Kathak, Odissi, Kuchipudi, Manipuri, Mohiniyattam, Kathakali, Carnatic and Hindustani music, Raga system, Gharanas
29
- - **Festivals** Diwali, Holi, Navratri, Durga Puja, Onam, Pongal, Kumbh Mela, Rath Yatra, Thrissur Pooram, Garba/Dandiya
30
- - **Indian History** Indus Valley Civilization, Vedic period, Maurya and Gupta Empires, Mughal era, Bhakti movement, Independence movement, Partition
31
- - **Key Figures** Gandhi, Ambedkar, Ashoka, Chandragupta, Akbar, Shivaji, Tagore, Vivekananda, Ramanujan, Aryabhata, Tansen, MS Subbulakshmi, Ravi Shankar, Lata Mangeshkar, Mirabai, Kabir Das, Adi Shankaracharya
32
- - **Ayurveda & Wellness** Doshas, Panchakarma, Ayurvedic cooking, medicinal plants (Tulsi, Neem, Peepal)
33
- - **Regional Cuisine** North vs South Indian food, Mughal culinary contributions, Ayurvedic cooking, Indian spices
34
- - **Traditional Art Forms** — Madhubani painting, Warli art, Pattachitra, Kolam/Rangoli, Tanjore painting
35
- - **Sacred Texts** — Bhagavad Gita, Upanishads, Arthashastra, Thirukkural, Panchatantra, Natya Shastra
36
- - **Architecture & Heritage** — Taj Mahal, Hampi, Nalanda University, Chola temples, Vastu Shastra
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  ## How to Use
39
 
@@ -41,83 +88,150 @@ This model has been trained on high-quality instruction pairs covering:
41
  from transformers import AutoModelForCausalLM, AutoTokenizer
42
  import torch
43
 
44
- model_id = "sgattup/IndianCultureLLM"
45
  tokenizer = AutoTokenizer.from_pretrained(model_id)
46
- model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
47
-
48
- ALPACA_PROMPT = """Below is a question or instruction about Indian culture.
49
- Write a thoughtful, accurate, and detailed response.
50
-
51
- ### Instruction:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  {}
53
 
54
- ### Response:
55
  """
56
 
57
- def ask(question):
58
- prompt = ALPACA_PROMPT.format(question)
59
  inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
60
- outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
 
 
 
 
 
 
61
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
62
- return response.split("### Response:")[-1].strip()
63
 
64
- print(ask("What is the significance of Diwali in Indian culture?"))
65
- print(ask("Explain the eight limbs of Yoga according to Patanjali."))
66
- print(ask("Who was Adi Shankaracharya and what did he teach?"))
 
67
  ```
68
 
69
- ## Example Outputs
 
 
70
 
71
- **Q: What is a Raga in Indian classical music?**
 
72
 
73
- > A Raga is the fundamental melodic framework of Indian classical music — not merely a scale but a complete musical personality with rules about which notes to use, how to ascend and descend, what mood it evokes, and what time of day it should be performed. Different ragas are associated with times of day: Bhairav at dawn, Yaman at dusk...
 
74
 
75
- **Q: Who was Dr. B.R. Ambedkar?**
 
76
 
77
- > Dr. Bhimrao Ramji Ambedkar (1891–1956) was one of the most transformative figures in modern Indian history. Born into a Dalit family, he overcame severe discrimination to earn degrees from Columbia University and the London School of Economics. He was the principal architect of India's Constitution, which abolished untouchability and guaranteed fundamental rights to all citizens regardless of caste...
 
78
 
79
- ## Model Details
 
80
 
81
- | Property | Value |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  |---|---|
83
- | Base Model | LLaMA 3.2 3B (unsloth/llama-3.2-3B-bnb-4bit) |
84
- | Fine-tuning Method | QLoRA via Unsloth |
 
85
  | LoRA Rank | 16 |
86
- | Training Epochs | 3 |
87
- | Dataset Size | 75+ high-quality instruction pairs |
 
 
 
 
 
88
  | Language | English |
89
  | License | Apache 2.0 |
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  ## Limitations
92
 
93
- - This is an early version trained on a relatively small dataset responses are informative but may lack depth on niche topics
94
- - Primarily covers mainstream Hindu/pan-Indian cultural topics; regional and tribal cultures are underrepresented
95
- - Not a substitute for academic sources on complex historical or religious topics
96
- - May reflect certain perspectives more than others given the training data
97
 
98
- ## Future Plans
99
 
100
- - Expand dataset to 2,000+ examples
101
- - Add regional language support (Tamil, Telugu, Hindi, Bengali)
102
- - Cover tribal and indigenous Indian cultures more deeply
103
- - Add a HuggingFace Space for interactive demos
104
- - Train a larger 7B version for improved depth
105
 
106
- ## Training Code
 
 
107
 
108
- Training code and dataset are available at:
109
- [github.com/sai-educ/indian-culture-llm](https://github.com/sai-educ/indian-culture-llm)
110
 
111
  ## Citation
112
 
113
- If you use this model in your work, please cite:
114
-
115
- ```
116
- @misc{IndianCultureLLM2026,
117
- author = {sgattup},
118
- title = {Indian Culture LLM},
119
- year = {2026},
120
- publisher = {HuggingFace},
121
- url = {https://huggingface.co/sgattup/IndianCultureLLM}
122
  }
123
  ```
 
 
 
 
 
3
  - en
4
  license: apache-2.0
5
  tags:
6
+ - education
7
+ - math
8
+ - elementary-math
9
+ - readability
10
+ - tutoring
11
+ - usable-math
12
+ - estella-explainer
13
+ - math-word-problems
14
  - fine-tuned
15
+ - gemma
16
+ - gemma-4
17
  - unsloth
 
18
  - lora
19
+ - open-educational-resource
20
+ base_model: unsloth/gemma-4-E4B-it
21
  pipeline_tag: text-generation
22
  ---
23
 
24
+ # Estella Explainer LLM
25
 
26
+ **An open-weights fine-tuned language model that generates child-friendly readability hints for elementary and middle school math word problems trained on the pedagogical framework of [Usable Math](https://usablemath.org), an open educational resource developed at the University of Massachusetts Amherst.**
27
 
28
+ ---
29
+
30
+ ## Overview
31
+
32
+ Understanding a math word problem is a prerequisite to solving it. Research in mathematics education — including the foundational work of George Pólya (*How to Solve It*, 1945) and the Feynman Technique for conceptual clarity — establishes that students who cannot parse the *language* of a math problem are blocked from applying the mathematical operations they otherwise know.
33
+
34
+ **Estella Explainer LLM** is a domain-fine-tuned version of Google's Gemma 4 E4B model, trained to fulfill the role of *Estella Explainer* — a virtual reading and language coach from the Usable Math platform. Estella's function is precisely scoped: she helps students understand **what a math problem is asking**, without solving it. She does not compute answers. She does not show steps. She clarifies language, identifies known quantities, and names the unknown — using vocabulary accessible to children in grades 3 through 8.
35
+
36
+ This model is an open-weights alternative to the existing [Estella Explainer Math Bot 2](https://chatgpt.com/g/g-69c817abf970819197e955c26eb15e3d-estella-explainer-math-bot-2), which is powered by GPT-4 and requires a ChatGPT account. This model runs entirely open — no proprietary API, no account required.
37
+
38
+ ---
39
+
40
+ ## Pedagogical Framework
41
+
42
+ ### Estella's Role in Usable Math
43
+
44
+ Usable Math (formerly 4mality) is a Google Slides-based interactive math tutoring system for grades 3–6, developed in the College of Education at the University of Massachusetts Amherst. Each math word problem in the system is accompanied by hints from four virtual coaches:
45
+
46
+ - **Estella Explainer** — *Reading and Language*: restates the problem in simple language; identifies what is known and what is being asked
47
+ - **Chef Math Bear** — *Computation*: suggests arithmetic operations
48
+ - **How-to-Hound** — *Strategy*: offers problem-solving approaches (rounding, elimination, estimation)
49
+ - **Visual Vicuna** — *Visualization*: suggests diagrams, charts, or drawings
50
+
51
+ This model exclusively replicates **Estella's** function.
52
+
53
+ ### Design Principles
54
 
55
+ Estella hints are governed by the following rules, encoded in the model's training:
56
 
57
+ 1. **Give exactly one hint.** No multi-part explanations.
58
+ 2. **Do not solve the problem.** The answer is never computed or stated.
59
+ 3. **Do not show calculation steps.** The hint does not model arithmetic.
60
+ 4. **Identify what is known.** State the given information clearly.
61
+ 5. **Identify what is unknown.** Name what the student needs to find.
62
+ 6. **Use very simple language.** Target Flesch Reading Ease 90���100 (very easy; equivalent to Grade 3–4 reading level).
63
+ 7. **Use characteristic phrases.** "We know...", "We are looking for...", "Think about...", "Think: ..."
64
+ 8. **Be friendly and encouraging.** Tone is warm, not academic.
65
+
66
+ ### Theoretical Grounding
67
+
68
+ - **Pólya's Problem-Solving Framework**: Estella operationalizes the *Understanding the Problem* phase — Pólya's first step — by separating comprehension from computation.
69
+ - **Feynman Technique**: Complex math vocabulary is broken into simple, concrete language, reflecting the principle that true understanding means being able to explain something simply.
70
+ - **Flesch-Kincaid Readability**: Hints are calibrated to Flesch Reading Ease 90–100, corresponding to very simple prose readable by early elementary students.
71
+
72
+ ---
73
+
74
+ ## Scope
75
+
76
+ This model generates readability hints for:
77
+
78
+ - **Grade levels**: 3 through 8 (elementary and middle school)
79
+ - **Topics covered**: Area and Perimeter, Rounding, Multiplication and Division, Algebraic Thinking, Addition and Subtraction, Fractions, Decimals, Place Value, Measurement, Money, Geometry, Charts and Graphs, Estimation, Ratios, Proportions, and Percentages
80
+ - **NOT included**: High school mathematics (Algebra II, Trigonometry, Calculus, Statistics)
81
+ - **Language**: English only
82
+
83
+ ---
84
 
85
  ## How to Use
86
 
 
88
  from transformers import AutoModelForCausalLM, AutoTokenizer
89
  import torch
90
 
91
+ model_id = "sgattup/EstellaExplainerLLM"
92
  tokenizer = AutoTokenizer.from_pretrained(model_id)
93
+ model = AutoModelForCausalLM.from_pretrained(
94
+ model_id,
95
+ torch_dtype=torch.float16,
96
+ device_map="auto"
97
+ )
98
+
99
+ SYSTEM_PROMPT = """You are Estella Explainer, a math reading and language coach for young learners in grades 3 through 8. Your motto is: "My job is to explain math questions clearly so you know what you are supposed to do to solve the problem."
100
+
101
+ Your rules:
102
+ - Give only ONE hint per problem.
103
+ - Do NOT solve the problem or show the answer.
104
+ - Do NOT show calculation steps or compute anything.
105
+ - Help the student understand what the problem is ASKING.
106
+ - Use very simple words and short sentences (Flesch Reading Ease 90-100).
107
+ - Identify what is known and what is being asked.
108
+ - Use phrases like "We know...", "We are looking for...", or "Think about...".
109
+ - Be friendly and encouraging."""
110
+
111
+ PROMPT = SYSTEM_PROMPT + """
112
+
113
+ ### Math Problem:
114
  {}
115
 
116
+ ### Estella's Hint:
117
  """
118
 
119
+ def ask_estella(problem, max_tokens=150):
120
+ prompt = PROMPT.format(problem)
121
  inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
122
+ outputs = model.generate(
123
+ **inputs,
124
+ max_new_tokens=max_tokens,
125
+ temperature=0.7,
126
+ do_sample=True,
127
+ repetition_penalty=1.1
128
+ )
129
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
130
+ return response.split("### Estella's Hint:")[-1].strip()
131
 
132
+ # Example usage
133
+ print(ask_estella("A rectangle has a length of 12 cm and a width of 5 cm. What is the area?"))
134
+ print(ask_estella("Sam had 3/4 of a pizza. He ate 1/4. How much is left?"))
135
+ print(ask_estella("A store sells apples for $0.75 each. Jake buys 6 apples. How much does he spend?"))
136
  ```
137
 
138
+ ---
139
+
140
+ ## Illustrative Outputs
141
 
142
+ **Problem:** A rectangle has a length of 12 cm and a width of 5 cm. What is the area?
143
+ > We know: length = 12 cm and width = 5 cm. Area means length × width. We are looking for how much space is inside the rectangle.
144
 
145
+ **Problem:** Sam had 3/4 of a pizza. He ate 1/4. How much is left?
146
+ > We know: Sam started with 3/4 and ate 1/4. The bottom numbers match. Think: 3/4 - 1/4. We are looking for how much pizza remains.
147
 
148
+ **Problem:** A store sells apples for $0.75 each. Jake buys 6 apples. How much does he spend?
149
+ > We know: each apple costs $0.75 and Jake buys 6. Think: 6 groups of $0.75. We are looking for the total cost.
150
 
151
+ **Problem:** Round 4,567 to the nearest hundred.
152
+ > Look at the tens digit in 4,567. Is it 5 or more? That tells you which way to round. We are looking for the nearest hundred.
153
 
154
+ **Problem:** A class has 28 students. They form groups of 4. How many groups are there?
155
+ > We know: 28 students and each group has 4. Think: 28 shared equally into groups of 4. We are looking for the number of groups.
156
 
157
+ ---
158
+
159
+ ## Intended Users
160
+
161
+ This model is designed for:
162
+
163
+ - **Elementary and middle school teachers** seeking on-demand language scaffolds for math problems
164
+ - **Math tutors and interventionists** who want to rephrase problems for struggling readers
165
+ - **Parents** supporting math homework at home
166
+ - **Education researchers** studying AI-generated scaffolding and readability in math instruction
167
+ - **EdTech developers** integrating open-weights readability assistance into math learning applications
168
+
169
+ ---
170
+
171
+ ## Model Specifications
172
+
173
+ | Parameter | Value |
174
  |---|---|
175
+ | Base Model | Gemma 4 Effective 4B (`unsloth/gemma-4-E4B-it`) |
176
+ | Fine-tuning Method | QLoRA (Quantized Low-Rank Adaptation) via Unsloth |
177
+ | Quantization | 4-bit NF4 with double quantization |
178
  | LoRA Rank | 16 |
179
+ | LoRA Alpha | 32 |
180
+ | Training Epochs | 4 |
181
+ | Learning Rate | 2e-4 (AdamW 8-bit optimizer) |
182
+ | Max Sequence Length | 2048 tokens |
183
+ | Training Hardware | Google Colab T4 GPU (free tier) |
184
+ | Dataset | 120+ curated Estella-style hint pairs (grades 3–8) |
185
+ | Prompt Format | System role + Problem/Hint instruction template |
186
  | Language | English |
187
  | License | Apache 2.0 |
188
 
189
+ ---
190
+
191
+ ## About Usable Math
192
+
193
+ Usable Math is a free, open educational resource (OER) licensed under CC-BY-NC 4.0, developed by Sharon Edwards, Robert Maloy, and Sai Gattupalli in the College of Education at the University of Massachusetts Amherst. It provides Google Slides-based interactive math problem-solving modules for grades 3–6, aligned with the Massachusetts Mathematics Curriculum Framework and the Common Core State Standards for Mathematics. Visit [usablemath.org](https://usablemath.org).
194
+
195
+ ### Selected Publications
196
+
197
+ Maloy, R. W., Gattupalli, S., & Edwards, S. A. (2024). Students Design Problem-Solving Slideshows. *Mathematics Teacher: Learning and Teaching PK-12*, 117(8), 579–582.
198
+
199
+ Gattupalli, S., Edwards, S.A, Maloy, R. W., & Rancourt, M. (2023). Designing for Learning: Key Decisions for an Open Online Math Tutor for Elementary Students. *Digital Experiences in Mathematics Education*.
200
+
201
+ Gattupalli, S., Maloy, R. W., & Edwards, S. (2023). Comparing Teacher-Written and AI-Generated Math Problem Solving Strategies for Elementary School Students.
202
+
203
+ ---
204
+
205
  ## Limitations
206
 
207
+ - **Dataset scale:** Trained on 120+ examples effective for common problem types, but coverage of unusual problem structures is limited. Performance improves substantially when augmented with extracted hints from Usable Math PDF modules.
208
+ - **No computation:** The model is explicitly trained *not* to solve problems. It will decline to compute answers by design.
209
+ - **English only:** No multilingual support in this version.
210
+ - **Not a teacher replacement:** Estella provides language scaffolding, not instruction. Human educators remain essential for interpreting student needs and providing individualized support.
211
 
212
+ ---
213
 
214
+ ## Companion Models
 
 
 
 
215
 
216
+ - **[sgattup/RagaLakshanaLLM](https://huggingface.co/sgattup/RagaLakshanaLLM)** — Indian classical music raga theory
217
+ - **[sgattup/KonakolSwaraLLM](https://huggingface.co/sgattup/KonakolSwaraLLM)** — Carnatic rhythmic and swara composition
218
+ - **[sgattup/IndianCultureLLM](https://huggingface.co/sgattup/IndianCultureLLM)** — Indian culture, history, and philosophy
219
 
220
+ ---
 
221
 
222
  ## Citation
223
 
224
+ ```bibtex
225
+ @misc{EstellaExplainerLLM2026,
226
+ author = {Gattupalli, Sai and Maloy, Robert W. and Edwards, Sharon A.},
227
+ title = {Estella Explainer LLM: An Open-Weights Readability Coach for Elementary Math Word Problems},
228
+ year = {2026},
229
+ publisher = {HuggingFace},
230
+ howpublished = {\url{https://huggingface.co/sgattup/EstellaExplainerLLM}},
231
+ note = {Fine-tuned from Google Gemma 4 E4B; based on the Usable Math OER (usablemath.org)}
 
232
  }
233
  ```
234
+
235
+ ---
236
+
237
+ *This model is part of the Usable Math AI initiative — exploring open, educator-friendly alternatives to proprietary AI tools for elementary mathematics instruction.*