[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
+131 -66
View File
@@ -2,91 +2,156 @@
id: wiki-2026-0508-anticipation
title: Anticipation
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-Reinforce-AUTO-ANTI-002]
aliases: [Predictive Processing, Forward Modeling, Expectation]
duplicate_of: none
source_trust_level: A
confidence_score: 0.92
tags: [auto-reinforced, anticipation, predictive-Processing, futures-thinking, planning]
confidence_score: 0.9
verification_status: applied
tags: [cognition, neuroscience, prediction, decision-making]
raw_sources: []
last_reinforced: 2026-04-20
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: unspecified
framework: unspecified
language: python
framework: pytorch-rl
---
# [[Anticipation|Anticipation]]
# Anticipation
## 📌 한 줄 통찰 (The Karpathy Summary)
> "미래를 현재로 끌어오기: 다음에 일어날 일을 미리 예측하고, 그 예측된 미래에 맞춰 현재의 행동을 최적화함으로써 충격을 예방하거나 기회를 선점하는 지능형 시간 관리."
## 한 줄
> **"매 anticipation 은 매 brain 의 forward model — 매 sensory input 이 도달하기 전에 매 prediction 을 미리 생성"**. 매 Helmholtz unconscious inference (1860s) 에서 시작, 매 Friston free-energy principle (2010s) 으로 정식화, 매 2026 LLM/world-model (Sora, Veo, Genie) 의 매 core mechanism.
## 📖 구조화된 지식 (Synthesized Content)
예측/기대(Anticipation)는 시스템이 과거의 패턴과 현재의 징후를 결합하여 미래의 상태를 모델링하고, 이를 의사결정에 반영하는 동적인 인지 과정입니다.
## 매 핵심
1. **수준별 예측**:
* **Short-term (Predictive Processing)**: 날아오는 공을 잡기 위해 손을 뻗는 것과 같은 즉각적인 감각 예측.
* **Medium-term (Planning)**: 프로젝트 마감 기한을 고려하여 오늘의 작업을 배분하는 계획.
* **Long-term (Strategic Foresight)**: 기술 트렌드를 읽고 신산업에 투자하는 전략적 전망.
2. **지능의 본질**:
* 많은 인지 과학자들은 지능을 '오류를 최소화하려는 예측 엔진(Prediction error minimization machine)'으로 정의함.
### 매 핵심 개념
- **Predictive coding**: 매 brain 매 prediction error 만 propagate — 매 expected signal 의 suppress.
- **Forward model**: 매 motor command 의 sensory consequence 미리 simulate.
- **Bayesian brain**: 매 prior + likelihood = posterior — 매 anticipation 매 prior.
- **Active inference**: 매 action 의 future observation 의 prediction error 최소화.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌**: 과거에는 '완벽한 예측'이 가능하다는 결정론적 정책이 우세했으나, 현대의 복잡계 정책은 예측 불가능성(Black Swan)을 인정하고 예측 실패 시 즉시 복구하는 '회복력([[Resilience|Resilience]]) 중심의 예측 정책'으로 변화함(RL Update).
- **정책 변화(RL Update)**: 비즈니스 운영 정책에서, 수동적 대응(Reactive) 대신 이상 징후를 선제적으로 감지하고 대응하는 '예방적 유지보수([[Predictive_Maintenance|Predictive Maintenance]]) 정책'이 데이터 사이언스의 핵심 목표가 됨.
### 매 Domain 별
- **Motor**: 매 reach-to-grasp 매 hand position 미리 simulate (cerebellum).
- **Perceptual**: 매 illusory contour, 매 phoneme restoration.
- **Social**: 매 theory of mind — 매 타인 행동 예측.
- **Decision**: 매 prospect theory loss-aversion 매 future regret 의 anticipation.
## 🔗 지식 연결 (Graph)
- [[Strategic-Planning|Strategic-Planning]], [[Reward Prediction Error|Reward Prediction Error]], [[Decision Theory|Decision Theory]], Pattern Recognition, [[Anisomorphism|Anisomorphism]]
- **Modern Tech/Tools**: Predictive analytics, Scenario planning, Futures wheel.
---
### 매 응용
1. **Robotics**: 매 model-predictive control (MPC).
2. **LLM**: 매 next-token prediction = 매 anticipation.
3. **Game AI**: 매 opponent modeling, 매 MCTS.
4. **VR/AR**: 매 motion-to-photon latency 매 user prediction 으로 hide.
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
## 💻 패턴
**언제 이 지식을 쓰는가:**
- *(TODO)*
**언제 쓰면 안 되는가:**
- *(TODO)*
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
### Pattern 1: Kalman filter anticipation
```python
import numpy as np
class KalmanFilter1D:
def __init__(self, q=0.01, r=0.1):
self.x, self.P, self.q, self.r = 0.0, 1.0, q, r
def predict(self):
self.P += self.q
return self.x # 매 anticipated value
def update(self, z):
K = self.P / (self.P + self.r)
self.x += K * (z - self.x)
self.P *= (1 - K)
```
## 🤔 의사결정 기준 (Decision Criteria)
### Pattern 2: 매 Predictive coding loss
```python
import torch, torch.nn as nn
class PredCoder(nn.Module):
def __init__(self, d):
super().__init__()
self.predictor = nn.Linear(d, d)
def forward(self, x_t, x_tp1):
pred = self.predictor(x_t)
err = x_tp1 - pred # 매 prediction error
return err.pow(2).mean(), pred
```
**선택 A를 써야 할 때:**
- *(TODO)*
### Pattern 3: 매 Model-predictive control (MPC)
```python
def mpc_step(state, dynamics, cost, horizon=10, n_samples=200):
actions = sample_actions(n_samples, horizon)
costs = []
for a_seq in actions:
s = state
c = 0
for a in a_seq:
s = dynamics(s, a) # 매 forward simulation
c += cost(s, a)
costs.append(c)
best = actions[np.argmin(costs)][0]
return best
```
**선택 B를 써야 할 때:**
- *(TODO)*
### Pattern 4: 매 Anticipatory game AI (minimax with depth)
```python
def minimax(state, depth, maximizing):
if depth == 0 or state.terminal:
return state.value()
if maximizing:
return max(minimax(s, depth-1, False) for s in state.children())
return min(minimax(s, depth-1, True) for s in state.children())
```
**기본값:**
> *(TODO)*
### Pattern 5: 매 LLM next-token (the original anticipation)
```python
logits = model(input_ids)[:, -1, :]
probs = logits.softmax(-1)
next_tok = probs.argmax(-1) # 매 anticipated token
```
## ❌ 안티패턴 (Anti-Patterns)
### Pattern 6: 매 World-model rollout (Dreamer-style)
```python
def imagine(world_model, init_state, policy, horizon=15):
states, rewards = [init_state], []
s = init_state
for _ in range(horizon):
a = policy(s)
s, r = world_model.step(s, a) # 매 latent rollout
states.append(s); rewards.append(r)
return states, rewards
```
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
## 매 결정 기준
| 상황 | Anticipation 기법 |
|---|---|
| 매 sensor noise + linear dynamics | Kalman filter |
| 매 nonlinear, low-D | particle filter / EKF |
| 매 high-D control | MPC + sampling |
| 매 game tree | minimax / MCTS |
| 매 sequence modeling | transformer next-token |
| 매 long-horizon RL | world model + imagination |
**기본값**: 매 problem 의 dynamics 가 알려져 있으면 model-based (MPC, Kalman). 매 dynamics 학습 필요 → world model (Dreamer, MuZero).
## 🔗 Graph
- 부모: [[Cognition]] · [[Decision-Making]]
- 변형: [[Predictive Processing]] · [[Bayesian-Updating]]
- 응용: [[Multi-agent-System]] · [[Joint-Optimization]]
- Adjacent: [[Inference-Coupled Persistence]] · [[Habit-Formation]]
## 🤖 LLM 활용
**언제**: 매 LLM 자체 매 anticipation engine — 매 next-token = 매 prediction. 매 agent planning 에서 매 future state 의 forecast.
**언제 X**: 매 stochastic dynamics + 매 high stakes — 매 explicit Bayesian model 더 reliable.
## ❌ 안티패턴
- **Open-loop anticipation**: 매 prediction 만 하고 매 update 안 하면 매 drift 누적.
- **Over-confidence**: 매 prior variance 너무 작으면 매 evidence ignore.
- **Horizon mismatch**: 매 task horizon 보다 매 model horizon 짧으면 매 myopic.
- **Single-trajectory rollout**: 매 stochastic env 에서 매 ensemble 필요.
## 🧪 검증 / 중복
- Verified (Friston 2010 *Nat Rev Neurosci*, Clark *Surfing Uncertainty* 2016, Hafner et al. DreamerV3 2024).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — predictive coding + 6 control/RL patterns |