Note: This project has been superseded by the Context Engine, which derives from first principles what this project discovered through iteration. Dialectical-TTS remains archived as the historical exploration that produced the key insights. See Context Engine for active development.
A local implementation of Test-Time Compute (Reasoning) for Apple Silicon.
This is not a chatbot. It is a structural reasoning engine that uses Tri-State Dialectics (Thesis, Antithesis, Synthesis) with recursive self-refinement to overcome the probabilistic biases of Large Language Models.
Designed to run on M-series chips (M1/M2/M3/M4) using the MLX framework.
Through building and testing this engine, several insights emerged that led to the Context Engine:
-
Multiple independent collapses composed through necessity produce more clarifying results than single-pass inference. The Believer/Logician/Contrarian structure demonstrated this, but the specific roles were scaffolding—not the principle.
-
The mechanism is always token prediction. The variable is always context. Everything this engine does is construct different contexts for the same collapse mechanism. The dialectical structure is one way to construct context. Not the only way.
-
Convergence is stopping, not arriving. The engine stops when it can't generate new framings, not when it's found truth. The human evaluates what remains in shadow.
These insights, combined with the Not a ToE, were traced to their generative ground and rebuilt as the Context Engine.
Round 1 (initial dialectical pass):
- Trace 1: The Believer (Thesis) — Runs with standard parameters. Represents training bias.
- Trace 2: The Logician (Antithesis) — Deconstructs into atomic events, checks constraints.
- Trace 3: The Contrarian (Red Team) — Assumes the intuitive answer is a trap, argues the opposite.
- The Arbiter (Synthesis) — Reviews all three traces. Ignores majority vote. Applies Logic of Necessity: which causal chain is necessary given the constraints?
Round N > 1 (recursive self-refinement):
The previous round's synthesis is stress-tested:
- Steelman — Defend the previous analysis as strongly as possible.
- Critique — Find smuggled assumptions and unchecked gaps.
- Counterfactual — Construct scenarios that would break the analysis.
- Arbiter — Determine if the analysis survives or needs revision.
Convergence: Recursion stops when the synthesis is stable under self-application — a natural fixed point. Hitting max depth without convergence is a diagnostic signal, not a failure.
- Hardware: Apple Silicon Mac (M1/M2/M3/M4).
- Recommended: 48GB+ RAM for 72B models. 16GB+ for 32B models.
- Software: Python 3.11+
-
Clone the repository:
git clone https://github.com/powerpig99/Dialectical-TTS.git cd Dialectical-TTS -
Install Dependencies:
pip install -r requirements.txt
# Run with default settings (72B model, max 5 recursive rounds)
python main.py
# Use a smaller model (for 16GB machines)
python main.py --model mlx-community/Qwen2.5-32B-Instruct-4bit
# Limit recursion depth
python main.py --max-depth 3
# Single-pass mode (v1 behavior, no recursion)
python main.py --no-recurse
# Custom problem
python main.py --prompt "Your logic puzzle here"
# Save reasoning history to JSON
python main.py --save output.json
# Quiet mode (suppress intermediate traces)
python main.py --quiet| Flag | Default | Description |
|---|---|---|
--model |
Qwen2.5-72B-Instruct-3bit |
MLX model ID |
--max-depth |
5 |
Maximum recursion depth |
--threshold |
0.85 |
Convergence similarity threshold |
--no-recurse |
off | Disable recursion (single-pass mode) |
--quiet |
off | Suppress intermediate trace output |
--save |
none | Save full reasoning history to JSON file |
--prompt |
built-in test | Problem to reason about |
The benchmark harness remains useful for evaluating any reasoning system against BIG-Bench Hard (BBH) tasks.
# Quick test: 2 problems per task, single-pass only
python -m benchmark.bbh_bench --model /path/to/model --mode single --sample 2
# Full comparison: single-pass vs recursive on 10 problems per task
python -m benchmark.bbh_bench --model /path/to/model --mode both --sample 10
# Resume an interrupted run
python -m benchmark.bbh_bench --model /path/to/model --resume benchmark/results/file.jsonl
# Re-read results and print summary (no model needed)
python -m benchmark.bbh_bench --report benchmark/results/file.jsonlSelected BBH tasks: causal_judgement, logical_deduction_three_objects, navigate, web_of_lies, snarks
This project is grounded in the Not a ToE:
Everything is layered projections of the infinite-dimensional orthogonal binary hyperspace from Nothing—the infinitely self-referencing Contradiction.
Everything else can be derived from it logically. The Context Engine is that derivation applied to language model reasoning.
MIT