Manuscript Offprint
arXiv:2610.25254BatchParScale: Sparse Batch-Mixing for Sequence Models
Abstract
Recent test-time scaling methods improve model performance by increasing inference-time compute. One practical form of this is parallel scaling, where a model samples multiple independent reasoning streams and aggregates their answers using methods like voting, reranking, or verification. While effective, this approach leaves the streams uncoordinated, and a discovery made in one rollout cannot influence any other. Multi-Sequence Verifiers jointly score candidate answers after generation, but the reasoning streams remain independent during inference. ParScale takes a step toward model-internal parallel scaling by learning to aggregate multiple forward passes, but its streams still do not exchange information while processing a sequence. We introduce BatchParScale, an attention mechanism that allows parallel streams to exchange information through a small set of communication positions. We evaluate BatchParScale on a new Parallel Needle-in-a-Haystack retrieval benchmark and in pretraining, fine-tuning, and cooperative multi-agent reinforcement learning. Across these settings, BatchParScale outperforms ParScale on language-model loss and remains competitive on coordination-sensitive MARL tasks. Masked pretraining runs beat an unmasked single-sequence baseline despite local sequence corruption, and LoRA fine-tuning shows the mechanism can be added to a pretrained Transformer. At the same time, fact retrieval performance for pretrained and fine-tuned BatchParScale models remains unclear.
1 Introduction
Parallel test-time scaling has become a practical way to spend more computation at inference time. The common recipe is to sample several candidate reasoning traces, then choose among them with voting, reranking, or verification (Wang et al., 2023; Snell et al., 2024; Cobbe et al., 2021; Lightman et al., 2023). This can improve answer coverage, but the parallel traces in one rollout cannot reuse information from another. For example, if different traces explore different proof strategies, an intermediate lemma found in one trace is unavailable to the others until final aggregation. Parallel scaling therefore increases the number of computations, but it does not make those computations collaborative.
Final aggregation and verification can compare completed traces, but they do not let one stream change another stream's computation during inference. This work asks whether sequence models can occupy a tunable middle ground between parallel and sequential scaling: keeping the diversity of parallel streams while allowing intentional communication during the forward pass. We introduce batch-mixing as a class of sequence models in which streams can attend to selected hidden states from their peers. Our concrete instantiation, BatchParScale, restricts this exchange to a small set of communication positions, so most tokens remain ordinary per-stream causal computation.
We evaluate this idea from several angles. Parallel Needle-in-a-Haystack tests whether a stream without local evidence can recover information from another stream. TinyStories pretraining and FineWeb-Edu LoRA continued pretraining test whether the mechanism improves ordinary language-model objectives and masked-token recovery. Parallel QA-style probes test whether those gains correspond to reliable transfer of specific facts across streams. Cooperative multi-agent reinforcement learning tests whether the same communication primitive can support learned coordination. Finally, because sparse attention patterns can be asymptotically attractive but slow in practice, we analyze the direct implementation and an efficient two-pass version of BatchParScale.
BatchParScale can learn controlled cross-stream retrieval, improves aggregate language-model loss in our small-scale comparisons, and improves masked-token recovery when neighboring streams contain redundant context. LoRA continued pretraining shows that the mechanism can be added to a pretrained Transformer, and MARL results show competitive performance on several coordination-sensitive tasks. However, aggregate loss improvements and masked-token recovery do not imply reliable transfer of specific facts to streams without local evidence. This failure mode is clearest in PNIAH and PMHQA, where for both pretrained and finetuned models performance remains close to random despite the model being able to solve the task perfectly when information remains in a single stream. On the other hand, performance on parallel-WikiHop remains

