rogermt commited on
Commit
51d8a6c
·
verified ·
1 Parent(s): d565d28

Add TRM solver README

Browse files
Files changed (1) hide show
  1. trm_solver/README.md +84 -0
trm_solver/README.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TRM Solver — NeuroGolf 2026
2
+
3
+ LLM-driven neural network executor for ARC-AGI image transformations.
4
+
5
+ ## Architecture
6
+
7
+ ```
8
+ ARC Grid → Kilo/DeepSeek (headless CLI, free tier)
9
+ → Markdown: transform name + parameters
10
+ → Tiny NN executor (frozen weights)
11
+ → ONNX export (per-task)
12
+ ```
13
+
14
+ ## Why this works for NeuroGolf
15
+
16
+ - **LLM does the heavy reasoning** (identifying transforms, shapes, patterns)
17
+ - **NN is tiny** — just executes the identified transform with frozen weights
18
+ - **ONNX is absurdly small** — most transforms have 0-1000 params
19
+ - **Free tier LLM** — Kilo headless CLI uses DeepSeek free tier, no API cost
20
+
21
+ ## File structure
22
+
23
+ - `executor.py` — 14 transform NN implementations + ONNX export
24
+ - `kilo_bridge.py` — Kilo/DeepSeek interface + full pipeline
25
+ - `requirements.txt` — dependencies
26
+
27
+ ## Quick start
28
+
29
+ ### Dry run (no LLM needed)
30
+ ```bash
31
+ python trm_solver/kilo_bridge.py --dry-run --output-dir onnx_models
32
+ ```
33
+
34
+ ### Single task
35
+ ```bash
36
+ # Render task and call Kilo
37
+ python trm_solver/kilo_bridge.py --task data/training/007bbfb7.json --output-dir onnx_models
38
+
39
+ # Pre-rendered image
40
+ python trm_solver/kilo_bridge.py --task rendered_task.png --no-render --output-dir onnx_models
41
+ ```
42
+
43
+ ### Batch mode
44
+ ```bash
45
+ python trm_solver/kilo_bridge.py --data-dir data/training --output-dir onnx_models --max-tasks 10
46
+ ```
47
+
48
+ ### Via SDK tunnel (Kaggle → local server)
49
+ ```bash
50
+ python trm_solver/kilo_bridge.py --data-dir data/training --use-sdk --server-url http://localhost:8765
51
+ ```
52
+
53
+ ## Transform types (14)
54
+
55
+ | Transform | Params | Description |
56
+ |-----------|--------|-------------|
57
+ | identity | 0 | Output equals input |
58
+ | color_map | 100 | Per-pixel color remapping |
59
+ | flip | 0 | Horizontal/vertical flip |
60
+ | transpose | 0 | Matrix transpose |
61
+ | rotate | 0 | 90/180/270 rotation |
62
+ | upscale | <100 | Nearest-neighbor upscale |
63
+ | kron_self_similar | 0 | Kronecker self-similar |
64
+ | tile_repeat | 0 | Tile input n×m |
65
+ | concat_patterns | 0 | Concat transformed copies |
66
+ | pos_color_lut | H×W | Position-based color LUT |
67
+ | spatial_gather | H×W×2 | Pixel rearrangement |
68
+ | onehot_conv | K²×100 | One-hot convolution (most powerful) |
69
+ | onehot_linear | 100 | One-hot linear transform |
70
+
71
+ ## Dependencies
72
+
73
+ ```
74
+ torch
75
+ numpy
76
+ Pillow
77
+ # For Kilo: kilo-cli or kilo-sdk
78
+ ```
79
+
80
+ ## Notes
81
+
82
+ - Free tier Kilo has latency (~10-60s per task). Batch overnight for 400 tasks.
83
+ - If Kilo misidentifies a transform, edit the `_spec.json` and re-export manually.
84
+ - The onehot_conv transform solved 220 tasks in the previous approach — it's the fallback.