Google Titans architecture, helping AI have long-term memory
TL;DR Highlight
Google's new architecture handles 2M token contexts without Transformer's quadratic complexity — using 'Titans' memory blocks instead of attention.
Who Should Read
ML researchers working on long-context models, and engineers building RAG or document processing systems who care about context length scaling.
Core Mechanics
- The architecture replaces standard attention with 'Titans' — memory units that store compressed representations of past context and can be retrieved efficiently, avoiding the quadratic cost of full attention over 2M tokens.
- Two types of memory: short-term (sliding window attention for recent tokens) and long-term (Titans persistent memory blocks trained to compress and retrieve key information).
- The long-term memory is a small neural network that learns to compress context — it's trained end-to-end with the main model, not a fixed external retrieval system.
- On benchmarks requiring long-range recall (e.g., needle-in-haystack at 2M tokens), performance is competitive with or better than full attention models at much lower compute cost.
- The architecture has implications for very long document understanding, multi-session memory, and any task where full-context attention is currently prohibitively expensive.
Evidence
- Google published benchmark results showing the Titans architecture matches or beats standard Transformers on long-context tasks while being significantly more efficient.
- HN commenters noted this is in the lineage of SSM/Mamba-style architectures but with a different approach to learned memory — some skepticism about whether benchmark gains hold in practice.
- Several researchers flagged that 'compressing' context into fixed-size memory inherently loses information — the question is whether the compression is smart enough for real tasks.
- The approach was compared favorably to RAG for some use cases, since the memory is learned end-to-end rather than relying on a separate retrieval index.
How to Apply
- If you're hitting context window limits on document processing tasks, watch this architecture closely — it could enable processing entire codebases or document repositories in a single forward pass.
- For multi-turn agents that need long memory without growing context costs, Titans-style architectures may be worth experimenting with as they become available in open-source form.
- RAG architects should benchmark against learned memory approaches for tasks where chunking and retrieval introduce too much information loss.
Code Example
# Core logic of Surprise-based memory update in Titans architecture (conceptual code)
import torch
import torch.nn as nn
class NeuralMemory(nn.Module):
def __init__(self, dim, memory_lr=0.01):
super().__init__()
# Long-term memory = small MLP (key-value associative memory)
self.memory_mlp = nn.Sequential(
nn.Linear(dim, dim * 2),
nn.SiLU(),
nn.Linear(dim * 2, dim)
)
self.memory_lr = memory_lr # Memory update rate
def compute_surprise(self, query, target):
"""Surprise = magnitude of prediction error (gradient norm)"""
pred = self.memory_mlp(query)
loss = nn.functional.mse_loss(pred, target)
grad = torch.autograd.grad(loss, self.memory_mlp.parameters())
surprise = sum(g.norm() for g in grad) # More surprising = stronger memorization
return surprise, loss
def update_memory(self, key, value, forget_gate):
"""Write surprising information into memory (test-time update)"""
surprise, loss = self.compute_surprise(key, value)
# Forgetting Gate: decay old memories + write new information
effective_lr = self.memory_lr * surprise.item() * forget_gate
for param in self.memory_mlp.parameters():
if param.grad is not None:
param.data -= effective_lr * param.grad
def recall(self, query):
"""Retrieve information from long-term memory using a query"""
return self.memory_mlp(query)
# Example usage with MAC (Memory as Context) variant
# memory_output = neural_memory.recall(current_query)
# context = torch.cat([memory_output, short_term_kv_cache], dim=1)
# output = attention(query, context) # Integration of long-term + short-term memoryTerminology
Related Papers
Show HN: Smart model routing directly in Claude, Codex and Cursor
프롬프트마다 적합한 AI 모델을 50ms 이내에 자동으로 선택해주는 프록시 라우터로, API 비용을 40~70% 절감할 수 있다고 주장하는 오픈소스 도구다. 단, 프롬프트 캐싱 손실 문제로 커뮤니티 반응은 엇갈린다.
Show HN: Overfitted a 900KB Transformer to Compress a 100MB CSV into 7MB
단일 파일을 통째로 암기하도록 Transformer를 과적합(overfitting)시킨 뒤 arithmetic coding으로 압축하는 실험으로, 100MB CSV를 7MB(~0.5 bits/byte)까지 줄이는 데 성공했다. 모델이 '범용 이해' 대신 '특정 파일 완전 암기'를 목표로 한다는 점에서 전통적 ML 학습과 정반대 방향이라 흥미롭다.
Ask HN: Anthropic banned me from using Claude Code and I don't know what to do
VPN 사용 또는 동일 카드 재사용으로 Anthropic Claude Code 계정이 이유 불명으로 정지당한 사용자의 사례와, 커뮤니티에서 나온 대안 및 우회 방법 논의.
Moebius: 0.2B image inpainting model with 10B-level performance
FLUX.1-Fill-Dev(11.9B) 대비 2% 미만의 파라미터(0.22B)로 동급 또는 그 이상의 인페인팅 품질을 달성하면서 추론 속도는 15배 빠른 경량 모델. 소비자용 GPU나 엣지 디바이스에서도 고품질 인페인팅이 가능해진다.
AI Compute Extensions (ACE) Specification
x86 Ecosystem Advisory Group이 행렬 곱셈과 저정밀도 데이터 포맷을 하드웨어 수준에서 가속하는 새로운 x86 명령어 확장 스펙 ACE를 공개했다. ML 워크로드를 CPU에서 더 효율적으로 돌리기 위한 ISA(명령어 집합 구조) 수준의 변화라 향후 AI 추론 환경에 영향을 줄 수 있다.
Show HN: High-Res Neural Cellular Automata
EPFL과 Google Research가 공동 개발한 Neural Cellular Automata(NCA)를 고해상도로 확장하는 기법으로, 기존 NCA의 해상도 한계를 경량 신경망 디코더로 극복한 SIGGRAPH 2026 논문이다.