Figure 1: Overview of BatchParScale. (A) BatchParScale lets parallel streams share selected hidden states through sparse communication positions. (B) ParScale streams interact only at final aggregation.
meaningfully above random. This motivates treating better data augmentation and training objectives as open problems for future research.
Our contributions are:
• We formulate batch-mixing as a sequence-modeling primitive for communication between parallel streams, and instantiate it as BatchParScale.
• We introduce Parallel Needle-in-a-Haystack (PNIAH) and parallel QA/MHQA (PQA/PMHQA)-style benchmarks for measuring whether information reaches streams that do not contain the evidence locally.
• We evaluate BatchParScale across language-model pretraining, LoRA continued pretraining, PNIAH and PMHQA, and cooperative MARL, finding that our architecture outperforms ParScale on sequence modelling, but performs poorly on downstream PNIAH and PMHQA-style benchmarks.
• We produce an efficient two-pass implementation that makes BatchParScale communication hardware-friendly.
2.1 Parallel Reasoning and Test-Time Scaling
Recent work treats inference-time computation as a scaling axis for language models. These scaling methods allocate additional computation to sampling, verification, or refinement, and have been shown in certain cases to improve performance more efficiently than increasing model size (Snell et al., 2024). The most common parallel form is to sample multiple independent candidate solutions and aggregate them. Self-consistency uses this idea for chain-of-thought reasoning by sampling multiple reasoning paths and selecting the most consistent answer (Wang et al., 2023). Large Language Monkeys studies this repeated-sampling regime at much larger scale, showing that solution coverage can improve over many samples, especially in domains with reliable automatic verification (Brown et al., 2024). However, these approaches leave the underlying computations independent: each rollout is generated without access to the intermediate states or discoveries of the others.
Multi-Sequence Verifiers address this limitation by jointly processing a set of candidate answers instead of scoring each candidate independently (Kim et al., 2026). They improve best-of-N selection and early stopping through an auxiliary verifier, but the reasoning streams themselves still do not communicate while generating. ParScale scales inference differently, by running parallel prefix-conditioned forward passes over the same sequence rather than sampling independent outputs (Chen et al., 2025). It duplicates the input across P streams that share a Transformer backbone; each stream prepends fixed, input-independent learned prefix tokens that diversify hidden states across streams. Their outputs are combined only at a final dynamic aggregation step, and the streams do not interact during the forward pass.
2.2 Sparse and Latent Attention
The Transformer introduced self-attention as the core sequence-modeling primitive (Vaswani et al., 2017).
Encoder-decoder attention, in which queries come from one sequence and keys and values come from another, provides an early form of cross-sequence information exchange (Bahdanau et al., 2015; Vaswani et al., 2017). Subsequent work has studied sparse and latent variants of these attention structures. Sparse Transformer, Longformer, and BigBird reduce the overhead of dense self-attention through local, strided, random, or global connectivity patterns (Child et al., 2019; Beltagy et al., 2020; Zaheer et al., 2020). Longformer furthermore designates selected positions as global-attention sites and gives them dedicated query, key, and value projections rather than reusing the ordinary token projections. Set Transformer and Perceiver-style architectures introduce learned latent slots or inducing points that mediate attention over large collections of inputs (Lee et al., 2019; Jaegle et al., 2021, 2022). Our communication positions play a similar inducing-point role, but they are embedded inside otherwise independent streams and are constrained by causal sequence order.
2.3 Multi-Agent Reinforcement Learning
Multi-agent reinforcement learning studies settings in which multiple agents learn policies while interacting through a shared environment (Tan, 1993; Littman, 1994; Busoniu et al., 2008). A common paradigm is centralized training with decentralized execution, where agents may use global information during training but act from local observations at test time (Oliehoek et al., 2008; Lowe et al., 2017). MADDPG introduced an actor-critic approach for mixed cooperative-competitive environments and popularized the Multi-Agent Particle Environment (MPE) benchmarks (Lowe et al., 2017). MAPPO later showed that a carefully tuned PPO implementation is a strong and simple baseline for cooperative MARL tasks (Schulman et al., 2017; Yu et al., 2022). A related line of work learns differentiable communication channels between separate actors. CommNet lets agents condition on an average of other agents' hidden states (Sukhbaatar and Fergus, 2016); IC3Net adds learned gates that control when agents communicate (Singh et al., 2019); and TarMAC uses attention to make communication targeted across senders and receivers (Das et al., 2019). These methods establish continuous hidden-state exchange as a trainable component of cooperative decision-making systems. Our MARL experiments place batch-mixing in this lineage by treating each agent's history as a stream and restricting cross-agent reads to selected communication positions.
Recent work has also applied sequence models to MARL. Multi-Agent Transformer formulates cooperative MARL as sequence modeling over agents and actions (Wen et al., 2022). Sable further studies scalable sequence models for MARL, emphasizing performance, memory efficiency, and scalability (Mahjoub et al., 2025). JAX-based environment suites have also made large batched RL experiments easier to run: Jumanji provides scalable single-agent environments and baselines (Bonnet et al., 2024), while JaxMARL extends this style of infrastructure to multi-agent environments and algorithms (Rutherford et al., 2023). Brax provides the differentiable physics backend used by continuous-control multi-agent environments such as MABrax (Freeman et al., 2021).
3 Method
3.1 ParScale
The model architecture most similar to our approach is ParScale (Chen et al., 2025). Given an input sequence
ParScale duplicates the sequence into parallel streams. Each stream is processed by the same Transformer backbone , but the streams are distinguished by learned prefix key-value caches. For stream and layer , let
denote the stream-specific learned prefix cache, with prefix length . For one attention head we have:
If the ordinary hidden states in stream p produce queries, keys, and values
then the attention operation in ParScale is schematically
Thus, all streams receive the same token sequence x, but stream p attends with its own learned prefix cache at every layer. We can summarize the resulting model as
where denotes the p-th prefix-conditioned stream and is its aggregation weight. The backbone parameters are shared across all streams; only the prefix caches and aggregation parameters are stream-specific. The aggregation weights are computed dynamically from the stream outputs, using an MLP
that maps stream outputs to P logits.
The aggregation weights are computed as
Training optimizes standard next-token cross-entropy on the aggregated output of , so all P streams contribute to a single prediction at each position rather than receiving separate per-stream losses. To avoid collapse, label smoothing is also applied to the aggregation weights,
which acts as a load-balancing regularizer and prevents a few streams from dominating the mixture early in training.
ParScale increases computation by evaluating P prefix-conditioned versions of the same sequence through a shared Transformer. The streams are diverse because they use different learned prefix key-value caches, but they remain independent while processing the sequence. Their only interaction occurs at the final dynamic aggregation step. The cost of adding sparse cross-stream communication is analyzed in Section 8.
3.2 Batch-Mixing
Transformer layers usually mix hidden states along two axes. Given hidden states , the MLP block is a channel mixer: it applies the same token-wise map over the feature dimension,
without exchanging information across positions or batch elements. Causal self-attention is a sequence mixer. After projecting hidden states to queries, keys, and values,
the output at position t in batch element b is a weighted sum of value vectors from earlier positions in the same sequence,
Thus ordinary causal attention mixes over the sequence index s, but keeps the batch index fixed.
Batch-mixing changes the attention mask so that tokens can also read from other batch elements. In practice, batch-mixing architectures cannot allow all tokens to communicate across the batch, as this quickly becomes computationally intractable.
3.3 BatchParScale
ParScale creates multiple prefix-conditioned streams, but those streams are independent until the final aggregation.
We now introduce BatchParScale (BPS), our first batch-mixing architecture in which B parallel streams are grouped in one forward pass and only designated communication positions may attend across streams. A small set of communication positions mediates information flow between otherwise independent streams. Each stream is processed as its own causal sequence through the shared Transformer, so cross-stream reads are a restricted form of cross-attention where queries come from one sequence and keys and values from another.
For each original sequence, we create streams and group them as a single communication set. Let denote the hidden states of stream entering layer . As in the traditional Transformer, each stream produces
Rather than prepend stream-specific prefix caches, we designate a sparse set of virtual tokens for stream at layer .
Let and stack the keys and values of all P streams,
so a query in stream p could in principle attend to any position in any stream. Cross-stream attention is then computed as
where the mask restricts attention to the allowed pattern. The mask preserves ordinary causal attention within each stream. Across streams, it allows attention only between virtual tokens. For a query at stream p, position t, and a key-value at stream r, position s, attention is allowed exactly when
Thus non-communication tokens cannot directly read another stream. Cross-stream information must be written into a communication position and then propagated forward through ordinary causal attention.
We experimented with three ways to define . One approach inserts K learned vocabulary tokens ([CROSS_ATTEND]) at uniform spacing through the sequence. These tokens have no loss and act only as buffers or scratchpads for moving information from one sequence to another. Another approach keeps sequence length fixed and pre-selects K ordinary token positions, spread uniformly, as communication positions via the mask. Here the virtual role is assigned to content-bearing hidden states rather than separate buffer tokens, much as Longformer designates selected positions as global attention sites (Beltagy et al., 2020).
Our third approach also routes over existing positions, but learns which positions to expose with a per-layer router in the style of Mixture-of-Depths (Raposo et al., 2024). At each layer, a gate head scores every position,
where is the logistic function and is a per-position Bernoulli parameter. During training and prefill, we do not sample from this distribution. Instead, we select a fixed budget of K positions per stream by top-K on the gate logits,
which enforces a sparse cross-stream channel while keeping selection deterministic. The sigmoid gate then scales the attention output at selected positions, letting gradients propagate back to the router. Because top-K routing is undefined at decode time, where only one new position is visible per step, we add an auxiliary BCE head that predicts membership from alone, enabling causal routing without revisiting past positions. Cross-stream queries and keys are restricted to these routed sites via a FlexAttention block mask (PyTorch Labs, 2024; Dong et al., 2024), which compiles to a fused Triton kernel; unless noted otherwise, our main results use this learned router, denoted Dynamic.
4 Toy Tasks
4.1 Parallel Needle-in-a-Haystack
Needle-in-a-haystack is a popular benchmark for measuring whether language models can retrieve information from long contexts (Kamradt, 2023; Liu et al., 2024; Hsieh et al., 2024). To isolate cross-stream retrieval, we introduce a synthetic benchmark called Parallel Needle-in-a-Haystack (PNIAH). Each training example is a single long sequence partitioned into B parallel streams. We call the stream that contains the needle the holder. The holder can answer the question using only local retrieval. The remaining streams are non-holders and their answer can only depend on information from other streams.
We report holder accuracy and non-holder accuracy separately. Each plotted point uses 1000 evaluation examples, so is measured over 1000 holder streams and over 1000( ) non-holder streams. We conduct a sweep over sequence lengths from 128, 256, ...1024, batch sizes and hidden sizes . We use four-layer Transformer models that follow the Qwen3 architecture except for the attention mechanism (Yang et al., 2025). Figure 2 visualizes holder and non-holder accuracies. The x-axis is haystack length and the y-axis is accuracy. Rows fix hidden size and columns fix .
Most models in this sweep solve the holder task, and larger models often solve the non-holder task as well. Counterintuitively, in some settings, non-holder accuracy increases with sequence length.
5 Pretraining
Having shown in toy experiments that batch-mixing can move information across sequences, we next ask whether cross-stream communication helps ordinary language-model pretraining.

Figure 2: PNIAH holder and non-holder accuracy for B = 4 and B = 8. Rows correspond to hidden sizes 32, 64, and 128, columns correspond to B = 4 and B = 8, and the x-axis is log-spaced haystack length. The gray × marks a configuration that did not complete.
For our experiments, we use TinyStories (Eldan and Li, 2023), which is small enough for controlled architecture comparisons while still requiring coherent next-token prediction.
We compare 3 model families on TinyStories. As a baseline reference we train a standard Qwen3 architecture (Yang et al., 2025). We train ParScale at B = 4 and B = 8 (Chen et al., 2025) so we can compare directly against BatchParScale under the same multi-stream setup. Our main models are BatchParScale with Static and Dynamic, at B = 4 and B = 8.
To facilitate the learning of cross-sequence communication, we add noise in the form of masking tokens to each sequence independently, thus forcing sequences to attend to each other to recover lost information. However for a 1-1 comparison to ParScale we also include training runs with masking disabled.
All models are GPT-2-scale with hyperparameters: 12 layers, , 12 attention heads, MLP width 3072, and a 50,257-token vocabulary, otherwise using the Qwen3 architecture (Yang et al., 2025).
In addition to next-token cross-entropy, we evaluate whether BatchParScale can move specific information across streams with a benchmark we name Parallel-QA (PQA).
Each example contains a source record, a masked query, and five candidate completions; we place the record and query in different streams. For each candidate , we score the teacher-forced

