Files
2nd/10_Wiki/Topic_Programming/AI_and_ML/Neural-Architecture-Search-NAS.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
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 폴더 제거.
2026-07-05 00:33:48 +09:00

6.4 KiB
Raw Blame History

id, title, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title 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-neural-architecture-search-nas Neural Architecture Search (NAS) verified wiki-2026-0508-neural-architecture-search-nas
NAS
AutoML-NAS
Architecture Search
none A 0.9 applied
automl
nas
deep-learning
architecture
optimization
2026-05-10 pending
python
pytorch
nni
autokeras

Neural Architecture Search (NAS)

한 줄 정의

신경망 아키텍처 자체를 자동 탐색해 정확도·지연시간·파라미터 같은 목적함수를 최적화하는 AutoML 분야. 20172020년 비전 분야 SOTA를 갱신했지만, 2022+ Transformer/Foundation 모델 표준화 이후 연구 활성도는 감소, 현재는 edge·MoE·LLM 변형 설계 등 특정 영역에 잔존한다.

핵심

3대 구성요소 (Elsken 2019 정리)

  1. Search space: 후보 연산(conv 3×3, depthwise, identity 등)과 토폴로지.
  2. Search strategy: RL, evolution, gradient(DARTS), Bayesian.
  3. Performance estimation: 짧은 학습, weight sharing, predictor.

대표 방법

  • NASNet (2017): RL controller로 cell 검색. GPU 수천 일 필요.
  • ENAS (2018): parameter sharing → 1 GPU 일.
  • DARTS (2019): 연속 완화 + gradient. NAS 대중화의 분기점.
  • ProxylessNAS (2019): 타겟 hardware latency 직접 최적화.
  • Once-for-All (2020): 한 번 학습 → 다양한 sub-network 추출 (edge).
  • EfficientNet 계열: NAS+compound scaling.
  • Zero-cost NAS (2021+): 학습 없이 proxy score (synflow, jacov).

20242026 현황

  • 비전: ConvNeXt/MAE 등 hand-design + 사전학습이 주류.
  • LLM: 사실상 dense Transformer 표준 → NAS는 MoE routing, KV cache 구조, 효율 attention 등 부분 검색에 한정.
  • Edge / NPU: TFLite/CoreML 타겟 latency-aware NAS는 여전히 유용.
  • AutoML 도구화: AutoKeras, NNI, Vertex AI Neural Architecture Search.

응용

모바일 비전 모델(MobileNetV3, EfficientNet-Lite), 의료 영상 백본 검색, NPU 최적화, 작은 LLM 변형 (헤드 수·차원 검색).

💻 패턴

Search space 정의 (간이 cell)

OPS = ["conv3x3", "conv5x5", "dwconv3x3", "max_pool3x3", "identity", "skip"]

def sample_cell(n_nodes=4):
    return [(prev_idx, op) for prev_idx in range(n_nodes)
                            for op in [random.choice(OPS)]]

DARTS — α 학습 (개념 코드)

class MixedOp(nn.Module):
    def __init__(self, C):
        super().__init__()
        self.ops = nn.ModuleList([build_op(o, C) for o in OPS])
        self.alpha = nn.Parameter(torch.zeros(len(OPS)))

    def forward(self, x):
        w = F.softmax(self.alpha, dim=-1)
        return sum(w[i] * op(x) for i, op in enumerate(self.ops))

# 1차 근사 학습 루프
for x_t, y_t, x_v, y_v in loader_pair:
    loss_w = ce(model(x_t), y_t); loss_w.backward(); opt_w.step(); opt_w.zero_grad()
    loss_a = ce(model(x_v), y_v); loss_a.backward(); opt_a.step(); opt_a.zero_grad()

best_op_per_edge = [OPS[m.alpha.argmax().item()] for m in mixed_ops]

Evolutionary search (간단)

def evolve(pop, fitness, gens=20, k=5):
    for _ in range(gens):
        scored = sorted(pop, key=fitness, reverse=True)
        parents = scored[:k]
        children = [mutate(random.choice(parents)) for _ in range(len(pop)-k)]
        pop = parents + children
    return scored[0]

Hardware-aware loss (ProxylessNAS 류)

loss = ce(logits, y) + lam * predicted_latency(arch_params)

Zero-cost proxy (synflow)

def synflow(model, x):
    for p in model.parameters():
        p.data = p.data.abs()
    out = model(x).sum()
    out.backward()
    score = sum((p * p.grad).sum().item() for p in model.parameters() if p.grad is not None)
    return score

NNI 사용 예 (현실적 default)

# search_space.json 정의 후
import nni
from nni.experiment import Experiment
exp = Experiment("local")
exp.config.search_space = json.load(open("search_space.json"))
exp.config.trial_command = "python train.py"
exp.config.trial_concurrency = 4
exp.config.tuner.name = "TPE"
exp.run(8080)

결정 기준

상황 추천
compute 풍부, 연구용 DARTS / Evolutionary
작은 GPU 1대 DARTS / ENAS
Edge / mobile latency 목표 ProxylessNAS, Once-for-All
빠른 baseline hand-design + 사전학습 (EfficientNet, ConvNeXt)
LLM 사전학습 NAS 비추 — 표준 Transformer 사용
빠른 평가 Zero-cost proxy + top-k 재학습
실서비스 자동화 NNI / Vertex NAS

기본값: 사전학습 backbone 사용. NAS는 edge latency 제약 또는 search space가 도메인-specific 일 때 검토.

🔗 Graph

🤖 LLM 활용

언제: search space 설계 brainstorm, DARTS α 해석 sanity check, 논문 비교 요약, NNI/AutoKeras config 작성.

언제 X: 실제 NAS 결과를 LLM 직관으로 대체 — 최종 아키텍처는 검증 데이터로 측정 필요. compute 비용 추정도 실측 우선.

안티패턴

  • DARTS의 weight sharing 편향(skip connection 폭주) 무시.
  • 검증셋이 search 와 final 학습에 모두 노출 → 결과 과대평가.
  • 단일 GPU·짧은 epoch 추정으로 최종 성능 결정 — 재학습 필수.
  • 하드웨어 latency 측정 없이 "FLOPs만" 최적화 → 실기기 속도와 괴리.
  • 2026년에 LLM 사전학습용 NAS 시도 — 비용·표준화 문제로 ROI 낮음.

🧪 검증 / 중복

Verified source: Elsken et al. NAS Survey (2019), Liu et al. DARTS (2019), Cai et al. ProxylessNAS / OFA, Microsoft NNI 문서, Google Vertex AI NAS docs, recent zero-cost NAS surveys (20222024). 신뢰도 A.

중복 없음. AutoML 은 부모, Hyperparameters 은 형제 개념.

🕓 Changelog

  • 2026-05-08 Phase 1 — 초기 stub.
  • 2026-05-10 Manual cleanup — FULL canonical 재작성. DARTS/ProxylessNAS/OFA/zero-cost 코드 6개, 20242026 현황(사용 빈도 감소) 반영.