ββββββ βββββββββββ ββββββ ββββββ
ββββββββββ ββββββββββββββββββββ ββββββ
βββ βββββ ββββ β β ββββββββββββββ
ββββ ββββ ββββββββ βββββββββ ββββ
ββββ ββββββ ββββββββ ββββ βββ ββββ
βββββ ββββββ ββββ β ββββ ββββ
ββββββββββββ βββββ βββββ βββββ
ββββββ ββ βββββ βββββ βββββ
"Quantum Frequency Modulation" β an alternative to attention matrices.
OSINT-Fanned Β· Pre-Tokenize Γ3 Β· Local Model Β· Lattice Next-Token
The first single-file HTML agent that discards classical attention matrices
in favor of a quantum-inspired frequency lattice and oscillator collapse.
What is QFM?
Quantum Frequency Modulator is a radical departure from transformer-style language models.
Instead of computing attention scores over token embeddings, QFM:
- Pre-tokenizes the prompt and fans it out across allow-listed OSINT sources (Dictionary API, Datamuse, Wikipedia, DuckDuckGo).
- Builds a local evidence corpus and a weighted n-gram / POS / resonance predictor.
- Maps every content word onto a frequency lattice (80 Hz β 1600 Hz base range, forced up to 4800 Hz).
- Drives four real-time audio oscillators (Kick-off, Next-Token Γ3, Lattice, Superposition).
- Accumulates interference patterns into a decaying signature vector.
- Performs a spectral collapse (DFT) to obtain the dominant frequency, centroid, spread, and peak statistics.
- Emits a coherent draft via lattice-guided next-token prediction β all inside a single HTML file.
No GPU. No model weights. No attention matrix.
Just pure frequency, phase, and local evidence.
For a full breakdown and more info on the conceot/theory download this PDF:
Core Innovation β Attention β Lattice
| Classical Transformer | QFM Lattice Agent |
|---|---|
| Softmax attention scores | Oscillator interference peaks |
| QKV projections | Frequency + partials from embeddings |
| Residual stream | Decaying signature accumulator |
| Softmax temperature | Peak threshold + force multiplier |
| Next-token logits | Resonance + bigram + POS + hot-set |
| Softmax sampling | Spectral collapse β dominant bin |
The lattice replaces the quadratic attention matrix with a fixed-size interference field (LATTICE_N = 256) whose spectrum is continuously tracked. Token selection is biased by the current dominant frequency bin, creating a closed audio-visual-linguistic loop.
Architecture Overview
User Prompt
β
βΌ
ββββββββββββββββββββββββ
β Pre-Tokenize Γ3 β β content words only
β + Intent Detection β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β OSINT Fan (parallel)β
β β’ Dictionary β
β β’ Datamuse (sem) β
β β’ Wikipedia β
β β’ DuckDuckGo β
β + IndexedDB cache β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β PRE-LLM Race β (optional, 3 free models)
β openai / mistral / β
β llama via Pollinations
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Local Predictor β
β Unigram + Bigram + β
β Trigram + Skip + β
β POS + Resonance + β
β Hot/Related/Prompt β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Oscillator Forward β
β A Β· Anchor β
β B Β· Forced Γ3 β
β C Β· Lattice beat β
β D Β· Superposition β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Signature + DFT β
β Collapse β DOM Freq β
ββββββββββββ¬ββββββββββββ
β
βΌ
Final Draft
(validated against
evidence sources)
Features
- True single-file PWA β no build step, no dependencies, works offline after first load
- Audio-reactive UI β four live oscillators + master waveform + live frequency band
- Sequence graph β predicted-token timeline with peak lighting
- Local model layer β IndexedDB persistence for words, queries, and LLM responses
- OSINT allow-list only β dictionaryapi.dev, datamuse, Wikipedia, DuckDuckGo, Pollinations
- Validation gate β prompt ratio + evidence ratio with source attribution
- Master volume knob with persistence
- Mobile-ready with safe-area insets and responsive layout
- Service Worker + Manifest injected at runtime
Quick Start
- Download
qfm.html - Open it in any modern browser (Chrome / Edge / Firefox / Safari)
- Click POWER to enable audio (required for full experience)
- Type a prompt and press RUN (or Enter)
Example prompt already loaded:
What is a photon, and can you make me a simple HTML page about light?
Technical Constants
| Parameter | Value | Meaning |
|---|---|---|
EMB_DIM |
64 | Character n-gram embedding size |
LATTICE_N |
256 | Interference field resolution |
FFT_PAD |
1024 | DFT zero-padding |
F_MIN / F_MAX |
80 β 1600 Hz | Base frequency range |
FORCE_MULT |
3 | Forced frequency multiplier for B |
PEAK_THRESHOLD |
0.62 | Interference peak detection |
MAX_GEN_TOKENS |
64 | Hard ceiling on lattice generation |
PRE_MODELS |
openai, mistral, llama | Parallel free LLM race |
Pipeline Stages (visible in UI)
| Stage | Description |
|---|---|
| PRE-TOKENIZE | Token extraction + OSINT fan + optional PRE-LLM |
| PREDICT | Lattice forward pass with live oscillator update |
| COLLAPSE | Full DFT on signature β dominant frequency |
| OUTPUT | Draft assembly + validation + optional POST-LLM |
All latencies (PRE MS, GEN MS, COLLAPSE MS) are reported in real time.
Design Philosophy
QFM was built under a strict constraint set:
- Zero external JavaScript dependencies
- Zero model weight files
- Completely transparent computation (every frequency, every peak, every source is visible)
- Audio is not decorative β it is the computational substrate
- The lattice is the attention mechanism
This makes QFM both a research prototype and a usable local agent that can run on air-gapped machines after the initial OSINT cache is populated.
Limitations
- Generation quality is bounded by the quality and coverage of the OSINT evidence + local n-gram statistics
- Maximum draft length is intentionally short (controlled by
MAX_GEN_TOKENSand sentence termination rules) - Free LLM endpoints (Pollinations) are rate-limited and may fail; the lattice still produces a draft
- Audio requires user gesture on most browsers
- Not a replacement for large language models on open-ended creative or long-form tasks
License
MIT License by webxos.netlify.app (github.com/webxos)
Citation
If you use or build upon QFM, please cite:
@misc{qfm2025,
title = {Quantum Frequency Modulator: Replacing Attention Matrices with Oscillator Lattice Collapse},
author = {webXOS},
year = {2025},
url = {huggingface.co/webxos}
}