Figure 3: Masked-context recovery on TinyStories. Top: masked-token argmax accuracy with cross-stream attention enabled. Bottom: accuracy gain over the same diagnostic with cross-stream attention disabled.
completion as
The predicted answer is the highest-scoring candidate. Accuracy (ArgMax) reports whether that candidate is correct, while rank reports the position of the correct candidate after sorting by score. The concatenated variant puts the record and query in a single ordinary sequence, allowing us to test whether standard within-stream attention can solve the candidate-scoring problem. This setup isolates model capability from cross-stream attention, making it possible to distinguish limitations due to the model itself from those arising specifically from cross-stream communication. Appendix F gives a concrete example of the prompt and stream layout.
Table 1 summarizes the final eval losses. The training-loss curves are shown in Appendix B, Figure 7.
We find that the BatchParScale models cluster around eval loss 1.008-1.014, a small 0.009-0.015 nats below ParScale .
The 30% masked variants also remain below the Qwen3 baseline (Yang et al., 2025), meaning that even when a meaningful portion of the sequence is garbled, our model is able to predict the next token better than the baseline, by retrieving the right context from other sequences. For the ParScale baselines, we use the same aggregation label-smoothing parameter as the ParScale paper, (Chen et al., 2025). Even with this matched regularizer, ParScale B = 8 is substantially worse than ParScale B = 4, suggesting stream collapse or under-utilization of streams.
| Model | Mask | B | Eval loss | PQA acc. | PQA rank | PQA (Concat) acc. |
|---|---|---|---|---|---|---|
| Qwen3 baseline | - | - | 1.711 | - | - | - |
| ParScale | - | 4 | 1.023 | - | - | - |
| ParScale | - | 8 | 1.268 | - | - | - |
| Static-BPS | 0% | 4 | 1.014 | 0.375 | 2.81 | 1.000 |
| Static-BPS | 30% | 4 | 1.485 | 0.250 | 2.75 | 1.000 |
| Dynamic-BPS | 0% | 4 | 1.010 | 0.250 | 3.00 | 0.250 |
| Dynamic-BPS | 30% | 4 | 1.470 | 0.125 | 3.22 | 0.125 |
| Static-BPS | 0% | 8 | 1.010 | 0.500 | 2.44 | 1.000 |
| Static-BPS | 30% | 8 | 1.476 | 0.625 | 1.69 | 1.000 |
| Dynamic-BPS | 0% | 8 | 1.008 | 0.250 | 2.69 | 0.375 |
| Dynamic-BPS | 30% | 8 | 1.453 | 0.125 | 3.22 | 0.250 |
Table 1: TinyStories pretraining results. Eval loss is aggregate validation loss. PQA accuracy/rank evaluate a split source-query probe with examples and five candidates, so chance accuracy is 0.2 and chance rank is about 3. PQA Concatenated accuracy uses the same probe with source and query in one ordinary sequence.
The concatenated column separates model capability from cross-stream communication. Static-BPS reaches perfect concatenated accuracy, showing that ordinary attention can solve the probe when the evidence and query are in one sequence. Its lower cross accuracy on the other hand, shows that the model is not yet able to retrieve important facts from other sequences. Dynamic-BPS has the best aggregate losses, but remains weak even in the concatenated condition, so its low cross accuracy should not be interpreted only as a communication failure, and although its loss is slightly better than Static-BPS, it is not able to solve these. We therefore find that aggregate loss improvements do not, by themselves, demonstrate reliable communication of specific facts between streams.
Figure 3 tracks masked-token argmax accuracy during pretraining on the duplicated 30%-masked validation setup. With cross-stream attention enabled, all four models eventually reach roughly 50% argmax accuracy on masked positions. The lower panel isolates the cross-stream contribution by subtracting the same diagnostic with cross-stream attention disabled. Dynamic-BPS shows a clear gain, reaching about 12–16 percentage points by the end of training, with the largest benefit at B = 8. Static-BPS remains near zero throughout, indicating that its loss improvement in Table 1 is not driven by recovery of masked tokens through the cross-stream channel. These results suggest that dynamic routing learns to borrow cross-stream evidence at corrupted positions, while static routing benefits mainly through generic contextual information rather than recovering specific masked tokens. This hints that alternative data augmentation methods or loss functions might be needed to better incentivize cross-stream communication.
The comparison also shows that dynamic routing is not uniformly better: it improves masked-token recovery, but it does not perform well on PQA.
Figure 4 inspects how the Dynamic-BPS router implements this behavior on 500 non-overlapping TinyStories validation chunks from the , masked model. The router selects 12 positions per stream in every layer. The top panel reports both directions of mask-router coupling: the fraction of virtual tokens that are masks, and the fraction of masked or unmasked tokens that are routed as virtual. Masks are strongly privileged as communication sites ( at layer 1 versus ), while layers 1 and 2 also route masks for 98.0% and 100.0% of virtual positions. The middle panel reports mean cross-stream attention mass from virtual communication positions to virtual keys in other streams, split by whether the query token is masked or unmasked; at layer 1, masked virtual queries route more aggressively than unmasked ones (0.34 versus 0.24). The bottom panel decomposes each virtual query's full attention budget into same-stream non-virtual context, same-stream virtual keys, and cross-stream virtual keys.
Together, Figures 3 and 4 show that Dynamic-BPS learns to route cross-stream communication through corrupted local positions, but they do not yet identify whether the information comes from semantically matched neighboring streams.
To obtain visual intuition for this mechanism, we also created an interactive artifact for the Dynamic-BPS , 30% masked model. The viewer is available here; it lets readers inspect token grids, cross-stream attention edges, and ablation heatmaps for the captured examples. Qualitatively, it shows the same pattern as Figure 4: early layers preferentially select masked tokens as communication sites, while at later layers, relay mass frequently flows through structural anchor points instead of directly targeting the exact visible copy of the masked token. Appendix C gives a targeted positional-offset diagnostic for these captures. Across four masked TinyStories attention-flow runs, cross-stream attention often concentrates on the same sequence position in neighboring streams, and relay mass concentrates near the aligned position even when the aligned token in the other stream is also masked. This suggests that the masked-copy setup can induce a positional addressing shortcut rather than fully content-addressed retrieval.
5.1 Is BatchParScale Selective?
The masked TinyStories results show that batch-mixing can improve language-model loss, but they do not identify what kind of cross-stream information is being used. In the standard masked diagnostic, all four streams are drawn from TinyStories, so neighboring streams will always contain useful distributional context. We therefore evaluate a different setting where not all sequences will be informative, and study whether the virtual tokens have learned to be selective in what information they attend to. For this analysis, we use the Dynamic-BPS , 30% masked TinyStories model and compare masked-token loss with cross-stream attention enabled and disabled.
Each evaluation batch contains four streams. We consider three versions. First, all streams are drawn from a single TinyStories validation batch with 30% masking applied, denoted AAAA or BBBB. Second, streams are split between two disjoint TinyStories validation


