Create todo.md
Browse files- llm/todo.md +46 -0
llm/todo.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Step 1: Install dependencies
|
| 2 |
+
|
| 3 |
+
pip install torch transformers safetensors tqdm
|
| 4 |
+
|
| 5 |
+
Step 2: Test circuit execution standalone
|
| 6 |
+
|
| 7 |
+
cd C:\Users\cnort\8bit-threshold-computer\llm
|
| 8 |
+
python circuit_llm.py --circuit-path ../neural_computer.safetensors --device cpu
|
| 9 |
+
|
| 10 |
+
Expected output:
|
| 11 |
+
- Load SmolLM2-360M
|
| 12 |
+
- Baseline arithmetic evaluation (~1-10% accuracy)
|
| 13 |
+
- Augment layers 10-20 with threshold circuits
|
| 14 |
+
- Test circuit execution (127+128=255, etc.)
|
| 15 |
+
|
| 16 |
+
Step 3: Train interface layers (CPU)
|
| 17 |
+
|
| 18 |
+
python train_circuit_interface.py \
|
| 19 |
+
--circuit-path ../neural_computer.safetensors \
|
| 20 |
+
--device cpu \
|
| 21 |
+
--epochs 3 \
|
| 22 |
+
--batch-size 4 \
|
| 23 |
+
--n-samples 2000
|
| 24 |
+
|
| 25 |
+
Expected:
|
| 26 |
+
- Freeze 362M params
|
| 27 |
+
- Train ~1.37M interface params (BitExtractor, BitInjector, Router)
|
| 28 |
+
- 3 epochs on arithmetic examples (reduced samples for CPU)
|
| 29 |
+
- Accuracy should improve from ~10% to >90%
|
| 30 |
+
- Training time: ~1-2 hours on CPU
|
| 31 |
+
|
| 32 |
+
Step 4: Save trained model
|
| 33 |
+
|
| 34 |
+
Output: circuit_augmented_smollm2.pt
|
| 35 |
+
|
| 36 |
+
Hardware Requirements
|
| 37 |
+
|
| 38 |
+
- GPU recommended (RTX 6000 Ada per guide.md)
|
| 39 |
+
- CPU possible but slow (~10x longer)
|
| 40 |
+
- ~4GB VRAM for SmolLM2-360M
|
| 41 |
+
|
| 42 |
+
Success Criteria
|
| 43 |
+
|
| 44 |
+
- Baseline accuracy: ~1-10% (SmolLM2 guessing)
|
| 45 |
+
- Post-training accuracy: >98% (circuits computing)
|
| 46 |
+
- Circuit tests pass: 127+128=255, 255+1=0, etc.
|