Repository navigation
Expand file tree
/
Copy pathfix_math.py
More file actions
126 lines (86 loc) · 5.39 KB
/
Copy pathfix_math.py
File metadata and controls
126 lines (86 loc) · 5.39 KB
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
123
124
125
126
import requests
api_key = "MCJzWCZDpiJTgi8EmYiwh1D1"
url = "https://dev.to/api/articles/3550853"
# dev.to uses Liquid tags for KaTeX: {% katex %} formula {% endkatex %}
# For inline: {% katex inline %} formula {% endkatex %}
body = """# Deep Dive: The Cognitive Science Behind the ACLAS Neuro-Edu SDK 🏛️🧠
At the **[Atlanta College of Liberal Arts and Sciences (ACLAS)](https://aclas.college)**, we aren't just building "another AI tutor." We are engineering a fundamental reconceptualization of how Large Language Models (LLMs) align with the human mind.
Today, we’re peeling back the curtain on the **Neuro-Edu Technical Whitepaper**. If you’ve ever wondered why generic LLMs sometimes fail as teachers, this deep dive is for you.
---
## 🧠 The Mathematics of Cognition
True alignment requires precise operationalization. In the Neuro-Edu framework, we treat cognitive science principles as explicit, computable objectives.
### 1. Intrinsic Load Estimation
To prevent overwhelming the learner, we employ a multi-factor intrinsic load estimator:
{% katex %}
L_{intrinsic} = \\sum_{i=1}^{n} w_i \\cdot F_i(x) + \\epsilon
{% endkatex %}
Where {% katex inline %}F_i(x){% endkatex %} represents lexical complexity (Flesch-Kincaid), syntactic depth, and conceptual density (prerequisite counts).
### 2. The CGAP-RLHF Objective
We extend the traditional RLHF (Reinforcement Learning from Human Feedback) objective function to incorporate educational constraints:
{% katex %}
\\mathcal{L}_{CGAP} = \\mathbb{E}[r(x,y)] - \\beta D_{KL}(\\pi || \\pi_{ref}) - \\lambda_1 L_{load} - \\lambda_2 L_{metacog}
{% endkatex %}
By adding {% katex inline %}\\lambda_1 L_{load}{% endkatex %} and {% katex inline %}\\lambda_2 L_{metacog}{% endkatex %}, we penalize responses that are either too complex or lack sufficient metacognitive scaffolding.
---
## 🛑 The "Helpfulness" Trap
Most LLMs today are aligned using RLHF to be **helpful, harmless, and honest**. While great for a chatbot, this is often **detrimental to learning**.
Why? Because human annotators tend to favor responses that are:
1. **Too Comprehensive**: Overwhelming the learner's working memory.
2. **Too Confident**: Reducing the learner's critical thinking.
3. **Too Immediate**: Eliminating "productive struggle."
In education, being "helpful" often means doing the work *for* the student. We built **Neuro-Edu** to fix this.
---
## 🧠 The Three Pillars of Neuro-Edu
Our framework operationalizes decades of cognitive psychology into computable alignment objectives.
### 1. Cognitive Load Calibration (CLT)
We don’t just generate text; we estimate the **Intrinsic Load** of every explanation. Using our **Cognitive-Grounded Alignment Protocol (CGAP)**, the model dynamically adjusts complexity based on:
- **Syntactic Depth**: Breaking down complex sentence structures.
- **Conceptual Density**: Segmenting high-interactive elements.
- **Metacognitive Prompting**: Encouraging the learner to reflect rather than just consume.
### 2. Dual-Process Scaffolding
Following **Dual-Process Theory**, we guide the learner through two cognitive systems:
- **System 1 (Intuitive)**: We start with concrete analogies and "Intuitive Hooks" to anchor new schemas.
- **System 2 (Analytical)**: We systematically transition to analytical deepening through Socratic questioning and counterexample exploration.
### 3. The Educational Sandbox (ESE)
How do you train an AI to be a better teacher without testing it on real students? You build a **Sandbox**.
Our **Educational Sandbox Environment (ESE)** simulates realistic learner behaviors—including attention decay and misconceptions—to generate high-fidelity training data for alignment.
---
## 📊 The Results: Data-Driven Pedagogy
We didn't just build this; we tested it. In our latest controlled studies across math, science, and programming, the Neuro-Edu aligned models showed:
| Metric | Neuro-Edu Advantage |
| :--- | :--- |
| **Knowledge Retention** | **+45.7%** |
| **Transfer Learning** | **+69.2%** |
| **Time to Mastery** | **-41.4% (Faster!)** |
*Note: These improvements were achieved with negligible degradation (<1%) on general benchmarks like MMLU.*
---
## 🚀 Open Source & Reproducible
True science belongs to the community. The entire Neuro-Edu ecosystem is open-sourced across three platforms:
* **💻 Code**: [GitHub/aclascollege/neuro-edu](https://github.com/aclascollege/neuro-edu)
* **🤗 Models**: [Hugging Face/ACLASCollege](https://huggingface.co/ACLASCollege)
* **📄 Research**: [Zenodo/ACLAS College Community](https://zenodo.org/communities/aclas_college/)
---
## 💬 Join the Mission
We are looking for researchers and educators to help us refine the **Cognitive-Grounded Alignment Protocol**.
* **Star our repo** to stay updated.
* **Try the live dashboard** on Hugging Face.
* **Drop a comment** with your thoughts on "Cognitive Alignment."
**Every mind deserves world-class learning.**
---
*[🌐 Official Website](https://aclas.college) | [🎓 Certification Programs](https://aclas.college/verify/certificate-verify)*
"""
payload = {
"article": {
"body_markdown": body
}
}
headers = {
"Content-Type": "application/json",
"api-key": api_key
}
response = requests.put(url, headers=headers, json=payload)
if response.status_code == 200:
print("Article math fixed successfully!")
else:
print(f"Failed to fix math. Status code: {response.status_code}")
print("Response:", response.text)