cross virtual same virtual same non-virtual
Figure 4: Router diagnostics for the Dynamic-BPS , 30% masked TinyStories model over 500 validation chunks. Top: (bars) and (lines). Middle: cross-stream attention mass from masked versus unmasked virtual queries. Bottom: full attention-budget shares for virtual queries (cross-stream virtual, same-stream virtual, same-stream non-virtual). Layer 0 routes no mask tokens as virtual.
sequences, denoted AABB. Third, half the streams are TinyStories and half are uniformly random token sequences, denoted AAUU or BBUU. We found that stream order didn’t matter for results, so we report the source layouts without separate order variants. All results in Table 2 use 100 masked evaluation batches with masking rate 0.3 for Dynamic-BPS .
Batch-mixing improves masked CE on real TinyStories streams in every condition. The improvement is similar when all neighboring streams are real TinyStories, when the batch mixes two disjoint TinyStories streams, and when half of the neighboring streams are random tokens. In contrast, the random streams do not benefit. Their loss slightly increases when cross-stream attention is enabled.
We also measure how attention is distributed over sequences. Let denote the set of virtual token positions in a batch and let be the attention weight from a virtual token to key . We renormalize over all
| Layout | Source | CE on | CE off | Δ CE | Mass R0 | Mass R1 | Mass R2 | Mass R3 |
|---|---|---|---|---|---|---|---|---|
| AAAA | A | 2.517 | 3.327 | -0.811 | 0.248 | 0.258 | 0.252 | 0.241 |
| AABB | A | 2.557 | 3.311 | -0.754 | 0.366 | 0.368 | 0.134 | 0.131 |
| AABB | B | 2.711 | 3.487 | -0.777 | 0.125 | 0.128 | 0.375 | 0.372 |
| BBBB | B | 2.743 | 3.444 | -0.700 | 0.248 | 0.244 | 0.256 | 0.253 |
| AAUU | A | 2.507 | 3.319 | -0.812 | 0.367 | 0.366 | 0.132 | 0.135 |
| AAUU | U | 12.917 | 12.739 | 0.178 | 0.116 | 0.113 | 0.387 | 0.384 |
| BBUU | B | 2.695 | 3.462 | -0.766 | 0.373 | 0.355 | 0.135 | 0.137 |
| BBUU | U | 12.863 | 12.704 | 0.158 | 0.113 | 0.109 | 0.386 | 0.392 |
Table 2: Source-mismatch masked evaluation for the Dynamic-BPS , masked TinyStories model over 100 validation batches. Row indices follow the layout string left to right (e.g. AABB assigns rows 0–1 to stream A and rows 2–3 to stream B; AAUU assigns rows 0–1 to A and rows 2–3 to U). Mass Ri is the fraction of attention from masked router-selected queries in the source stream to router-selected keys in batch row , renormalized over all router-selected keys in the batch.
virtual tokens,
and report the mass landing on each sequence separately (Mass R0–R3 in Table 2).
We find that sequences allocate relatively little attention mass to sequences different from the source. For example, in AABB and AAUU all rows for B and U get around 0.125 of the probability mass, despite B being more informative than the random noise in U. Thus we find that the model does exhibit selectivity: it can ignore foreign sequences, but it does not distinguish between sequences that are different but still informative (B) and completely random sequences (U).
Even with noisy neighboring streams, masked CE on A or B is lower than the ordinary unmasked next-token CE of the pretrained TinyStories Qwen baseline measured on the same source-mismatch validation setup.
6 Continued Pretraining with LoRA
We next ask whether the same mechanisms can be used when starting from an existing pretrained language model. To study this, we ran a 100M-token FineWeb-Edu continued-pretraining comparison using Qwen3-0.6B with sequence length 512 (Penedo et al., 2024). The multi-stream models use , virtual tokens, and LoRA rank 64 with alpha 128. Table 3 reports the final LM losses and evaluation scores across PNIAH and PMHQA-style datasets. For all candidate-scoring probes, including WikiHop, we rank candidates by mean token log-probability. Training curves for these runs are shown in Appendix D, Figure 8.
As a stronger task-specific control, we also fine-tune a BatchParScale adapter directly on WikiHop with split evidence across parallel streams (Appendix H). Each example forms one batch-parallel forward pass: three support documents occupy separate streams and a fourth target stream contains the query and supervised answer tokens, with LoRA on Qwen3-0.6B and dynamic cross-stream attention enabled. Training minimizes the split-evidence objective
so only target answer tokens are supervised while evidence streams still influence predictions through cross-stream attention.
The LM-loss result is encouraging for ordinary continued pretraining: ParScale and the no-mask BatchParScale run both improve over the Qwen3 LoRA baseline. For the masked LoRA runs, we also log the same masked-context diagnostic used in TinyStories pretraining: masked-token argmax accuracy with cross-stream attention enabled versus disabled on duplicated validation batches. Appendix Figure 9 shows a clear gap, reaching roughly 14 percentage points on the -mask run and 10 percentage points on the -mask run, suggesting that the fine-tuned model uses neighboring streams to recover corrupted tokens.
The QA diagnostics in Table 3 show a sharper limitation. The plain Qwen baselines solve the concatenated versions of PNIAH and PMHQA, so the tasks are answerable when all evidence is placed in one ordinary context. The BatchParScale adapters, however, remain close to chance on non-holder PNIAH and PMHQA, and disabling cross-stream attention is often comparable or better.
WikiHop, however, shows a different pattern: the concatenated baseline reaches 36% accuracy, whereas our CPT adapters reach 20–27%, meaningfully above chance and close to the dedicated BatchParScale B = 4 WikiHop fine-tuning run at 30%.
For additional notes on QA-finetuning experiments and methods see Appendix H.
7 Multi-Agent Reinforcement Learning
Our longer-term motivation is not only to let parallel streams exchange information, but to let them learn coordinated strategies. This section studies multi-agent coordination problems at a small scale. Each agent's observation history is treated as a stream, and the policy must learn when information from other streams is useful for coordinated action.
We study six policy classes: MLP, RNN, Temporal Transformer, Agent Transformer, Temporal-Agent Transformer, and BatchParScale. For each environment state, agent i at time t observes , which is embedded into a token . The policy outputs an action distribu-
| Model | Mask | Train | Eval | PN on | PN off | PN cat | PM on | PM off | PM cat | WH on | WH off | WH cat |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Qwen3 base | - | - | - | - | - | 1.000 | - | - | 1.000 | - | - | .360 |
| Qwen3 LoRA | - | 3.079 | 3.121 | - | - | 1.000 | - | - | 1.000 | - | - | .350 |
| ParScale B = 4 | - | 2.890 | 2.912 | - | - | - | - | - | - | - | - | - |
| BatchParScale B = 4 | 0% | 2.889 | 2.853 | .094 | .107 | - | .260 | .350 | - | .230 | .060 | .200 |
| BatchParScale B = 4 | 30% | 3.879 | 3.932 | .112 | .117 | - | .220 | .340 | - | .270 | .130 | .200 |
| BatchParScale B = 4 | 50% | 4.682 | 4.777 | .102 | .133 | - | .300 | .290 | - | .210 | .110 | .210 |
| BatchParScale B = 4 WikiHop | - | - | - | - | - | - | - | - | - | .300 | .230 | - |
Table 3: FineWeb-Edu LoRA continued-pretraining and QA evaluation results. Train and eval are ordinary FineWeb-Edu next-token losses after 100M unique training tokens. PN is Parallel-NIAH non-holder accuracy, PM is four-way Parallel-MHQA accuracy, and WH is WikiHop candidate accuracy. On/off denote cross-stream attention enabled and disabled for BatchParScale rows. Cat(concatenated) puts all evidence in one ordinary sequence. All candidate-scoring columns use mean token log-probability, which avoids the length bias of sequence-sum scoring. The BatchParScale WikiHop row reports the direct split-evidence fine-tuning control from Appendix H.
tion
where is the final representation for that agent and timestep. In our current implementations, transformer tokens are observation-history tokens, not separate observation and action tokens. Previous actions are used by PPO (Schulman et al., 2017) for the policy-gradient objective, and available-action masks are applied to the output logits, but actions are not fed back as tokens in the attention sequence. The Temporal Transformer applies causal attention independently within each agent's history,
The Agent Transformer attends across agents only at the current timestep,
The Temporal-Agent Transformer flattens time and agents into one sequence and allows dense causal attention across both axes,
At long sequences, this architecture becomes infeasible. It is also a natural upper reference for BatchParScale, because it can use dense attention across agents and time rather than communicating only through selected positions.
BatchParScale keeps a separate temporal stream for each agent and permits cross-agent communication only through selected virtual tokens,
We note that BatchParScale is at a significant disadvantage compared to our most expressive model Temporal-Agent-Transformer which can do full dense attention across all streams.
All policies are trained with a MAPPO-style actor-critic objective. This follows the centralized-training, decentralized-execution paradigm: the critic receives centralized world-state histories during training, while the actor acts from per-agent observation histories. For BatchParScale, Agent-Transformer, and Temporal-Agent-Transformer, decentralized execution still includes learned communication, because each agent stream can read selected hidden states from other agent streams. For each policy class, the critic receives centralized world-state histories and uses the corresponding architecture family. The comparison therefore keeps the MAPPO-style training setup fixed across policies, but it does not hold the critic architecture fixed.
| Task | Policy | Final | Std. | Best | Last 10 |
|---|---|---|---|---|---|
| Spread | MLP | -22.7 | 0.4 | -22.3 | -22.7 |
| Spread | RNN | -21.0 | 0.2 | -20.7 | -21.3 |
| Spread | Agent | -19.3 | 0.4 | -18.8 | -19.2 |
| Spread | Temporal | -19.2 | 0.2 | -18.8 | -19.2 |
| Spread | Temporal-Agent | -19.1 | 0.4 | -18.3 | -18.8 |
| Spread | BatchParScale | -18.9 | 0.3 | -18.5 | -19.0 |
| Reference | MLP | -27.0 | 0.4 | -25.8 | -26.9 |
| Reference | RNN | -21.3 | 0.3 | -20.5 | -21.2 |
| Reference | Agent | -20.6 | 0.2 | -20.3 | -21.0 |
| Reference | Temporal | -19.7 | 0.4 | -19.3 | -20.0 |
| Reference | Temporal-Agent | -20.0 | 0.5 | -19.7 | -20.3 |
| Reference | BatchParScale | -19.6 | 0.3 | -19.2 | -19.8 |
Table 4: MPE Simple Spread and Simple Reference results, 500K timesteps per run, seeds 0–2. Higher return is better. RNN is the official recurrent baseline; Agent, Temporal, and Temporal-Agent are transformer policies.
7.1 MPE
The MPE tasks are small but communication-sensitive coordination problems (Lowe et al., 2017). Table 4 reports the three-seed results. On Simple Spread and Simple Reference, BatchParScale is competitive with the Temporal-Agent Transformer.
7.2 SMAX
SMAX is a harder stress test for sparse virtual-token communication, implemented through the JaxMARL SMAX suite (Samvelyan et al., 2019; Rutherford et al., 2023). Table 5 summarizes the main SMAX comparison. Across three rerun seeds, the strongest policies vary
| Policy | Return | Std. | Win rate | Time |
|---|---|---|---|---|
| MLP | 1.5 | 0.7 | 0.65 | 212s |
| RNN | 1.2 | 0.6 | 0.35 | 342s |
| Agent Transformer | 1.1 | 0.5 | 0.30 | 223s |
| Temporal Transformer | 0.8 | 0.0 | 0.09 | 645s |
| Temporal-Agent Transformer | 0.8 | 0.1 | 0.09 | 1231s |
| BatchParScale | 0.8 | 0.0 | 0.07 | 1307s |
Table 5: JaxMARL SMAX 5m_vs_6m, seeds 0–2, about 10M environment steps per seed. Higher return and win rate are better. Time is mean wall-clock time per seed. Win-rate spread was not logged for this summary.
| Policy | Final | Std. | Best | Last 10 |
|---|---|---|---|---|
| MLP | 74 | 2 | 79 | 74 |
| RNN | 97 | 11 | 113 | 96 |
| Agent Transformer | 110 | 2 | 114 | 107 |
| Temporal Transformer | 95 | 5 | 101 | 92 |
| Temporal-Agent Transformer | 96 | 7 | 99 | 93 |
| BatchParScale | 85 | 3 | 89 | 84 |
Table 6: MABrax HalfCheetah 6x1, seeds 0–2, 500K timesteps per run. Metrics are rollout returns; higher is better.
substantially, while the temporal-attention policies fail on this task with consistently low scores. BatchParScale remains close to the temporal and Temporal-Agent transformer means, but all agent communication mechanisms are weak on this task and a simple MLP performs best, suggesting multi-agent coordination is not critical for this task.
7.3 MABrax
MABrax gives a continuous-control counterexample to the MPE gains (Freeman et al., 2021; Rutherford et al., 2023). Table 6 reports the HalfCheetah results. BatchParScale learns and improves over the MLP baseline, but it underperforms the temporal and agent transformers on this HalfCheetah task.
7.4 Jumanji Search and Rescue
SearchAndRescue tests partial observability more directly (Bonnet et al., 2024). Table 7 reports the main SearchAndRescue setting. For results varying the number of vision rays and searchers, see Figure 10.
Appendix Table 8 reports a sweep over the visibility parameter. BatchParScale beats Temporal-Agent in four of six settings.
Overall, BatchParScale participates in learned coordina-
| Policy | Found | Std. | Remaining | Time |
|---|---|---|---|---|
| MLP | 18.4 | 0.4 | 0.08 | 44.5s |
| RNN | 18.1 | 0.9 | 0.10 | 144.0s |
| Agent Transformer | 19.2 | 0.6 | 0.04 | 67.6s |
| Temporal Transformer | 18.4 | 1.3 | 0.08 | 110.5s |
| Temporal-Agent Transformer | 19.7 | 0.2 | 0.02 | 99.3s |
| BatchParScale | 19.4 | 0.4 | 0.03 | 111.8s |
Table 7: Jumanji SearchAndRescue-v0, seeds 0–4, 500K timesteps per run with 4 searchers, 20 targets, time limit 200, and 64 vision rays. Higher found and lower remaining are better.

