This single-file PWA that turns words into noise frequencies, collides them in a lattice, and drafts text from the resulting signature — an experiment in frequency-domain next-token prediction as an alternative to transformer attention.
Test it for free at: https://agentowl.netlify.app/qfm
Modern large language models (ChatGPT, Claude, Gemini, Llama, etc.) all share the same core engine: the transformer attention mechanism. Tokens are projected into high-dimensional vectors, every token looks at every other token (or a sliding window of them), and the resulting weighted sum becomes the next prediction.
The Quantum Frequency Modulator (QFM) asks a different question:
What if next-token prediction did not need attention matrices at all?
What if words were turned into frequencies, those frequencies interfered with each other inside a lattice, and the final spectral signature was what drove the next word?
QFM is a pure experiment in that direction. It is a single offline-first HTML page that implements an OSINT-fanned lattice agent. No server-side model weights, no attention heads, no recurrent state beyond a running frequency signature. Everything runs in the browser.
This article explains what it is, how the pipeline works, and why the approach is interesting as an alternative to the dominant attention paradigm.
What QFM Actually Is
QFM is a black-and-white visual studio with four live oscillators, a master waveform, a sequence graph, and a right-hand pipeline panel. Color appears only on live frequency bands.
The conceptual goal is deliberately narrow:
Four independent sound oscillators convert words into noise frequencies. A tiny in-browser embedding model plus free LLM endpoints turn those frequencies into tokens. The fourth oscillator holds the pure superposition of the first three and collapses into a final frequency signature that drives the draft.
No recurrence. No attention matrix. Forward wave only.
The page is both a functional text generator and a real-time audio-visual instrument. You can hear the prediction happening.
The High-Level Pipeline
- Pre-tokenize (OSINT fan + local model)
- Anchor the first content word as a frequency
- Oscillator forward pass that predicts the remaining tokens
- Lattice collision + signature accumulation
- Spectral collapse
- Assemble and validate the draft
Optional post-LLM rewrite is present in the code but disabled by default to keep latency low.
Stage 1 — Pre-Tokenize
Before any oscillator starts, QFM builds a small evidence package:
- Content-word extraction (function words are dropped)
- Intent detection (explain / question / code / creative / statement)
- Parallel OSINT fan:
- Free Dictionary API (definitions + part-of-speech)
- Datamuse (related words)
- Wikipedia summary
- DuckDuckGo Instant Answer
- Local IndexedDB cache of previous word resolutions
- Optional race across free LLM endpoints (openai / mistral / llama aliases via Pollinations) for a short “pre-read”
The pre-read is validated against the gathered evidence. If the remote model drifts too far from the corpus terms, QFM falls back to a purely local pre-read. This stage is the only place traditional LLMs are used as a helper; they are not the token predictor.
Stage 2 — Frequency Embedding
Every word is turned into a 64-dimensional vector using:
- Character n-gram features (2–4 grams)
- Optional POS bias
- Optional related-word semantic blend
That vector is projected onto a fixed random direction to produce a frequency in a fixed band (roughly 80 Hz – 1600 Hz). The same embedding also yields a set of partials (ratios + gains) that drive the additive oscillators.
Related nouns therefore land near the same frequency regions. This is the entire “model.” There is no learned transformer weight matrix.
Stage 3 — The Four Oscillators
Oscillator A — Kick-off
Seeds the first content word’s frequency and starts the wave.
Oscillator B — Next-token ×3
Receives the predicted token’s frequency, often forced upward by a multiplier so the prediction is audible and distinct.
Oscillator C — Lattice
Computes the collision between the anchor frequency and the current prediction frequency. Constructive interference produces high peak ratios; those peaks become the visual and scoring signal.
Oscillator D — Superposition
Holds a running sum of the interference signatures. At the end of the pass it is the only oscillator left running; its final dominant frequency is the collapsed signature of the entire draft.
Audio is synthesized with a lightweight multi-partial engine (AudioWorklet when available, ScriptProcessor fallback). The same parameters that drive the visuals drive the sound. Prediction and sonification are the same process.
Stage 4 — Lattice Next-Token Prediction
This is the heart of the experiment and the clearest departure from attention.
A small bigram / trigram predictor is built on the fly from a weighted corpus:
- The pre-read text (highest weight)
- Dictionary definitions
- Wikipedia and DuckDuckGo snippets
- The original prompt tokens
At each step the predictor scores candidate next words using:
- Local n-gram statistics from the corpus
- Frequency proximity to the current dominant signature
- Hot-set boosts (words that appeared in the pre-read or related terms)
- Recent-token repetition penalties
- Proper-noun preservation
- Simple loop-breaking rules
There is no query-key-value attention. There is no softmax over a vocabulary of 50k+ tokens. The candidate set is small and local. The “attention” is replaced by frequency collision strength and spectral continuity.
Tokens are emitted in a paced sweep so the oscillators and sequence graph can be watched in real time. The draft is deliberately bounded (hard caps on tokens and sentences) so latency stays predictable.
Stage 5 — Collapse and Output
After the prediction loop finishes, a full DFT is taken of the accumulated signature. The dominant bin becomes the final collapse frequency. Oscillator D is driven hard to that frequency for a short hold, then faded.
The sequence of predicted tokens is assembled into readable text, proper nouns are restored, frequency-unit leakage is sanitized, and a lightweight term-support validation runs against the original evidence package. The result is shown as the “oscillator draft.”
If the optional post-model stage is enabled, a second free LLM can attempt a rewrite conditioned on the draft and the spectral summary. In the default configuration that stage is off; the lattice draft is the answer.
How This Differs from Attention and Modern LLMs
Transformer attention asks: “Given every previous token’s representation, which ones should influence the next prediction and by how much?”
QFM asks: “Given the running frequency signature of the tokens so far, which next word continues the spectral trajectory most coherently inside this local evidence lattice?”
Key differences:
- No quadratic attention matrix. Memory and compute stay bounded by the small candidate set and a fixed-size signature buffer.
- No large learned weight matrices. The only “model” is the character n-gram embedder plus the ephemeral corpus statistics.
- Prediction is forward-only and non-recurrent beyond the signature accumulator.
- The same process that predicts also produces audible and visible interference. You can hear when the lattice is constructive or destructive.
- Remote LLMs are used only for optional evidence gathering and optional polishing. The core next-token step is local and frequency-driven.
- Latency is intentionally kept roughly constant; the system does not scale compute with prompt length the way long-context transformers do.
This is not a claim that frequency lattices will replace transformers for general intelligence. It is a working demonstration that a completely different inductive bias — spectral continuity inside a constrained evidence lattice — can produce coherent short drafts without ever computing an attention head.
Why the Experiment Matters
Most current open-source work still orbits the same transformer skeleton. QFM deliberately steps outside it.
It shows that:
- A tiny deterministic embedder + local statistics can drive usable next-token decisions when the domain is constrained by OSINT evidence.
- Frequency-domain representations give an orthogonal axis for scoring candidates (how well a word continues the current spectrum) that is independent of discrete token IDs.
- Coupling prediction to real-time audio synthesis creates an immediate human-interpretable signal of model behavior.
- Single-file, offline-first PWAs can host non-trivial experimental agents without API keys or server-side inference.
The success criteria listed in the original conceptual guide are still the right ones to watch:
- Related nouns should produce consistent color/frequency peaks.
- Latency should stay roughly stable across prompt lengths.
- The final draft should remain coherent with the original prompt and the gathered evidence.
Those criteria are testable on every run.
Closing
QFM is not a better ChatGPT. It is a different instrument.
Test it for free at: https://agentowl.netlify.app/qfm
It treats language as a wave that can be modulated, collided, and collapsed rather than as a sequence of discrete symbols that must attend to one another. The result is a strange, audible, visual, and fully browser-native form of next-token prediction.
Whether frequency lattices scale, whether they can be hybridized with attention, or whether they remain a pure research curiosity is still open. The point of the page is to make the alternative concrete enough that you can run it, hear it, and decide for yourself.
Open the single HTML file, type a prompt, press RUN, and watch the oscillators decide the next token by the shape of the interference.

Top comments (0)