@wiseaidev/lmm 0.1.14 → 0.2.0
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 +77 -720
- package/index.d.ts +158 -0
- package/index.js +84 -52
- package/lmm.linux-x64-gnu.node +0 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
[](https://wiseai.dev)
|
|
6
6
|
|
|
7
7
|
[](https://github.com/wiseaidotdev/lmm)
|
|
8
|
+
[](https://crates.io/crates/lmm)
|
|
9
|
+
[](https://docs.rs/lmm)
|
|
8
10
|
[](https://crates.io/crates/lmm)
|
|
9
11
|
[](https://pypi.org/project/lmm-rs/)
|
|
10
12
|
[](https://www.npmjs.com/package/@wiseaidev/lmm)
|
|
@@ -17,46 +19,44 @@
|
|
|
17
19
|
[](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
20
|
[](https://www.linkedin.com/shareArticle?url=https://github.com/wiseaidotdev/lmm&title=LMM%3A%20Large%20Mathematical%20Model)
|
|
19
21
|
|
|
20
|
-
> **LMM** is a pure‑Rust framework that
|
|
22
|
+
> **LMM (Large Mathematical Model)** is a pure‑Rust framework that models higher‑dimensional reality through symbolic mathematics and physics simulation; Inspired by the Pharaonic model of intelligence: compress the world into durable, universal equations. No training. No GPU. No API key.
|
|
23
|
+
|
|
24
|
+
| 🐧 Linux `(Recommended)` | 🪟 Windows | 🐳 Docker |
|
|
25
|
+
| :------: | :--------: | :--------: |
|
|
26
|
+
|  |  |  |
|
|
27
|
+
| [Download `lmm` binary](https://github.com/wiseaidotdev/lmm/releases/latest/download/lmm) | [Download `lmm.exe` binary](https://github.com/wiseaidotdev/lmm/releases/latest/download/lmm.exe) | `docker pull wiseaidev/lmm` |
|
|
28
|
+
| `cargo install lmm --features rust-binary` | `cargo install lmm --features rust-binary` | `docker run -it wiseaidev/lmm` |
|
|
29
|
+
| `lmm` ← launches CLI | `lmm` ← launches CLI | [Read DOCKER.md](https://github.com/wiseaidotdev/lmm/blob/main/DOCKER.md) |
|
|
21
30
|
|
|
22
31
|
</div>
|
|
23
32
|
|
|
24
33
|
## 🎬 Demo
|
|
25
34
|
|
|
26
|
-
The following
|
|
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>
|
|
35
|
+
The following demonstrates the symbolic prediction engine generating coherent English sentences powered entirely by deterministic mathematical equations and structural Subject-Verb-Object grammar; No neural networks, no statistical models. The engine supports a full suite of CLI subcommands including `predict`, `summarize`, `sentence`, `paragraph`, `essay`, and `ask`, enabling multi-paragraph construction driven entirely by mathematics.
|
|
39
36
|
|
|
40
|
-
|
|
37
|
+
| | | |
|
|
38
|
+
|:---:|:---:|:---:|
|
|
39
|
+
| <video src="https://github.com/user-attachments/assets/f20ed16f-d90e-4983-bc47-0de2ce5c5a4f"></video> | <video src="https://github.com/user-attachments/assets/680d4ef4-bab1-47d4-84e8-86a11aa93294"></video> | <video src="https://github.com/user-attachments/assets/299c280d-dcf3-484f-bf02-c37836811dcb"></video> |
|
|
40
|
+
| <video src="https://github.com/user-attachments/assets/06ef5c15-7743-4d62-908f-52d22288de76"></video> | <video src="https://github.com/user-attachments/assets/3b4bba24-012b-487b-98c8-91e61336cead"></video> | <video src="https://github.com/user-attachments/assets/fc1d0adc-e2c3-421a-b6b6-4b21dcf3af06"></video> |
|
|
41
41
|
|
|
42
|
-
## 🧠
|
|
42
|
+
## 🧠 What Does LMM Provide?
|
|
43
43
|
|
|
44
44
|
LMM bridges multimodal perception and actionable scientific discovery through five tightly integrated layers:
|
|
45
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
|
|
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
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
|
|
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
53
|
|
|
54
54
|
### ⚙️ Architecture
|
|
55
55
|
|
|
56
56
|
```mermaid
|
|
57
57
|
flowchart TD
|
|
58
58
|
A["Raw Input\n(bytes / sensors)"]
|
|
59
|
-
B["MultiModalPerception\n
|
|
59
|
+
B["MultiModalPerception\n → Tensor"]
|
|
60
60
|
C["Consciousness Loop\nperceive → encode → predict\nevaluate → plan (lookahead)"]
|
|
61
61
|
D["WorldModel\n(RK4 physics)"]
|
|
62
62
|
E["SymbolicRegression\n(GP equation search)"]
|
|
@@ -73,726 +73,77 @@ flowchart TD
|
|
|
73
73
|
|
|
74
74
|
### 🔬 Key Capabilities
|
|
75
75
|
|
|
76
|
-
- 🧬 **Genetic Programming**:
|
|
77
|
-
- 📐 **Symbolic Calculus**: automatic differentiation (chain rule, product rule
|
|
78
|
-
- 🌀 **Physics Suite**: Harmonic, Lorenz, Pendulum, SIR
|
|
79
|
-
- 🔢 **Field Calculus**: N-D gradient, Laplacian, divergence, 3-D curl
|
|
80
|
-
- 🔗 **Causal Reasoning**: structural causal models, `do(X=v)` interventions, counterfactual queries.
|
|
81
|
-
- 🧩 **Neural Operators**: circular convolution with SGD kernel learning
|
|
82
|
-
- 🔤 **Text ↔ Equation**: encode any text into a symbolic equation
|
|
83
|
-
- 🔮 **Symbolic Prediction**:
|
|
84
|
-
- 🎲 **Stochastic Enhancement**: synonym-bank word replacement (`--stochastic`)
|
|
76
|
+
- 🧬 **Genetic Programming**: population-based symbolic regression with template seeding (linear, quadratic, periodic) and variable-enforcement guards.
|
|
77
|
+
- 📐 **Symbolic Calculus**: automatic differentiation (chain rule, product rule, trig) and constant-folding simplification.
|
|
78
|
+
- 🌀 **Physics Suite**: Harmonic Oscillator, Lorenz Attractor, Pendulum, SIR Epidemic, N-body Gravity; All implement `Simulatable`.
|
|
79
|
+
- 🔢 **Field Calculus**: N-D gradient, Laplacian, divergence, and 3-D curl via central differences.
|
|
80
|
+
- 🔗 **Causal Reasoning**: structural causal models, `do(X=v)` interventions, and counterfactual queries.
|
|
81
|
+
- 🧩 **Neural Operators**: circular convolution with SGD kernel learning and Fourier spectral operators.
|
|
82
|
+
- 🔤 **Text ↔ Equation**: losslessly encode any text string into a symbolic equation and recover it exactly via integer residuals.
|
|
83
|
+
- 🔮 **Symbolic Prediction**: equation-native text continuation using sliding-window GP regression and vocabulary anchoring.
|
|
84
|
+
- 🎲 **Stochastic Enhancement**: synonym-bank word replacement (`--stochastic`) delivers unique output each run while preserving mathematical sentence structure.
|
|
85
|
+
- 🎨 **Spectral Image Synthesis**: generate procedural PPM images from a text prompt by hashing it into Fourier wave components.
|
|
85
86
|
|
|
86
87
|
## 📦 Installation
|
|
87
88
|
|
|
88
|
-
|
|
89
|
+
The `lmm` crate ships the following Cargo features:
|
|
89
90
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
| Feature | Description |
|
|
92
|
+
| -------------- | ------------------------------------------------------- |
|
|
93
|
+
| `rust-binary` | Enables the standalone `lmm` terminal CLI executable |
|
|
94
|
+
| `cli` | Core CLI scaffolding (subsets of `rust-binary`) |
|
|
95
|
+
| `net` | Internet-aware `ask` command via DuckDuckGo search |
|
|
96
|
+
| `python` | Python extension module via `pyo3` / maturin |
|
|
97
|
+
| `node` | Node.js native add-on via `napi-derive` |
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
## 🦀 Rust
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
cargo install lmm --all-features
|
|
102
|
-
```
|
|
101
|
+
The `lmm` library is available on [crates.io](https://crates.io/crates/lmm). For the complete API reference, installation guide, and worked examples, see the **[Rust usage guide](https://github.com/wiseaidotdev/lmm/blob/main/RUST.md)**.
|
|
103
102
|
|
|
104
|
-
|
|
103
|
+
## 💻 Command-Line Interface
|
|
105
104
|
|
|
106
|
-
|
|
107
|
-
npm install -g @wiseaidev/lmm
|
|
108
|
-
```
|
|
105
|
+
The `lmm` binary supports 15 subcommands spanning simulation, discovery, encoding, prediction, summarisation, and rich text generation: all powered by pure equations.
|
|
109
106
|
|
|
110
|
-
|
|
107
|
+
For the full option reference and usage examples, see the **[CLI documentation](https://github.com/wiseaidotdev/lmm/blob/main/CLI.md)** or run `lmm --help` after installing with `cargo install lmm --features rust-binary`.
|
|
111
108
|
|
|
112
|
-
|
|
113
|
-
pip install lmm-rs
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
> [!NOTE]
|
|
117
|
-
> Requires Rust 1.86+. Install via [rustup](https://rustup.rs).
|
|
118
|
-
|
|
119
|
-
> [!TIP]
|
|
120
|
-
> To enable internet-aware commands (`ask`), install with the `net` feature:
|
|
121
|
-
>
|
|
122
|
-
> ```sh
|
|
123
|
-
> cargo install lmm --features cli,net
|
|
124
|
-
> # or
|
|
125
|
-
> cargo install lmm --all-features
|
|
126
|
-
> ```
|
|
127
|
-
>
|
|
128
|
-
> Or build from source: `cargo build --release --features cli,net`
|
|
129
|
-
|
|
130
|
-
## 🚀 CLI Usage
|
|
131
|
-
|
|
132
|
-
```sh
|
|
133
|
-
▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄ ▄▄▄
|
|
134
|
-
▀██▀ ███▄ ▄███ ███▄ ▄███
|
|
135
|
-
██ ██ ▀█▀ ██ ██ ▀█▀ ██
|
|
136
|
-
██ ██ ██ ██ ██
|
|
137
|
-
██ ██ ██ ██ ██
|
|
138
|
-
████████ ▀██▀ ▀██▄ ▀██▀ ▀██▄
|
|
139
|
-
|
|
140
|
-
Large Mathematical Model · Equation-Based Intelligence
|
|
141
|
-
|
|
142
|
-
The `lmm` CLI enables interaction with the Large Mathematical Model (LMM).
|
|
143
|
-
It provides advanced equation discovery, physics simulation, causal
|
|
144
|
-
inference, and unified sequence processing features.
|
|
145
|
-
|
|
146
|
-
Usage: lmm <COMMAND>
|
|
147
|
-
Commands:
|
|
148
|
-
simulate Simulate continuous logical pathways
|
|
149
|
-
discover Discover governing equations from data
|
|
150
|
-
consciousness Evaluate conscious state coherence
|
|
151
|
-
physics Run harmonic and chaotic physical models
|
|
152
|
-
causal Perform causal interventions and counterfactuals
|
|
153
|
-
field Compute tensor field gradients and divergences
|
|
154
|
-
encode Encode continuous truth into discrete text
|
|
155
|
-
decode Decode text back into dynamic equations
|
|
156
|
-
predict Predict next sequence based on pattern logic
|
|
157
|
-
summarize Extract key meaning via GP scoring
|
|
158
|
-
sentence Generate a single structural sentence
|
|
159
|
-
paragraph Generate a cohesive paragraph from a seed
|
|
160
|
-
essay Structure a full essay with intro and conclusion
|
|
161
|
-
ask Ask a question and get an equation-scored answer from the web
|
|
162
|
-
imagen Generate an image from text via Spectral Field Synthesis
|
|
163
|
-
help Print this message or the help of the given subcommand(s)
|
|
164
|
-
|
|
165
|
-
Global Stochastic Flags (available on predict, summarize, sentence, paragraph, essay, ask):
|
|
166
|
-
--stochastic Enable synonym-based randomization of output
|
|
167
|
-
--probability Replacement rate 0.0 - 1.0 (default: 0.5)
|
|
168
|
-
|
|
169
|
-
Options:
|
|
170
|
-
-v, --verbose Show detailed output with formatting
|
|
171
|
-
-h, --help Print help
|
|
172
|
-
-V, --version Print version
|
|
173
|
-
```
|
|
109
|
+
## 🐍 Python
|
|
174
110
|
|
|
175
|
-
|
|
176
|
-
> By default, all commands cleanly output their raw generated results. Provide the `--verbose` (or `-v`) flag to display full interactive banners, seed information, and boxed separators!
|
|
111
|
+
The Python bindings are published to PyPI as **`lmm-rs`** and are installed with `pip install lmm-rs`. Built with [maturin](https://www.maturin.rs/), the package ships pre-compiled wheels for major CPython versions and runs a fully embedded Tokio runtime; no `asyncio` required.
|
|
177
112
|
|
|
178
|
-
|
|
113
|
+
For installation instructions, configuration options, and full method signatures, see the **[Python usage guide](https://github.com/wiseaidotdev/lmm/blob/main/PYTHON.md)**.
|
|
179
114
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
Runs a harmonic oscillator using the RK4 integrator.
|
|
183
|
-
|
|
184
|
-
```sh
|
|
185
|
-
lmm simulate --step 0.01 --steps 200
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
```sh
|
|
189
|
-
Simulated 200 steps with step_size=0.01
|
|
190
|
-
Final state: [-0.41614683639502004, -0.9092974268937748]
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
| Flag | Default | Description |
|
|
194
|
-
| --------------- | ------- | --------------------------- |
|
|
195
|
-
| `-s`, `--step` | `0.01` | Integration step size (Δt) |
|
|
196
|
-
| `-t`, `--steps` | `100` | Number of integration steps |
|
|
197
|
-
|
|
198
|
-
### 2. `physics`: Physics Model Simulation
|
|
199
|
-
|
|
200
|
-
Simulate one of four built-in physics models.
|
|
201
|
-
|
|
202
|
-
```sh
|
|
203
|
-
# Lorenz chaotic attractor (σ=10, ρ=28, β=8/3)
|
|
204
|
-
lmm physics --model lorenz --steps 500 --step-size 0.01
|
|
205
|
-
|
|
206
|
-
# Nonlinear pendulum
|
|
207
|
-
lmm physics --model pendulum --steps 300 --step-size 0.005
|
|
208
|
-
|
|
209
|
-
# SIR epidemic model
|
|
210
|
-
lmm physics --model sir --steps 1000 --step-size 0.5
|
|
211
|
-
|
|
212
|
-
# Damped harmonic oscillator (default)
|
|
213
|
-
lmm physics --model harmonic --steps 200
|
|
214
|
-
```
|
|
115
|
+
## 🟩 Node.js
|
|
215
116
|
|
|
216
|
-
|
|
117
|
+
The Node.js bindings are published to npm as **`@wiseaidev/lmm`** and are installed with `npm install @wiseaidev/lmm`. Built with [napi-rs](https://napi.rs/), the package ships a pre-compiled `.node` add-on with TypeScript type definitions.
|
|
217
118
|
|
|
218
|
-
|
|
219
|
-
Lorenz: 500 steps. Final xyz: [-8.900269690476492, -7.413716837503834, 29.311877708359006]
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
**SIR example:**
|
|
223
|
-
|
|
224
|
-
```sh
|
|
225
|
-
SIR: 1000 steps. Final [S,I,R]: [58.797367656865795, 7.649993277129408e-15, 941.2026323431321]
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
| Flag | Default | Description |
|
|
229
|
-
| ------------------- | ---------- | ---------------------------------------------- |
|
|
230
|
-
| `-m`, `--model` | `harmonic` | Model: `lorenz`, `pendulum`, `sir`, `harmonic` |
|
|
231
|
-
| `-s`, `--steps` | `200` | Number of integration steps |
|
|
232
|
-
| `-z`, `--step-size` | `0.01` | Step size Δt |
|
|
233
|
-
|
|
234
|
-
### 3. `discover`: Symbolic Regression
|
|
235
|
-
|
|
236
|
-
Runs Genetic Programming (GP) to discover a symbolic equation from data.
|
|
237
|
-
|
|
238
|
-
```sh
|
|
239
|
-
lmm discover --iterations 200
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
```sh
|
|
243
|
-
Discovered equation: (x + (1.002465056833142 + x))
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
The engine fits data points `(i*0.5, 2*i*0.5 + 1)` by default and finds the
|
|
247
|
-
underlying linear law. Increase `--iterations` for more complex datasets.
|
|
248
|
-
|
|
249
|
-
| Flag | Default | Description |
|
|
250
|
-
| -------------------- | ----------- | ------------------------------------------------ |
|
|
251
|
-
| `-d`, `--data-path` | `synthetic` | Data source (`synthetic` = built-in linear data) |
|
|
252
|
-
| `-i`, `--iterations` | `100` | Number of GP evolution iterations |
|
|
253
|
-
|
|
254
|
-
### 4. `consciousness`: Perceive → Predict → Act Loop
|
|
255
|
-
|
|
256
|
-
Runs one tick of the full consciousness loop: raw bytes → perception tensor →
|
|
257
|
-
world model prediction → action plan.
|
|
258
|
-
|
|
259
|
-
```sh
|
|
260
|
-
lmm consciousness --lookahead 5
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
```sh
|
|
264
|
-
Consciousness ticked. New state: [0.0019607843137254832, -0.24901960784313726, -0.37450980392156863, 0.5]
|
|
265
|
-
Mean prediction error: 0
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
| Flag | Default | Description |
|
|
269
|
-
| ------------------- | ------- | ---------------------------------- |
|
|
270
|
-
| `-l`, `--lookahead` | `3` | Multi-step lookahead horizon depth |
|
|
271
|
-
|
|
272
|
-
### 5. `causal`: Causal Graph + do-Calculus
|
|
273
|
-
|
|
274
|
-
Builds a 3-node Structural Causal Model (`x → y → z`) and applies an
|
|
275
|
-
intervention `do(node = value)`, printing before/after values.
|
|
276
|
-
|
|
277
|
-
```sh
|
|
278
|
-
# Intervene on x: set x = 10, observe how y and z change
|
|
279
|
-
lmm causal --intervene-node x --intervene-value 10.0
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
```sh
|
|
283
|
-
Before intervention: x=Some(3.0), y=Some(6.0), z=Some(7.0)
|
|
284
|
-
After do(x=10): x=Some(10.0), y=Some(20.0), z=Some(21.0)
|
|
285
|
-
```
|
|
119
|
+
For installation instructions, type definitions, and examples, see the **[Node.js usage guide](https://github.com/wiseaidotdev/lmm/blob/main/NODE.md)**.
|
|
286
120
|
|
|
287
|
-
|
|
121
|
+
## 🌐 WebAssembly (WASM)
|
|
288
122
|
|
|
289
|
-
- `
|
|
290
|
-
- `z = y + 1`
|
|
123
|
+
LMM natively targets `wasm32-unknown-unknown`. Because `reqwest` switches to the browser `fetch` API automatically, you can deploy LMM inside Rust frontend frameworks such as **Yew**, **Dioxus**, and **Leptos** without any additional glue code.
|
|
291
124
|
|
|
292
|
-
|
|
293
|
-
| ------------------------- | ------- | -------------------------------------- |
|
|
294
|
-
| `-n`, `--intervene-node` | `x` | Name of the node to intervene on |
|
|
295
|
-
| `-v`, `--intervene-value` | `1.0` | Value to set the node to (do-calculus) |
|
|
125
|
+
For CORS considerations, build steps, and usage details, see the **[WASM usage guide](https://github.com/wiseaidotdev/lmm/blob/main/WASM.md)**.
|
|
296
126
|
|
|
297
|
-
|
|
127
|
+
## 🤖 Agent Framework
|
|
298
128
|
|
|
299
|
-
|
|
129
|
+
The `lmm-agent` crate extends LMM with a fully autonomous, equation-based agent layer; no LLM, no API key, no training data.
|
|
300
130
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
lmm
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
```sh
|
|
310
|
-
Gradient of x²: [1.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 13.0]
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
```sh
|
|
314
|
-
Laplacian of x²: [0.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 0.0]
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
| Flag | Default | Description |
|
|
318
|
-
| ------------------- | ---------- | ------------------------------------ |
|
|
319
|
-
| `-s`, `--size` | `10` | Number of field points |
|
|
320
|
-
| `-o`, `--operation` | `gradient` | Operation: `gradient` or `laplacian` |
|
|
321
|
-
|
|
322
|
-
### 7. `encode`: Text → Symbolic Equation
|
|
323
|
-
|
|
324
|
-
This is the flagship demonstration of LMM's power. Any text is treated as a
|
|
325
|
-
sequence of byte values indexed by position. The GP engine discovers a symbolic
|
|
326
|
-
equation `f(x) ≈ byte[x]`. Integer residuals `(byte[x] - round(f(x)))` are
|
|
327
|
-
stored alongside the equation, guaranteeing **lossless round-trip recovery**.
|
|
328
|
-
|
|
329
|
-
```sh
|
|
330
|
-
lmm encode --text "The Pharaohs encoded reality in mathematics." \
|
|
331
|
-
--iterations 150 --depth 5
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
```sh
|
|
335
|
-
╔══════════════════════════════════════════════════════╗
|
|
336
|
-
║ 📐 Encode · GP Symbolic Compression ║
|
|
337
|
-
╚══════════════════════════════════════════════════════╝
|
|
338
|
-
|
|
339
|
-
📝 Input : "The Pharaohs encoded reality in mathematics."
|
|
340
|
-
📏 Length : 44 chars
|
|
341
|
-
|
|
342
|
-
-- Equation ----------------------------------
|
|
343
|
-
Equation: ((-12.541407707100985 * sin((-0.4 + ((x * x) * 0.8837323816189393)))) + 94.96615109151574)
|
|
344
|
-
Length: 44 chars
|
|
345
|
-
MSE: 530.1715
|
|
346
|
-
Max residual: 56
|
|
347
|
-
|
|
348
|
-
-- Encoded Data ------------------------------
|
|
349
|
-
{"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]}
|
|
350
|
-
|
|
351
|
-
-- Round-trip Verify -------------------------
|
|
352
|
-
✅ PERFECT
|
|
353
|
-
Decoded : "The Pharaohs encoded reality in mathematics."
|
|
354
|
-
|
|
355
|
-
💾 To decode later:
|
|
356
|
-
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"
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
> [!NOTE]
|
|
360
|
-
> 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.
|
|
361
|
-
|
|
362
|
-
```sh
|
|
363
|
-
# Encode from a file
|
|
364
|
-
lmm encode --input ./my_message.txt --iterations 200 --depth 5
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
| Flag | Default | Description |
|
|
368
|
-
| --------------- | ------------- | -------------------------------------------------- |
|
|
369
|
-
| `-i`, `--input` | `-` | Path to a text file to encode (`-` = use `--text`) |
|
|
370
|
-
| `-t`, `--text` | `Hello, LMM!` | Inline text (used when `--input` is `-`) |
|
|
371
|
-
| `--iterations` | `80` | GP evolution iterations |
|
|
372
|
-
| `--depth` | `4` | Maximum expression tree depth |
|
|
373
|
-
|
|
374
|
-
### 8. `decode`: Symbolic Equation → Text
|
|
375
|
-
|
|
376
|
-
Reconstructs the original text from the equation and residuals printed by `encode`.
|
|
377
|
-
|
|
378
|
-
```sh
|
|
379
|
-
lmm decode \
|
|
380
|
-
--equation "(95.09620435614187 - cos(x))" \
|
|
381
|
-
--length 44 \
|
|
382
|
-
--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"
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
```sh
|
|
386
|
-
╔══════════════════════════════════════════════════════╗
|
|
387
|
-
║ 🔓 Decode · Equation to Text ║
|
|
388
|
-
╚══════════════════════════════════════════════════════╝
|
|
389
|
-
|
|
390
|
-
📐 Equation : (95.09620435614187 - cos(x))
|
|
391
|
-
📏 Length : 44
|
|
392
|
-
|
|
393
|
-
-- Decoded Text ------------------------------
|
|
394
|
-
The Pharaohs encoded reality in mathematics.
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
| Flag | Required | Description |
|
|
398
|
-
| ------------------- | -------- | --------------------------------------------------------------------------- |
|
|
399
|
-
| `-e`, `--equation` | ✅ | Equation string (from `encode` output) |
|
|
400
|
-
| `-l`, `--length` | ✅ | Number of characters to recover |
|
|
401
|
-
| `-r`, `--residuals` | ✅ | Comma-separated residuals. Use `--residuals="-3,1,..."` for negative values |
|
|
402
|
-
|
|
403
|
-
> [!IMPORTANT]
|
|
404
|
-
> Use `--residuals="-3,..."` (with `=`) or quote the argument when residuals contain negative values to prevent the shell from treating them as flags.
|
|
405
|
-
|
|
406
|
-
### 9. `predict`: Symbolic Text Continuation
|
|
407
|
-
|
|
408
|
-
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**.
|
|
409
|
-
|
|
410
|
-
It does this by operating on three distinct, deterministic signals:
|
|
411
|
-
|
|
412
|
-
- **GP Trajectory Equation**: `f(pos) → word_byte_tone` (discovers long-range subject themes)
|
|
413
|
-
- **GP Rhythm Equation**: `g(pos) → word_length` (discovers alternating phonetic cadence)
|
|
414
|
-
- **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.
|
|
415
|
-
|
|
416
|
-
```sh
|
|
417
|
-
lmm predict --text "Wise AI built the first LMM" --window 10 --predict-length 80
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
```text
|
|
421
|
-
╔══════════════════════════════════════════════════════╗
|
|
422
|
-
║ 🔮 Predict · Symbolic Continuation ║
|
|
423
|
-
╚══════════════════════════════════════════════════════╝
|
|
424
|
-
|
|
425
|
-
📚 Dictionary: 63746 words loaded
|
|
426
|
-
📝 Input : "Wise AI built the first LMM"
|
|
427
|
-
🪟 Window : 6 words
|
|
428
|
-
📈 Trajectory: (x + 103.82300000000001)
|
|
429
|
-
🎵 Rhythm : (3.00402169780806 + sin(cos(cos(x))))
|
|
430
|
-
|
|
431
|
-
-- Continuation ------------------------------
|
|
432
|
-
Wise AI built the first LMM in the true soul often long time and an open path of a solid scope is the human
|
|
433
|
-
```
|
|
434
|
-
|
|
435
|
-
> [!NOTE]
|
|
436
|
-
> 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.
|
|
437
|
-
|
|
438
|
-
| Flag | Default | Description |
|
|
439
|
-
| ------------------------ | --------------------------------- | ------------------------------------------------ |
|
|
440
|
-
| `-i`, `--input` | `-` | Path to a text file (`-` = use `--text`) |
|
|
441
|
-
| `-t`, `--text` | `The Pharaohs encoded reality in` | Inline text seed |
|
|
442
|
-
| `-w`, `--window` | `32` | Context window in words |
|
|
443
|
-
| `-p`, `--predict-length` | `16` | Approximate character budget for continuation |
|
|
444
|
-
| `--iterations` | `80` | GP evolution iterations for the prediction model |
|
|
445
|
-
| `--depth` | `4` | Maximum expression tree depth |
|
|
446
|
-
| `--stochastic` | `false` | Enable synonym-based output randomization |
|
|
447
|
-
| `--probability` | `0.5` | Word replacement rate (0.0 = none, 1.0 = all) |
|
|
448
|
-
|
|
449
|
-
### 10. `summarize`: Key Sentence Extraction
|
|
450
|
-
|
|
451
|
-
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.
|
|
452
|
-
|
|
453
|
-
```sh
|
|
454
|
-
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
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
```sh
|
|
458
|
-
╔══════════════════════════════════════════════════════╗
|
|
459
|
-
║ ✂️ Summarize · Key Sentence Extraction ║
|
|
460
|
-
╚══════════════════════════════════════════════════════╝
|
|
461
|
-
|
|
462
|
-
📝 Input : 264 chars
|
|
463
|
-
📊 Extracting 2 key sentences via GP scoring...
|
|
464
|
-
|
|
465
|
-
-- Summary -----------------------------------
|
|
466
|
-
1. The ancient Egyptians built the pyramids using advanced mathematical knowledge.
|
|
467
|
-
2. Mathematics was their sacred language of cosmic alignment.
|
|
468
|
-
```
|
|
131
|
+
| Document | Description |
|
|
132
|
+
| -------- | ----------- |
|
|
133
|
+
| **[AGENT.md](AGENT.md)** | Architecture, quick-start, types, and async API reference |
|
|
134
|
+
| **[DERIVE.md](DERIVE.md)** | `#[derive(Auto)]` macro: generated traits and field contract |
|
|
135
|
+
| **[lmm-agent README](lmm-agent/README.md)** | Crate-level API reference, builder, and example |
|
|
136
|
+
| **[lmm-derive README](lmm-derive/README.md)** | Macro crate details and field rules |
|
|
469
137
|
|
|
470
|
-
|
|
471
|
-
| ------------------- | ------- | ---------------------------------- |
|
|
472
|
-
| `-t`, `--text` | `...` | Input text to summarize |
|
|
473
|
-
| `-n`, `--sentences` | `2` | Number of key sentences to extract |
|
|
474
|
-
| `--stochastic` | `false` | Enable synonym-based randomization |
|
|
475
|
-
| `--probability` | `0.5` | Word replacement rate (0.0 - 1.0) |
|
|
138
|
+
## 📰 Publications & Research
|
|
476
139
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
Generates a single, structurally elegant sentence. Add `--stochastic` to randomize word choices on each run - the mathematical structure stays fixed while synonyms vary.
|
|
480
|
-
|
|
481
|
-
```sh
|
|
482
|
-
lmm sentence --text "Mathematics is the language of the universe"
|
|
483
|
-
|
|
484
|
-
# With stochastic: different output every time
|
|
485
|
-
lmm sentence --text "Mathematics is the language of the universe" --stochastic
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
```sh
|
|
489
|
-
╔══════════════════════════════════════════════════════╗
|
|
490
|
-
║ ✍️ Sentence · Single Sentence Generation ║
|
|
491
|
-
╚══════════════════════════════════════════════════════╝
|
|
492
|
-
|
|
493
|
-
🌱 Seed : "Mathematics is the language of the universe"
|
|
494
|
-
|
|
495
|
-
-- Generated Sentence ------------------------
|
|
496
|
-
Analysis enables the dynamic meaning of the universe.
|
|
497
|
-
|
|
498
|
-
# --stochastic run 1:
|
|
499
|
-
Cognition enables the dynamic significance of the world.
|
|
500
|
-
|
|
501
|
-
# --stochastic run 2:
|
|
502
|
-
Purplish facilitates the dynamic meaning of the world.
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
| Flag | Default | Description |
|
|
506
|
-
| --------------- | ------- | ------------------------------------------------- |
|
|
507
|
-
| `-t`, `--text` | `...` | Seed topic |
|
|
508
|
-
| `--stochastic` | `false` | Randomize word synonyms each run |
|
|
509
|
-
| `--probability` | `0.5` | Fraction of eligible words to replace (0.0 - 1.0) |
|
|
510
|
-
|
|
511
|
-
### 12. `paragraph`: Cohesive Paragraph Generation
|
|
512
|
-
|
|
513
|
-
Chains multiple logically coherent sentences together, seeding subsequent sentence structures using extracted keywords from the original seed.
|
|
514
|
-
|
|
515
|
-
```sh
|
|
516
|
-
lmm paragraph --text "Equations reveal hidden truths about nature" --sentences 6
|
|
517
|
-
```
|
|
518
|
-
|
|
519
|
-
```sh
|
|
520
|
-
╔══════════════════════════════════════════════════════╗
|
|
521
|
-
║ 📄 Paragraph · Generate a Paragraph ║
|
|
522
|
-
╚══════════════════════════════════════════════════════╝
|
|
523
|
-
|
|
524
|
-
🌱 Seed : "Equations reveal hidden truths about nature"
|
|
525
|
-
📊 Sentences : 6
|
|
526
|
-
|
|
527
|
-
-- Generated Paragraph -----------------------
|
|
528
|
-
|
|
529
|
-
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.
|
|
530
|
-
```
|
|
531
|
-
|
|
532
|
-
| Flag | Default | Description |
|
|
533
|
-
| ------------------- | ------- | ------------------------------------------------- |
|
|
534
|
-
| `-t`, `--text` | `...` | Seed topic for paragraph generation |
|
|
535
|
-
| `-n`, `--sentences` | `4` | Number of sentences in the paragraph |
|
|
536
|
-
| `--stochastic` | `false` | Randomize word synonyms each run |
|
|
537
|
-
| `--probability` | `0.5` | Fraction of eligible words to replace (0.0 - 1.0) |
|
|
538
|
-
|
|
539
|
-
### 13. `essay`: Full Essay Blueprint
|
|
540
|
-
|
|
541
|
-
Generates a fully structured essay, complete with an introduction, mathematical body paragraphs based on derived sub-topics, and a cohesive conclusion.
|
|
542
|
-
|
|
543
|
-
```sh
|
|
544
|
-
lmm essay --text 'Symmetry and the deeper patterns of physics' --paragraphs 2 --sentences 15
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
```sh
|
|
548
|
-
╔══════════════════════════════════════════════════════╗
|
|
549
|
-
║ 📖 Essay · Generate a Full Essay ║
|
|
550
|
-
╚══════════════════════════════════════════════════════╝
|
|
551
|
-
|
|
552
|
-
🌱 Topic : "Symmetry and the deeper patterns of physics"
|
|
553
|
-
📊 Paragraphs : 2 (15 sentences each)
|
|
554
|
-
|
|
555
|
-
-- Essay -------------------------------------
|
|
556
|
-
|
|
557
|
-
══════════════════════════════════════
|
|
558
|
-
📖 Symmetry And The Deeper Patterns Of Physics
|
|
559
|
-
══════════════════════════════════════
|
|
560
|
-
|
|
561
|
-
-- Introduction ------------------------------
|
|
562
|
-
|
|
563
|
-
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.
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
-- Body · §1 ---------------------------------
|
|
567
|
-
|
|
568
|
-
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.
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
-- Body · §2 ---------------------------------
|
|
572
|
-
|
|
573
|
-
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.
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
-- Conclusion --------------------------------
|
|
577
|
-
|
|
578
|
-
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.
|
|
579
|
-
```
|
|
580
|
-
|
|
581
|
-
| Flag | Default | Description |
|
|
582
|
-
| -------------------- | ------- | ------------------------------------------------- |
|
|
583
|
-
| `-t`, `--text` | `...` | Topic or title seed for the essay |
|
|
584
|
-
| `-n`, `--paragraphs` | `2` | Number of body paragraphs to generate |
|
|
585
|
-
| `-s`, `--sentences` | `3` | Number of sentences per paragraph |
|
|
586
|
-
| `--stochastic` | `false` | Randomize word synonyms each run |
|
|
587
|
-
| `--probability` | `0.5` | Fraction of eligible words to replace (0.0 - 1.0) |
|
|
588
|
-
|
|
589
|
-
### 14. `ask`: Internet-Aware Knowledge Synthesis _(requires `net` feature)_
|
|
590
|
-
|
|
591
|
-
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.
|
|
592
|
-
|
|
593
|
-
```sh
|
|
594
|
-
lmm ask --prompt "What is the Rust programming language?" --limit 5 --sentences 3
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
```sh
|
|
598
|
-
╔══════════════════════════════════════════════════════╗
|
|
599
|
-
║ 🌐 Ask · Internet-Aware Knowledge Synthesis ║
|
|
600
|
-
╚══════════════════════════════════════════════════════╝
|
|
601
|
-
|
|
602
|
-
❓ Prompt : "What is the Rust programming language?"
|
|
603
|
-
|
|
604
|
-
-- DuckDuckGo Results ------------------------
|
|
605
|
-
Rust (programming language)
|
|
606
|
-
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.
|
|
607
|
-
Abstract Source: Wikipedia
|
|
608
|
-
Abstract URL: https://en.wikipedia.org/wiki/Rust_(programming_language)
|
|
609
|
-
Image URL: https://duckduckgo.com/i/832f249b21809a13.png
|
|
610
|
-
1. Rust (programming language) Category
|
|
611
|
-
URL: https://duckduckgo.com/c/Rust_(programming_language)?kp=%2D2
|
|
612
|
-
--------------------------------------------
|
|
613
|
-
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.
|
|
614
|
-
URL: https://duckduckgo.com/History_of_programming_languages?kp=%2D2
|
|
615
|
-
--------------------------------------------
|
|
616
|
-
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.
|
|
617
|
-
URL: https://duckduckgo.com/Outline_of_the_Rust_programming_language?kp=%2D2
|
|
618
|
-
--------------------------------------------
|
|
619
|
-
4. Pattern matching programming languages
|
|
620
|
-
URL: https://duckduckgo.com/c/Pattern_matching_programming_languages?kp=%2D2
|
|
621
|
-
--------------------------------------------
|
|
622
|
-
5. Multi-paradigm programming languages
|
|
623
|
-
URL: https://duckduckgo.com/c/Multi-paradigm_programming_languages?kp=%2D2
|
|
624
|
-
--------------------------------------------
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
-- LMM Response ------------------------------
|
|
628
|
-
Rust is a general-purpose programming language.
|
|
629
|
-
Rust supports multiple programming paradigms.
|
|
630
|
-
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.
|
|
631
|
-
```
|
|
632
|
-
|
|
633
|
-
> [!NOTE]
|
|
634
|
-
> The `ask` command requires building with `--features cli,net`. No API key is needed.
|
|
635
|
-
|
|
636
|
-
| Flag | Default | Description |
|
|
637
|
-
| ------------------- | -------- | ------------------------------------------------- |
|
|
638
|
-
| `-p`, `--prompt` | required | The question or search query |
|
|
639
|
-
| `-l`, `--limit` | `5` | Maximum number of search results to fetch |
|
|
640
|
-
| `-n`, `--sentences` | `3` | Number of key sentences to extract |
|
|
641
|
-
| `--region` | `wt-wt` | DuckDuckGo region code (e.g. `us-en`, `uk-en`) |
|
|
642
|
-
| `--iterations` | `40` | GP scoring iterations |
|
|
643
|
-
| `--depth` | `3` | Maximum GP expression depth |
|
|
644
|
-
| `--stochastic` | `false` | Randomize word synonyms in the answer |
|
|
645
|
-
| `--probability` | `0.5` | Fraction of eligible words to replace (0.0 - 1.0) |
|
|
646
|
-
|
|
647
|
-
### 15. `imagen`: Spectral Field Synthesis Image Generation
|
|
648
|
-
|
|
649
|
-
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.
|
|
650
|
-
|
|
651
|
-
```sh
|
|
652
|
-
lmm imagen --prompt "The ancient Egyptians built the pyramids with mathematical precision" \
|
|
653
|
-
--width 512 --height 512 --style plasma --palette warm --components 12 --output ./egypt.ppm
|
|
654
|
-
```
|
|
655
|
-
|
|
656
|
-
```sh
|
|
657
|
-
╔══════════════════════════════════════════════════════╗
|
|
658
|
-
║ 🎨 Imagen · Spectral Field Synthesis ║
|
|
659
|
-
╚══════════════════════════════════════════════════════╝
|
|
660
|
-
|
|
661
|
-
🖼 Prompt : "The ancient Egyptians built the pyramids with mathematical precision"
|
|
662
|
-
📐 Dimensions : 512x512
|
|
663
|
-
🎭 Style : plasma
|
|
664
|
-
🎨 Palette : warm
|
|
665
|
-
🌊 Components : 12
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
-- Rendering ---------------------------------
|
|
669
|
-
✅ Saved to: ./egypt.ppm
|
|
670
|
-
```
|
|
671
|
-
|
|
672
|
-
| Flag | Default | Description |
|
|
673
|
-
| -------------------- | ------------ | ------------------------------------------------------------------- |
|
|
674
|
-
| `-p`, `--prompt` | required | The text prompt to hash into the spectral seed |
|
|
675
|
-
| `--width` | `512` | Image width in pixels |
|
|
676
|
-
| `--height` | `512` | Image height in pixels |
|
|
677
|
-
| `-c`, `--components` | `8` | Number of cosine wave components per channel |
|
|
678
|
-
| `-s`, `--style` | `plasma` | Transform: `wave`, `radial`, `orbital`, `fractal`, `flow`, `plasma` |
|
|
679
|
-
| `--palette` | `auto` | Color palette: `warm`, `cool`, `neon`, `mono`, `auto` |
|
|
680
|
-
| `-o`, `--output` | `output.ppm` | Output file path or directory (auto-names if dir) |
|
|
681
|
-
|
|
682
|
-
## 🔬 Architecture Deep Dive
|
|
683
|
-
|
|
684
|
-
### Genetic Programming Symbolic Regression
|
|
685
|
-
|
|
686
|
-
```mermaid
|
|
687
|
-
flowchart TD
|
|
688
|
-
A["Seeded population\n(linear/quadratic/periodic templates + random)"]
|
|
689
|
-
B["Evaluate fitness\nMDL = n·ln(MSE) + complexity·ln(2)"]
|
|
690
|
-
C["Tournament selection (k=5)"]
|
|
691
|
-
D["Crossover & mutation"]
|
|
692
|
-
E["Reject constant collapse\n(inject fresh random expr 70% of the time)"]
|
|
693
|
-
F{Iterations done?}
|
|
694
|
-
G["Best variable-containing expression (simplified)"]
|
|
695
|
-
|
|
696
|
-
A --> B --> C --> D --> E --> F
|
|
697
|
-
F -- No --> B
|
|
698
|
-
F -- Yes --> G
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
### Multi-Signal Prediction Engine
|
|
702
|
-
|
|
703
|
-
```mermaid
|
|
704
|
-
flowchart TD
|
|
705
|
-
In["Context Window\n(Recent Tokens)"]
|
|
706
|
-
|
|
707
|
-
In -->|Train| M["2nd-Order Markov Chain\nTransition probabilities"]
|
|
708
|
-
In -->|GP Fit| T["Word-ID Trajectory GP\nf(pos) ≈ word_id"]
|
|
709
|
-
In -->|GP Fit| R["Word-Length Rhythm GP\ng(pos) ≈ length"]
|
|
710
|
-
|
|
711
|
-
In --> S["Suffix Pattern Matcher"]
|
|
712
|
-
|
|
713
|
-
S -- "Match Found" --> Out["Exact Phrase Continuation"]
|
|
714
|
-
S -- "No Match" --> Score["Composite Scorer"]
|
|
715
|
-
|
|
716
|
-
M --> Score
|
|
717
|
-
T --> Score
|
|
718
|
-
R --> Score
|
|
719
|
-
|
|
720
|
-
Score -->|Lowest Score| W["Select Best Word from Vocab"]
|
|
721
|
-
W -->|Update Recency| Out
|
|
722
|
-
```
|
|
723
|
-
|
|
724
|
-
### Stochastic Synonym Enhancement
|
|
725
|
-
|
|
726
|
-
When `--stochastic` is enabled, the deterministic output is piped through the `StochasticEnhancer` layer, which draws from two synonym sources:
|
|
727
|
-
|
|
728
|
-
```mermaid
|
|
729
|
-
flowchart TD
|
|
730
|
-
T["Deterministic Text Output\n(sentence / paragraph / essay / summary)"] --> TOK["Tokenizer\n(split words, strip punctuation)"]
|
|
731
|
-
|
|
732
|
-
TOK --> STW{Stop Word?}
|
|
733
|
-
STW -- Yes --> KEEP["Keep Original Word"]
|
|
734
|
-
STW -- No --> PROB{"Random(0,1) < probability?"}
|
|
735
|
-
|
|
736
|
-
PROB -- No --> KEEP
|
|
737
|
-
PROB -- Yes --> CUR["Curated Synonym Table\n(100+ scientific / mathematical terms)"]
|
|
738
|
-
|
|
739
|
-
CUR -- Found --> SYN["Pick Random Synonym"]
|
|
740
|
-
CUR -- Not Found --> WL["System Dictionary Fallback\n(/usr/share/dict/words)\ngrouped by word length"]
|
|
741
|
-
WL -- Found --> SYN
|
|
742
|
-
WL -- Not Found --> KEEP
|
|
743
|
-
|
|
744
|
-
SYN --> CASE["Restore Capitalization\n& Punctuation"]
|
|
745
|
-
KEEP --> CASE
|
|
746
|
-
CASE --> OUT["Stochastic Output\n(unique each run)"]
|
|
747
|
-
```
|
|
748
|
-
|
|
749
|
-
### Spectral Field Synthesis Image Generation
|
|
750
|
-
|
|
751
|
-
```mermaid
|
|
752
|
-
flowchart TD
|
|
753
|
-
P["Text Prompt"] -->|FNV-1a Hash| S["64-bit Spectral Seed"]
|
|
754
|
-
S --> W_R["Generate Red Wave Components\n(Freq, Amp, Phase)"]
|
|
755
|
-
S --> W_G["Generate Green Wave Components\n(Freq, Amp, Phase)"]
|
|
756
|
-
S --> W_B["Generate Blue Wave Components\n(Freq, Amp, Phase)"]
|
|
757
|
-
|
|
758
|
-
W_R --> F["Evaluate F(x,y) = Σ A_k·cos(2π·f_x·x + 2π·f_y·y + φ_k)\nacross all (x,y) pixels"]
|
|
759
|
-
W_G --> F
|
|
760
|
-
W_B --> F
|
|
761
|
-
|
|
762
|
-
F --> T["Apply Non-linear Style Transform\n(Wave, Radial, Fractal, etc.)"]
|
|
763
|
-
T --> C["Map to Palette\n(Bias + Amp·sin(v))"]
|
|
764
|
-
C --> O["PPM Image Output"]
|
|
765
|
-
```
|
|
766
|
-
|
|
767
|
-
### RK45 Adaptive Integrator
|
|
768
|
-
|
|
769
|
-
All Butcher-tableau coefficients are named package-level constants:
|
|
770
|
-
|
|
771
|
-
```rust
|
|
772
|
-
const RK45_A41: f64 = 1932.0 / 2197.0;
|
|
773
|
-
const RK45_A42: f64 = -7200.0 / 2197.0;
|
|
774
|
-
const RK45_A43: f64 = 7296.0 / 2197.0;
|
|
775
|
-
const RK45_B5_1: f64 = 16.0 / 135.0;
|
|
776
|
-
// ... etc.
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
Step size is adapted each iteration using the error estimate:
|
|
780
|
-
|
|
781
|
-
```sh
|
|
782
|
-
h_new = 0.9 · h · (tol / error)^0.2
|
|
783
|
-
```
|
|
784
|
-
|
|
785
|
-
## 📰 Publications & Blog Posts
|
|
786
|
-
|
|
787
|
-
### Official Whitepaper
|
|
788
|
-
|
|
789
|
-
The architecture, formal mathematics, and paradigm behind the framework are fully documented in our official whitepaper.
|
|
790
|
-
**[Read the Whitepaper (PDF)](papers/lmm.pdf)**
|
|
140
|
+
The architecture, formal mathematics, and paradigm are fully documented in the official whitepaper:
|
|
141
|
+
**[Read the Whitepaper (PDF)](papers/lmm.pdf)**.
|
|
791
142
|
|
|
792
143
|
### Blog Posts
|
|
793
144
|
|
|
794
|
-
- [LLMs are
|
|
795
|
-
- [Training Is An Evil Concept. LMMs Eliminates It Altogether](https://wiseai.dev/blogs/training-is-an-evil-concept-lmms-eliminates-it-altogether):
|
|
145
|
+
- [LLMs are Useful. LMMs will Break Reality](https://wiseai.dev/blogs/llms-are-usefull-lmms-will-break-reality): the original post that started this project.
|
|
146
|
+
- [Training Is An Evil Concept. LMMs Eliminates It Altogether](https://wiseai.dev/blogs/training-is-an-evil-concept-lmms-eliminates-it-altogether): ethical, architectural, and data advantages of training-free models.
|
|
796
147
|
|
|
797
148
|
## 📝 Citation
|
|
798
149
|
|
|
@@ -810,8 +161,14 @@ If you use LMM in your research, please cite our whitepaper:
|
|
|
810
161
|
|
|
811
162
|
## 🤝 Contributing
|
|
812
163
|
|
|
813
|
-
Contributions are welcome! Feel free to open issues or pull requests.
|
|
164
|
+
Contributions are welcome! Feel free to open issues or pull requests on [GitHub](https://github.com/wiseaidotdev/lmm).
|
|
165
|
+
|
|
166
|
+
## 📄 License
|
|
167
|
+
|
|
168
|
+
Licensed under the [MIT License](LICENSE).
|
|
169
|
+
|
|
170
|
+
## ⭐ Star Us
|
|
814
171
|
|
|
815
|
-
|
|
172
|
+
If you use or enjoy LMM, please leave us a star on [GitHub](https://github.com/wiseaidotdev/lmm)! It helps others discover the project and keeps the momentum going ☕.
|
|
816
173
|
|
|
817
|
-
|
|
174
|
+
[](https://star-history.com/#wiseaidotdev/lmm&Date)
|