Figure 5: Single-layer prefill/block overhead on an A100 for at , normalized by local causal attention. Crosses mark out-of-memory runs. The direct masked implementation can erase the expected advantage over dense cross-stream attention.
tion: strong on MPE, competitive on SearchAndRescue. They are also mixed: BatchParScale underperforms on MABrax and does not solve the harder SMAX setting. Sparse communication is therefore useful, but not a complete substitute for denser temporal-agent attention.
8 Performance and Hardware-Aware Cross-Stream Attention Mechanisms
The computational appeal of BatchParScale is that streams or sequences communicate through a small set of tokens rather than through fully dense attention. With streams of length , independent causal attention costs , while allowing every token in every stream to attend across all streams costs . If each stream exposes only communication positions, the intended cost becomes . However, Figure 5 shows that the asymptotic advantage does not show up in practice, and BatchParScale has a large overhead and even runs slower than fully dense cross-stream attention.
The direct implementation is slow because FlexAttention does not handle the resulting irregular mask efficiently.
We thus propose a two-pass implementation. Let be the selected positions in stream , and let be its hidden states. The first pass runs local causal attention within each stream. The second pass gathers the selected states into a compact block:
For a selected query , let be its local-causal key set and let be the gathered selected-key set with

Figure 6: Single-layer timing normalized by local causal attention. Dense cross-stream attention grows expensive with sequence length and batch count; exact two-pass attention stays close to local causal attention while matching the selected-token output.
keys already present in removed. The two attention passes produce local and global outputs and , while retaining their log normalizers:
The virtual token output is then merged as
Because and are disjoint, this is exactly the same softmax as attention over , which is the original selected-token mask. The merge is the standard log-sum-exp combination used in FlashAttention-style tiled kernels. The cost is , and the term is computed by its own small dense attention kernel.
Another benefit of this decomposition is that, as in Longformer (Beltagy et al., 2020), we can use separate query, key, and value projections for the local causal pass and for attention over gathered virtual-token states, without changing the merged output above. Dedicated projections would let virtual-token queries and keys specialize for cross-stream retrieval rather than reusing representations tuned for local language modeling.
Figure 6 compares our two-pass implementation with local causal attention and dense attention across sequences. Two-pass BatchParScale remains close to the local causal baseline, while fully dense attention becomes increasingly expensive as sequence length and batch count grow.
9 Conclusion
In this paper we introduce batch-mixing as a new class of sequence models for coordinated parallel computation. For a concrete and hardware-efficient instantiation of such a model we proposed BatchParScale, and showed that, when implemented carefully, it can exhibit negligible overhead compared to standard self-attention. We showed it can learn controlled cross-stream retrieval on parallel-needle-in-a-haystack, outperforms ParScale on language modelling on TinyStories and FineWeb-Edu, and can perform competitively on many MARL tasks.
Although 30%-masked BatchParScale models beat the Qwen baseline on pretraining loss and cross-stream attention improves masked-token recovery, we find that on PNIAH all models meaningfully underperform the concatenated version, suggesting that streams still cannot reliably recover facts from parallel streams. PMHQA remains near chance despite strong holder accuracy, suggesting that language-modelling loss improvements do not yet correlate with reliable retrieval to streams that must answer without local evidence. This suggests that our current pretraining approach alone does not incentivize the cross-stream retrieval and communication these benchmarks measure. Also, whereas BatchParScale at 30% noise was able to outperform the baseline on pretraining, we do not find this to be the case for finetuning. Whether this is due to the much harder language-modelling objective or the smaller space of weights to tune remains in question.
Future work should focus on better training objectives and data augmentation techniques to incentivize multi-sequence communication and coordination. For example, instead of just masking, we could mix in or rephrase data from other streams to encourage true cross-sequence reasoning instead of copying. Additionally, future experiments should further extend pretraining and finetuning to larger model sizes, helping us understand how this method performs at larger scales and on more challenging data mixtures.
A SearchAndRescue Visibility Sweep
| Setting | Vision | Agent | Temporal-Agent | BatchParScale | Δ |
|---|---|---|---|---|---|
| Sparse | 4 | 17.29 | 16.87 | 17.18 | +0.31 |
| Sparse | 8 | 15.69 | 16.23 | 15.49 | -0.74 |
| Sparse | 16 | 15.84 | 15.52 | 16.18 | +0.66 |
| Sparse | 24 | 15.78 | 16.01 | 16.53 | +0.52 |
| Large | 12 | 12.39 | 10.55 | 11.87 | +1.32 |
| Large | 16 | 10.22 | 10.16 | 10.58 | +0.41 |
Table 8: SearchAndRescue visibility sweep, reporting final targets found over five seeds. Sparse settings use env size 2.0, 4 searchers, 25 targets, and time limit 300; large settings use env size 4.0 and time limit 800. is BatchParScale minus Temporal-Agent. Higher is better.
B TinyStories Training Loss
No mask and baselines

