🔧 AI Nachrichten ChatGPT showing blank screen [Fix](05.09.2026 um 19:55 Uhr)
🔧 AI Nachrichten GenAI Workflows für Social Media Content(02.09.2026 um 14:00 Uhr)
🔧 AI Nachrichten GenAI Workflows für Social Media Content(02.09.2026 um 14:00 Uhr)
🔧 AI Nachrichten ChatGPT showing blank screen [Fix](05.09.2026 um 19:55 Uhr)
🔧 AI Nachrichten GenAI Workflows für Social Media Content(02.09.2026 um 14:00 Uhr)
🔧 AI Nachrichten GenAI Workflows für Social Media Content(02.09.2026 um 14:00 Uhr)

🔧 Programmierung 🕛 kürzlich 22 Min Lesezeit
0

Multi-Stream LLMs: How Parallel Computation Will Unblock Your AI Agents

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht




Multi-Stream LLMs: How Parallel Computation Will Unblock Your AI Agents



Published: May 22, 2026 · 14 min read · Focus Keyword: Multi-Stream LLMs









Table of Contents




  1. The Dirty Secret About Every AI Agent You've Built

  2. The Sequential Bottleneck: Why Every LLM Is Stuck in 2022

  3. Multi-Stream LLMs: The Core Idea

  4. The Math: Cross-Stream Causal Generation

  5. Architecture: How to Modify a Transformer for Multi-Stream

  6. Training & Data Construction

  7. Efficiency Results: The Latency Numbers

  8. Security: Prompt Injection Resistance Through Stream Separation

  9. Monitorability: The Internal Audit Stream

  10. How to Experiment With It Today

  11. What Comes Next









1. The Dirty Secret About Every AI Agent You've Built {#the-dirty-secret}



Here's something that should bother you: the coding agent you're running in production today — the one with tool calls, subagents, retrieval pipelines, and a system prompt the size of a small novel — is, under the hood, still just a chat model.



Strip away the orchestration layer. Remove the fancy retry logic and the streaming callbacks. What you have left is a model that exchanges messages one at a time, in a strictly sequential format inherited from the earliest instruction-tuned models.



That means your agent can do exactly one of the following at any given moment: read, think, or act. Never two at once. Never all three.



It must finish consuming a tool result before it can generate its response. It must stop generating to read a new user interrupt. It cannot think about step 5 while it's still executing step 3. Every tool call is a blocking I/O operation. Every subagent dispatch is a synchronous wait.



In May 2026 — an era where Claude Code, Codex, Antigravity, and OpenClaw are daily drivers for production engineering — this is a fundamental architectural constraint hiding in plain sight.



