@wiseaidev/lmm 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,736 @@
1
+ <div align="center">
2
+
3
+ # ๐Ÿ‘๏ธ LMM ๐Ÿฆ€
4
+
5
+ [![LMM](https://wiseai.dev/assets/logo.png)](https://wiseai.dev)
6
+
7
+ [![Work In Progress](https://img.shields.io/badge/Work%20In%20Progress-orange)](https://github.com/wiseaidotdev/lmm)
8
+ [![Crates.io Downloads](https://img.shields.io/crates/d/lmm)](https://crates.io/crates/lmm)
9
+ [![PyPI version](https://img.shields.io/pypi/v/lmm.svg)](https://pypi.org/project/lmm/)
10
+ [![NPM version](https://img.shields.io/npm/v/@wiseaidev/lmm.svg)](https://www.npmjs.com/package/@wiseaidev/lmm)
11
+ [![made-with-rust](https://img.shields.io/badge/Made%20with-Rust-1f425f.svg?logo=rust&logoColor=white)](https://www.rust-lang.org/)
12
+ [![Rust](https://img.shields.io/badge/Rust-1.86%2B-blue.svg)](https://www.rust-lang.org)
13
+ [![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE)
14
+ [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/wiseaidev)
15
+
16
+ [![Share On Reddit](https://img.shields.io/badge/share%20on-reddit-red?logo=reddit)](https://reddit.com/submit?url=https://github.com/wiseaidotdev/lmm&title=LMM%3A%20Large%20Mathematical%20Model%20%E2%80%94%20Encode%20Reality%20as%20Equations)
17
+ [![Share On X](https://img.shields.io/badge/share%20on-X-03A9F4?logo=x)](https://twitter.com/share?url=https://github.com/wiseaidotdev/lmm&text=LMM%3A%20Large%20Mathematical%20Model%20%E2%80%94%20Encode%20Reality%20as%20Equations)
18
+ [![Share On Linkedin](https://img.shields.io/badge/share%20on-linkedin-3949AB?logo=linkedin)](https://www.linkedin.com/shareArticle?url=https://github.com/wiseaidotdev/lmm&title=LMM%3A%20Large%20Mathematical%20Model)
19
+
20
+ > **LMM** is a pureโ€‘Rust framework that represents higherโ€‘dimensional realities through symbolic mathematics and physics simulation, inspired by the Pharaonic model of intelligence: compress the world into durable, universal equations.
21
+
22
+ </div>
23
+
24
+ ## ๐ŸŽฌ Demo
25
+
26
+ The following is a proof-of-concept demonstration of the predictive engine generating coherent English sentences. It is powered purely by deterministic mathematical equations and structural Subject-Verb-Object loops, utilizing the standard Linux system dictionary (`/usr/share/dict/words`) as its vocabulary fallback to function.
27
+
28
+ <video src="https://github.com/user-attachments/assets/f20ed16f-d90e-4983-bc47-0de2ce5c5a4f"></video>
29
+
30
+ This engine supports a complete suite of text-generation CLI commands, including `summarize`, `sentence`, `paragraph`, `essay`, and `ask` enabling sophisticated multi-paragraph construction driven entirely by mathematics.
31
+
32
+ <video src="https://github.com/user-attachments/assets/680d4ef4-bab1-47d4-84e8-86a11aa93294"></video>
33
+
34
+ <video src="https://github.com/user-attachments/assets/299c280d-dcf3-484f-bf02-c37836811dcb"></video>
35
+
36
+ <video src="https://github.com/user-attachments/assets/06ef5c15-7743-4d62-908f-52d22288de76"></video>
37
+
38
+ <video src="https://github.com/user-attachments/assets/3b4bba24-012b-487b-98c8-91e61336cead"></video>
39
+
40
+ <video src="https://github.com/user-attachments/assets/fc1d0adc-e2c3-421a-b6b6-4b21dcf3af06"></video>
41
+
42
+ ## ๐Ÿง  Framework Overview
43
+
44
+ LMM bridges multimodal perception and actionable scientific discovery through five tightly integrated layers:
45
+
46
+ | Layer | Modules | Purpose |
47
+ | -------------- | --------------------------------------------- | ------------------------------------------------------- |
48
+ | **Perception** | `perception.rs`, `tensor.rs` | Raw bytes โ†’ normalised tensors |
49
+ | **Symbolic** | `equation.rs`, `symbolic.rs`, `discovery.rs` | GP symbolic regression, differentiation, simplification |
50
+ | **Physics** | `physics.rs`, `simulation.rs` | ODE models + Euler / RK4 / RK45 / leapfrog integrators |
51
+ | **Causal** | `causal.rs` | SCM graphs, do-calculus interventions, counterfactuals |
52
+ | **Cognition** | `consciousness.rs`, `world.rs`, `operator.rs` | Full perceive โ†’ encode โ†’ predict โ†’ act loop |
53
+
54
+ ### โš™๏ธ Architecture
55
+
56
+ ```mermaid
57
+ flowchart TD
58
+ A["Raw Input\n(bytes / sensors)"]
59
+ B["MultiModalPerception\nโ”€โ”€โ–บ Tensor"]
60
+ C["Consciousness Loop\nperceive โ†’ encode โ†’ predict\nevaluate โ†’ plan (lookahead)"]
61
+ D["WorldModel\n(RK4 physics)"]
62
+ E["SymbolicRegression\n(GP equation search)"]
63
+ F["CausalGraph\nintervention / counterfactual"]
64
+ G["Expression AST\ndifferentiate / simplify"]
65
+
66
+ A --> B --> C
67
+ C --> D
68
+ C --> E
69
+ E --> G
70
+ G --> F
71
+ D --> F
72
+ ```
73
+
74
+ ### ๐Ÿ”ฌ Key Capabilities
75
+
76
+ - ๐Ÿงฌ **Genetic Programming**: real population-based symbolic regression that seeds templates (linear, quadratic, periodic) and enforces variable-containing equations.
77
+ - ๐Ÿ“ **Symbolic Calculus**: automatic differentiation (chain rule, product rule), constant folding simplification.
78
+ - ๐ŸŒ€ **Physics Suite**: Harmonic, Lorenz, Pendulum, SIR epidemic, N-body gravity: all implement `Simulatable`.
79
+ - ๐Ÿ”ข **Field Calculus**: N-D gradient, Laplacian, divergence, 3-D curl (central differences).
80
+ - ๐Ÿ”— **Causal Reasoning**: structural causal models, `do(X=v)` interventions, counterfactual queries.
81
+ - ๐Ÿงฉ **Neural Operators**: circular convolution with SGD kernel learning, Fourier spectral operators.
82
+ - ๐Ÿ”ค **Text โ†” Equation**: encode any text into a symbolic equation; decode it back exactly (lossless via residuals).
83
+ - ๐Ÿ”ฎ **Symbolic Prediction**: LMM-native text continuation via sliding-window GP regression and vocabulary anchoring.
84
+
85
+ ## ๐Ÿ“ฆ Installation
86
+
87
+ ### From Source
88
+
89
+ ```sh
90
+ git clone https://github.com/wiseaidotdev/lmm
91
+ cd lmm
92
+ cargo build --release --all-features
93
+ ```
94
+
95
+ The binary is at `./target/release/lmm`.
96
+
97
+ ### Via Cargo
98
+
99
+ ```sh
100
+ cargo install lmm --all-features
101
+ ```
102
+
103
+ ### Via NPM
104
+
105
+ ```sh
106
+ npm install -g @wiseaidev/lmm
107
+ ```
108
+
109
+ ### Via Python
110
+
111
+ ```sh
112
+ pip install lmm
113
+ ```
114
+
115
+ > [!NOTE]
116
+ > Requires Rust 1.86+. Install via [rustup](https://rustup.rs).
117
+
118
+ > [!TIP]
119
+ > To enable internet-aware commands (`ask`), install with the `net` feature:
120
+ >
121
+ > ```sh
122
+ > cargo install lmm --features cli,net
123
+ > # or
124
+ > cargo install lmm --all-features
125
+ > ```
126
+ >
127
+ > Or build from source: `cargo build --release --features cli,net`
128
+
129
+ ## ๐Ÿš€ CLI Usage
130
+
131
+ ```sh
132
+ โ–„โ–„โ–„ โ–„โ–„โ–„ โ–„โ–„โ–„ โ–„โ–„โ–„ โ–„โ–„โ–„
133
+ โ–€โ–ˆโ–ˆโ–€ โ–ˆโ–ˆโ–ˆโ–„ โ–„โ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–„ โ–„โ–ˆโ–ˆโ–ˆ
134
+ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–€โ–ˆโ–€ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–€โ–ˆโ–€ โ–ˆโ–ˆ
135
+ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ
136
+ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ
137
+ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ โ–€โ–ˆโ–ˆโ–€ โ–€โ–ˆโ–ˆโ–„ โ–€โ–ˆโ–ˆโ–€ โ–€โ–ˆโ–ˆโ–„
138
+
139
+ Large Mathematical Model ยท Equation-Based Intelligence
140
+
141
+ The `lmm` CLI enables interaction with the Large Mathematical Model (LMM).
142
+ It provides advanced equation discovery, physics simulation, causal
143
+ inference, and unified sequence processing features.
144
+
145
+ Usage: lmm <COMMAND>
146
+ Commands:
147
+ simulate Simulate continuous logical pathways
148
+ discover Discover governing equations from data
149
+ consciousness Evaluate conscious state coherence
150
+ physics Run harmonic and chaotic physical models
151
+ causal Perform causal interventions and counterfactuals
152
+ field Compute tensor field gradients and divergences
153
+ encode Encode continuous truth into discrete text
154
+ decode Decode text back into dynamic equations
155
+ predict Predict next sequence based on pattern logic
156
+ summarize Extract key meaning via GP scoring
157
+ sentence Generate a single structural sentence
158
+ paragraph Generate a cohesive paragraph from a seed
159
+ essay Structure a full essay with intro and conclusion
160
+ ask Ask a question and get an equation-scored answer from the web
161
+ imagen Generate an image from text via Spectral Field Synthesis
162
+ help Print this message or the help of the given subcommand(s)
163
+
164
+ Options:
165
+ -h, --help Print help
166
+ -V, --version Print version
167
+ ```
168
+
169
+ ## ๐Ÿ“– Subcommand Reference
170
+
171
+ ### 1. `simulate`: Harmonic Oscillator
172
+
173
+ Runs a harmonic oscillator using the RK4 integrator.
174
+
175
+ ```sh
176
+ lmm simulate --step 0.01 --steps 200
177
+ ```
178
+
179
+ ```sh
180
+ Simulated 200 steps with step_size=0.01
181
+ Final state: [-0.41614683639502004, -0.9092974268937748]
182
+ ```
183
+
184
+ | Flag | Default | Description |
185
+ | --------------- | ------- | --------------------------- |
186
+ | `-s`, `--step` | `0.01` | Integration step size (ฮ”t) |
187
+ | `-t`, `--steps` | `100` | Number of integration steps |
188
+
189
+ ### 2. `physics`: Physics Model Simulation
190
+
191
+ Simulate one of four built-in physics models.
192
+
193
+ ```sh
194
+ # Lorenz chaotic attractor (ฯƒ=10, ฯ=28, ฮฒ=8/3)
195
+ lmm physics --model lorenz --steps 500 --step-size 0.01
196
+
197
+ # Nonlinear pendulum
198
+ lmm physics --model pendulum --steps 300 --step-size 0.005
199
+
200
+ # SIR epidemic model
201
+ lmm physics --model sir --steps 1000 --step-size 0.5
202
+
203
+ # Damped harmonic oscillator (default)
204
+ lmm physics --model harmonic --steps 200
205
+ ```
206
+
207
+ **Lorenz example:**
208
+
209
+ ```sh
210
+ Lorenz: 500 steps. Final xyz: [-8.900269690476492, -7.413716837503834, 29.311877708359006]
211
+ ```
212
+
213
+ **SIR example:**
214
+
215
+ ```sh
216
+ SIR: 1000 steps. Final [S,I,R]: [58.797367656865795, 7.649993277129408e-15, 941.2026323431321]
217
+ ```
218
+
219
+ | Flag | Default | Description |
220
+ | ------------------- | ---------- | ---------------------------------------------- |
221
+ | `-m`, `--model` | `harmonic` | Model: `lorenz`, `pendulum`, `sir`, `harmonic` |
222
+ | `-s`, `--steps` | `200` | Number of integration steps |
223
+ | `-z`, `--step-size` | `0.01` | Step size ฮ”t |
224
+
225
+ ### 3. `discover`: Symbolic Regression
226
+
227
+ Runs Genetic Programming (GP) to discover a symbolic equation from data.
228
+
229
+ ```sh
230
+ lmm discover --iterations 200
231
+ ```
232
+
233
+ ```sh
234
+ Discovered equation: (x + (1.002465056833142 + x))
235
+ ```
236
+
237
+ The engine fits data points `(i*0.5, 2*i*0.5 + 1)` by default and finds the
238
+ underlying linear law. Increase `--iterations` for more complex datasets.
239
+
240
+ | Flag | Default | Description |
241
+ | -------------------- | ----------- | ------------------------------------------------ |
242
+ | `-d`, `--data-path` | `synthetic` | Data source (`synthetic` = built-in linear data) |
243
+ | `-i`, `--iterations` | `100` | Number of GP evolution iterations |
244
+
245
+ ### 4. `consciousness`: Perceive โ†’ Predict โ†’ Act Loop
246
+
247
+ Runs one tick of the full consciousness loop: raw bytes โ†’ perception tensor โ†’
248
+ world model prediction โ†’ action plan.
249
+
250
+ ```sh
251
+ lmm consciousness --lookahead 5
252
+ ```
253
+
254
+ ```sh
255
+ Consciousness ticked. New state: [0.0019607843137254832, -0.24901960784313726, -0.37450980392156863, 0.5]
256
+ Mean prediction error: 0
257
+ ```
258
+
259
+ | Flag | Default | Description |
260
+ | ------------------- | ------- | ---------------------------------- |
261
+ | `-l`, `--lookahead` | `3` | Multi-step lookahead horizon depth |
262
+
263
+ ### 5. `causal`: Causal Graph + do-Calculus
264
+
265
+ Builds a 3-node Structural Causal Model (`x โ†’ y โ†’ z`) and applies an
266
+ intervention `do(node = value)`, printing before/after values.
267
+
268
+ ```sh
269
+ # Intervene on x: set x = 10, observe how y and z change
270
+ lmm causal --intervene-node x --intervene-value 10.0
271
+ ```
272
+
273
+ ```sh
274
+ Before intervention: x=Some(3.0), y=Some(6.0), z=Some(7.0)
275
+ After do(x=10): x=Some(10.0), y=Some(20.0), z=Some(21.0)
276
+ ```
277
+
278
+ The SCM is:
279
+
280
+ - `y = 2 * x`
281
+ - `z = y + 1`
282
+
283
+ | Flag | Default | Description |
284
+ | ------------------------- | ------- | -------------------------------------- |
285
+ | `-n`, `--intervene-node` | `x` | Name of the node to intervene on |
286
+ | `-v`, `--intervene-value` | `1.0` | Value to set the node to (do-calculus) |
287
+
288
+ ### 6. `field`: Scalar Field Calculus
289
+
290
+ Computes differential operators on a 1-D scalar field `f(i) = iยฒ`.
291
+
292
+ ```sh
293
+ # Gradient: should approach 2i (central differences)
294
+ lmm field --size 8 --operation gradient
295
+
296
+ # Laplacian: should be โ‰ˆ 2 everywhere (second derivative of xยฒ)
297
+ lmm field --size 8 --operation laplacian
298
+ ```
299
+
300
+ ```sh
301
+ Gradient of xยฒ: [1.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 13.0]
302
+ ```
303
+
304
+ ```sh
305
+ Laplacian of xยฒ: [0.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 0.0]
306
+ ```
307
+
308
+ | Flag | Default | Description |
309
+ | ------------------- | ---------- | ------------------------------------ |
310
+ | `-s`, `--size` | `10` | Number of field points |
311
+ | `-o`, `--operation` | `gradient` | Operation: `gradient` or `laplacian` |
312
+
313
+ ### 7. `encode`: Text โ†’ Symbolic Equation
314
+
315
+ This is the flagship demonstration of LMM's power. Any text is treated as a
316
+ sequence of byte values indexed by position. The GP engine discovers a symbolic
317
+ equation `f(x) โ‰ˆ byte[x]`. Integer residuals `(byte[x] โˆ’ round(f(x)))` are
318
+ stored alongside the equation, guaranteeing **lossless round-trip recovery**.
319
+
320
+ ```sh
321
+ lmm encode --text "The Pharaohs encoded reality in mathematics." \
322
+ --iterations 150 --depth 5
323
+ ```
324
+
325
+ ```sh
326
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
327
+ โ•‘ ๐Ÿ“ Encode ยท GP Symbolic Compression โ•‘
328
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
329
+
330
+ ๐Ÿ“ Input : "The Pharaohs encoded reality in mathematics."
331
+ ๐Ÿ“ Length : 44 chars
332
+
333
+ -- Equation ----------------------------------
334
+ Equation: ((-12.541407707100985 * sin((-0.4 + ((x * x) * 0.8837323816189393)))) + 94.96615109151574)
335
+ Length: 44 chars
336
+ MSE: 530.1715
337
+ Max residual: 56
338
+
339
+ -- Encoded Data ------------------------------
340
+ {"eq":"((-12.541407707100985 * sin((-0.4 + ((x * x) * 0.8837323816189393)))) + 94.96615109151574)","len":44,"mse":530.171549,"res":[-16,15,6,-51,-3,13,2,8,-3,27,9,17,-51,-6,15,-2,12,-1,5,-7,-51,16,7,13,9,0,22,28,-51,22,13,-56,11,10,19,22,18,15,5,12,8,13,23,-49]}
341
+
342
+ -- Round-trip Verify -------------------------
343
+ โœ… PERFECT
344
+ Decoded : "The Pharaohs encoded reality in mathematics."
345
+
346
+ ๐Ÿ’พ To decode later:
347
+ lmm decode --equation "((-12.541407707100985 * sin((-0.4 + ((x * x) * 0.8837323816189393)))) + 94.96615109151574)" --length 44 --residuals "-16,15,6,-51,-3,13,2,8,-3,27,9,17,-51,-6,15,-2,12,-1,5,-7,-51,16,7,13,9,0,22,28,-51,22,13,-56,11,10,19,22,18,15,5,12,8,13,23,-49"
348
+ ```
349
+
350
+ > [!NOTE]
351
+ > GP is stochastic: the discovered equation and residual values will differ across runs. The round-trip recovery is always โœ… PERFECT because the integer residuals correct for any approximation error.
352
+
353
+ ```sh
354
+ # Encode from a file
355
+ lmm encode --input ./my_message.txt --iterations 200 --depth 5
356
+ ```
357
+
358
+ | Flag | Default | Description |
359
+ | --------------- | ------------- | -------------------------------------------------- |
360
+ | `-i`, `--input` | `-` | Path to a text file to encode (`-` = use `--text`) |
361
+ | `-t`, `--text` | `Hello, LMM!` | Inline text (used when `--input` is `-`) |
362
+ | `--iterations` | `80` | GP evolution iterations |
363
+ | `--depth` | `4` | Maximum expression tree depth |
364
+
365
+ ### 8. `decode`: Symbolic Equation โ†’ Text
366
+
367
+ Reconstructs the original text from the equation and residuals printed by `encode`.
368
+
369
+ ```sh
370
+ lmm decode \
371
+ --equation "(95.09620435614187 - cos(x))" \
372
+ --length 44 \
373
+ --residuals "-10,9,5,-64,-16,9,3,20,2,15,8,20,-62,7,15,3,15,5,7,6,-63,18,5,1,13,11,22,26,-64,9,15,-62,15,2,20,8,6,15,3,21,9,3,20,-49"
374
+ ```
375
+
376
+ ```sh
377
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
378
+ โ•‘ ๐Ÿ”“ Decode ยท Equation to Text โ•‘
379
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
380
+
381
+ ๐Ÿ“ Equation : (95.09620435614187 - cos(x))
382
+ ๐Ÿ“ Length : 44
383
+
384
+ -- Decoded Text ------------------------------
385
+ The Pharaohs encoded reality in mathematics.
386
+ ```
387
+
388
+ | Flag | Required | Description |
389
+ | ------------------- | -------- | --------------------------------------------------------------------------- |
390
+ | `-e`, `--equation` | โœ… | Equation string (from `encode` output) |
391
+ | `-l`, `--length` | โœ… | Number of characters to recover |
392
+ | `-r`, `--residuals` | โœ… | Comma-separated residuals. Use `--residuals="-3,1,..."` for negative values |
393
+
394
+ > [!IMPORTANT]
395
+ > Use `--residuals="-3,..."` (with `=`) or quote the argument when residuals contain negative values to prevent the shell from treating them as flags.
396
+
397
+ ### 9. `predict`: Symbolic Text Continuation
398
+
399
+ The `predict` command acts as LMM's continuation engine. Unlike neural network LLMs that use massive statistical models, LMM strings together coherent English output using **Pure Mathematics**.
400
+
401
+ It does this by operating on three distinct, deterministic signals:
402
+
403
+ - **GP Trajectory Equation**: `f(pos) โ†’ word_byte_tone` (discovers long-range subject themes)
404
+ - **GP Rhythm Equation**: `g(pos) โ†’ word_length` (discovers alternating phonetic cadence)
405
+ - **Dictionary Grammar Engine**: Maps mathematical values to a curated pool of English nouns, verbs, adjectives with system dictionary fallback (`/usr/share/dict`), while flowing through cyclic Subject-Verb-Object (SVO) POS grammar loops.
406
+
407
+ ```sh
408
+ lmm predict --text "Wise AI built the first LMM" --window 10 --predict-length 80
409
+ ```
410
+
411
+ ```text
412
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
413
+ โ•‘ ๐Ÿ”ฎ Predict ยท Symbolic Continuation โ•‘
414
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
415
+
416
+ ๐Ÿ“š Dictionary: 63746 words loaded
417
+ ๐Ÿ“ Input : "Wise AI built the first LMM"
418
+ ๐ŸชŸ Window : 6 words
419
+ ๐Ÿ“ˆ Trajectory: (x + 103.82300000000001)
420
+ ๐ŸŽต Rhythm : (3.00402169780806 + sin(cos(cos(x))))
421
+
422
+ -- Continuation ------------------------------
423
+ Wise AI built the first LMM in the true soul often long time and an open path of a solid scope is the human
424
+ ```
425
+
426
+ > [!NOTE]
427
+ > Text is parsed completely via pure equations over a carefully constructed English vocabulary pool, mapping geometric relationships and POS states into elegant and mysterious sentences.
428
+
429
+ | Flag | Default | Description |
430
+ | ------------------------ | --------------------------------- | ------------------------------------------------ |
431
+ | `-i`, `--input` | `-` | Path to a text file (`-` = use `--text`) |
432
+ | `-t`, `--text` | `The Pharaohs encoded reality in` | Inline text seed |
433
+ | `-w`, `--window` | `32` | Context window in words |
434
+ | `-p`, `--predict-length` | `16` | Approximate character budget for continuation |
435
+ | `--iterations` | `80` | GP evolution iterations for the prediction model |
436
+ | `--depth` | `4` | Maximum expression tree depth |
437
+
438
+ ### 10. `summarize`: Key Sentence Extraction
439
+
440
+ Summarize distills a large body of text down to its most mathematically significant sentences. It scores each sentence by tracking tone deviations, length variances, and relative position.
441
+
442
+ ```sh
443
+ lmm summarize --text "The ancient Egyptians built the pyramids using advanced mathematical knowledge. Their understanding of geometry was extraordinary for the time. Modern engineers still struggle to replicate their precision. Mathematics was their sacred language of cosmic alignment." --sentences 2
444
+ ```
445
+
446
+ ```sh
447
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
448
+ โ•‘ โœ‚๏ธ Summarize ยท Key Sentence Extraction โ•‘
449
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
450
+
451
+ ๐Ÿ“ Input : 264 chars
452
+ ๐Ÿ“Š Extracting 2 key sentences via GP scoring...
453
+
454
+ -- Summary -----------------------------------
455
+ 1. The ancient Egyptians built the pyramids using advanced mathematical knowledge.
456
+ 2. Mathematics was their sacred language of cosmic alignment.
457
+ ```
458
+
459
+ | Flag | Default | Description |
460
+ | ------------------- | ------- | ---------------------------------- |
461
+ | `-t`, `--text` | `...` | Input text to summarize |
462
+ | `-n`, `--sentences` | `2` | Number of key sentences to extract |
463
+
464
+ ### 11. `sentence`: Single Sentence Generation
465
+
466
+ Generates a single, structurally elegant sentence inspired by a seed text, using rotating Subject-Verb-Object (SVO) sequence patterns parsed from math tones.
467
+
468
+ ```sh
469
+ lmm sentence --text "Mathematics is the language of the universe"
470
+ ```
471
+
472
+ ```sh
473
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
474
+ โ•‘ โœ๏ธ Sentence ยท Single Sentence Generation โ•‘
475
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
476
+
477
+ ๐ŸŒฑ Seed : "Mathematics is the language of the universe"
478
+
479
+ -- Generated Sentence ------------------------
480
+ Analysis enables the dynamic meaning of the universe.
481
+ ```
482
+
483
+ ### 12. `paragraph`: Cohesive Paragraph Generation
484
+
485
+ Chains multiple logically coherent sentences together, seeding subsequent sentence structures using extracted keywords from the original seed.
486
+
487
+ ```sh
488
+ lmm paragraph --text "Equations reveal hidden truths about nature" --sentences 6
489
+ ```
490
+
491
+ ```sh
492
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
493
+ โ•‘ ๐Ÿ“„ Paragraph ยท Generate a Paragraph โ•‘
494
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
495
+
496
+ ๐ŸŒฑ Seed : "Equations reveal hidden truths about nature"
497
+ ๐Ÿ“Š Sentences : 6
498
+
499
+ -- Generated Paragraph -----------------------
500
+
501
+ Simulation manifests the continuous symmetry of the truths. The symmetric wavelength connects infinity. Entropy remains the invariant truths underlying knowledge. The entropy of truths connects infinity. In essence, the symmetric integration encodes boundaries. Dimension describes precise reality beneath truths.
502
+ ```
503
+
504
+ | Flag | Default | Description |
505
+ | ------------------- | ------- | ------------------------------------ |
506
+ | `-t`, `--text` | `...` | Seed topic for paragraph generation |
507
+ | `-n`, `--sentences` | `4` | Number of sentences in the paragraph |
508
+
509
+ ### 13. `essay`: Full Essay Blueprint
510
+
511
+ Generates a fully structured essay, complete with an introduction, mathematical body paragraphs based on derived sub-topics, and a cohesive conclusion.
512
+
513
+ ```sh
514
+ lmm essay --text 'Symmetry and the deeper patterns of physics' --paragraphs 2 --sentences 15
515
+ ```
516
+
517
+ ```sh
518
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
519
+ โ•‘ ๐Ÿ“– Essay ยท Generate a Full Essay โ•‘
520
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
521
+
522
+ ๐ŸŒฑ Topic : "Symmetry and the deeper patterns of physics"
523
+ ๐Ÿ“Š Paragraphs : 2 (15 sentences each)
524
+
525
+ -- Essay -------------------------------------
526
+
527
+ โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
528
+ ๐Ÿ“– Symmetry And The Deeper Patterns Of Physics
529
+ โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
530
+
531
+ -- Introduction ------------------------------
532
+
533
+ Analysis illuminates the probabilistic motion of the truth. The deterministic probability reflects knowledge. Algebra holds the infinite truth of motion. The frequency of truth shapes chaos. At its core, the axiomatic probability transforms perception. Physics unveils bounded infinity beyond truth. Recursion connects the bounded balance of the truth. The dynamic wavelength unveils infinity. Wavelength remains the bounded truth through reality. The dimension of truth produces identity. At its core, the discrete frequency governs existence. Frequency produces invariant perception pervading truth. Structure unveils the invariant existence of the truth. The coherent integration produces existence. Integration remains the mathematical truth governing complexity.
534
+
535
+
536
+ -- Body ยท ยง1 ---------------------------------
537
+
538
+ At its core, the discrete computation governs truth. Computation manifests invariant harmony pervading symmetry. Topology enables the invariant truth of the symmetry. The coherent transformation manifests change. Transformation remains the mathematical symmetry governing time. The physics of symmetry encodes order. In this framework, the continuous calculus generates nature. Geometry enables axiomatic space across symmetry. Gradient determines the axiomatic time of the symmetry. The structural divergence illuminates matter. Physics remains the probabilistic symmetry beneath meaning. The mathematics of symmetry expresses truth. At its core, the deterministic recursion captures matter. Entropy unveils abstract balance of symmetry. Divergence connects the abstract limits of the symmetry.
539
+
540
+
541
+ -- Body ยท ยง2 ---------------------------------
542
+
543
+ The recursive transformation manifests energy. Transformation remains the continuous symmetry within limits. The calculus of symmetry enables meaning. At its core, the axiomatic analysis transforms knowledge. Gradient illuminates probabilistic motion inside symmetry. Pattern illuminates the probabilistic truth of the symmetry. The fundamental physics expresses matter. Physics remains the deterministic symmetry underlying harmony. The algebra of symmetry unveils energy. In this framework, the abstract recursion captures causality. Entropy describes bounded truth beyond symmetry. Divergence connects the bounded unity of the symmetry. The dynamic logic unveils truth. Resonance remains the bounded symmetry through knowledge. The entropy of symmetry produces knowledge.
544
+
545
+
546
+ -- Conclusion --------------------------------
547
+
548
+ Gradient unveils the invariant limits of the symmetry. The invariant computation compresses balance. Divergence is the bounded symmetry of identity. The pattern of symmetry defines matter. Fundamentally, the continuous gradient generates truth. Logic determines axiomatic harmony across symmetry. Recursion determines the axiomatic infinity of the symmetry. The structural entropy illuminates infinity. Entropy are the probabilistic symmetry beneath space. The dimension of symmetry expresses reality. Moreover, the deterministic frequency defines existence. Frequency connects abstract perception of symmetry. Structure encodes the abstract chaos of the symmetry. The elegant integration encodes existence. Integration are the dynamic symmetry within meaning.
549
+ ```
550
+
551
+ | Flag | Default | Description |
552
+ | -------------------- | ------- | ------------------------------------- |
553
+ | `-t`, `--text` | `...` | Topic or title seed for the essay |
554
+ | `-n`, `--paragraphs` | `2` | Number of body paragraphs to generate |
555
+ | `-s`, `--sentences` | `3` | Number of sentences per paragraph |
556
+
557
+ ### 14. `ask`: Internet-Aware Knowledge Synthesis _(requires `net` feature)_
558
+
559
+ Searches the internet via DuckDuckGo Lite, aggregates the result snippets into a single text corpus, then applies the LMM's GP-scored equation engine to extract and compose the most mathematically significant sentences into a coherent response.
560
+
561
+ ```sh
562
+ lmm ask --prompt "What is the Rust programming language?" --limit 5 --sentences 3
563
+ ```
564
+
565
+ ```sh
566
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
567
+ โ•‘ ๐ŸŒ Ask ยท Internet-Aware Knowledge Synthesis โ•‘
568
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
569
+
570
+ โ“ Prompt : "What is the Rust programming language?"
571
+
572
+ -- DuckDuckGo Results ------------------------
573
+ Rust (programming language)
574
+ Abstract: Rust is a general-purpose programming language. It is noted for its emphasis on performance, type safety, concurrency, and memory safety. Rust supports multiple programming paradigms. It was influenced by ideas from functional programming, including immutability, higher-order functions, algebraic data types, and pattern matching. It also supports object-oriented programming via structs, enums, traits, and methods. Rust is noted for enforcing memory safety without a conventional garbage collector; instead, memory safety errors and data races are prevented by the "borrow checker", which tracks the object lifetime of references at compile time. Software developer Graydon Hoare created Rust in 2006 while working at Mozilla, which officially sponsored the project in 2009. The first stable release, Rust 1.0, was published in May 2015.
575
+ Abstract Source: Wikipedia
576
+ Abstract URL: https://en.wikipedia.org/wiki/Rust_(programming_language)
577
+ Image URL: https://duckduckgo.com/i/832f249b21809a13.png
578
+ 1. Rust (programming language) Category
579
+ URL: https://duckduckgo.com/c/Rust_(programming_language)?kp=%2D2
580
+ --------------------------------------------
581
+ 2. History of programming languages - The history of programming languages spans from documentation of early mechanical computers to modern tools for software development. Early programming languages were highly specialized, relying on mathematical notation and similarly obscure syntax.
582
+ URL: https://duckduckgo.com/History_of_programming_languages?kp=%2D2
583
+ --------------------------------------------
584
+ 3. Outline of the Rust programming language - The following outline is provided as an overview of and topical guide to Rust: Rust is a multi-paradigm programming language emphasizing performance, memory safety, and concurrency.
585
+ URL: https://duckduckgo.com/Outline_of_the_Rust_programming_language?kp=%2D2
586
+ --------------------------------------------
587
+ 4. Pattern matching programming languages
588
+ URL: https://duckduckgo.com/c/Pattern_matching_programming_languages?kp=%2D2
589
+ --------------------------------------------
590
+ 5. Multi-paradigm programming languages
591
+ URL: https://duckduckgo.com/c/Multi-paradigm_programming_languages?kp=%2D2
592
+ --------------------------------------------
593
+
594
+
595
+ -- LMM Response ------------------------------
596
+ Rust is a general-purpose programming language.
597
+ Rust supports multiple programming paradigms.
598
+ Outline of the Rust programming language - The following outline is provided as an overview of and topical guide to Rust: Rust is a multi-paradigm programming language emphasizing performance, memory safety, and concurrency.
599
+ ```
600
+
601
+ > [!NOTE]
602
+ > The `ask` command requires building with `--features cli,net`. No API key is needed.
603
+
604
+ | Flag | Default | Description |
605
+ | ------------------- | -------- | ---------------------------------------------- |
606
+ | `-p`, `--prompt` | required | The question or search query |
607
+ | `-l`, `--limit` | `5` | Maximum number of search results to fetch |
608
+ | `-n`, `--sentences` | `3` | Number of key sentences to extract |
609
+ | `--region` | `wt-wt` | DuckDuckGo region code (e.g. `us-en`, `uk-en`) |
610
+ | `--iterations` | `40` | GP scoring iterations |
611
+ | `--depth` | `3` | Maximum GP expression depth |
612
+
613
+ ### 15. `imagen`: Spectral Field Synthesis Image Generation
614
+
615
+ Generates an image from text based on Spectral Field Synthesis. It hashes the prompt to derive pure mathematical wave components, applies non-linear styles, and maps amplitudes to RGB.
616
+
617
+ ```sh
618
+ lmm imagen --prompt "The ancient Egyptians built the pyramids with mathematical precision" \
619
+ --width 512 --height 512 --style plasma --palette warm --components 12 --output ./egypt.ppm
620
+ ```
621
+
622
+ ```sh
623
+ โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
624
+ โ•‘ ๐ŸŽจ Imagen ยท Spectral Field Synthesis โ•‘
625
+ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
626
+
627
+ ๐Ÿ–ผ Prompt : "The ancient Egyptians built the pyramids with mathematical precision"
628
+ ๐Ÿ“ Dimensions : 512x512
629
+ ๐ŸŽญ Style : plasma
630
+ ๐ŸŽจ Palette : warm
631
+ ๐ŸŒŠ Components : 12
632
+
633
+
634
+ -- Rendering ---------------------------------
635
+ โœ… Saved to: ./egypt.ppm
636
+ ```
637
+
638
+ | Flag | Default | Description |
639
+ | -------------------- | ------------ | ------------------------------------------------------------------- |
640
+ | `-p`, `--prompt` | required | The text prompt to hash into the spectral seed |
641
+ | `--width` | `512` | Image width in pixels |
642
+ | `--height` | `512` | Image height in pixels |
643
+ | `-c`, `--components` | `8` | Number of cosine wave components per channel |
644
+ | `-s`, `--style` | `plasma` | Transform: `wave`, `radial`, `orbital`, `fractal`, `flow`, `plasma` |
645
+ | `--palette` | `auto` | Color palette: `warm`, `cool`, `neon`, `mono`, `auto` |
646
+ | `-o`, `--output` | `output.ppm` | Output file path or directory (auto-names if dir) |
647
+
648
+ ## ๐Ÿ”ฌ Architecture Deep Dive
649
+
650
+ ### Genetic Programming Symbolic Regression
651
+
652
+ ```mermaid
653
+ flowchart TD
654
+ A["Seeded population\n(linear/quadratic/periodic templates + random)"]
655
+ B["Evaluate fitness\nMDL = nยทln(MSE) + complexityยทln(2)"]
656
+ C["Tournament selection (k=5)"]
657
+ D["Crossover & mutation"]
658
+ E["Reject constant collapse\n(inject fresh random expr 70% of the time)"]
659
+ F{Iterations done?}
660
+ G["Best variable-containing expression (simplified)"]
661
+
662
+ A --> B --> C --> D --> E --> F
663
+ F -- No --> B
664
+ F -- Yes --> G
665
+ ```
666
+
667
+ ### Multi-Signal Prediction Engine
668
+
669
+ ```mermaid
670
+ flowchart TD
671
+ In["Context Window\n(Recent Tokens)"]
672
+
673
+ In -->|Train| M["2nd-Order Markov Chain\nTransition probabilities"]
674
+ In -->|GP Fit| T["Word-ID Trajectory GP\nf(pos) โ‰ˆ word_id"]
675
+ In -->|GP Fit| R["Word-Length Rhythm GP\ng(pos) โ‰ˆ length"]
676
+
677
+ In --> S["Suffix Pattern Matcher"]
678
+
679
+ S -- "Match Found" --> Out["Exact Phrase Continuation"]
680
+ S -- "No Match" --> Score["Composite Scorer"]
681
+
682
+ M --> Score
683
+ T --> Score
684
+ R --> Score
685
+
686
+ Score -->|Lowest Score| W["Select Best Word from Vocab"]
687
+ W -->|Update Recency| Out
688
+ ```
689
+
690
+ ### Spectral Field Synthesis Image Generation
691
+
692
+ ```mermaid
693
+ flowchart TD
694
+ P["Text Prompt"] -->|FNV-1a Hash| S["64-bit Spectral Seed"]
695
+ S --> W_R["Generate Red Wave Components\n(Freq, Amp, Phase)"]
696
+ S --> W_G["Generate Green Wave Components\n(Freq, Amp, Phase)"]
697
+ S --> W_B["Generate Blue Wave Components\n(Freq, Amp, Phase)"]
698
+
699
+ W_R --> F["Evaluate F(x,y) = ฮฃ A_kยทcos(2ฯ€ยทf_xยทx + 2ฯ€ยทf_yยทy + ฯ†_k)\nacross all (x,y) pixels"]
700
+ W_G --> F
701
+ W_B --> F
702
+
703
+ F --> T["Apply Non-linear Style Transform\n(Wave, Radial, Fractal, etc.)"]
704
+ T --> C["Map to Palette\n(Bias + Ampยทsin(v))"]
705
+ C --> O["PPM Image Output"]
706
+ ```
707
+
708
+ ### RK45 Adaptive Integrator
709
+
710
+ All Butcher-tableau coefficients are named package-level constants:
711
+
712
+ ```rust
713
+ const RK45_A41: f64 = 1932.0 / 2197.0;
714
+ const RK45_A42: f64 = -7200.0 / 2197.0;
715
+ const RK45_A43: f64 = 7296.0 / 2197.0;
716
+ const RK45_B5_1: f64 = 16.0 / 135.0;
717
+ // ... etc.
718
+ ```
719
+
720
+ Step size is adapted each iteration using the error estimate:
721
+
722
+ ```sh
723
+ h_new = 0.9 ยท h ยท (tol / error)^0.2
724
+ ```
725
+
726
+ ## ๐Ÿ“ฐ Whitepaper
727
+
728
+ [LLMs are Usefull. LMMs will Break Reality](https://wiseai.dev/blogs/llms-are-usefull-lmms-will-break-reality): the blog post that started this project.
729
+
730
+ ## ๐Ÿค Contributing
731
+
732
+ Contributions are welcome! Feel free to open issues or pull requests.
733
+
734
+ ## ๐Ÿ“ License
735
+
736
+ This project is licensed under the MIT License: see the [LICENSE](LICENSE) file for details.