30% masked duplicate
Figure 7: Zoomed TinyStories training loss over unique tokens for the same runs summarized in Table 1. The plot omits the first 25M unique tokens and applies a 9-point median smoothing window so that late-training differences are visible. The top panel shows no-mask Static-BPS and Dynamic-BPS runs together with Qwen3 and ParScale baselines; the BPS curves cluster below ParScale , while the y-axis zoom clips the highest-loss baseline segments. The bottom panel shows the masked duplicate runs.
C Positional Copy-Shortcut Diagnostics
The masked TinyStories experiments duplicate a validation sequence across parallel streams and independently mask each stream. This setup is useful because a masked token in one stream may be visible in another stream. However, exact duplication also creates a possible shortcut: the model can address the same sequence position in another stream rather than retrieve by content. We therefore run a positional-offset diagnostic on four Dynamic-BPS attention-flow captures with , masking rates and , and sequence length 128. For every cross-stream attention edge from query position to key position , we record the relative offset
We aggregate attention mass over per layer and per head. A concentration at means that a head reads the aligned position in another stream. For masked queries, we additionally inspect relay sources from the attention-flow artifact. The relay score composes head-mean local attention before and after one cross-stream bridge, then records the largest source positions contributing to each masked query. This gives a coarse source-level view of where cross-stream information appears to originate.
| Run | oracle | non-oracle | |
|---|---|---|---|
| , mask 30% | 2.3 | 2.8 | 37.2 |
| , mask 50% | 1.1 | 7.7 | 40.6 |
| , mask 30% | 0.1 | 7.2 | 40.9 |
| , mask 50% | 0.2 | 4.8 | 42.4 |
Table 9: Relay-source offset diagnostics. Values are percentages of top-source relay mass. Oracle means the aligned position in another stream contains the visible copy of the masked token. Non-oracle means the aligned position is also masked, so the token identity is not available at that location.
The diagnostic shows two related effects. First, some heads are strongly position locked. In the runs, late-layer heads such as L9H4, L9H7, and L9H9 put roughly of their cross-stream attention mass on . These heads mostly read the same position in another stream. Second, the relay-source diagnostic shows that exactly aligned relay mass is often larger for non-oracle aligned positions than for oracle aligned positions. That is, relay mass can land on the same position in a neighboring stream even when that position is also masked.
The relay mass is not only concentrated at the exact aligned token. Around 37%–42% of top-source relay mass lies within four tokens of the aligned position, far above the uniform baseline of about 3.5% for a length-128 sequence. The largest offsets are typically just before the query position. This suggests a mechanism in which the model imports local context from the aligned neighborhood of another stream, rather than directly copying the visible target token itself.
These results support a positional-addressing interpretation of the masked-copy gains. Cross-stream attention appears to exploit the fact that the streams are exact aligned copies, so the same position or nearby positions in another stream are likely to contain useful context. This is useful for masked-token recovery, but it is weaker than content-addressed retrieval. It also helps explain why aggregate masked-token improvements do not necessarily translate into reliable transfer of non-redundant facts in PNIAH, PMHQA, or WikiHop-style probes.
This diagnostic has important limitations. It uses attention weights rather than value norms or direct logit attribution, and the relay source analysis is truncated to the top recorded sources per masked query. The relay computation also uses head-mean attention and a restricted local-to-cross-to-local path form. A stronger causal test would shift the duplicated streams by tokens and measure masked-token recovery as a function of , or inject disagreeing copies and test whether pre-dictions follow the copied stream against local context.
D FineWeb Continued-Pretraining Training Loss

Qwen3
BatchParScale 30% mask
ParScale B=4
BatchParScale 50% mask
BatchParScale 0% mask
Figure 8: FineWeb-Edu LoRA continued-pretraining training loss over unique tokens for the runs summarized in Table 3. The top panel shows all five runs. The bottom panel zooms in on the Qwen3, ParScale, and no-mask BatchParScale runs. The masked BatchParScale variants have substantially higher language-model loss, even though the no-mask BatchParScale run is competitive with the regular ParScale baseline. Periodic oscillations reflect the fixed ordering of the training stream.
E FineWeb Masked-Context Accuracy

Figure 9: Masked-context recovery diagnostics for the masked FineWeb-Edu LoRA continued-pretraining runs summarized in Table 3. The top panel evaluates masked-token argmax accuracy with cross-stream attention enabled. The bottom panel reports accuracy gain over the same diagnostic with cross-stream attention disabled.
F Cross-Stream Candidate Probe Example
The first deterministic TinyStories candidate-scoring probe example, using seed 0, is:
Source record: Alice and Jack went to the school yard. They met Sam near a paper crown. Sam smiled and asked their names. Alice said, “We are Alice and Jack.”
Masked query: [MASK] and [MASK] went to the school yard. They met Sam near a paper crown. Sam asked their names. They answered, “Our names are
Correct completion: Alice and Jack.
Candidates: Alice and Sam.; Lily and Max.; Alice and Jack.; Jane and Kate.; Sam and Jack.
The concatenated control puts the record and query in one ordinary sequence:
Read the record and complete the answer.
Record: Alice and Jack went to the school yard. They met Sam near a paper crown. Sam smiled and asked their names. Alice said, “We are Alice and Jack.”
[MASK] and [MASK] went to the school yard. They met Sam near a paper crown. Sam asked their names. They answered, “Our names are candidate
The cross-stream condition for separates the evidence from the target stream: Table 10 gives the stream layout.
| Stream | Text used while scoring one candidate |
|---|---|
| 0 | Source record only |
| 1 | Masked query followed by <candidate> |
| 2 | Neutral background note about the school yard. |
| 3 | Neutral background note about the paper crown. |
Table 10: Stream layout for the cross-stream candidate probe. The callback repeats this layout once for each candidate and scores the candidate tokens on stream 1.
Thus, in the cross-stream condition, stream 1 can only prefer the correct candidate if information from stream 0 is made available through the cross-stream communication path.
G Multi-Stream Generation Example
Table 11 shows a qualitative sample from the completed TinyStories Static-BPS , no-mask run. We use greedy decoding for 32 new tokens from four related toy-shop prompts. The example is qualitative only, but it illustrates the intended inference layout: several streams are decoded in parallel and each stream maintains a distinct continuation.
Table 12 gives a second example from the completed dynamic local-causal , mask run. Here we begin from ordinary masked-evaluation copies of the same TinyStories validation sequence, then sample 20 new tokens from each masked stream without applying any further masking during generation. The prefixes shown are the final story segment of the full 128-token prompt.
The second stream invents the name “Remy” even though the unmasked story is about Roxy, illustrating that masked-prefix recovery remains imperfect.
H Parallel-MHQA Fine-Tuning
This appendix gives the details behind the QA diagnostics summarized in Table 3. We use these probes to test whether the masked-context benefit in continued pretraining corresponds to usable cross-stream transfer. Parallel-NIAH (PNIAH) extends the holder/non-holder setup from Section 4.1 to real FineWeb-Edu documents. Each example has parallel streams, one randomly chosen holder stream contains a synthetic needle of the form The secret access code is "XXX-YYYY", and the remaining non-holder streams contain unrelated text with the answer redacted. At evaluation time, every stream is asked for the code and scored with a 10-way multiple-choice test over synthetic codes in the same format: the true answer plus nine randomly generated distractors. For each candidate we teacher-force the completion and rank options by mean token log-probability, following the same candidate-scoring procedure as ParallelQA; chance is 0.1. We report non-holder accuracy , i.e. whether streams that do not locally contain the needle select the correct code. Holder accuracy measures only local retrieval and is therefore not the metric of interest here. This design avoids treating target-row shortcuts or memorized NIAH benchmark facts as evidence of cross-stream communication.
Parallel-MHQA (PMHQA) extends ParallelQA to a split-evidence multi-hop setting. ParallelQA in Section 5 tests single-hop cross-stream retrieval: a source record in one stream must help a masked query in another select among five name completions. PMHQA is not built from an existing multi-hop benchmark; we generate 100 fully synthetic two-hop cases with random person names, project titles, and reference codes. Each case is authored as two short records that form a controlled chain; for example, “Record 1: Aria assigned reference code ABC-123 to the Cedar initiative” and “Record 2: Milo says Nora should use Aria’s reference for the Cedar initiative”. We place the two records on separate streams while a target stream asks which code Nora should use. The target stream lists four synthetic code options and is scored with the same teacher-forced candidate-ranking procedure as ParallelQA; chance and the best constant-position baseline are both 0.25. Answering therefore depends on chaining both facts through cross-stream attention, not on retrieving a single locally absent fact or on pretrained WikiHop-style knowledge. We run this probe on continued-pretraining adapters rather than the TinyStories from-scratch models, because the multi-hop composition is substantially harder and would be difficult to interpret on models whose reasoning capacity is still largely untrained.
Both communication diagnostics remain weak. On PNIAH, remains close to chance even though holder accuracy is near perfect. The multi-hop QA probe is also near chance: the BatchParScale runs reach 0.26, 0.22, and 0.30, and the controls with cross-stream attention disabled are 0.35, 0.34, and 0.29, respectively. On two of the three settings, disabling the cross-stream channel is better, so the channel can actively hurt this probe or the differences are noise at n = 100. For this task we also trained a non-holder-only objective,
where is the holder stream. Fine-tuning an existing LM can preserve or mobilize local knowledge and can lower language-model loss, but reliable transfer to streams that do not contain the evidence remains unresolved. Reliable transfer to non-holder streams is the clearest failure we observe, and it makes routing the natural target for future work.
We also run direct split-evidence QA fine-tuning probes. The goal is to test a stronger intervention than continued pretraining: if we explicitly fine-tune the model on answer supervision where evidence is placed in neighboring streams, does it learn to retrieve those facts through batch-mixing? Table 13 summarizes these direct fine-tuning controls. These experiments are useful mainly as controls, because standard QA datasets can be answered from target-row artifacts or pretrained knowledge. Each example is represented as streams. Some streams
| Stream | Prompt | Greedy continuation |
|---|---|---|
| 0 | In the toy shop, Anna picked up a tiny drum. | She was so excited! She took it home and started to play. Anna’s mom saw her playing and said, “That drum looks so cute!” |
| 1 | In the toy shop, Ben looked for a yellow train. | He found one and said, “I want this one!” The shopkeeper said, “That’s a nice train. It will fit in your hand” |
| 2 | In the toy shop, the shopkeeper smiled and opened a box. | Inside the box was a toy car. The car was red and shiny. The shopkeeper said, “This car is for you!” The little boy |
| 3 | In the toy shop, a kitten slept under the shelf. | The kitten was very cute and soft. Lily wanted to take the kitten home, but her mom said no. Lily was sad, but she listened |
Table 11: Generated multi-stream TinyStories sample from the completed Static-BPS , no-mask run udilkiu0. Continuations are greedy decodes with max_new_tokens=32.
| Stream | Masked prefix tail | Sampled continuation |
|---|---|---|
| 0 | Once a time, in big , there lived a rhinoceros named Roxy. Roxy loved to climb. She climbed , rocks, and hills One day, Roxy found an icy | . She thought it would be fun to climb it. Roxy climbed and climbed, but |
| 1 | Once upon a , in a big forest, lived a rhinoceros R . R loved climb. She climbed trees, , and hills. One , R found an icy hill | . It was so cold, she thought she would freeze! Remy wanted to see how |
| 2 | Once upon time, a big forest , there a rhin eros named oxy. Roxy loved to climb. She climbed trees, rocks, . day, Roxy found an icy hill | . She thought it would be fun to climb the icy hill. Roxy started to climb |
| 3 | upon a time , in a forest, there lived oc named Roxy Roxy to trees, rocks, and hills. One day , Roxy hill | and decided to climb it. As Roxy climbed, she met a tiny bird named Ch |
Table 12: Masked-prefix multi-stream TinyStories sample from the completed dynamic local-causal , 30% mask Hugging Face model. Each row is one masked copy of the same validation prefix.
contain evidence, while one target stream contains the question and answer format. Unless otherwise stated, only answer tokens on the target stream contribute to the supervised loss:
where is the set of answer-token positions in target stream . The evidence streams still participate in the forward pass and can influence the target prediction through cross-stream attention, but they are not asked to reproduce the target answer. For the matched isolated control we disable batch-mixing and train the same target loss,
A high isolated-control result means that the benchmark is not cleanly measuring cross-stream evidence. It suggests that pretrained knowledge, benchmark artifacts, or target-row shortcuts can explain the apparent gain.
| Task | Train | Eval | Ctrl. | Cross |
|---|---|---|---|---|
| WikiHop | 800 | 100 | .230 | .300 |
| QASC | 800 | 926 | .454/.185 | .472 |
| Guarded QA | 800 | 926 | .125 | .146 |
| QA-v4 | 800 | 128 | .117 | .164 |
Table 13: Direct split-evidence QA fine-tuning probes. Values are accuracies. Control is isolated split accuracy, except QASC reports question/options-only followed by isolated split accuracy. Cross-stream is the best split-evidence fine-tuning result. WikiHop uses candidate scoring with chance about 0.047; the other multiple-choice tasks have chance 0.125. QA-v4 has 926 validation examples; for comparability across these runs we report the fixed 128-example evaluation.
We ran these probes on WikiHop-style candidate scoring (Welbl et al., 2018), QASC (Khot et al., 2020), and two guarded synthetic multiple-choice tasks. WikiHop reaches 0.300 in the best direct split-evidence run, but the isolated split control already reaches 0.230, far above the random-candidate baseline. QASC is even less clean: a base model with only the question and answer options reaches 0.454, close to the best split cross-stream result of 0.472. These results show that pretrained knowledge, candidate-list artifacts, and target-row lexical signal can explain much of the apparent success.
The guarded synthetic tasks remove those shortcuts and give a sharper negative result. On the first guarded synthetic task, the isolated control remains at chance, but the best cross-stream run is only 0.146 and the correct-answer probability remains essentially uniform. Synthetic QA-v4 makes the same point more directly: a full-context SFT model reaches 0.984 accuracy when both evidence rows are placed in one sequence, while the isolated split model reaches 0.117 and the best split cross-stream variant reaches only 0.164. We also tried reader variants that scored candidates stream-by-stream, message variants that placed short summaries in communication positions, and latent-memory variants with extra shared slots, but none closed the gap to full context. By this standard, the current multi-hop QA results are short probes rather than final benchmarks.
I Additional MARL Architectures
Table 14 collects non-core MARL policy variants used as architecture probes but excluded from the main comparison set.