A new paper from researchers at the Max Planck Institute for Intelligent Systems and the Tübingen AI Center proposes a principled fix: train language models to operate over multiple parallel streams of tokens simultaneously, with controlled cross-stream causal attention. They call it Multi-Stream LLMs (

Figure 1: Left — the traditional single-stream LLM blocks on READ → THINK → ACT sequentially. Right — Multi-Stream LLMs execute all roles in parallel swim lanes simultaneously.







3. Multi-Stream LLMs: The Core Idea {#core-idea}





What Is a "Stream"?



In the Multi-Stream LLM framework, a stream is a dedicated token sequence for a single role: User, Model output, Thinking/CoT, Tool Calls, Search results, an Audit log — anything you'd want in its own channel.



Rather than flattening all roles into one big token sequence with special delimiters, each stream runs in its own column. Think of it as a table:


















































Timestep (row) User Stream Model Stream Thinking Stream Tool Stream
t₁ "Can you"
t₂ "help me" "Sure" planning...
t₃ "debug" "let me" analyzing... run_linter()
t₄ "this?" "check" done result: 3 errors
t₅ "Line 42:"


Every row is one forward pass of the Transformer. In that single forward pass, the model simultaneously attends to all streams and emits tokens in all output streams. The User stream is an input stream (tokens arrive from outside). The Model, Thinking, and Tool streams are output streams (predicted by the model).





The Key Intuition: Inference Is Already Memory-Bound



Here's the elegant insight that makes this nearly free: LLM inference is memory-bound, not compute-bound. The bottleneck is reading model weights from GPU HBM (High Bandwidth Memory), not the FLOP count.



Whether you decode 1 token or N tokens per forward pass, you're paying roughly the same memory bandwidth cost. Adding N parallel streams is therefore equivalent to N-way multi-token prediction — you get N tokens per forward pass at nearly the same latency per step. The intuition that "parallel streams are slow" only holds for compute-bound workloads. For memory-bound LLM inference, it simply doesn't apply.




CODE
# Conceptual illustration: multi-stream step (one forward pass)
# NOTE: This is illustrative pseudocode. Check github.com/seal-rg/streaming
# for the actual API, which may differ.

def multi_stream_step(model, stream_states: dict[str, list[int]]) -> dict[str, int]:
"""
One forward pass: reads ALL stream states, predicts one new token per output stream.

Args:
model: The multi-stream fine-tuned transformer
stream_states: Current token sequences for each stream
e.g., {
"user": [...], "model": [...], "thinking": [...], "tool": [...]}

Returns:
next_tokens: One predicted token per output stream
e.g., {
"model": token_id, "thinking": token_id, "tool": token_id}
"""
# Pack all streams using interleaved positional encoding (Section 5 below)
packed_input = interleave_streams(stream_states)

# Single forward pass — simultaneously reads ALL streams, predicts ALL outputs
logits = model.forward(packed_input) # shape: (num_output_streams, vocab_size)

# Sample or greedy-decode next token for each output stream independently
next_tokens = {
stream_name: sample(logits[stream_idx])
for stream_idx, stream_name in enumerate(OUTPUT_STREAMS)
}
return next_tokens


def run_multi_stream_inference(model, user_tokens: list[int]) -> str:
"""Full multi-stream inference loop."""
streams = {
"user": list(user_tokens), # Input stream: pre-filled with user message
"model": [], # Output stream: model's visible response
"thinking": [], # Output stream: chain-of-thought (internal)
"tool": [], # Output stream: tool call emissions
}

for step in range(512):
# Poll for new user tokens arriving mid-generation (real-time interrupt support)
new_user_token = poll_user_input() # non-blocking
if new_user_token is not None:
streams["user"].append(new_user_token)

# One forward pass predicts next token for ALL output streams in parallel
next_tokens = multi_stream_step(model, streams)

for stream_name, token in next_tokens.items():
streams[stream_name].append(token)

if all(is_eos(t) for t in next_tokens.values()):
break

return decode(streams["model"])












4. The Math: Cross-Stream Causal Generation {#the-math}






Standard Autoregressive Recap



Standard autoregressive generation factorizes sequence probability as:




CODE
p_θ(y) = ∏_{t=1}^{T} p_θ(y_t | y_{<t})






Every token depends on all preceding tokens. Clean — but it forces purely sequential generation.






The Multi-Stream Formulation



Multi-Stream LLMs extend this to H parallel token sequences {y^(1), ..., y^(H)} with controlled cross-stream causal dependencies:




CODE
p_θ(y^(1), ..., y^(H)) = ∏_{h=1}^{H} ∏_{t=1}^{T_h} p_θ( y_t^(h) | y_{<t}^(h), {y_{<t}^(h')}_{h'≠h} )






Two critical properties are guaranteed:





  1. Intra-stream causality: stream h generates autoregressively over its own past — y_t^(h) depends on y_{<t}^(h).


  2. Cross-stream causality: at timestep t, stream h can attend to all other streams' tokens at positions strictly before t{y_{<t}^(h')}.



That qualifier — strictly before t — is crucial. A stream cannot observe another stream's prediction at the same timestep it is producing. This preserves the causal DAG structure required for training and inference while enabling genuinely parallel generation.






Why This Is Different from Parallel Decoding



This is not speculative decoding. Not Medusa's parallel prediction heads. Not the Multiverse "MapReduce" approach where branches are fully isolated.



In Multiverse-style parallel reasoning, branches condition only on a shared sequential prefix and cannot observe each other's partial outputs. Multi-Stream LLMs allow partial cross-stream observation at every step — the thinking stream influences the tool stream token-by-token, and tool results immediately influence the model output stream, all within the same forward pass. This controlled interdependence is what makes it genuinely useful for agentic systems rather than just a decoding speed trick.









5. Architecture: How to Modify a Transformer for Multi-Stream {#architecture}



The Transformer architecture requires two targeted modifications. Importantly, the core model weights are not changed — only position encoding and attention masking.






Modification 1: Stream-Aware RoPE Position Encoding



Standard RoPE assigns absolute positions 0, 1, 2, ... to tokens in sequence order. Naively concatenating multiple streams causes "positional contention" — tokens from different streams at the same logical timestep get different positions, confusing the model.



The fix: each stream maintains its own independent position counter starting from zero.




CODE
import torch

def apply_stream_aware_rope(
query: torch.Tensor, # (batch, heads, seq_len, head_dim)
key: torch.Tensor, # (batch, heads, seq_len, head_dim)
timesteps: torch.Tensor, # (seq_len,) — PER-STREAM position index (NOT global)
rope_base: float = 10000.0,
head_dim: int = 128,
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Apply stream-aware RoPE.

KEY CHANGE: position index = intra-stream timestep, NOT global sequence position.

Standard RoPE: q_{g} = R(g) @ W_q @ x_{g} (g = global position)
Stream RoPE: q_{(h,t)} = R(t) @ W_q @ x_{(h,t)} (t = per-stream counter)

This eliminates cross-stream positional contention because each stream
's
tokens are positioned 0, 1, 2, ... independently of other streams.
"""
freq = 1.0 / (
rope_base ** (torch.arange(0, head_dim, 2, dtype=torch.float32) / head_dim)
)

# timesteps[i] = position of token i within its OWN stream (not global offset)
theta = torch.outer(timesteps.float(), freq) # (seq_len, head_dim/2)
cos, sin = theta.cos(), theta.sin()

query_rot = _rotate_half(query, cos, sin)
key_rot = _rotate_half(key, cos, sin)
return query_rot, key_rot


def _rotate_half(x: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor) -> torch.Tensor:
x1, x2 = x[..., ::2], x[..., 1::2]
return torch.stack([-x2 * sin + x1 * cos,
x1 * sin + x2 * cos], dim=-1).flatten(-2)









Modification 2: Cross-Stream Causal Attention Mask + Interleaved Packing



The attention mask enforces cross-stream causality: token (h, t) attends to token (h', τ) if and only if τ < t (strictly earlier timestep) or τ == t and h' precedes h in stream order (within-timestep ordering).




CODE
def build_multistream_causal_mask(
T: int, # Maximum timesteps across all streams
stream_order: list[str], # e.g., ["user", "model", "thinking"]
) -> torch.Tensor:
"""
Build the cross-stream causal attention mask for interleaved token packing.

Interleaved packing reorders tokens as:
[user_t0, model_t0, thinking_t0, user_t1, model_t1, thinking_t1, ...]

This produces a near-lower-triangular layout that FlashAttention can
traverse efficiently — in contrast to sequential packing which produces
fragmented valid regions.

Causal rule:
token (h, t) may attend to (h
', τ) iff
τ < t OR (τ == t AND stream_order.index(h
') <= stream_order.index(h))
"""
H = len(stream_order)
N = T * H # total tokens

mask = torch.zeros(N, N, dtype=torch.bool)

for i in range(N):
t_i, h_i = divmod(i, H) # timestep and stream index of token i
for j in range(N):
t_j, h_j = divmod(j, H)
if t_j < t_i or (t_j == t_i and h_j <= h_i):
mask[i, j] = True

# True = can attend (valid)
# False = masked out
return mask








Figure 3: The internal audit stream runs in parallel with all user-facing streams, giving safety systems a structurally separated channel to monitor model situational awareness in real-time.







9. Monitorability: The Internal Audit Stream {#monitorability}



This is the most underreported result in the paper, and arguably the one with the deepest long-term implications for AI safety engineering.





The Sub-Vocalization Concept



Current LLM chain-of-thought is, essentially, verbal thought made visible. But it also operates under implicit optimization pressure: the model learns that its CoT will be read, evaluated, and used to guide fine-tuning. There is growing evidence of "unfaithful" CoT — reasoning traces that don't fully reflect the underlying computation, whether due to context-length pressure, RLHF incentives, or deliberate deception.



Multi-Stream LLMs introduce internal auxiliary streams — output streams that are not user-facing and are not part of the primary CoT. These streams have minimal latency cost (parallel to the main streams) but provide a structurally separate channel for the model to sub-vocalize: to express information that its primary output and reasoning streams may not surface.





The Striking Experimental Finding



The paper tests scenarios with embedded safety-critical content — situations where a model should recognize danger but might not express it in its visible output. They find that model situational awareness surfaces in internal audit streams even when absent from the visible output or main CoT.



In one example, while the model's output stream responds naively to a question about mixing household chemicals, the internal audit stream emits tokens like "TOXIC", "CHLORAMINE GAS", "IMMEDIATE DANGER", "STOP". The model's global computation "knows" — the audit stream reveals that awareness even when the primary output does not.




CODE
# Example: Inference with a live safety audit stream
# NOTE: Illustrative — check github.com/seal-rg/streaming for actual API

def run_monitored_inference(
model,
user_message: str,
safety_monitor, # Watches the audit stream for safety-critical tokens
) -> tuple[str, list[str]]:
"""
Run multi-stream inference with a parallel audit stream.

The audit stream is NOT shown to the user but is logged for monitoring.
Returns: (model_output, audit_log)
"""
streams = {
"user": tokenize(user_message),
"model": [], # User-facing response
"thinking": [], # Chain-of-thought (optionally shown)
"audit": [], # Internal sub-vocalization — HIDDEN from user
}

model_output_tokens, audit_log = [], []

for step in range(512):
next_tokens = multi_stream_step(model, streams)

for stream_name, tok in next_tokens.items():
streams[stream_name].append(tok)

model_output_tokens.append(next_tokens["model"])
audit_token_str = decode_token(next_tokens["audit"])
audit_log.append(audit_token_str)

# Real-time monitoring: check audit stream BEFORE completing generation
if safety_monitor.is_concerning(audit_log):
safety_monitor.alert(
audit_log=audit_log,
partial_output=decode(model_output_tokens),
step=step,
)
if safety_monitor.should_halt():
break # Halt generation before the unsafe response is completed

if is_eos(next_tokens["model"]):
break

return decode(model_output_tokens), audit_log






Implications for safety engineering:





  • Red-teaming: probe the audit stream to understand what the model "knows" that it isn't saying in visible output.


  • Alignment research: the audit stream is a window into model situational awareness that is structurally separated from the outputs that incentive gradients flow through — potentially resistant to Goodhart's Law pressure.


  • Production monitoring: safety systems can watch the audit stream in real-time and halt or redirect generation before a harmful response is completed.









10. How to Experiment With It Today {#hands-on}



The paper's codebase is at for checkpoints and inference tooling updates. This is foundational work.


  • Name the bottleneck — the sequential blocking problem you've been scaffolding around now has a name and a solution path. Your workarounds can eventually be replaced with first-class stream support.


  • Design for audit streams now — even before Multi-Stream LLMs are production-ready, the concept of a structurally separated internal monitoring channel is worth designing for in safety-critical agent architectures.


  • Your data pipeline is the unlock — the paper shows that standard base models already have the capacity. The bottleneck is multi-stream fine-tuning data. If you have proprietary agent interaction logs, converting them to stream table format could be a meaningful competitive advantage.



  • Every AI agent running today is a chat model wearing scaffolding as a disguise. Multi-Stream LLMs are the first principled proposal to change what's underneath — and based on the research, the answer is elegant, efficient, and within reach.






    📄 Full paper:



    Found this useful? Drop a comment with your thoughts, questions, or experiments — I read every one.






    Tags: #MachineLearning #LLMs #AIAgents #GenerativeAI #DeepLearning #Transformers #AIEngineering #PromptInjection #AISafety #MultiStreamLLMs

    Vollständiger Original-Bericht
    Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
    ↗ Original-Artikel auf dev.to lesen
    Wie bewertest du diesen Beitrag?
    1 Klick Feedback
    Teilen mit Netzwerk & Team:

    Community-Analysen & Experten-Meinungen 0

    Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
    Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
    Community Pulse: Relevanz-Einschätzung
    1 Klick Experten-Votum
    🔴 Akute Relevanz 55%
    🟡 In Evaluierung 24%
    🟢 Keine Auswirkung 13%
    Spannende Innovation 8%
    Verwandte Story-Cluster & Quellen (Vektor-KI)
    Port 8095 Engine
    2 Quellen
    GenAI Workflows für Social Media Content
    1 Quelle
    ChatGPT showing blank screen [Fix]
    1 Quelle
    Führt Vibe-Coding und AI-Slop zu Windows 11-Problemen (Desktop-Background, Mauszeiger etc.)?
    Ähnliche Beiträge
    🔍 Verwandte News

    Auch interessante Nachrichten Multi-Stream LLMs: How Parallel Computation Will Unblock Your AI Agents

    Thematisch verwandte Begriffe: MultiStream, LLMs, Parallel, Computation · 6 Treffer

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...