Loading repository data…
Loading repository data…
infinition / repository
BeamForge is an experimental text generation engine coded in Rust from scratch. Unlike modern LLMs that use extremely demanding deep neural networks, BeamForge relies on a stochastic semantic graph coupled with a Beam Search algorithm.
An experimental text generation engine written in Rust from scratch. Instead of neural networks, BeamForge uses a stochastic semantic graph paired with a Beam Search algorithm. The goal is to explore what you can get from classical probabilistic methods with fast native tokenization and online learning.
Tokenization: Raw text is converted to u32 identifiers. During generation the model works with integer arrays rather than strings, which keeps memory and CPU usage low.
Beam Search: Rather than greedy next-token selection, the algorithm explores multiple candidate sequences in parallel (BEAM_WIDTH = 5) and picks the globally highest-scoring completion. Scores are normalized by length to prevent the model from padding endlessly.
Online learning: Every declarative sentence typed by the user updates synaptic weights in real time. No training epochs, no restart.
Binary persistence: The brain state saves and loads via bincode. Fast enough to use between sessions.
The SemanticMesh brain uses three learning structures:
w1 + w2 -> target. Strict two-word context to a third.w2 -> target. Used when the strict context is unknown.Requires Rust (stable).
Windows:
winget install --id Rustlang.Rustup -e
rustup default stable
Linux / macOS:
curl https://sh.rustup.rs -sSf | sh
source "$HOME/.cargo/env"
Run:
cargo run --bin beamforge
Release build:
cargo build --release --bin beamforge
# target/release/beamforge
Once running, a YOU > prompt appears.
?. The model runs Beam Search and prints a response prefixed with BEAMFORGE:.Commands:
| Command | Effect |
|---|---|
/train [folder] | Ingest all .txt and .md files in a folder |
/save | Save the current brain to beamforge.brain |
/load | Reload a previously saved brain |
/quit | Exit |
MIT.