Laplace 3B’s Fixed-State Bet: What the Trainium2 Results Show
Laplace 3B replaces growing KV caches with fixed recurrent state, but that memory advantage comes with retrieval and implementation trade-offs. Examine the Trainium2 engineering decisions, reported results, and what they do—and do not—show for agent systems.
Editorial note · AI-assisted
AI-assisted original explainer; sources are listed at the end. Worked examples and exercises were not run unless marked as tested. Diagrams are AI-generated. The cover is an editorial photo.
Based on AWS’s Trainium2 implementation report and Microsoft Research’s separate Agent Lightning system report.

Key points
- Laplace 3B replaces growing transformer KV caches with a recurrent state reported at 29.5 MB per sequence, regardless of context length; that saves memory by compressing history, not by retaining every key and value.
- Its Trainium2 results depended on hardware-specific choices: 128-token chunks, distributed `all_to_all` communication for Muon, and a compiled decode path. The figures describe a particular model, instance, and workload—not a general hardware ranking.
- A bounded model state is only one part of an agent’s resource budget. Microsoft Research’s Agent Lightning describes a separate training system whose variable-length harness rollouts bring their own scheduling and accounting challenges.
The problem: context makes serving state grow
In ordinary transformer inference, the key-value (KV) cache stores representations of prior tokens so the model can attend to them again. As a conversation or document grows, the cache grows too. That makes long contexts more expensive in accelerator memory and can constrain how many sequences a serving system runs at once.
AWS’s engineering post describes i14’s Laplace 3B as an alternative: every layer uses Simple Gated Linear Attention (GLA), which compresses prior context into a recurrent matrix state. The reported state is 29.5 MB per sequence, independent of context length. This is a different memory contract, not a lossless way of storing an unlimited transcript. Linear attention compresses history; teams still need to test whether that representation preserves the information their workload needs.
The case is useful because it shows that changing the attention mechanism does not remove engineering work. It moves the work: the team had to adapt the architecture, optimizer communication, compilation strategy, and serving runtime to Trainium2.
Design decisions: align the recurrence with the machine
The original Laplace implementation used GPU-oriented Triton kernels. The AWS Generative AI Innovation Center team rewrote the GLA kernel using standard PyTorch operators through the beta TorchNeuron Native backend. The post says this performed better than the alternative they compared, but does not present a broad comparison across backends or hardware.
Three decisions shaped the implementation:
1. Use 16 chunks of 128 tokens. The chunk size matched the 128 partitions in each NeuronCore’s 28 MiB software-managed on-chip State Buffer (SBUF). The reported mapping raised measured throughput by 14 percent. Smaller chunks would mean more sequential steps in the backward pass; larger ones risked intermediate values spilling into high-bandwidth memory. The post reports that 32 chunks overflowed the compiler scheduler, while 8 chunks caused spills. The 16-chunk configuration fit the reported constraints.
2. Redistribute Muon’s orthogonalization instead of gathering full gradients. With Fully Sharded Data Parallel, each of 64 ranks holds only a shard of a weight matrix. A shard-local calculation omits cross-shard terms. The team used two all_to_all collectives so ranks could process complete matrices in parallel, rather than gathering the full gradient to one rank and broadcasting the result. The reported per-rank traffic fell from 10.87 GB to 0.45 GB per step, and throughput rose from 73,378 to 119,934 tokens per second, with a bit-identical loss curve.
3. Compile the decode step. In the reported serving setup, large projections were near the HBM-streaming floor, while many small operators dispatched individually under eager PyTorch. Compilation reduced that dispatch overhead. However, changing batch widths created new compiled shapes, each with an approximately 11-second first-use cost. Padding to fixed widths removed that cost with bit-exact results in the reported test. Under staggered arrivals, compiled decode improved per-replica throughput 3.52 times; the fixed-batch comparison was 1.46 times. The post also notes that BF16 reassociation can make compiled outputs differ slightly from eager outputs, so it recommends eager decoding where exact reproducibility matters.
| Engineering decision | Source-reported evidence | What the result does not establish |
|---|---|---|
| 128-token chunks aligned to SBUF partitions | Measured throughput increased 14 percent. | That the same chunk size is optimal for other models, shapes, or hardware. |
Two all_to_all exchanges for Muon under FSDP2 | Per-rank traffic fell 24 times; throughput rose 1.63 times, with a bit-identical loss curve. | That communication is the bottleneck for every optimizer or training setup. |
| Compiled, padded decode shapes | On the reported instance, output throughput reached 11,544 tokens per second; padding avoided first-use compilation costs for new batch widths. | That the result transfers to different arrival patterns, host limits, or serving stacks. |
| Fixed recurrent state | The post reports 29.5 MB per sequence and a 0.5 percent increase in cost per output token when prompts grew from 2,048 to 8,192 tokens. | That retrieval quality remains adequate as contexts grow, or that all end-to-end costs stay fixed. |

