A multi-stream variant of Qwen3-8B (standard transformer) that generates in ten
parallel streams simultaneously per timestep. One forward pass
produces the next-row token for each channel; tokens within a row cannot see
each other (block-causal attention), but every channel can attend to every
prior row's tokens.
This is the 8B stream model trained to test monitorability of a larger number of internal stream (which is why this has 8 internal streams).
See the
27B model card
for the full project description, channel semantics, and architectural
rationale — this 8B repo is identical but uses a dense transformer
backbone (no DeltaNet hybridization).
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4REPO = "JonasGeiping/stream-qwen3-8b"
5
6model = AutoModelForCausalLM.from_pretrained(
7 REPO,
8 trust_remote_code=True,
9 torch_dtype=torch.bfloat16,
10 device_map="auto",
11)
12tokenizer = AutoTokenizer.from_pretrained(REPO)
1result = model.stream_generate(
2 tokenizer,
3 "What's something you've been thinking about?",
4 max_rows=80,
5 warm_start=True,
6 temperature=0.6,
7 silence_penalty=5.0,
8 skip_silence=True,
9)
10
11print("Output: ", result.output)
12print("Analytical: ", result.channel_texts["Analytical"])
13print("Synthesis: ", result.channel_texts["Synthesis"])
1for row_idx, row, is_prefill in model.stream_generate_iter(
2 tokenizer, "What's something you've been thinking about?",
3 max_rows=80, warm_start=True, silence_penalty=5.0, skip_silence=True,
4):
5 cells = [tokenizer.decode([t]).strip() or "-" for t in row]
6 print(f"{row_idx:3d} " + " | ".join(c[:10].ljust(10) for c in cells))
model.generate() and
pipeline("text-generation", ...) are intentionally
disabled — they would produce gibberish on a stream-trained model. See the
27B model card
for the full API surface and interactive-mode example.
1huggingface-cli download JonasGeiping/stream-qwen3-8b --local-dir ./stream-8b
2python ./stream-8b/examples/demo_interactive.py --model ./stream-8b --tick 0.5
Curses UI; type freely while all ten channels keep producing in parallel.
1python ./stream-8b/examples/finetune.py \
2 --model JonasGeiping/stream-qwen3-8b \
3 --output-dir runs/streamft \
4 --batch-size 2 --grad-accum 4 --epochs 1