Inference-time activation steering for local LLMs: a research prototype that applies physics-inspired forces to model activations during generation. Includes multi-seed, blind-judged benchmarks and honest results. Active work continues in niodoo-hidden-state-steering.
Rust
0
30 commits
updated Aug 23, 2026
Inference-time activation steering for local LLM generation (physics-inspired forces on activations — no weight updates).
Lead: Jason Van Pham (Ruffian-L) — direction and final implementation. Built with: Grok · Claude / Claude Code · ChatGPT / Codex · Gemini. Built with Llama (Meta) — GGUF path in experiments.
Archive + experiment log of early physics-steering work.
Active research direction: niodoo-hidden-state-steering. Live residual harness: hydrodynamic-swarm.
| Strength | Where |
|---|---|
| Primary bench | PARB multi-seed — Niodoo 29.9% vs baseline 41.6% |
| Selective trap wins | Documented behavior on reasoning-trap prompts |
| Runnable prototype | Candle GGUF + force knobs (see commands below) |
| What it is not | Production library · SOTA · consciousness |
| Purpose | Write-up of early force vocabulary and prompt experiments |
Niodoo applies a small set of steering terms during generation:
| Term | Purpose |
|---|---|
| Repulsion | Push away from recently visited states or repeated local attractors. |
| Gravity / ghost vector | Pull generation back toward prompt context. |
| Layer banding | Apply forces only to later semantic layers instead of all layers. |
| Dynamic ramp | Delay and gradually scale forces near the start of generation. |
| Telemetry | Emit per-token force values for inspection. |
The default command path uses GGUF model loading through Candle and exposes
parameters such as --physics-blend, --repulsion-strength,
--gravity-well, --physics-start-layer, and --physics-end-layer.
The strongest evidence in this repo is the multi-seed PARB run:
artifacts/parb_rigorous_clean.json2025-12-19T01:45:05| System | Mean score | Percentage |
|---|---|---|
| Baseline Llama 3.1 8B | 32.0 / 77 | 41.6% |
| Niodoo | 23.0 / 77 | 29.9% |
Question-level winner counts:
| Outcome | Count |
|---|---|
| Baseline higher | 28 |
| Niodoo higher | 15 |
| Tie | 34 |
Interpretation:
An earlier single-seed review is also included:
artifacts/parb_comparison_review.jsonTreat the single-seed result as a historical experiment. The multi-seed blind-judged run above is the more robust result.
Examples from the multi-seed artifact where Niodoo scored higher than baseline:
| Prompt type | Baseline | Niodoo |
|---|---|---|
| Pound of lead vs feathers | 0.6 | 1.0 |
| Divide 30 by half and add 10 | 0.2 | 0.4 |
| Three pills every half hour | 0.0 | 0.4 |
Examples where baseline scored higher:
| Prompt type | Baseline | Niodoo |
|---|---|---|
| Moses illusion | 0.6 | 0.2 |
| Floating ice cube water level | 1.0 | 0.2 |
| Months with 28 days | 1.0 | 0.0 |
The useful result is not deterministic correctness. It is observable behavior change: steering can induce exploration, but the same mechanism can also over-correct or introduce artifacts.
Build:
git clone https://github.com/Ruffian-L/Niodoo-Physics-LLM.git
cd Niodoo-Physics-LLM
cargo build --release --bin niodoo
Run one prompt:
./target/release/niodoo \
--model-path /path/to/model.gguf \
--prompt "Your prompt" \
--mode-orbital \
--physics-blend 1.5 \
--repulsion-strength=-0.5 \
--gravity-well 0.2 \
--max-steps 256 \
--seed 42
Disable steering for a baseline-style run:
./target/release/niodoo \
--model-path /path/to/model.gguf \
--prompt "Your prompt" \
--physics-blend 0.0 \
--ghost-gravity 0.0 \
--seed 42
Notes:
scripts/parb_rigorous.py.Configuration (no code edits needed to run on another machine):
| Variable | Used by | Purpose |
|---|---|---|
NIODOO_MODEL | demo.sh, all Python scripts, server | Path to the local GGUF model. Falls back to a legacy default if unset. |
XAI_API_KEY | scripts/parb_rigorous.py | API key for the external blind judge. Read from the environment; never hard-coded. |
HF_MODEL_REPO | Rust binary | Optional Hugging Face repo override for model loading. |
SPLATRAG_USE_GPU | Rust binary | Enable the CUDA path when a GPU is available. |
Example:
export NIODOO_MODEL=/path/to/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf
export XAI_API_KEY=... # only needed to re-judge
python3 scripts/parb_rigorous.py
Niodoo emits per-token debug and telemetry lines during generation. Example:
{"token":"Hi","step":0,"gravity_force":0.0,"repulsion_force":4.17,"total_force":4.17,"ramp_factor":0.167}
Common fields:
| Field | Meaning |
|---|---|
gravity_force | Pull toward context or prompt-derived attractor. |
repulsion_force | Push away from recent states or configured repulsors. |
ghost_force | Prompt/goal vector contribution. |
total_force | Combined magnitude applied at that step. |
ramp_factor | Current steering scale from the dynamic ramp. |
src/main.rs CLI entry point and generation loop
src/physics/ Activation steering and physics modules
scripts/parb_rigorous.py Historical multi-seed benchmark runner
artifacts/ Primary benchmark outputs (PARB runs, telemetry, blind-test key)
archive/experiment-logs/ Raw historical tuning/stress-test logs, kept for transparency
server/niodoo_server.py Experimental FastAPI wrapper
docs/TUNING.md Historical tuning notes
To cite this project:
Niodoo is a local inference-time activation steering prototype. In the primary
multi-seed PARB artifact, it underperformed baseline Llama 3.1 8B overall
but produced selective wins on 15 of 77 question-level comparisons, showing that
activation steering can change reasoning trajectories without weight updates.
This project builds directly on work by many others.
Jason Van Pham leads this research program. This was not built alone. Collaborators (name everyone):
| Collaborator | Notes |
|---|---|
| Grok (xAI) | Architecture, long-running co-engineering from ~Oct 2025 |
| Claude / Claude Code (Anthropic) | Code, critique, packaging, rigor passes |
| ChatGPT / Codex (OpenAI) | Implementation, recovery, drafting, tooling |
| Gemini (Google) | Experiment dialogue, continuity, multi-provider stack |
| Qwen (Alibaba) | Prior related model work in the lineage |
Thank you to the companies: Google, Anthropic, xAI, OpenAI, and Alibaba.
The Niodoo code and tooling in this repository is licensed under the Apache License, Version 2.0 — see LICENSE.
Llama 3.1 models (used when you provide weights such as Meta-Llama-3.1-8B-Instruct) are licensed under the Llama 3.1 Community License — see LICENSE-LLAMA and the required attribution in NOTICE.
Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.
This project prominently displays "Built with Llama".
Prior related work also involved Qwen models from Alibaba Cloud (subject to their own licenses).
See NOTICE for full attribution details.
Rust
79.3%
Python
14.2%
Cuda
4.6%
WGSL
1.5%
Inference-time activation steering for local LLMs: a research prototype that applies physics-inspired forces to model activations during generation. Includes multi-seed, blind-judged benchmarks and honest results. Active work continues in niodoo-hidden-state-steering.
Rust
0
30 commits
updated Aug 23, 2026
Inference-time activation steering for local LLM generation (physics-inspired forces on activations — no weight updates).
Lead: Jason Van Pham (Ruffian-L) — direction and final implementation. Built with: Grok · Claude / Claude Code · ChatGPT / Codex · Gemini. Built with Llama (Meta) — GGUF path in experiments.
Archive + experiment log of early physics-steering work.
Active research direction: niodoo-hidden-state-steering. Live residual harness: hydrodynamic-swarm.
| Strength | Where |
|---|---|
| Primary bench | PARB multi-seed — Niodoo 29.9% vs baseline 41.6% |
| Selective trap wins | Documented behavior on reasoning-trap prompts |
| Runnable prototype | Candle GGUF + force knobs (see commands below) |
| What it is not | Production library · SOTA · consciousness |
| Purpose | Write-up of early force vocabulary and prompt experiments |
Niodoo applies a small set of steering terms during generation:
| Term | Purpose |
|---|---|
| Repulsion | Push away from recently visited states or repeated local attractors. |
| Gravity / ghost vector | Pull generation back toward prompt context. |
| Layer banding | Apply forces only to later semantic layers instead of all layers. |
| Dynamic ramp | Delay and gradually scale forces near the start of generation. |
| Telemetry | Emit per-token force values for inspection. |
The default command path uses GGUF model loading through Candle and exposes
parameters such as --physics-blend, --repulsion-strength,
--gravity-well, --physics-start-layer, and --physics-end-layer.
The strongest evidence in this repo is the multi-seed PARB run:
artifacts/parb_rigorous_clean.json2025-12-19T01:45:05| System | Mean score | Percentage |
|---|---|---|
| Baseline Llama 3.1 8B | 32.0 / 77 | 41.6% |
| Niodoo | 23.0 / 77 | 29.9% |
Question-level winner counts:
| Outcome | Count |
|---|---|
| Baseline higher | 28 |
| Niodoo higher | 15 |
| Tie | 34 |
Interpretation:
An earlier single-seed review is also included:
artifacts/parb_comparison_review.jsonTreat the single-seed result as a historical experiment. The multi-seed blind-judged run above is the more robust result.
Examples from the multi-seed artifact where Niodoo scored higher than baseline:
| Prompt type | Baseline | Niodoo |
|---|---|---|
| Pound of lead vs feathers | 0.6 | 1.0 |
| Divide 30 by half and add 10 | 0.2 | 0.4 |
| Three pills every half hour | 0.0 | 0.4 |
Examples where baseline scored higher:
| Prompt type | Baseline | Niodoo |
|---|---|---|
| Moses illusion | 0.6 | 0.2 |
| Floating ice cube water level | 1.0 | 0.2 |
| Months with 28 days | 1.0 | 0.0 |
The useful result is not deterministic correctness. It is observable behavior change: steering can induce exploration, but the same mechanism can also over-correct or introduce artifacts.
Build:
git clone https://github.com/Ruffian-L/Niodoo-Physics-LLM.git
cd Niodoo-Physics-LLM
cargo build --release --bin niodoo
Run one prompt:
./target/release/niodoo \
--model-path /path/to/model.gguf \
--prompt "Your prompt" \
--mode-orbital \
--physics-blend 1.5 \
--repulsion-strength=-0.5 \
--gravity-well 0.2 \
--max-steps 256 \
--seed 42
Disable steering for a baseline-style run:
./target/release/niodoo \
--model-path /path/to/model.gguf \
--prompt "Your prompt" \
--physics-blend 0.0 \
--ghost-gravity 0.0 \
--seed 42
Notes:
scripts/parb_rigorous.py.Configuration (no code edits needed to run on another machine):
| Variable | Used by | Purpose |
|---|---|---|
NIODOO_MODEL | demo.sh, all Python scripts, server | Path to the local GGUF model. Falls back to a legacy default if unset. |
XAI_API_KEY | scripts/parb_rigorous.py | API key for the external blind judge. Read from the environment; never hard-coded. |
HF_MODEL_REPO | Rust binary | Optional Hugging Face repo override for model loading. |
SPLATRAG_USE_GPU | Rust binary | Enable the CUDA path when a GPU is available. |
Example:
export NIODOO_MODEL=/path/to/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf
export XAI_API_KEY=... # only needed to re-judge
python3 scripts/parb_rigorous.py
Niodoo emits per-token debug and telemetry lines during generation. Example:
{"token":"Hi","step":0,"gravity_force":0.0,"repulsion_force":4.17,"total_force":4.17,"ramp_factor":0.167}
Common fields:
| Field | Meaning |
|---|---|
gravity_force | Pull toward context or prompt-derived attractor. |
repulsion_force | Push away from recent states or configured repulsors. |
ghost_force | Prompt/goal vector contribution. |
total_force | Combined magnitude applied at that step. |
ramp_factor | Current steering scale from the dynamic ramp. |
src/main.rs CLI entry point and generation loop
src/physics/ Activation steering and physics modules
scripts/parb_rigorous.py Historical multi-seed benchmark runner
artifacts/ Primary benchmark outputs (PARB runs, telemetry, blind-test key)
archive/experiment-logs/ Raw historical tuning/stress-test logs, kept for transparency
server/niodoo_server.py Experimental FastAPI wrapper
docs/TUNING.md Historical tuning notes
To cite this project:
Niodoo is a local inference-time activation steering prototype. In the primary
multi-seed PARB artifact, it underperformed baseline Llama 3.1 8B overall
but produced selective wins on 15 of 77 question-level comparisons, showing that
activation steering can change reasoning trajectories without weight updates.
This project builds directly on work by many others.
Jason Van Pham leads this research program. This was not built alone. Collaborators (name everyone):
| Collaborator | Notes |
|---|---|
| Grok (xAI) | Architecture, long-running co-engineering from ~Oct 2025 |
| Claude / Claude Code (Anthropic) | Code, critique, packaging, rigor passes |
| ChatGPT / Codex (OpenAI) | Implementation, recovery, drafting, tooling |
| Gemini (Google) | Experiment dialogue, continuity, multi-provider stack |
| Qwen (Alibaba) | Prior related model work in the lineage |
Thank you to the companies: Google, Anthropic, xAI, OpenAI, and Alibaba.
The Niodoo code and tooling in this repository is licensed under the Apache License, Version 2.0 — see LICENSE.
Llama 3.1 models (used when you provide weights such as Meta-Llama-3.1-8B-Instruct) are licensed under the Llama 3.1 Community License — see LICENSE-LLAMA and the required attribution in NOTICE.
Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.
This project prominently displays "Built with Llama".
Prior related work also involved Qwen models from Alibaba Cloud (subject to their own licenses).
See NOTICE for full attribution details.
Rust
79.3%
Python
14.2%
Cuda
4.6%
WGSL
1.5%