TrueV1sion123 commited on
Commit
f5e5506
Β·
verified Β·
1 Parent(s): bedb4a4

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +121 -0
README.md ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RAE Training Methodology
2
+ ## Recursive Abstraction Engine as Training-Time Cognitive Installation
3
+
4
+ > **The handwriting principle**: Slow, multi-representational, generative reconstruction
5
+ > during training installs richer internal representations β€” producing fast, effortless
6
+ > retrieval at inference. The hand was slow so the mind could be fast later.
7
+
8
+ ---
9
+
10
+ ## Core Thesis
11
+
12
+ Standard fine-tuning trains models on flat `input β†’ output` pairs. This is **typing** β€”
13
+ discriminative lookup from heavy context. RAE Training forces models through **multi-phase
14
+ generative reconstruction**, creating the neural equivalent of handwriting:
15
+
16
+ | Property | Handwriting | RAE Training |
17
+ |----------|------------|--------------|
18
+ | Forced sequential reconstruction | Must regenerate each letter from memory | Must generate each cognitive phase from internal state |
19
+ | Multi-pathway co-firing | Motor + visual + spatial + linguistic | Saturation + abstraction + descent + integration |
20
+ | Temporal bottleneck | Slowness forces deeper encoding | Multi-phase chain forces richer weight geometry |
21
+ | Variability | No two handwritten letters identical | Stochastic phase generation prevents rote memorization |
22
+ | Closed-loop embodiment | Proprioceptive error correction | Phase-to-phase coherence loss creates self-correction |
23
+
24
+ ## Architecture
25
+
26
+ ```
27
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
28
+ β”‚ RAE TRAINING PIPELINE β”‚
29
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
30
+ β”‚ β”‚
31
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
32
+ β”‚ β”‚SATURATION│───►│ABSTRACTION│───►│ DESCENT │───►│INTEGRATE β”‚ β”‚
33
+ β”‚ β”‚ tokens β”‚ β”‚ tokens β”‚ β”‚ tokens β”‚ β”‚ tokens β”‚ β”‚
34
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
35
+ β”‚ β–² β”‚ β”‚
36
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
37
+ β”‚ β”‚
38
+ β”‚ Loss = λ₁·L_sat + Ξ»β‚‚Β·L_abs + λ₃·L_desc + Ξ»β‚„Β·L_int β”‚
39
+ β”‚ + Ξ»_cohΒ·L_coherence + Ξ»_compΒ·L_compression β”‚
40
+ β”‚ β”‚
41
+ β”‚ Key: ALL phases contribute to loss, not just final answer β”‚
42
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
43
+ ```
44
+
45
+ ## Training Objectives (Multi-Objective Co-Training)
46
+
47
+ 1. **Phase Generation Loss** β€” Each RAE phase must be generated correctly
48
+ 2. **Cross-Phase Coherence Loss** β€” Abstractions must logically follow from saturation
49
+ 3. **Compression Loss** β€” Abstraction phase penalized for being longer than saturation
50
+ 4. **Prediction Accuracy Loss** β€” Descent-phase predictions evaluated against ground truth
51
+ 5. **Integration Quality Loss** β€” Final synthesis must incorporate phase outputs
52
+
53
+ ## Quick Start
54
+
55
+ ### Option A: AutoTrain (No-Code)
56
+ ```bash
57
+ pip install autotrain-advanced
58
+ autotrain --config configs/autotrain_rae_sft.yaml
59
+ ```
60
+
61
+ ### Option B: Custom Trainer (Full Control)
62
+ ```bash
63
+ pip install -r requirements.txt
64
+ python src/train_rae.py --config configs/rae_training_config.json
65
+ ```
66
+
67
+ ### Option C: HuggingFace Spaces
68
+ Upload to a Space with GPU β€” see `scripts/deploy_to_hf_space.sh`
69
+
70
+ ## Dataset Format
71
+
72
+ RAE training data uses JSONL with structured multi-phase reasoning:
73
+
74
+ ```json
75
+ {
76
+ "messages": [
77
+ {"role": "system", "content": "You are an RAE-trained reasoner..."},
78
+ {"role": "user", "content": "<problem>"},
79
+ {"role": "assistant", "content": "<SATURATION>...</SATURATION><ABSTRACTION>...</ABSTRACTION><DESCENT>...</DESCENT><INTEGRATION>...</INTEGRATION>"}
80
+ ]
81
+ }
82
+ ```
83
+
84
+ ## Files
85
+
86
+ ```
87
+ rae-training/
88
+ β”œβ”€β”€ README.md # This file
89
+ β”œβ”€β”€ requirements.txt # Python dependencies
90
+ β”œβ”€β”€ configs/
91
+ β”‚ β”œβ”€β”€ autotrain_rae_sft.yaml # AutoTrain config (no-code path)
92
+ β”‚ β”œβ”€β”€ rae_training_config.json # Custom trainer config
93
+ β”‚ └── base_models.json # Tested base model registry
94
+ β”œβ”€β”€ src/
95
+ β”‚ β”œβ”€β”€ dataset_generator.py # Generates RAE-structured training data
96
+ β”‚ β”œβ”€β”€ rae_data_formatter.py # Formats raw data into RAE phases
97
+ β”‚ β”œβ”€β”€ train_rae.py # Custom RAE trainer with multi-phase loss
98
+ β”‚ β”œβ”€β”€ rae_loss.py # Multi-objective loss functions
99
+ β”‚ └── rae_tokenizer_utils.py # Phase-aware tokenization
100
+ β”œβ”€β”€ evaluation/
101
+ β”‚ β”œβ”€β”€ eval_rae_model.py # Evaluation harness
102
+ β”‚ └── benchmarks.json # Test problems for before/after comparison
103
+ β”œβ”€β”€ data/
104
+ β”‚ └── seed_problems.jsonl # Seed problems for dataset generation
105
+ └── scripts/
106
+ β”œβ”€β”€ generate_dataset.sh # End-to-end dataset generation
107
+ β”œβ”€β”€ run_training.sh # Training launcher
108
+ └── deploy_to_hf_space.sh # HF Spaces deployment
109
+ ```
110
+
111
+ ## Theory: Why This Works
112
+
113
+ See the companion document `THEORY.md` for the full neuroscience-to-ML mapping.
114
+
115
+ **TL;DR**: Handwriting activates widespread brain connectivity because it forces
116
+ *generative reconstruction through multiple representational modalities simultaneously
117
+ under a temporal bottleneck*. RAE training replicates this by forcing the model to
118
+ traverse Saturation β†’ Abstraction β†’ Descent β†’ Integration phases, with loss computed
119
+ on ALL phases β€” meaning the model cannot shortcut to the answer. The multi-phase
120
+ structure installs richer weight geometry that persists as faster, more capable
121
+ inference after training.