Science & Analytics

The Scientist

The Signal

Google Research's Memory Caching paper gives RNNs a tunable O(NL)

A potential 500x FLOP reduction at 8K sequence lengths sounds transformative, but every experiment caps at 1.3B parameters. If you're evaluating long-context inference alternatives to Transformers, this is the strongest theoretical framework yet, but treat it as a research signal, not an architecture decision.

In Play

  1. Memory Caching: RNNs Get a Long-Range Recall Upgrade

    Google's Memory Caching segments RNN sequences, saves intermediate states, and retrieves them via learned gating. GRM (dense gating) beats sparse routing — opposite of parameter-space MoE behavior. Theoretical framework unifies hybrid RNN-attention architectures. All results capped at 1.3B params.

    Ask Clarity
  2. GRM Beats Sparse Routing — Dense Gating Wins in Small-Cache Regimes

    Four caching strategies tested: Residual, GRM, Memory Soup, and Sparse Selective Caching. GRM's dense input-dependent gating consistently outperforms MoE-style top-k routing. When cache size N is small, learning a router doesn't pay off vs. soft-weighting everything. This inverts the MoE intuition from parameter space.

    Ask Clarity
  3. Claude Code Reaches ML Workflow-Ready Feature Density

    Claude Code now ships Subagents (parallel instances), Hooks (PreToolUse/PostToolUse shell scripts), and MCP (database/API access) — 12 production features total. Maps directly onto ML experiment orchestration. Vendor lock-in risk is real: CLAUDE.md and .claude/ configs don't port to Codex or alternatives.

    Ask Clarity

Deep Dives

Memory Caching: The Most Principled RNN Long-Context Fix Yet — And Why You Can't Use It Tomorrow

What Google Actually Built

The team behind Titans and MIRAS has published Memory Caching, a framework that attacks the oldest problem in recurrent architectures: as sequences grow, early tokens get progressively overwritten in the fixed-size state vector. Memory Caching segments the input sequence, saves intermediate RNN states as a cache, then retrieves relevant cached states at inference time. The complexity lands at O(NL) — where N is the configurable number of segments — sitting precisely between RNNs' O(L) and Transformers' O(L²).

This isn't just another architectural trick. The N parameter is a tunable knob: set N=1 and you have a standard RNN; push N toward L and you approach Transformer-like global attention. For a workload running at L=8K tokens with N=16 segments, the paper implies a roughly 500x FLOP reduction compared to quadratic attention. But FLOPs ≠ wall-clock time — memory bandwidth and implementation details determine actual latency gains.


Why GRM Wins and What That Tells You

Four retrieval strategies were tested. Gated Residual Memory (GRM) — which uses input-dependent gates to soft-weight each cached segment's relevance per token — won consistently across all benchmarks. This is a notable result because it inverts the MoE intuition: in parameter space, sparse top-k routing outperforms dense mixing, but in this temporal cache regime with small N, dense gating dominates. When your cache has 16 states, the overhead of learning a router function doesn't justify itself vs. attending softly to everything.

The Memory Soup approach — treating cached states as model parameters to merge rather than activations to aggregate — is architecturally creative and borrows from model merging literature, but doesn't consistently beat GRM's simpler mechanism. Sparse Selective Caching (SSC), the MoE-style approach, underperforms both.

Dense gating beats sparse routing when your cache is small — the opposite of what parameter-space MoE research would predict. Watch whether this pattern holds as cache sizes grow.

The Unification Claim — and Its Limits

The paper's most ambitious claim: under simplifying assumptions, hybrid RNN-attention architectures (interleaved recurrent and attention layers, à la Griffin or Jamba) are a special case of Memory Caching. If this holds at scale, it provides a principled design framework for hybrid architectures rather than the current practice of hand-tuning layer interleaving patterns. The simplifying assumptions required for this equivalence are not fully detailed, so treat this as a theoretical direction.

Where It Breaks

Transformers still dominate on the hardest exact-retrieval tasks — UUID lookup at long contexts, the kind of needle-in-haystack matching requiring global attention over every token. Memory Caching helps with holistic understanding (summarization, classification, conversational context) but not precise lookup. If your workload requires exact retrieval from long sequences, this won't replace attention.

The Scale Question

Every experiment caps at 1.3B parameters. This is the critical constraint. We've watched enough architectural innovations fail the scaling test — early linear attention variants, certain SSM configurations — to know that 1.3B results are necessary but not sufficient for production relevance. The Titans team has access to Google's compute. If frontier-scale results don't appear within 6 months, that absence is itself diagnostic.

What to do

  1. Profile your top 3 long-context inference workloads by sequence length and retrieval-type requirements (holistic understanding vs. exact lookup) this sprint

  2. Set a calendar reminder to check Google's Titans/MIRAS/Memory Caching publication line in October 2025 for >10B parameter results

  3. Benchmark a GRM-augmented RNN against your current Transformer on one representative long-context task at your working parameter scale

Claude Code's Subagents + MCP + Hooks — A Real ML Experiment Orchestration Stack or Vendor Trap?

What's New

Claude Code now ships 12 production-grade features, and three of them form a natural ML experiment orchestration stack: Subagents (parallel Claude instances for multi-step tasks), Hooks (shell scripts triggered on PreToolUse and PostToolUse events), and MCP (Model Context Protocol for direct database and API access). Together, these map onto a real workflow: launch parallel hyperparameter sweeps via Subagents, auto-log results to your tracking system via MCP, and enforce guardrails or generate comparison reports via Hooks.

The question isn't whether Claude Code can orchestrate ML experiments — it clearly can. The question is whether you want your experiment infrastructure written in Anthropic-specific configuration files.

The Lock-In Calculus

The practical concern is that CLAUDE.md, .claude/skills/, and .claude/commands/ create project-level configuration that is entirely Anthropic-specific. None of this ports to OpenAI's Codex, Cursor, or other AI coding assistants. If you build your experiment orchestration around these abstractions, you're making a vendor commitment — not just using an API.

For teams already standardized on Anthropic's stack, this is a reasonable tradeoff. For teams hedging across providers, the right move is to use Claude Code for ad-hoc experiment acceleration (one-off sweeps, report generation) while keeping your core orchestration in provider-agnostic tooling like Weights & Biases, MLflow, or Hydra.

What to do

  1. Run a time-boxed 2-hour pilot using Claude Code Subagents to parallelize one existing hyperparameter sweep this sprint

  2. Audit your current ML experiment config files for any Anthropic-specific dependencies (CLAUDE.md, .claude/) before they accumulate

The bottom line

Google's Memory Caching gives RNNs a tunable O(NL) complexity knob with Gated Residual Memory winning across all tasks — potentially a 500x FLOP reduction at 8K token sequences — but everything is validated at only 1.3B parameters, Transformers still win on exact retrieval, and production adoption would be a bet on unproven scaling behavior. Track it; don't build on it.