9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
6.4 KiB
6.4 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-state-space | State Space | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
State Space
매 한 줄
"매 hidden state evolves over time, observations emerge from it". State space 는 매 control theory / signal processing 의 핵심 representation:
x_{t+1}=Ax_t+Bu_t,\; y_t=Cx_t+Du_t. 매 2024-2026 의 deep learning 의 SSM (S4, Mamba, Mamba-2) 가 매 Transformer 의 long-context alternative 로 부상.
매 핵심
매 control-theory origin
- State
x_t: 매 system 의 internal memory. - Input
u_t: 매 external control / observation. - Output
y_t: 매 measurable. - Matrices
A, B, C, D: 매 dynamics, input mapping, observation, feedthrough. - Discrete vs continuous:
\dot x = Ax + Bu(continuous) vsx_{t+1}(discrete).
매 deep learning SSM 진화
- HiPPO (2020): 매 long-range memory 의 polynomial 근사 — 매 A matrix 의 영리한 init.
- S4 (2022): structured SSM, FFT-based convolution view, long-range arena SOTA.
- H3, Hyena: 매 SSM + gating 의 hybrid.
- Mamba (2023): 매 selective SSM — 매 input-dependent A,B,C, hardware-aware parallel scan.
- Mamba-2 (2024): 매 SSD (state-space duality) — 매 attention 과 의 unification.
- Hybrid (2025+): 매 Jamba, Zamba, Samba — 매 Transformer + Mamba mix.
매 vs Transformer
| 측면 | Transformer | SSM (Mamba) |
|---|---|---|
| Train | O(N²) parallel | O(N) parallel scan |
| Infer | O(N) per token, KV cache | O(1) per token, fixed state |
| Memory at infer | grows with context | constant |
| Long context | quadratic cost | linear cost |
| In-context recall | strong | weaker (improving with hybrids) |
매 응용
- Control systems — 매 robotics, aerospace, Kalman filter.
- Time series — 매 Kalman / particle filter, dynamic factor model.
- Long-context LLM — 매 Mamba-3B, Jamba-1.5 의 1M+ context.
- DNA / genomics — 매 Caduceus, HyenaDNA 의 long sequence.
- Audio — 매 SaShiMi 의 raw-waveform generation.
💻 패턴
Classic discrete state space (control)
import numpy as np
def simulate(A, B, C, D, u, x0):
x, ys = x0.copy(), []
for ut in u:
y = C @ x + D @ ut
x = A @ x + B @ ut
ys.append(y)
return np.array(ys)
Kalman filter
def kalman_step(x, P, u, z, A, B, C, Q, R):
# predict
x = A @ x + B @ u
P = A @ P @ A.T + Q
# update
K = P @ C.T @ np.linalg.inv(C @ P @ C.T + R)
x = x + K @ (z - C @ x)
P = (np.eye(len(x)) - K @ C) @ P
return x, P
S4 convolutional view (PyTorch)
import torch, torch.nn.functional as F
def s4_conv(u, A_bar, B_bar, C, L):
# K_l = C A_bar^l B_bar → conv kernel of length L
K = torch.stack([C @ torch.matrix_power(A_bar, l) @ B_bar for l in range(L)])
y = F.conv1d(u.unsqueeze(0), K.flip(0).unsqueeze(0).unsqueeze(0))
return y.squeeze()
Mamba selective scan (mamba-ssm package)
from mamba_ssm import Mamba
import torch
model = Mamba(d_model=512, d_state=16, d_conv=4, expand=2).cuda()
x = torch.randn(2, 1024, 512, device="cuda")
y = model(x) # [B, L, D] — O(L) parallel scan
HiPPO initialization (LegS)
def hippo_legs(N):
A = np.zeros((N, N))
for n in range(N):
for k in range(N):
if n > k: A[n, k] = -np.sqrt((2*n+1) * (2*k+1))
elif n == k: A[n, k] = -(n + 1)
return A
Mamba-2 SSD block (simplified)
def ssd_block(X, A, B, C, chunk=64):
# state-space duality: structured matrix multiply
# parallelizable as matmul, shows attention-SSM equivalence
L = X.shape[1]
Y = torch.zeros_like(X)
state = torch.zeros(...)
for s in range(0, L, chunk):
Y[:, s:s+chunk], state = ssd_chunk(X[:, s:s+chunk], A, B, C, state)
return Y
Hybrid (Jamba-style: Mamba + attention)
class JambaBlock(nn.Module):
def __init__(self, d, use_attn=False):
super().__init__()
self.layer = MultiheadAttention(d, 8) if use_attn else Mamba(d_model=d)
self.mlp = MoE(d) if use_moe else MLP(d)
def forward(self, x): return self.mlp(self.layer(x) + x) + x
매 결정 기준
| 상황 | Approach |
|---|---|
| Control system 의 design | classical SSM + LQR / Kalman |
| Time-series filtering | Kalman / particle filter |
| Long-context language (>128k) | Mamba / Jamba hybrid |
| In-context recall heavy | Transformer or hybrid (not pure Mamba) |
| Genomics 1M token | HyenaDNA / Caduceus |
| Audio raw waveform | SaShiMi / Mamba-Audio |
기본값: 매 control 의 classical SSM. 매 long-context LM 의 Mamba-2 또는 Jamba 의 hybrid (pure Mamba 의 recall 약점 의 보완).
🔗 Graph
- 부모: Control-Theory · Sequence-to-Sequence-Models
- 변형: S4 · Mamba · Linear-RNN
- 응용: Kalman-Filter-and-State-Tracking · Time-Series-Analysis
- Adjacent: Transformer · 데이터 사이언스 및 ML 엔지니어링
🤖 LLM 활용
언제: SSM literature 정리, mamba-ssm boilerplate, control-system identification 의 sympy / numpy code. 언제 X: real-time safety-critical control (aerospace, medical) — 매 verified controller / formal methods 의 영역.
❌ 안티패턴
- HiPPO init 무시: random init Mamba 의 long-range 성능 추락. 매 proper A init 필수.
- Pure Mamba 의 in-context retrieval 기대: needle-in-haystack 약함. Hybrid 권장.
- No selective mechanism: 매 vanilla S4 의 modern Mamba 보다 약함 — input-dependent param 필수.
- Classical SSM 의 nonlinearity 무시: 매 real system 의 nonlinear — EKF / UKF / particle filter 사용.
- CUDA scan 미활용: 매 naive Python loop 의 100배 slow. mamba-ssm 의 official kernel 사용.
🧪 검증 / 중복
- Verified (Kalman 1960, Gu et al. S4 2022, Gu & Dao Mamba 2023, Dao & Gu Mamba-2 2024, Jamba 2024).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — control SSM + modern Mamba/Mamba-2/Jamba |