Reported outcomes—and their conditions
The training run used one trn2.48xlarge instance with all 64 logical NeuronCores and the all_to_all Muon path. The full recipe was 190,735 steps over 100 billion FineWeb-Edu tokens, but the reported training results stop at step 84,210—about 44 billion tokens. Throughput settled at roughly 120,000 tokens per second after compilation warmup. The loss moved from about 11.4 to 2.3729 by that step, and the post reports no post-warmup divergence or NaN/Inf values. These are observations from the reported run, not evidence that the full recipe completed or that another run will match it.
For inference, the team reports 11,544 output tokens per second across 1,280 concurrent sequences on one trn2.48xlarge instance using an unmodified vLLM engine with a wrapper for the recurrent state. In a token-for-token check, outputs matched the i14 reference for 48 of 48 steps on each of 3 prompts in BF16. That is a narrowly specified correctness check, not a broad evaluation of answer quality or retrieval across long documents.
The post also compares the recurrent state with a comparable KV cache at 8,192 tokens, reporting an approximately 82-fold size difference. That comparison supports a memory-efficiency claim for the stated setup; it does not show that GLA and softmax attention answer the same long-context questions equally well. The AWS post explicitly identifies retrieval quality as something teams should evaluate for their own workloads.
A boundary for agent systems
The memory benefit matters to agents because long-running work can accumulate context. But agent capacity is not just model-state capacity. Microsoft Research’s Agent Lightning v1.0 illustrates a different systems problem: when a real agent harness controls tool use and context management, one rollout can produce a variable number of training samples. Its authors identify consequences for retokenization, advantage calculation, loss normalization, and backend scheduling.
That source does not validate Laplace 3B or compare its inference performance. It does reinforce a useful boundary: reducing per-sequence inference state cannot, by itself, solve the variable workload and accounting problems created by agent execution. Likewise, Agent Lightning’s reported coding-agent gains do not demonstrate the value of linear attention. These are separate engineering results, and they should be evaluated separately.
Look at the whole memory budget
- Weights
What is actually loaded
- KV cache
Context and concurrent requests
- Runtime
Buffers and other allocations
Trade-offs and transferability
Laplace 3B’s fixed state makes memory use more predictable as context length increases, but compression is a modeling trade-off: it is not equivalent to keeping every past key and value available. Its decay schedule gives heads different memory lengths, with the reported configuration spanning half-lives from one token to 2,048 tokens. Those design details make workload-specific retrieval tests important, especially when a task depends on exact details far back in a conversation.
The performance numbers also rely on a specific combination: a 3.028-billion-parameter model, one 16-chip Trainium2 instance, 64 logical NeuronCores, particular training and inference implementations, and the stated sequence and concurrency conditions. Host CPU use reached 82 percent at 64 eager replicas before compilation improved throughput, another reminder that accelerators are not the only bottleneck. The post’s results are valuable as an implementation case study, not as a like-for-like benchmark against other accelerators or attention architectures.
Our verdict
The strongest lesson is not simply that linear attention has a smaller cache. It is that a fixed-state architecture can change the memory side of long-context serving, while realizing that advantage requires careful kernel mapping, distributed optimizer communication, and realistic decode benchmarking. The reported results are promising within their exact conditions, but they leave the central application question open: does compressed recurrent memory retrieve what a particular agent or document workflow needs? Answer that with workload-specific quality tests before treating predictable state size as usable long-term memory.
References: AWS, “Beyond the KV cache: Training and serving i14’s Laplace 3B linear attention model on AWS Trainium2 with native PyTorch,” https://aws.amazon.com/blogs/machine-learning/beyond-the-kv-cache-training-and-serving-i14s-laplace-3b-linear-attention-model-on-aws-trainium2-with-native-pytorch/ ; Microsoft Research, “Agent Lightning v1.0: A 3,500-Line Lightweight Agentic RL Framework for Training Agents with Real Harnesses,” https://www.microsoft.com/en-us/research/blog/agent-lightning-v1-0-a-3500-line-lightweight-agentic-rl-framework-for-training-agents-with-real-harnesses/.