Figure 10: SearchAndRescue env-size 4.0 visibility sweeps ordered by target count. Rows scale the number of searchers and targets together: 4 searchers with 25 targets, 8 searchers with 50 targets, and 16 searchers with 100 targets. Points report mean final targets found over five seeds, with error bars showing standard deviation. Higher is better.
J Default Cross-Stream Attention Mask
We define the mask used for the default sparse cross-stream attention pattern, omitting implementation switches for dropout, padding, and ablation modes. Consider one original example expanded into streams. Within a layer , index a query by and a key-value by , where are stream indices and are sequence positions. Let be the communication positions selected for stream . The Boolean allow-mask is defined by
if and only if either
or
Equivalently, same-stream tokens use standard causal self-attention, while cross-stream attention is available only from a communication query position to a communication key-value position in another stream, with the same causal order constraint. The additive attention mask used in the softmax is
For a static virtual-token model, is the fixed set of virtual-token positions. For a routed model, is the layerwise top-K set selected by the router.
J.1 FlexAttention Mask Implementation
In FlexAttention, the mask is implemented as a Boolean mask_mod rather than as a materialized additive mask (PyTorch Labs, 2024; Dong et al., 2024). We flatten the stream and sequence axes inside each communication group:
Thus FlexAttention calls mask_mod with flattened query and key-value indices. The default sparse rule is implemented by recovering the stream and position indices, then returning the local causal rule or the cross-stream communication rule:
def mask_mod(b, h, q_idx, kv_idx): q_stream = q_idx // seq_len q_pos = q_idx % seq_len kv_stream = kv_idx // seq_len kv_pos = kv_idx % seq_len
same_stream = ( q_stream == kv_stream ) causal = kv_pos <= q_pos local = same_stream & causal
q_selected = selected[ b, q_stream, q_pos ] kv_selected = selected[ b, kv_stream, kv_pos ] cross = ( (~same_stream) & q_selected & kv_selected & causal )
return local | cross
| Benchmark | Policy | Final | Std. / Win | Best | Last 10 / Time |
|---|---|---|---|---|---|
| SMAX | Perceiver Transformer | 1.2 | 0.6 / 0.38 | - | 1580s |
| SMAX | Agent-Query Perceiver | 1.6 | 0.6 / 0.67 | - | 1418s |
| SMAX | Agent-Query Sink Perceiver | 1.2 | 0.6 / 0.39 | - | 1806s |
| SMAX | Agent-Query Sink Perceiver + RoPE | 2.0 | 0.0 / 0.96 | - | 1892s |
| SMAX | Sparse Cross-Batch Transformer | 0.7 | 0.0 / 0.02 | - | 1565s |
| MABrax | Last-token Agent Transformer | 90 | 13 | 106 | 94 |
| MABrax | Perceiver Transformer | 93 | 4 | 100 | 92 |
Table 14: Additional MARL architecture probes excluded from the main tables. SMAX entries use seeds 0, 1, and 2 from the A100 num_envs=64 rerun; their second metric reports return standard deviation / mean win rate, and the final column is mean wall-clock time per seed. MABrax entries report rollout-return standard deviation, best rollout return, and mean last-10 rollout return. -- indicates that a baseline was not run for that suite. RoPE denotes rotary position embeddings (Su et al., 2024).
Here selected has shape , where is the number of original examples in the batch after grouping, is the number of streams, and is the per-stream sequence length. The tensors passed to FlexAttention have shape , obtained by reshaping from . The full call is:
q_flat = q.permute( 0, 2, 1, 3, 4 ).reshape(G, H, P * n, d_h) k_flat = k.permute( 0, 2, 1, 3, 4 ).reshape(G, H, P * n, d_h) v_flat = v.permute( 0, 2, 1, 3, 4 ).reshape(G, H, P * n, d_h)
block_mask = create_block_mask( mask_mod, B=G, H=H, Q_LEN=P * n, KV_LEN=P * n, device=q.device, )
out_flat = flex_attention( q_flat, k_flat, v_flat, block_mask=block_mask, )
out = out_flat.reshape( G, H, P, n, d_h ).permute(0, 2, 1, 3, 4)
For static virtual tokens, selected is a fixed Boolean position mask broadcast across groups and streams. For dynamic routing, selected is produced by a per-stream top-K router over sequence positions.
References
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations.
Iz Beltagy, Matthew E. Peters, and Arman Cohan. 2020.
Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150.
Clément Bonnet, Daniel Luo, Donal Byrne, Shikha Surana, Sasha Abramowitz, Paul Duckworth, Vincent Coyette, Laurence I. Midgley, Elshadai Tegegn, Tristan Kalloniatis, Omayma Mahjoub, Matthew Macfarlane, Andries P. Smit, Nathan Grinsztajn, Raphael Boige, Cemlyn N. Waters, Mohamed A. Mimouni, Ulrich A. Mbou Sob, Ruan de Kock, and 5 others. 2024. Jumanji: A diverse suite of scalable reinforcement learning environments in JAX. In International Conference on Learning Representations.
Bradley Brown, Jordan Juravsky, Ryan Ehrlich, Ronald Clark, Quoc V. Le, Christopher Ré, and Azalia Mirhoseini. 2024. Large language monkeys: Scaling inference compute with repeated sampling. Preprint, arXiv:2407.21787.
Lucian Busoniu, Robert Babuška, and Bart De Schutter. 2008. A comprehensive survey of multiagent reinforcement learning. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 38(2):156–172.
Mouxiang Chen, Binyuan Hui, Zeyu Cui, Jiaxi Yang, Dayiheng Liu, Jianling Sun, Junyang Lin, and Zhongxin Liu. 2025. Parallel scaling law for language models. arXiv preprint arXiv:2505.10475.
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. 2019. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509.
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Alex Ray, and John Schulman. 2021. Training verifiers to solve math word problems. Preprint, arXiv:2110.14168.
Abhishek Das, Theophile Gervet, Joshua Romoff, Dhruv Batra, Devi Parikh, Michael Rabbat, and Joelle Pineau. 2019. TarMAC: Targeted multi-agent communication. In International Conference on Machine Learning.
Juechu Dong, Boyuan Feng, Driss Guessous, Yanbo Liang, and Horace He. 2024. Flex attention: A programming model for generating optimized attention kernels. Preprint, arXiv:2412.05496.
Ronen Eldan and Yuanzhi Li. 2023. Tinystories: How small can language models be and still speak coherent english? Preprint, arXiv:2305.07759.
C. Daniel Freeman, Erik Frey, Anton Raichuk, Sertan Girgin, Igor Mordatch, and Olivier Bachem. 2021. Brax: A differentiable physics engine for large scale rigid body simulation.
Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya, Dima Rekesh, Fei Jia, Yang Zhang, and Boris Ginsburg. 2024. RULER: What's the real context size of your long-context language models? In Conference on Language Modeling.
Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch, Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, Olivier J. Hénaff, Matthew Botvinick, Andrew Zisserman, Oriol Vinyals, and Joao Carreira. 2022. Perceiver IO: A general architecture for structured inputs and outputs. In International Conference on Learning Representations.
Andrew Jaegle, Felix Gimeno, Andy Brock, Andrew Zisserman, Oriol Vinyals, and Joao Carreira. 2021. Perceiver: General perception with iterative attention. In International Conference on Machine Learning.
Greg Kamradt. 2023. Needle in a haystack: Pressure testing LLMs. https://github.com/gkamradt/LLMTest_NeedleInAHaystack.
Tushar Khot, Peter Clark, Michal Guerquin, Peter Jansen, and Ashish Sabharwal. 2020. QASC: A dataset for question answering via sentence composition. In AAAI Conference on Artificial Intelligence, volume 34, pages 8082–8090.
Yegon Kim, Seungyoo Lee, Chaeyun Jang, Hyungi Lee, and Juho Lee. 2026. Parallel test-time scaling with multi-sequence verifiers. Preprint, arXiv:2603.03417.
Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. 2019. Set transformer: A framework for attention-based permutation-invariant neural networks. In International Conference on Machine Learning.
Hunter Lightman, Vineet Kosaraju, Yura Burda, Harri Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. 2023. Let's verify step by step. Preprint, arXiv:2305.20050.
Michael L. Littman. 1994. Markov games as a framework for multi-agent reinforcement learning. In International Conference on Machine Learning, pages 157–163.
Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024. Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12:157–173.
Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. 2017. Multi-agent actor-critic for mixed cooperative-competitive environments. Advances in Neural Information Processing Systems.
Omayma Mahjoub, Sasha Abramowitz, Ruan de Kock, Wiem Khlifi, Simon du Toit, Jemma Daniel, Louay Ben Nessir, Louise Beyers, Liam Clark, and Arnu Pretorius. 2025. Sable: a performant, efficient and scalable sequence model for marl. In International Conference on Machine Learning.
Frans A. Oliehoek, Matthijs T. J. Spaan, and Nikos Vlassis. 2008. Optimal and approximate q-value functions for decentralized POMDPs. Journal of Artificial Intelligence Research, 32:289–353.
Guilherme Penedo, Hynek Kydlíček, Loubna Ben Alal, Anton Lozhkov, Margaret Mitchell, Colin Raffel, Leandro von Werra, and Thomas Wolf. 2024. The FineWeb datasets: Decanting the web for the finest text data at scale. In Advances in Neural Information Processing Systems.
PyTorch Labs. 2024. Attention Gym: Helpful tools and examples for working with FlexAttention. https://github.com/pytorch-labs/attention-gym. GitHub repository.
David Raposo, Sam Ritter, Blake Richards, Timothy Lillicrap, Peter Conway Humphreys, and Adam Santoro. 2024. Mixture-of-depths: Dynamically allocating compute in transformer-based language models. Preprint, arXiv:2404.02258.
Alexander Rutherford, Benjamin Ellis, Matteo Gallici, Justin Cook, Andrei Lupu, Gardar Ingvarsson, Timon Willi, Akbir Khan, Christian Schroeder de Witt, and Jakob Foerster. 2023. Jaxmarl: Multi-agent rl environments and algorithms in jax. Preprint, arXiv:2311.10090.
Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim G. J. Rudner, Chia-Man Hung, Philip H. S. Torr, Jakob Foerster, and Shimon Whiteson. 2019. The starcraft multi-agent challenge. In International Conference on Autonomous Agents and Multiagent Systems, pages 2186–2188.
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. Preprint, arXiv:1707.06347.
Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. 2019. Learning when to communicate at scale in multiagent cooperative and competitive tasks. In International Conference on Learning Representations.
Charlie Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. 2024. Scaling llm test-time compute optimally can be more effective than scaling model parameters. Preprint, arXiv:2408.03314.
Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, and Yunfeng Liu. 2024. RoFormer: Enhanced transformer with rotary position embedding. Neurocomputing, 568:127063.
Sainbayar Sukhbaatar and Rob Fergus. 2016. Learning multiagent communication with backpropagation. In Advances in Neural Information Processing Systems.
Ming Tan. 1993. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the Tenth International Conference on Machine Learning, pages 330–337. Morgan Kaufmann.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in Neural Information Processing Systems.
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2023. Self-consistency improves chain of thought reasoning in language models. In International Conference on Learning Representations.
Johannes Welbl, Pontus Stenetorp, and Sebastian Riedel. 2018. Constructing datasets for multi-hop reading comprehension across documents. In Transactions of the Association for Computational Linguistics, volume 6, pages 287–302.
Muning Wen, Jakub Grudzien Kuba, Runji Lin, Weinan Zhang, Ying Wen, Jun Wang, and Yaodong Yang. 2022. Multi-agent reinforcement learning is a sequence modeling problem. In Advances in Neural Information Processing Systems.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, and 1 others. 2025. Qwen3 technical report. Preprint, arXiv:2505.09388.
Chao Yu, Akash Velu, Eugene Vinitsky, Yu Wang, Alexandre Bayen, and Yi Wu. 2022. The surprising effectiveness of ppo in cooperative multi-agent games. In Advances in Neural Information Processing Systems.
Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, and Amr Ahmed. 2020. Big bird: Transformers for longer sequences. In Advances in Neural Information Processing Systems.